CN115909552B - Intelligent door lock control method, system and storage medium - Google Patents

Intelligent door lock control method, system and storage medium Download PDF

Info

Publication number
CN115909552B
CN115909552B CN202211317793.0A CN202211317793A CN115909552B CN 115909552 B CN115909552 B CN 115909552B CN 202211317793 A CN202211317793 A CN 202211317793A CN 115909552 B CN115909552 B CN 115909552B
Authority
CN
China
Prior art keywords
preset
door lock
value
current
motor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211317793.0A
Other languages
Chinese (zh)
Other versions
CN115909552A (en
Inventor
余晓鹏
陈鸿填
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Hutlon Technology Co Ltd
Foshan Hutlon Intelligent Technology Co Ltd
Original Assignee
Guangdong Hutlon Technology Co Ltd
Foshan Hutlon Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Hutlon Technology Co Ltd, Foshan Hutlon Intelligent Technology Co Ltd filed Critical Guangdong Hutlon Technology Co Ltd
Priority to CN202211317793.0A priority Critical patent/CN115909552B/en
Publication of CN115909552A publication Critical patent/CN115909552A/en
Application granted granted Critical
Publication of CN115909552B publication Critical patent/CN115909552B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Lock And Its Accessories (AREA)

Abstract

本发明公开了一种智能门锁控制方法、系统及存储介质,应用于门锁控制技术领域,能够有效提升门锁控制的准确性,延长门锁的使用寿命。该方法包括:获取预设学习参数;预设学习参数包括门锁的开关次数和调试状态;确定预设学习参数满足预设学习条件,控制门锁进行动态学习得到平稳编码值;平稳编码值为门锁进行开关操作过程中,电机转动角度相应的编码值,预设学习条件包括预设开关次数或初始调试状态;根据平稳编码值控制电机驱动进行门锁开关操作;控制所述门锁进行动态学习,得到平稳编码值,包括:获取预设编码值;根据预设编码值控制电机转动至相应的旋转角度;获取电机的当前电流数据;根据当前电流数据调整电机的编码值,得到平稳编码值。

The present invention discloses an intelligent door lock control method, system and storage medium, which are applied to the field of door lock control technology, and can effectively improve the accuracy of door lock control and extend the service life of door locks. The method includes: obtaining preset learning parameters; the preset learning parameters include the number of times the door lock is switched on and off and the debugging state; determining that the preset learning parameters meet the preset learning conditions, controlling the door lock to perform dynamic learning to obtain a stable coding value; the stable coding value is the coding value corresponding to the motor rotation angle during the door lock switching operation, and the preset learning conditions include the preset number of switches or the initial debugging state; according to the stable coding value, the motor drive is controlled to perform the door lock switching operation; the door lock is controlled to perform dynamic learning to obtain a stable coding value, including: obtaining the preset coding value; controlling the motor to rotate to the corresponding rotation angle according to the preset coding value; obtaining the current current data of the motor; adjusting the coding value of the motor according to the current current data to obtain a stable coding value.

Description

智能门锁控制方法、系统及存储介质Intelligent door lock control method, system and storage medium

技术领域Technical Field

本发明涉及门锁控制技术领域,尤其涉及一种智能门锁控制方法、系统及存储介质。The present invention relates to the field of door lock control technology, and in particular to an intelligent door lock control method, system and storage medium.

背景技术Background Art

目前,全自动智能锁实现自动开锁的方式有两种。一种是把电机内置在锁体电子内部,通过减速电机转动带动锁舌,实现自动开门。这种方式能够通过锁体锁舌触发开关判断是否开到位、关到位,不会导致开关锁误判断。但由于锁体内部的空间较小,能放下的减速电机为小电机,因此,难以实现大扭矩开关锁,一旦门锁安装好后,与门框有摩擦阻力,便会导致开锁失败。另一种方案是使用常规机械锁体,把减速电机放到锁后的把手,再通过锁芯转动轴带动锁舌,实现自动开门。由于锁后把手空间较大,减速电机体积可以做得更大,开锁的成功率也更高。但这种方式是通过电机的堵转电流来判断锁舌是否完成开锁这一过程,容易出现误判断。在实际应用中存在一定的开锁误判断比例,并且用电机堵转来判断,电流会超出电机的额定电流,对减速齿轮造成损伤,形成不可逆的损害,这也导致了门锁的使用寿命缩短。相关技术中,如何实现准确的开关锁,并延长门锁的使用寿命没有很好的办法。At present, there are two ways for fully automatic smart locks to achieve automatic unlocking. One is to build the motor into the lock body electronics, and drive the lock tongue through the rotation of the reduction motor to achieve automatic door opening. This method can determine whether the lock is fully opened or closed by triggering the switch through the lock body and lock tongue, and will not cause misjudgment of the switch lock. However, due to the small space inside the lock body, the reduction motor that can be placed is a small motor, so it is difficult to achieve a large torque switch lock. Once the door lock is installed, there is friction resistance with the door frame, which will cause unlocking failure. Another solution is to use a conventional mechanical lock body, put the reduction motor on the handle behind the lock, and then drive the lock tongue through the lock core rotating shaft to achieve automatic door opening. Due to the large space behind the lock handle, the reduction motor can be made larger, and the success rate of unlocking is also higher. However, this method is to judge whether the lock tongue has completed the unlocking process by the motor's stall current, which is prone to misjudgment. In actual applications, there is a certain proportion of misjudgment of unlocking, and if the motor is stalled, the current will exceed the rated current of the motor, causing damage to the reduction gear, resulting in irreversible damage, which also shortens the service life of the door lock. In the related art, there is no good way to achieve accurate opening and closing of the lock and extend the service life of the door lock.

发明内容Summary of the invention

为了解决上述技术问题的至少之一,本发明提出一种智能门锁控制方法、系统及存储介质,能够有效提升门锁控制的准确性,延长门锁的使用寿命。In order to solve at least one of the above technical problems, the present invention proposes an intelligent door lock control method, system and storage medium, which can effectively improve the accuracy of door lock control and extend the service life of the door lock.

一方面,本发明实施例提供了一种智能门锁控制方法,包括以下步骤:On the one hand, an embodiment of the present invention provides a smart door lock control method, comprising the following steps:

获取预设学习参数;其中,所述预设学习参数包括门锁的开关次数和调试状态;Obtaining preset learning parameters; wherein the preset learning parameters include the number of times the door lock is opened and closed and the debugging state;

确定所述预设学习参数满足预设学习条件,控制所述门锁进行动态学习,得到平稳编码值;其中,所述平稳编码值为所述门锁进行开关操作过程中,电机转动角度相应的编码值,所述预设学习条件包括预设开关次数或初始调试状态;Determine that the preset learning parameters meet the preset learning conditions, control the door lock to perform dynamic learning, and obtain a stable coding value; wherein the stable coding value is a coding value corresponding to the motor rotation angle during the switch operation of the door lock, and the preset learning conditions include a preset number of switches or an initial debugging state;

根据所述平稳编码值控制电机驱动进行门锁开关操作;Controlling the motor drive to perform door lock switch operation according to the stable coding value;

其中,所述控制所述门锁进行动态学习,得到平稳编码值,包括:The controlling the door lock to perform dynamic learning to obtain a stable coding value includes:

获取预设编码值;Get the preset encoding value;

根据所述预设编码值控制所述电机转动至相应的旋转角度;Control the motor to rotate to a corresponding rotation angle according to the preset coding value;

获取所述电机的当前电流数据;Acquiring current data of the motor;

根据所述当前电流数据调整所述电机的编码值,得到所述平稳编码值。The encoding value of the motor is adjusted according to the current current data to obtain the stable encoding value.

根据本发明实施例的一种智能门锁控制方法,至少具有如下有益效果:本实施例通过获取预设学习参数,如门锁的开关次数和调试状态,确定预设学习参数满足预设学习条件后,如门锁的开关次数满足预设开关次数或调试状态为初始调试状态,控制门锁进行动态学习,以得到在门锁进行开关操作过程中,电机转动角度相应的编码值,即平稳编码值,从而有效提升门锁控制的准确性,缓解由于门锁形变导致的开关锁异常问题。进一步地,本实施例通过动态学习得到的平稳编码值控制电机驱动进行门锁开关操作,以编码控制电机的方式进行门锁的开关操作,有效缓解了由于堵转导致的减速齿轮损伤问题,延长了门锁的使用寿命。同时,通过根据电机编码值对电机进行驱动,能够实现对门锁开关锁操作进行精确控制,有效提升门锁控制的准确性。另外,在动态学习过程中,本实施例通过获取电机转动到预设编码值时电机的当前电流数据,以通过电机的当前电流数据调整电机的编码值,从而得到平稳编码值,能够有效缓解电机堵转问题,减少在门锁进行开关操作过程中出现电机堵转问题,有效提升门锁控制的准确性,延长门锁的使用寿命。According to an embodiment of the present invention, a smart door lock control method has at least the following beneficial effects: this embodiment obtains preset learning parameters, such as the number of times the door lock is switched on and off and the debugging state, and after determining that the preset learning parameters meet the preset learning conditions, such as the number of times the door lock is switched on and off meets the preset number of times or the debugging state is the initial debugging state, controls the door lock to perform dynamic learning, so as to obtain the coding value corresponding to the motor rotation angle during the door lock switching operation, that is, the stable coding value, thereby effectively improving the accuracy of the door lock control and alleviating the abnormal switch lock problem caused by the deformation of the door lock. Further, this embodiment controls the motor drive to perform the door lock switch operation through the stable coding value obtained by dynamic learning, and performs the door lock switch operation in the manner of coding control motor, which effectively alleviates the problem of damage to the reduction gear caused by stalling and prolongs the service life of the door lock. At the same time, by driving the motor according to the motor coding value, it is possible to achieve precise control of the door lock switch lock operation, effectively improving the accuracy of the door lock control. In addition, during the dynamic learning process, this embodiment obtains the current current data of the motor when the motor rotates to the preset coding value, and adjusts the coding value of the motor according to the current current data of the motor, thereby obtaining a stable coding value. This can effectively alleviate the problem of motor stalling and reduce the problem of motor stalling during the switching operation of the door lock, effectively improve the accuracy of door lock control, and extend the service life of the door lock.

根据本发明的一些实施例,所述获取预设编码值,包括:According to some embodiments of the present invention, obtaining a preset coding value includes:

确定所述门锁是初次上电调试,通过堵转电流法获取所述预设编码值;Determining that the door lock is powered on for the first time for debugging, and obtaining the preset coding value by a locked-rotor current method;

或者,确定所述门锁不是初次上电调试,将前一次动态学习得到的所述平稳编码值作为所述预设编码值。Alternatively, it is determined that the door lock is not powered on for the first time for debugging, and the stable coding value obtained by the previous dynamic learning is used as the preset coding value.

根据本发明的一些实施例,所述确定所述门锁是初次上电调试,通过堵转电流法获取所述预设编码值,包括:According to some embodiments of the present invention, determining that the door lock is powered on for the first time and obtaining the preset coding value by a locked-rotor current method includes:

获取电机的所述当前电流数据;Acquiring the current data of the motor;

确定所述当前电流数据满足预设堵转电流条件,记录所述电机转动角度的编码值,得到中间编码值;Determine that the current current data meets the preset stall current condition, record the encoding value of the motor rotation angle, and obtain an intermediate encoding value;

确定所述中间编码值的数量大于预设中间值数量,根据所述中间编码值构建编码数据库;Determining that the number of the intermediate code values is greater than a preset number of intermediate values, and constructing a coding database according to the intermediate code values;

确定所述编码数据库中的各个所述中间编码值的变化量小于预设变化量,得到所述预设编码值。It is determined that the change amount of each intermediate coding value in the coding database is less than a preset change amount, and the preset coding value is obtained.

根据本发明的一些实施例,所述根据所述当前电流数据调整所述电机的编码值,得到所述平稳编码值,包括:According to some embodiments of the present invention, adjusting the encoding value of the motor according to the current current data to obtain the stable encoding value includes:

判断所述当前电流数据与前一电流数据的电流数据关系;其中,所述前一电流数据为前一电流获取时刻获取得到的电机的电流数据;Determine the current data relationship between the current data and the previous current data; wherein the previous current data is the current data of the motor acquired at the previous current acquisition moment;

根据所述电流数据关系对所述预设编码值进行调整操作,得到当前编码值;其中,所述调整操作包括增加预设编码量或减少预设编码量;According to the current data relationship, the preset coding value is adjusted to obtain a current coding value; wherein the adjustment operation includes increasing the preset coding amount or decreasing the preset coding amount;

根据所述调整操作设置相应的标志位;其中,所述标志位包括增加标志和减少标志;Setting a corresponding flag bit according to the adjustment operation; wherein the flag bit includes an increase flag and a decrease flag;

根据所述标志位构建标志记录序列;Constructing a flag record sequence according to the flag bit;

确定所述标志记录序列满足预设记录条件,根据所述当前编码值得到所述平稳编码值。It is determined that the mark record sequence meets a preset record condition, and the stable code value is obtained according to the current code value.

根据本发明的一些实施例,所述根据所述电流数据关系对所述预设编码值进行调整操作,得到当前编码值,包括:According to some embodiments of the present invention, the adjusting operation on the preset coding value according to the current data relationship to obtain the current coding value includes:

确定所述电流数据关系满足预设堵转条件,将所述预设编码值减少预设编码量,得到当前编码值;Determining that the current data relationship satisfies a preset stall condition, reducing the preset coding value by a preset coding amount to obtain a current coding value;

或者,确定所述电流数据关系未满足所述预设堵转条件,将所述预设编码值增加所述预设编码量,得到所述当前编码值。Alternatively, it is determined that the current data relationship does not satisfy the preset stall condition, and the preset coding value is increased by the preset coding amount to obtain the current coding value.

根据本发明的一些实施例,所述确定所述标志记录序列满足预设记录条件,根据所述当前编码值得到所述平稳编码值,包括:According to some embodiments of the present invention, determining that the mark record sequence satisfies a preset record condition, and obtaining the stable code value according to the current code value, comprises:

确定所述标志记录序列中所述增加标志和所述减少标志交替记录的次数满足预设交替次数,根据所述当前编码值得到所述平稳编码值。It is determined that the number of times the increase mark and the decrease mark in the mark record sequence are alternately recorded meets a preset number of alternations, and the stable code value is obtained according to the current code value.

根据本发明的一些实施例,所述根据所述平稳编码值控制电机驱动进行门锁开关操作,包括:According to some embodiments of the present invention, controlling the motor drive to perform a door lock switch operation according to the stable code value includes:

获取门锁控制指令;其中,所述门锁控制指令包括开锁操作和关锁操作;Obtaining a door lock control instruction; wherein the door lock control instruction includes an unlocking operation and a locking operation;

根据所述门锁控制指令驱动所述电机;driving the motor according to the door lock control instruction;

通过预设编码器实时获取所述电机的编码数据;Acquire the encoding data of the motor in real time through a preset encoder;

确定所述编码数据与所述平稳编码值的误差小于预设误差数据,控制所述电机停止转动。Determine that the error between the encoding data and the stable encoding value is less than a preset error data, and control the motor to stop rotating.

另一方面,本发明实施例还提供了一种智能门锁控制系统,包括:On the other hand, an embodiment of the present invention further provides an intelligent door lock control system, comprising:

获取模块,用于获取预设学习条件参数;其中,所述预设学习条件参数包括门锁的开关次数和初始调试状态;An acquisition module, used to acquire preset learning condition parameters; wherein the preset learning condition parameters include the number of times the door lock is opened and closed and the initial debugging state;

学习模块,用于确定所述预设学习参数满足预设学习条件,控制所述门锁进行动态学习,得到平稳编码值;其中,所述平稳编码值为所述门锁进行开关操作过程中,电机转动角度相应的编码值,所述预设学习条件包括预设开关次数或初始调试状态;A learning module, used to determine that the preset learning parameters meet the preset learning conditions, control the door lock to perform dynamic learning, and obtain a stable coding value; wherein the stable coding value is a coding value corresponding to the motor rotation angle during the switch operation of the door lock, and the preset learning conditions include a preset number of switches or an initial debugging state;

控制模块,用于根据所述平稳编码值控制电机驱动进行门锁开关操作;A control module, used for controlling the motor drive to perform door lock switch operation according to the stable coding value;

其中,所述控制所述门锁进行动态学习,得到平稳编码值,包括:The controlling the door lock to perform dynamic learning to obtain a stable coding value includes:

获取预设编码值;Get the preset encoding value;

根据所述预设编码值控制所述电机转动至相应的旋转角度;Control the motor to rotate to a corresponding rotation angle according to the preset coding value;

获取所述电机的当前电流数据;Acquiring current data of the motor;

根据所述当前电流数据调整所述电机的编码值,得到所述平稳编码值。The encoding value of the motor is adjusted according to the current current data to obtain the stable encoding value.

另一方面,本发明实施例还提供了一种智能门锁控制系统,包括:On the other hand, an embodiment of the present invention further provides an intelligent door lock control system, comprising:

至少一个处理器;at least one processor;

至少一个存储器,用于存储至少一个程序;at least one memory for storing at least one program;

当所述至少一个程序被所述至少一个处理器执行,使得至少一个所述处理器实现如上述实施例所述的智能门锁控制方法。When the at least one program is executed by the at least one processor, the at least one processor implements the smart door lock control method as described in the above embodiment.

另一方面,本发明实施例还提供了一种计算机存储介质,其中存储有处理器可执行的程序,所述处理器可执行的程序在由所述处理器执行时用于实现如上述实施例所述的智能门锁控制方法。On the other hand, an embodiment of the present invention further provides a computer storage medium, which stores a program executable by a processor, and the program executable by the processor is used to implement the smart door lock control method as described in the above embodiment when executed by the processor.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是本发明实施例提供的智能门锁控制方法流程图;FIG1 is a flow chart of a smart door lock control method provided by an embodiment of the present invention;

图2是本发明实施例提供的智能门锁控制系统原理框图。FIG. 2 is a functional block diagram of an intelligent door lock control system provided by an embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

本申请实施例所描述的实施例不应视为对本申请的限制,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。The embodiments described in the embodiments of this application should not be regarded as limitations of this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

目前,全自动智能锁实现自动开锁的方式有两种,一种是把电机内置在锁体电子内部,通过减速电机转动后带动锁舌,实现自动开门,另一种是使用常规机械锁体,并把检索电机放到锁后的把手,再通过锁芯转动轴带动锁舌,实现自动开门。第一种方案能够通过锁体锁舌触发开关判断门锁是否开到位、关到位,不会导致开关锁误判断。但是由于锁体内部的空间较小,能放下的减速电机也是小电机,这也导致了其难以实现大扭矩开关锁。一旦门锁安装好后与门框有摩擦力,便会导致开锁失败。而第二种方案中,由于锁后把手空间较大,减速电机体积能够做的更大,因此开关锁的成功率也更高。但是由于这种方式是通过电机的堵转电流来判断锁舌是否完成开锁这一过程,容易出现误判断,在实际应用中存在一定的开锁误判比例。并且由于是通过电机堵转来判断开关锁操作是否完成,电流会超出电机的额定电流,对减速齿轮造成损伤,形成不可逆的损害,这也导致了门锁的使用寿命缩短。如何实现对门锁进行准确的控制,缓解门锁寿命缩短的问题,没有很好的方法。At present, there are two ways for fully automatic smart locks to achieve automatic unlocking. One is to build the motor into the lock body electronics, and drive the lock tongue by rotating the reduction motor to achieve automatic door opening. The other is to use a conventional mechanical lock body, put the search motor in the handle behind the lock, and then drive the lock tongue through the lock core rotating shaft to achieve automatic door opening. The first solution can determine whether the door lock is fully opened and closed by triggering the switch of the lock body and lock tongue, and will not cause misjudgment of the switch lock. However, due to the small space inside the lock body, the reduction motor that can be placed is also a small motor, which also makes it difficult to achieve high torque switch lock. Once the door lock is installed, there is friction with the door frame, which will cause unlocking failure. In the second solution, due to the large space of the handle behind the lock, the reduction motor can be made larger, so the success rate of the switch lock is also higher. However, since this method uses the motor's stall current to determine whether the lock tongue has completed the unlocking process, it is easy to make misjudgments, and there is a certain proportion of unlocking misjudgments in actual applications. And because the motor is locked to determine whether the switch lock operation is complete, the current will exceed the rated current of the motor, causing damage to the reduction gear, resulting in irreversible damage, which also shortens the service life of the door lock. There is no good way to achieve accurate control of the door lock and alleviate the problem of shortened door lock life.

本发明的一个实施例提供了一种智能门锁控制方法、系统及存储介质,能够有效提升门锁控制的准确性,延长门锁的使用寿命。参照图1,本发明实施例的方法包括但不限于步骤S110、步骤S120和步骤S130。An embodiment of the present invention provides a smart door lock control method, system and storage medium, which can effectively improve the accuracy of door lock control and extend the service life of the door lock. Referring to Figure 1, the method of the embodiment of the present invention includes but is not limited to step S110, step S120 and step S130.

具体地,本发明实施例的方法应用过程包括但不限于以下步骤:Specifically, the method application process of the embodiment of the present invention includes but is not limited to the following steps:

S110:获取预设学习参数。其中,预设学习参数包括门锁的开关次数和调试状态。S110: Obtaining preset learning parameters, wherein the preset learning parameters include the number of times the door lock is opened and closed and the debugging state.

S120:确定预设学习参数满足预设学习条件,控制门锁进行动态学习,得到平稳编码值。其中,平稳编码值为门锁进行开关操作过程中,电机转动角度相应的编码值,预设学习条件包括预设开关次数或初始调试状态。S120: Determine that the preset learning parameters meet the preset learning conditions, control the door lock to perform dynamic learning, and obtain a stable coding value. The stable coding value is the coding value corresponding to the motor rotation angle during the door lock opening and closing operation, and the preset learning conditions include the preset opening and closing times or the initial debugging state.

S130:根据平稳编码值控制电机驱动进行门锁开关操作。S130: Control the motor drive to perform door lock switch operation according to the stable coding value.

其中,控制门锁进行动态学习,得到平稳编码值,包括但不限于:Among them, the door lock is controlled to perform dynamic learning to obtain a stable coding value, including but not limited to:

获取预设编码值。Get the preset encoding value.

根据预设编码值控制电机转动至相应的旋转角度。The motor is controlled to rotate to the corresponding rotation angle according to the preset encoding value.

获取电机的当前电流数据。Get the current data of the motor.

根据当前电流数据调整电机的编码值,得到平稳编码值。The motor's encoding value is adjusted according to the current current data to obtain a stable encoding value.

在本具体实施例工作过程中,本实施例首先获取预设学习参数。其中,预设学习参数包括门锁的开关次数和调试状态。例如,当门锁进行初始上电时,门锁的调试状态为初始调试状态,或者在每次进行门锁的开关操作时进行记录,得到门锁的开关数据,即开关次数。本实施例通过对门锁的开关次数和调试状态进行记录,得到相应的预设学习参数。进一步地,当确定预设学习参数满足预设学习条件,控制门锁进行动态学习。本实施例中当确定门锁开关次数满足预设开关次数,则控制门锁进行动态学习,以得到门锁进行开关操作过程中电机转动角度相应的编码值,即平稳编码值。例如,当门锁的开关次数每达到200次,则控制门锁进行一次动态学习,以通过动态学习的方式使得平稳编码值能够自适应门锁的变化,如由于使用时间过长发生的形变等,有效提升门锁控制的准确性。或者,当确定门锁为初始调试状态,则控制门锁进行动态学习,得到门锁进行开关操作过程中电机转动角度相应的平稳编码值,以通过动态学习的方式自主获取门锁的平稳编码值,简化门锁设置流程。然后,本实施例根据平稳编码值控制电机驱动进行门锁开关操作。当接收到门锁的开关操作控制指令后,根据动态学习得到的平稳编码值控制电机转动值相应的角度,从而实现门锁的开关操作,以通过电机编码器进行门锁电机控制的方式,有效提升了对门锁电机的控制精确度,且通过电机、电机编码器以及门锁控制器之间形成的控制闭环,能够实现高精度的电机控制,缓解常规机械锁体通过堵转电流判断开关锁过程没有精确反馈,导致开关锁失败的问题。具体地,本实施例在进行动态学习的过程中,首先获取预设编码值,该预设编码值为初始设定的开关锁操作电机所需转动角度对应的编码值。然后,本实施例根据预设编码值控制电机转动至相应的旋转角度。同时,本实施例获取电机的当前电流数据。当根据预设编码值控制电机转动至相应的旋转角度后,本实施例通过原有的堵转电流检测电路获取电机的当前电流数据。接着,根据电机的当前电流数据对电机的编码值进行调整得到平稳编码值。例如,根据电机的当前电流数据分析当前设置的电机编码值是否会产生堵转电流,以对设置的电机编码值进行调整,得到平稳编码值。本实施例通过获取电机转动至预设编码值相应的旋转角度后的电流数据对电机的编码值进行调整,从而实现平稳编码值的动态学习,自适应门锁的变化,有效提升门锁控制的准确性,并且缓解了电机堵转导致的门锁损伤问题,延长了门锁的使用寿命。During the working process of this specific embodiment, this embodiment first obtains preset learning parameters. Among them, the preset learning parameters include the number of times the door lock is switched on and off and the debugging state. For example, when the door lock is initially powered on, the debugging state of the door lock is the initial debugging state, or the door lock is recorded each time the switch operation is performed to obtain the switch data of the door lock, that is, the number of switches. This embodiment obtains the corresponding preset learning parameters by recording the number of switches and the debugging state of the door lock. Further, when it is determined that the preset learning parameters meet the preset learning conditions, the door lock is controlled to perform dynamic learning. In this embodiment, when it is determined that the number of times the door lock is switched on and off meets the preset number of switches, the door lock is controlled to perform dynamic learning to obtain the encoding value corresponding to the motor rotation angle during the switch operation of the door lock, that is, the stable encoding value. For example, when the number of times the door lock is switched on and off reaches 200 times, the door lock is controlled to perform dynamic learning once, so that the stable encoding value can adapt to the changes of the door lock through dynamic learning, such as deformation caused by long use time, etc., effectively improving the accuracy of door lock control. Alternatively, when it is determined that the door lock is in the initial debugging state, the door lock is controlled to perform dynamic learning to obtain the stable coding value corresponding to the motor rotation angle during the door lock switch operation, so as to autonomously obtain the stable coding value of the door lock through dynamic learning, thereby simplifying the door lock setting process. Then, the present embodiment controls the motor drive to perform the door lock switch operation according to the stable coding value. After receiving the switch operation control instruction of the door lock, the angle corresponding to the motor rotation value is controlled according to the stable coding value obtained by dynamic learning, so as to realize the switch operation of the door lock, and the control accuracy of the door lock motor is effectively improved by controlling the door lock motor through the motor encoder, and the control closed loop formed between the motor, the motor encoder and the door lock controller can realize high-precision motor control, which alleviates the problem that the conventional mechanical lock body does not have accurate feedback in the switch lock process through the stall current judgment, resulting in the failure of the switch lock. Specifically, in the process of dynamic learning, the present embodiment first obtains a preset coding value, which is the coding value corresponding to the rotation angle required for the switch lock operation motor initially set. Then, the present embodiment controls the motor to rotate to the corresponding rotation angle according to the preset coding value. At the same time, the present embodiment obtains the current current data of the motor. After the motor is controlled to rotate to a corresponding rotation angle according to a preset code value, the present embodiment obtains the current current data of the motor through the original stall current detection circuit. Then, the code value of the motor is adjusted according to the current current data of the motor to obtain a stable code value. For example, whether the currently set motor code value will generate a stall current is analyzed according to the current current data of the motor, so as to adjust the set motor code value to obtain a stable code value. The present embodiment adjusts the code value of the motor by obtaining the current data after the motor rotates to the corresponding rotation angle of the preset code value, thereby realizing dynamic learning of the stable code value, adapting to the changes of the door lock, effectively improving the accuracy of the door lock control, and alleviating the problem of door lock damage caused by motor stalling, thereby extending the service life of the door lock.

在本发明的一些实施例中,获取预设编码值,包括但不限于:In some embodiments of the present invention, obtaining a preset coding value includes, but is not limited to:

确定门锁是初次上电调试,通过堵转电流法获取预设编码值。Make sure the door lock is powered on for the first time and obtain the preset coding value through the locked-rotor current method.

或者,确定门锁不是初次上电调试,将前一次动态学习得到的平稳编码值作为预设编码值。Alternatively, it is determined that the door lock is not powered on for the first time for debugging, and the stable coding value obtained by the previous dynamic learning is used as the preset coding value.

在本具体实施例中,当门锁为初次上电调试,本实施例通过堵转电流法获取得到预设编码值。同时,当门锁不是初次上电调试,则本实施例将前一次动态学习得到的平稳编码值作为预设编码值。具体地,当门锁为初次上电调试时,本实施例通过堵转电流的方式判断门锁的开关锁操作,并记录开关锁操作相应的编码数据,从而得到预设编码值。而当门锁不是初次上电调试时,本实施例将前一次进行动态学习得到的平稳编码值作为本次动态学习的预设编码值,以通过动态学习实现自适应门锁控制,提高门锁控制的准确性。In this specific embodiment, when the door lock is powered on for the first time, the preset coding value is obtained by the locked-rotor current method. At the same time, when the door lock is not powered on for the first time, the stable coding value obtained by the previous dynamic learning is used as the preset coding value. Specifically, when the door lock is powered on for the first time, the embodiment determines the switch lock operation of the door lock by the locked-rotor current method, and records the coding data corresponding to the switch lock operation, thereby obtaining the preset coding value. When the door lock is not powered on for the first time, the embodiment uses the stable coding value obtained by the previous dynamic learning as the preset coding value for this dynamic learning, so as to realize adaptive door lock control through dynamic learning and improve the accuracy of door lock control.

在本发明的一些实施例中,确定门锁是初次上电调试,通过堵转电流法获取所述预设编码值,包括但不限于:In some embodiments of the present invention, it is determined that the door lock is powered on for the first time and the preset code value is obtained by the locked-rotor current method, including but not limited to:

获取电机的当前电流数据。Get the current data of the motor.

确定当前电流数据满足预设堵转电流条件,记录电机转动角度的编码值,得到中间编码值。Determine whether the current data meets the preset stall current condition, record the encoding value of the motor rotation angle, and obtain the intermediate encoding value.

确定中间编码值的数量大于预设中间值数量,根据中间编码值构建编码数据库。It is determined that the number of intermediate coding values is greater than the preset number of intermediate values, and a coding database is constructed according to the intermediate coding values.

确定编码数据库中的各个中间编码值的变化量小于预设变化量,得到预设编码值。It is determined that the change amount of each intermediate coding value in the coding database is less than the preset change amount, and the preset coding value is obtained.

在本具体实施例中,当门锁是初次上电调试,本实施例通过堵转电流法获取预设编码值。具体地,本实施例首先获取电机的当前电流数据,当确定当前电流数据满足预设转电流条件,则记录电机转动角度的编码值,得到中间编码值。进一步地,当中间编码值的数量大于预设中间值数量,本实施例根据中间编码值构建编码数据库。当编码数据库中的各个中间编码值的变化量小于预设变化量时,得到预设编码值。示例性地,当门锁初次上电时,本实施例驱动电机进行开关锁操作,并获取电机的电流数据,即当前电流数据。当确定电流数据满足预设堵转电流条件时,认为门锁的开关锁操作完成,控制电机停转并记录当前电机转动角度对应的编码值,将该编码值记录为一个中间编码值。重复上述的过程,得到若干个中间编码值。当确定中间编码值的数量大于预设中间值数量,本实施例根据得到的中间编码值构建编码数据库,例如,当进行20次开关锁操作,得到20个中间编码值后,本实施例根据这20个中间编码值构建编码数据库。进一步地,本实施例通过对编码数据库中的中间编码值之间的变化进行分析,当确定各个中间编码值的变化量小于预设变化量后,得到预设编码值。例如,当中间编码值的变化值低于1%时,则认为目前门锁的开关锁操作稳定,从而得到预设编码值。容易理解的是,在本发明的一些实施例中预设编码值可以通过将编码数据库中各个中间编码值进行平均得到。本实施例通过获取多次稳定开锁的电机编码值得到预设编码值的方式,有效缓解了安装调试过程中认为因素对编码数据造成的干扰问题,使得获取的预设编码值更加稳定和准确。In this specific embodiment, when the door lock is powered on for the first time for debugging, this embodiment obtains the preset coding value through the stall current method. Specifically, this embodiment first obtains the current current data of the motor. When it is determined that the current current data meets the preset current condition, the coding value of the motor rotation angle is recorded to obtain the intermediate coding value. Further, when the number of intermediate coding values is greater than the preset number of intermediate values, this embodiment constructs a coding database based on the intermediate coding values. When the change in each intermediate coding value in the coding database is less than the preset change, the preset coding value is obtained. Exemplarily, when the door lock is powered on for the first time, this embodiment drives the motor to perform the switch lock operation and obtains the current data of the motor, that is, the current current data. When it is determined that the current data meets the preset stall current condition, it is considered that the switch lock operation of the door lock is completed, the motor is controlled to stop and the coding value corresponding to the current motor rotation angle is recorded, and the coding value is recorded as an intermediate coding value. Repeat the above process to obtain several intermediate coding values. When it is determined that the number of intermediate code values is greater than the preset number of intermediate values, this embodiment constructs a code database based on the intermediate code values obtained. For example, when 20 switch lock operations are performed and 20 intermediate code values are obtained, this embodiment constructs a code database based on these 20 intermediate code values. Further, this embodiment analyzes the changes between the intermediate code values in the code database, and obtains the preset code value after determining that the change amount of each intermediate code value is less than the preset change amount. For example, when the change value of the intermediate code value is less than 1%, it is considered that the current switch lock operation of the door lock is stable, thereby obtaining the preset code value. It is easy to understand that in some embodiments of the present invention, the preset code value can be obtained by averaging the intermediate code values in the code database. This embodiment obtains the preset code value by obtaining the motor code value of multiple stable unlockings, which effectively alleviates the interference problem caused by the factors on the code data during the installation and debugging process, making the obtained preset code value more stable and accurate.

在本发明的一些实施例中,根据当前电流数据调整电机的编码值,得到平稳编码值,包括但不限于:In some embodiments of the present invention, the encoder value of the motor is adjusted according to the current current data to obtain a stable encoder value, including but not limited to:

判断当前电流数据与前一电流数据的电流数据关系。其中,前一电流数据为前一电流获取时刻获取得到的电机的电流数据。Determine the current data relationship between the current data and the previous current data, wherein the previous current data is the current data of the motor obtained at the previous current acquisition moment.

根据电流数据关系对预设编码值进行调整操作,得到当前编码值。其中,调整操作包括增加预设编码量或减少预设编码量。The preset coding value is adjusted according to the current data relationship to obtain the current coding value, wherein the adjustment operation includes increasing the preset coding amount or decreasing the preset coding amount.

根据调整操作设置相应的标志位。其中,标志位包括增加标志和减少标志。The corresponding flag bit is set according to the adjustment operation, wherein the flag bit includes an increase flag and a decrease flag.

根据标志位构建标志记录序列。Construct a sequence of flag records based on the flag bits.

确定标志记录序列满足预设记录条件,根据当前编码值得到平稳编码值。It is determined that the mark record sequence meets the preset record conditions, and a stable code value is obtained according to the current code value.

在本具体实施例中,本实施例首先判断当前电流数据与前一电流数据的电流数据关系,然后根据电流数据对预设编码值进行调整操作,得到当前编码值。同时,根据调整操作设置相应的标志位,并根据标志位构建标志记录序列。当确定标志记录序列满足预设记录条件,本实施例根据当前编码值得到平稳编码值。具体地,前一电流数据为前一电流获取时刻获取得到的电机的电流数据。本实施例通过获取电机的当前电流数据与前一电流获取时刻获取得到的电机的电流数据进行比较,得到电流数据的关系,如是否出现堵转电流等。进一步地,根据电流数据关系对预设编码值进行的调整操作包括增加预设编码量和减少预设编码量。本实施例根据电流数据关系判断预设编码值需要进行编码量增加还是减少,然后对预设编码值进行相应的调整操作,得到当前编码值。同时,本实施例根据进行的调整操作记录相应的标志位,例如,当调整操作为增加预设编码量时,将标志位设置为增加标志,当调整操作为减少预设编码量时,将标志位设置为减少标志。进一步地,本实施例根据标志位构建标志记录序列。例如,本实施例根据记录的标志位,按照先后顺序进行排列构建得到标志记录序列。当确定标志记录序列满足预设记录条件时,则根据当前编码值得到平稳编码值。示例性地,当记录的标志记录序列出现增加标志和减少标志交替出现时,则电机当前的编码值已经稳定,且满足准确开关锁操作的要求,本实施例则根据当前编码值得到平均编码值。In this specific embodiment, this embodiment first determines the current data relationship between the current current data and the previous current data, and then performs an adjustment operation on the preset code value according to the current data to obtain the current code value. At the same time, the corresponding flag bit is set according to the adjustment operation, and a flag record sequence is constructed according to the flag bit. When it is determined that the flag record sequence meets the preset recording condition, this embodiment obtains a stable code value according to the current code value. Specifically, the previous current data is the current data of the motor obtained at the previous current acquisition moment. This embodiment obtains the relationship of the current data by obtaining the current current data of the motor and comparing it with the current data of the motor obtained at the previous current acquisition moment. Such as whether a stall current occurs. Further, the adjustment operation performed on the preset code value according to the current data relationship includes increasing the preset code amount and reducing the preset code amount. This embodiment determines whether the preset code value needs to increase or decrease the code amount according to the current data relationship, and then performs a corresponding adjustment operation on the preset code value to obtain the current code value. At the same time, this embodiment records the corresponding flag bit according to the adjustment operation performed, for example, when the adjustment operation is to increase the preset code amount, the flag bit is set to an increase flag, and when the adjustment operation is to reduce the preset code amount, the flag bit is set to a decrease flag. Furthermore, the present embodiment constructs a flag record sequence according to the flag bits. For example, the present embodiment constructs a flag record sequence according to the recorded flag bits by arranging them in order. When it is determined that the flag record sequence meets the preset recording conditions, a stable code value is obtained according to the current code value. Exemplarily, when the increase and decrease signs appear alternately in the recorded flag record sequence, the current code value of the motor has stabilized and meets the requirements of accurate switch lock operation. The present embodiment obtains an average code value according to the current code value.

在本发明的一些实施例中,根据电流数据关系对预设编码值进行调整操作,得到当前编码值,包括但不限于:In some embodiments of the present invention, the preset coding value is adjusted according to the current data relationship to obtain the current coding value, including but not limited to:

确定电流数据关系满足预设堵转条件,将预设编码值减少预设编码量,得到当前编码值。It is determined that the current data relationship meets the preset stall condition, and the preset coding value is reduced by a preset coding amount to obtain a current coding value.

或者,确定电流数据关系未满足预设堵转条件,将预设编码值增加预设编码量,得到当前编码值。Alternatively, it is determined that the current data relationship does not satisfy the preset stall condition, and the preset coding value is increased by a preset coding amount to obtain a current coding value.

在本具体实施例中,本实施例根据电流数据关系是否满足预设堵转条件地预设编码值进行相应的调整操作。具体地,本实施例首先判断电流数据关系是否满足预设堵转条件,即电机的电流是否出现堵转电流。当确定电流数据关系满足预设堵转条件,即电机的当前电流出现了堵转电流,说明电机转动的角度过大,需要减小转动角度。因此,本实施例将预设编码值减少预设编码量,得到当前编码值。而当电流数据关系未满足预设堵转条件,则电机转动角度可能未满足门锁开关锁操作的需求,需要增加转动角度。本实施例将预设编码值增加预设编码量,得到当前编码值。示例性地,本实施例驱动电机转动到预设编码值X相应的旋转角度后,控制电机停止旋转并检测当前电机的电流,即获取电机的当前电流数据。将电机的当前电流数据与前一电流获取时刻获取得到的电机的电流数据进行比较,得到电流数据关系,如电机的电流变化趋势等。然后,本实施例根据电流数据关系判断电机电流是否堵转变大。当确定电机电流发生堵转变大时,则将预设编码值X减1,而当确定电机电流未发生堵转变大时,则将预设编码值X加1,从而得到新的编码值,即当前编码值。然后,本实施例重复上述操作,驱动电机旋转至新的编码值,即当前编码值,然后重新根据电流数据关系分析判断得到相应的当前编码值。In this specific embodiment, this embodiment performs corresponding adjustment operations according to the preset coding value of whether the current data relationship meets the preset stalling condition. Specifically, this embodiment first determines whether the current data relationship meets the preset stalling condition, that is, whether the current of the motor has a stalling current. When it is determined that the current data relationship meets the preset stalling condition, that is, the current current of the motor has a stalling current, it means that the angle of rotation of the motor is too large and the rotation angle needs to be reduced. Therefore, this embodiment reduces the preset coding value by a preset coding amount to obtain the current coding value. When the current data relationship does not meet the preset stalling condition, the motor rotation angle may not meet the requirements of the door lock switch lock operation, and the rotation angle needs to be increased. This embodiment increases the preset coding value by a preset coding amount to obtain the current coding value. Exemplarily, after the present embodiment drives the motor to rotate to the rotation angle corresponding to the preset coding value X, the motor is controlled to stop rotating and the current current of the motor is detected, that is, the current current data of the motor is obtained. The current current data of the motor is compared with the current data of the motor obtained at the previous current acquisition moment to obtain the current data relationship, such as the current change trend of the motor. Then, this embodiment determines whether the motor current is stalled and increased according to the current data relationship. When it is determined that the motor current is locked and increased, the preset code value X is reduced by 1, and when it is determined that the motor current is not locked and increased, the preset code value X is increased by 1, thereby obtaining a new code value, that is, the current code value. Then, this embodiment repeats the above operation, drives the motor to rotate to a new code value, that is, the current code value, and then re-analyzes and determines the corresponding current code value based on the current data relationship.

在本发明的一些实施例中,确定标志记录序列满足预设记录条件,根据当前编码值得到平稳编码值,包括但不限于:In some embodiments of the present invention, determining that the marker record sequence meets the preset record condition and obtaining a stable code value according to the current code value include but are not limited to:

确定标志记录序列中增加标志和减少标志交替记录的次数满足预设交替次数,根据当前编码值得到平稳编码值。It is determined that the number of alternating records of the increase mark and the decrease mark in the mark record sequence meets the preset alternation number, and a stable code value is obtained according to the current code value.

在本具体实施例中,本实施例通过标志记录序列中增加标志和减少标志交替记录的情况分析确定得到平稳编码值。具体地,本实施例对标志记录序列中增加标志和减少标志出现交替记录的次数进行分析,当增加标志和减少标志交替记录的次数满足预设交替次数时,认为当前编码值趋于稳定,从而根据当前编码值得到平稳编码值。示例性地,标志记录序列中根据记录的时间顺序对设置的标志位进行排序,当标志序列中增加标志和减少标志交替记录的次数大于10次时,则当前电机的编码值趋于稳定。例如,第一时刻记录的标志位为增加标志,第二时刻记录的标志位为减少标志,第三时刻记录的标志位为增加标志,第四时刻记录的标志位为减少标志,以此类推,当增加标志和减少标志交替记录的次数大于10次时,则根据当前编码值得到平稳编码值。容易理解的是,为了缓解电机堵转导致的减速齿轮的损伤,本实施例将预设交替次数记录中未执行增加预设编码量操作的当前编码值或执行了减少预设编码量操作的当前编码值作为平稳编码值。例如,当电机的当前编码值为Y,此时电机电流未发生堵转变大,则执行增加预设编码量操作,得到当前编码值为Y+1,并记录增加标志。而当控制电机驱动至当前编码值为Y+1相应的旋转角度后,检测到的电机电流发生了堵转变大,则执行减少预设编码量操作,得到当前编码值为Y,并记录减少标志。当增加标志和减少标志交替记录的次数大于十次之后,本实施例将预设交替次数记录中未执行增加预设编码量操作的当前编码值或执行了减少预设编码量操作的当前编码值作为平稳编码值,即将Y作为平稳编码值。In this specific embodiment, this embodiment determines to obtain a stable coding value by analyzing the situation of alternating recording of increase and decrease signs in the sign recording sequence. Specifically, this embodiment analyzes the number of times that the increase and decrease signs appear alternately recorded in the sign recording sequence. When the number of times that the increase and decrease signs are alternately recorded meets the preset number of alternations, it is considered that the current coding value tends to be stable, so as to obtain a stable coding value according to the current coding value. Exemplarily, the set flag bits are sorted according to the time sequence of the records in the sign recording sequence. When the number of times that the increase and decrease signs are alternately recorded in the sign sequence is greater than 10 times, the coding value of the current motor tends to be stable. For example, the flag bit recorded at the first moment is an increase flag, the flag bit recorded at the second moment is a decrease flag, the flag bit recorded at the third moment is an increase flag, and the flag bit recorded at the fourth moment is a decrease flag, and so on. When the number of times that the increase and decrease signs are alternately recorded is greater than 10 times, a stable coding value is obtained according to the current coding value. It is easy to understand that in order to alleviate the damage of the reduction gear caused by the motor stall, the present embodiment uses the current code value that does not perform the operation of increasing the preset code amount in the preset alternating number record or the current code value that performs the operation of reducing the preset code amount as a stable code value. For example, when the current code value of the motor is Y, and the motor current does not stall and increase, the operation of increasing the preset code amount is performed, and the current code value is Y+1, and the increase mark is recorded. When the motor is controlled to drive to the rotation angle corresponding to the current code value Y+1, the detected motor current is stalled and increased, and the operation of reducing the preset code amount is performed, and the current code value is Y, and the reduction mark is recorded. When the number of times the increase mark and the reduction mark are recorded alternately is greater than ten times, the present embodiment uses the current code value that does not perform the operation of increasing the preset code amount in the preset alternating number record or the current code value that performs the operation of reducing the preset code amount as a stable code value, that is, Y is used as a stable code value.

在本发明的一些实施例中,根据平稳编码值控制电机驱动进行门锁开关操作,包括但不限于:In some embodiments of the present invention, the motor drive is controlled according to the stable code value to perform the door lock switch operation, including but not limited to:

获取门锁控制指令。其中,门锁控制指令包括开锁操作和关锁操作。Get the door lock control command, which includes unlocking and locking operations.

根据门锁控制指令驱动所述电机。The motor is driven according to a door lock control instruction.

通过预设编码器实时获取电机的编码数据。The motor encoding data is obtained in real time through the preset encoder.

确定编码数据与平稳编码值的误差小于预设误差数据,控制电机停止转动。Determine that the error between the encoding data and the stable encoding value is less than the preset error data, and control the motor to stop rotating.

在本具体实施例中,本实施例首先获取门锁控制指令,并根据门锁控制指令确定电机,以执行相应的门锁控制操作。其中,门锁控制指令包括开锁操作和关锁操作。进一步地,本实施通过预设编码器实时获取电机的编码数据,当确定编码数据与平稳编码值的误差小于预设误差数据,则控制电机停止转动,完成相应的门锁控制。具体地,本实施例通过预设编码器实时监测电机的旋转角度。当获取到门锁控制指令,如开锁操作或关锁操作,本实施例根据该门锁控制指令驱动电机进行工作。同时,本实施例实时获取电机的编码数据,以实现对电机旋转角度的检测。当检测到的编码数据与平稳编码值的误差小于预设误差数据,即电机旋转至目标角度,本实施例控制电机停止转动,此时完成相应的开始操作或关锁操作,从而实现对门锁的精确控制。通过电机、预设编码器以及门锁控制器之间形成的控制闭环,有效提升了门锁控制的准确性,减少开关锁操作失败的情况。In this specific embodiment, this embodiment first obtains the door lock control instruction, and determines the motor according to the door lock control instruction to perform the corresponding door lock control operation. Among them, the door lock control instruction includes an unlocking operation and a locking operation. Further, this implementation obtains the encoding data of the motor in real time through a preset encoder, and when it is determined that the error between the encoding data and the stable encoding value is less than the preset error data, the motor is controlled to stop rotating to complete the corresponding door lock control. Specifically, this embodiment monitors the rotation angle of the motor in real time through a preset encoder. When a door lock control instruction, such as an unlocking operation or a locking operation, is obtained, this embodiment drives the motor to work according to the door lock control instruction. At the same time, this embodiment obtains the encoding data of the motor in real time to realize the detection of the rotation angle of the motor. When the error between the detected encoding data and the stable encoding value is less than the preset error data, that is, the motor rotates to the target angle, this embodiment controls the motor to stop rotating, and at this time completes the corresponding start operation or locking operation, thereby realizing accurate control of the door lock. Through the control closed loop formed between the motor, the preset encoder and the door lock controller, the accuracy of the door lock control is effectively improved, and the failure of the switch lock operation is reduced.

本发明的一个实施例还提供了一种智能门锁控制系统,包括:An embodiment of the present invention further provides an intelligent door lock control system, comprising:

获取模块,用于获取预设学习条件参数。其中,预设学习条件参数包括门锁的开关次数和初始调试状态。The acquisition module is used to acquire preset learning condition parameters, wherein the preset learning condition parameters include the number of times the door lock is opened and closed and the initial debugging state.

学习模块,用于确定预设学习参数满足预设学习条件,控制门锁进行动态学习,得到平稳编码值。其中,平稳编码值为门锁进行开关操作过程中,电机转动角度相应的编码值,预设学习条件包括预设开关次数或初始调试状态。The learning module is used to determine whether the preset learning parameters meet the preset learning conditions, control the door lock to perform dynamic learning, and obtain a stable coding value. The stable coding value is the coding value corresponding to the motor rotation angle during the door lock's switch operation, and the preset learning conditions include the preset switch times or the initial debugging state.

控制模块,用于根据平稳编码值控制电机驱动进行门锁开关操作。The control module is used to control the motor drive to perform door lock switch operation according to the stable coding value.

其中,控制门锁进行动态学习,得到平稳编码值,包括:Among them, the door lock is controlled to perform dynamic learning to obtain a stable coding value, including:

获取预设编码值。Get the preset encoding value.

根据预设编码值控制电机转动至相应的旋转角度。The motor is controlled to rotate to the corresponding rotation angle according to the preset encoding value.

获取电机的当前电流数据。Get the current data of the motor.

根据当前电流数据调整电机的编码值,得到平稳编码值。The motor's encoding value is adjusted according to the current current data to obtain a stable encoding value.

参照图2,本发明的一个实施例还提供了一种智能门锁控制系统,包括:2, an embodiment of the present invention further provides an intelligent door lock control system, comprising:

至少一个处理器210。At least one processor 210 .

至少一个存储器220,用于存储至少一个程序。At least one memory 220 is used to store at least one program.

当至少一个程序被至少一个处理器210执行,使得至少一个处理器210实现如上述实施例描述的智能门锁控制方法。When at least one program is executed by at least one processor 210, at least one processor 210 implements the smart door lock control method described in the above embodiment.

本发明的一个实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机可执行指令,该计算机可执行指令被一个或多个控制处理器执行,例如,执行以上实施例描述的步骤。An embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. The computer-executable instructions are executed by one or more control processors, for example, to execute the steps described in the above embodiment.

本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统可以被实施为软件、固件、硬件及其适当的组合。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

以上是对本发明的较佳实施进行了具体说明,但本发明并不局限于上述实施方式,熟悉本领域的技术人员在不违背本发明精神的前提下还可作出种种的等同变形或替换,这些等同的变形或替换均包含在本发明权利要求所限定的范围内。The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present invention.

Claims (9)

1.一种智能门锁控制方法,其特征在于,包括以下步骤:1. A smart door lock control method, characterized in that it includes the following steps: 获取预设学习参数;其中,所述预设学习参数包括门锁的开关次数和调试状态;Obtaining preset learning parameters; wherein the preset learning parameters include the number of times the door lock is opened and closed and the debugging state; 确定所述预设学习参数满足预设学习条件,控制所述门锁进行动态学习,得到平稳编码值;其中,所述平稳编码值为所述门锁进行开关操作过程中,电机转动角度相应的编码值,所述预设学习条件包括预设开关次数或初始调试状态;Determine that the preset learning parameters meet the preset learning conditions, control the door lock to perform dynamic learning, and obtain a stable coding value; wherein the stable coding value is a coding value corresponding to the motor rotation angle during the switch operation of the door lock, and the preset learning conditions include a preset number of switches or an initial debugging state; 根据所述平稳编码值控制电机驱动进行门锁开关操作;Controlling the motor drive to perform door lock switch operation according to the stable coding value; 其中,所述控制所述门锁进行动态学习,得到平稳编码值,包括:The controlling the door lock to perform dynamic learning to obtain a stable coding value includes: 获取预设编码值;Get the preset encoding value; 根据所述预设编码值控制所述电机转动至相应的旋转角度;Control the motor to rotate to a corresponding rotation angle according to the preset coding value; 获取所述电机的当前电流数据;Acquiring current data of the motor; 根据所述当前电流数据调整所述电机的编码值,得到所述平稳编码值;Adjusting the encoding value of the motor according to the current current data to obtain the stable encoding value; 其中,所述根据所述当前电流数据调整所述电机的编码值,得到所述平稳编码值,包括:Wherein, adjusting the encoding value of the motor according to the current current data to obtain the stable encoding value includes: 判断所述当前电流数据与前一电流数据的电流数据关系;其中,所述前一电流数据为前一电流获取时刻获取得到的电机的电流数据;Determine the current data relationship between the current data and the previous current data; wherein the previous current data is the current data of the motor acquired at the previous current acquisition moment; 根据所述电流数据关系对所述预设编码值进行调整操作,得到当前编码值;其中,所述调整操作包括增加预设编码量或减少预设编码量;According to the current data relationship, the preset coding value is adjusted to obtain a current coding value; wherein the adjustment operation includes increasing the preset coding amount or decreasing the preset coding amount; 根据所述调整操作设置相应的标志位;其中,所述标志位包括增加标志和减少标志;Setting a corresponding flag bit according to the adjustment operation; wherein the flag bit includes an increase flag and a decrease flag; 根据所述标志位构建标志记录序列;Constructing a flag record sequence according to the flag bit; 确定所述标志记录序列满足预设记录条件,根据所述当前编码值得到所述平稳编码值。It is determined that the mark record sequence meets a preset record condition, and the stable code value is obtained according to the current code value. 2.根据权利要求1所述的智能门锁控制方法,其特征在于,所述获取预设编码值,包括:2. The smart door lock control method according to claim 1, wherein obtaining the preset code value comprises: 确定所述门锁是初次上电调试,通过堵转电流法获取所述预设编码值;Determining that the door lock is powered on for the first time for debugging, and obtaining the preset coding value by a locked-rotor current method; 或者,确定所述门锁不是初次上电调试,将前一次动态学习得到的所述平稳编码值作为所述预设编码值。Alternatively, it is determined that the door lock is not powered on for the first time for debugging, and the stable coding value obtained by the previous dynamic learning is used as the preset coding value. 3.根据权利要求2所述的智能门锁控制方法,其特征在于,所述确定所述门锁是初次上电调试,通过堵转电流法获取所述预设编码值,包括:3. The intelligent door lock control method according to claim 2, characterized in that the step of determining that the door lock is powered on for the first time and obtaining the preset code value by a locked-rotor current method comprises: 获取电机的所述当前电流数据;Acquiring the current data of the motor; 确定所述当前电流数据满足预设堵转电流条件,记录所述电机转动角度的编码值,得到中间编码值;Determine that the current current data meets the preset stall current condition, record the encoding value of the motor rotation angle, and obtain an intermediate encoding value; 确定所述中间编码值的数量大于预设中间值数量,根据所述中间编码值构建编码数据库;Determining that the number of the intermediate code values is greater than a preset number of intermediate values, and constructing a coding database according to the intermediate code values; 确定所述编码数据库中的各个所述中间编码值的变化量小于预设变化量,得到所述预设编码值。It is determined that the change amount of each intermediate coding value in the coding database is less than a preset change amount, and the preset coding value is obtained. 4.根据权利要求1所述的智能门锁控制方法,其特征在于,所述根据所述电流数据关系对所述预设编码值进行调整操作,得到当前编码值,包括:4. The smart door lock control method according to claim 1, characterized in that the adjusting operation on the preset coding value according to the current data relationship to obtain the current coding value comprises: 确定所述电流数据关系满足预设堵转条件,将所述预设编码值减少预设编码量,得到当前编码值;Determining that the current data relationship satisfies a preset stall condition, reducing the preset coding value by a preset coding amount to obtain a current coding value; 或者,确定所述电流数据关系未满足所述预设堵转条件,将所述预设编码值增加所述预设编码量,得到所述当前编码值。Alternatively, it is determined that the current data relationship does not satisfy the preset stall condition, and the preset coding value is increased by the preset coding amount to obtain the current coding value. 5.根据权利要求1所述的智能门锁控制方法,其特征在于,所述确定所述标志记录序列满足预设记录条件,根据所述当前编码值得到所述平稳编码值,包括:5. The smart door lock control method according to claim 1, characterized in that the determining that the flag record sequence meets the preset record condition and obtaining the stable code value according to the current code value comprises: 确定所述标志记录序列中所述增加标志和所述减少标志交替记录的次数满足预设交替次数,根据所述当前编码值得到所述平稳编码值。It is determined that the number of times the increase mark and the decrease mark in the mark record sequence are alternately recorded meets a preset number of alternations, and the stable code value is obtained according to the current code value. 6.根据权利要求1所述的智能门锁控制方法,其特征在于,所述根据所述平稳编码值控制电机驱动进行门锁开关操作,包括:6. The intelligent door lock control method according to claim 1, characterized in that the controlling the motor drive to perform the door lock switch operation according to the stable code value comprises: 获取门锁控制指令;其中,所述门锁控制指令包括开锁操作和关锁操作;Obtaining a door lock control instruction; wherein the door lock control instruction includes an unlocking operation and a locking operation; 根据所述门锁控制指令驱动所述电机;driving the motor according to the door lock control instruction; 通过预设编码器实时获取所述电机的编码数据;Acquire the encoding data of the motor in real time through a preset encoder; 确定所述编码数据与所述平稳编码值的误差小于预设误差数据,控制所述电机停止转动。Determine that the error between the encoding data and the stable encoding value is less than a preset error data, and control the motor to stop rotating. 7.一种智能门锁控制系统,其特征在于,包括:7. An intelligent door lock control system, characterized by comprising: 获取模块,用于获取预设学习条件参数;其中,所述预设学习条件参数包括门锁的开关次数和初始调试状态;An acquisition module, used to acquire preset learning condition parameters; wherein the preset learning condition parameters include the number of times the door lock is opened and closed and the initial debugging state; 学习模块,用于确定所述预设学习参数满足预设学习条件,控制所述门锁进行动态学习,得到平稳编码值;其中,所述平稳编码值为所述门锁进行开关操作过程中,电机转动角度相应的编码值,所述预设学习条件包括预设开关次数或初始调试状态;A learning module, used to determine that the preset learning parameters meet the preset learning conditions, control the door lock to perform dynamic learning, and obtain a stable coding value; wherein the stable coding value is a coding value corresponding to the motor rotation angle during the switch operation of the door lock, and the preset learning conditions include a preset number of switches or an initial debugging state; 控制模块,用于根据所述平稳编码值控制电机驱动进行门锁开关操作;A control module, used for controlling the motor drive to perform door lock switch operation according to the stable coding value; 其中,所述控制所述门锁进行动态学习,得到平稳编码值,包括:The controlling the door lock to perform dynamic learning to obtain a stable coding value includes: 获取预设编码值;Get the preset encoding value; 根据所述预设编码值控制所述电机转动至相应的旋转角度;Control the motor to rotate to a corresponding rotation angle according to the preset coding value; 获取所述电机的当前电流数据;Acquiring current data of the motor; 根据所述当前电流数据调整所述电机的编码值,得到所述平稳编码值;Adjusting the encoding value of the motor according to the current current data to obtain the stable encoding value; 其中,所述根据所述当前电流数据调整所述电机的编码值,得到所述平稳编码值,包括:Wherein, adjusting the encoding value of the motor according to the current current data to obtain the stable encoding value includes: 判断所述当前电流数据与前一电流数据的电流数据关系;其中,所述前一电流数据为前一电流获取时刻获取得到的电机的电流数据;Determine the current data relationship between the current data and the previous current data; wherein the previous current data is the current data of the motor acquired at the previous current acquisition moment; 根据所述电流数据关系对所述预设编码值进行调整操作,得到当前编码值;其中,所述调整操作包括增加预设编码量或减少预设编码量;According to the current data relationship, the preset coding value is adjusted to obtain a current coding value; wherein the adjustment operation includes increasing the preset coding amount or decreasing the preset coding amount; 根据所述调整操作设置相应的标志位;其中,所述标志位包括增加标志和减少标志;Setting a corresponding flag bit according to the adjustment operation; wherein the flag bit includes an increase flag and a decrease flag; 根据所述标志位构建标志记录序列;Constructing a flag record sequence according to the flag bit; 确定所述标志记录序列满足预设记录条件,根据所述当前编码值得到所述平稳编码值。It is determined that the mark record sequence meets a preset record condition, and the stable code value is obtained according to the current code value. 8.一种智能门锁控制系统,其特征在于,包括:8. An intelligent door lock control system, characterized by comprising: 至少一个处理器;at least one processor; 至少一个存储器,用于存储至少一个程序;at least one memory for storing at least one program; 当所述至少一个程序被所述至少一个处理器执行,使得至少一个所述处理器实现如权利要求1至6任一项所述的智能门锁控制方法。When the at least one program is executed by the at least one processor, the at least one processor implements the smart door lock control method as described in any one of claims 1 to 6. 9.一种计算机存储介质,其中存储有处理器可执行的程序,其特征在于,所述处理器可执行的程序在由所述处理器执行时用于实现如权利要求1至6任一项所述的智能门锁控制方法。9. A computer storage medium storing a processor-executable program, wherein the processor-executable program is used to implement the smart door lock control method as described in any one of claims 1 to 6 when executed by the processor.
CN202211317793.0A 2022-10-26 2022-10-26 Intelligent door lock control method, system and storage medium Active CN115909552B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211317793.0A CN115909552B (en) 2022-10-26 2022-10-26 Intelligent door lock control method, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211317793.0A CN115909552B (en) 2022-10-26 2022-10-26 Intelligent door lock control method, system and storage medium

Publications (2)

Publication Number Publication Date
CN115909552A CN115909552A (en) 2023-04-04
CN115909552B true CN115909552B (en) 2024-10-18

Family

ID=86470118

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211317793.0A Active CN115909552B (en) 2022-10-26 2022-10-26 Intelligent door lock control method, system and storage medium

Country Status (1)

Country Link
CN (1) CN115909552B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120016909A (en) * 2025-04-15 2025-05-16 浙江德施曼科技智能股份有限公司 Motor control method, device, smart door lock and medium based on AI learning

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117558077B (en) * 2024-01-10 2025-05-27 深圳市每开创新科技有限公司 Parameter adjustment method of electronic lock, storage medium and terminal device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104218975A (en) * 2014-09-16 2014-12-17 深圳市镭润科技有限公司 Power line carrier communication method and information transmitting device
CN109098116A (en) * 2017-06-21 2018-12-28 杭州海康威视数字技术股份有限公司 Alignment method of adjustment, device and the controller of gate equipment, component of blocking

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW302588B (en) * 1996-03-05 1997-04-11 Microchip Tech Inc Method and apparatus for electronic encoding and decoding
CN106327640A (en) * 2016-08-26 2017-01-11 内蒙古晶新科技有限责任公司 Electronic lock and the control circuit thereof
CN108694765A (en) * 2018-05-11 2018-10-23 京东方科技集团股份有限公司 A kind of visitor's recognition methods and device, access control system
KR20200017247A (en) * 2018-08-08 2020-02-18 경남대학교 산학협력단 Smart door locks using Bluetooth
CN110599642B (en) * 2019-08-23 2022-03-22 珠海优特电力科技股份有限公司 Unlocking equipment, lock and lock control system
CN110599660A (en) * 2019-10-15 2019-12-20 珠海优特电力科技股份有限公司 Passive electric coding lock and storage method of current information
CN112614249B (en) * 2020-11-11 2023-01-10 邹阳 Intelligent lock abnormity alarm system based on deep learning
CN112746773B (en) * 2020-12-04 2021-10-22 珠海格力电器股份有限公司 Door lock and control method of door lock
CN113077570A (en) * 2021-03-23 2021-07-06 杭州海康威视数字技术股份有限公司 Method and device for adjusting a stop
CN114622500B (en) * 2022-01-27 2024-01-16 浙江大华技术股份有限公司 Gate wing steering learning method, system, gate, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104218975A (en) * 2014-09-16 2014-12-17 深圳市镭润科技有限公司 Power line carrier communication method and information transmitting device
CN109098116A (en) * 2017-06-21 2018-12-28 杭州海康威视数字技术股份有限公司 Alignment method of adjustment, device and the controller of gate equipment, component of blocking

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120016909A (en) * 2025-04-15 2025-05-16 浙江德施曼科技智能股份有限公司 Motor control method, device, smart door lock and medium based on AI learning

Also Published As

Publication number Publication date
CN115909552A (en) 2023-04-04

Similar Documents

Publication Publication Date Title
CN115909552B (en) Intelligent door lock control method, system and storage medium
US10224859B2 (en) Motor control device and motor control method
US6986064B2 (en) Method, recording medium and apparatus for power saving control via detection of usage pattern based on stored history and accounting of a spin down cost
EP3130696A1 (en) Washing machine and anti-pinching control method for electric door thereof
DE112012000498T5 (en) Cooling system of a power converter for vehicle-mounted rotating electrical machine
CN117549839A (en) Ceiling screen control method, system, electronic equipment and media
CN112593777B (en) Motor control method of intelligent door lock and intelligent door lock
CN115856478A (en) Operation state monitoring method, device, device and storage medium of electronic lock
CN108063471B (en) Mobile power supply rental equipment and device and method for locking the mobile power supply
CN115713822A (en) Electronic lock unlocking method and device, electronic lock and readable storage medium
US20220416695A1 (en) Method of adaptively controlling brushless dc motor
CN112821848B (en) Motor control method and device, intelligent lock and storage medium
KR102597741B1 (en) Sidestep control system for vehicle
CN108843138A (en) A kind of lockset shuts control method, device, storage medium and lockset
CN114687613B (en) Method for automatically adjusting the torque of a lock, lock and computer-readable storage medium
CN117918107A (en) Mower cutter mechanism, control method and device thereof and terminal equipment
CN114089643B (en) Control method and system of intelligent equipment and storage medium
CN117127883A (en) Car tailgate control method, system, controller and car
US20240313682A1 (en) Motor driving apparatus and control method therefor
CN115405170A (en) Control method and device for electric tail gate
US11065947B2 (en) Apparatus and method for tracking location of sunroof blind
KR102799948B1 (en) Method and system for creating deep learning model based on setting optimization strategy for intellignent object detection
CN115750769B (en) Method, device and vehicle-mounted terminal for updating hard stop position of vehicle gear
CN117759130A (en) Car door control method, system and vehicle
US20080253243A1 (en) Controlling an Optical Disc Drive

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Intelligent door lock control method, system and storage medium

Granted publication date: 20241018

Pledgee: Agricultural Bank of China Limited by Share Ltd. Nanhai Lishui branch

Pledgor: Foshan HuitaiLong Intelligent Technology Co., Ltd.|Guangdong Huitailong Technology Co., Ltd.

Registration number: Y2025980020146