Clock exception handling method based on access control equipment

By adding external storage modules and internal tick timers to the access control equipment, the clock abnormality caused by clock chip damage, battery power storage or crystal oscillator aging is solved, ensuring that the equipment can still operate normally under abnormal conditions and improve robustness.

CN119763233APending Publication Date: 2025-04-04SHENZHEN DAS INTELLITECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411808838.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The access control equipment is damaged due to the clock chip, the clock powered battery cannot be stored, or the clock crystal oscillator is aging and fails to work, resulting in abnormal clocks, affecting the accuracy of permission verification and logging, and posing hidden dangers to security management.

Method used

Add an external storage module and an internal tick timer to the access control device. By comparing the time A saved in the external storage module with the time point B in the last entry and exit record, taking a larger value as the timing time reference value, starting the tick timer operation, and generating an abnormal alarm event uploaded to the software platform.

Benefits of technology

Ensure that the access control equipment can still operate normally under abnormal clock conditions, continue to verify the validity period of permissions, save in and out records, and operate the holidays and time period groups, improve the robustness and user experience of the equipment, and promptly notify the administrator for repairs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119763233A_ABST
    Figure CN119763233A_ABST
Patent Text Reader

Abstract

The invention discloses a clock exception handling method based on access control equipment, which is characterized in that an external storage module is added in the existing access control equipment, and an internal ticking timer is added in a micro-control unit; the external storage module is used for storing time A after the access control equipment and the software platform synchronize a clock and personnel access records each time after the access control equipment is normally started; based on the structure of the access control equipment, the clock exception handling method comprises the following steps: when the access control equipment is started abnormally, calling time A stored in the external storage module and a time point B in the last access record by an exception handling program in the micro-control unit, comparing the time A with the time point B, and taking a larger time value as a timing time reference value, starting the ticking timer to operate, generating operation recording time, and generating and uploading an access control equipment starting abnormity alarm event to the software platform; according to the invention, the problem of normal starting operation under the abnormal starting condition of the access control equipment is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of electronic timers, and relates to a method for processing clock anomalies of a terminal device, and in particular to a method for processing clock anomalies based on access control equipment. Background Art

[0002] With the widespread application of intelligent building management systems, access control equipment, as an important part of security prevention, is particularly important for its reliability and accuracy. Access control systems usually include central management systems, front-end identification devices (such as card readers, fingerprint readers, etc.), control units, door locks and other components. Among them, the clock synchronization of access control equipment directly affects the accuracy of access rights verification and the security of the system. For example, when an employee holds a time-sensitive access control card, the access control device needs to accurately determine whether the card is within the validity period based on the current time. In addition, the accuracy of the clock is also indispensable in recording access logs and audit tracking.

[0003] However, in actual applications, the access control device may have clock anomalies due to various reasons, such as damage to the device clock chip, aging of the clock crystal, and network failure affecting the NTP (Network Time Protocol) time synchronization. Clock anomalies will not only lead to permission verification errors, but also affect the accuracy of log records, thus bringing hidden dangers to security management. For example, if the device clock lags behind the actual time, an expired access card may be allowed to continue to pass; conversely, if the clock is ahead, a valid access card may be mistakenly judged as invalid, affecting normal access.

[0004] At present, the access control systems on the market usually use the NTP protocol or a custom private protocol for clock synchronization. However, when the device clock runs abnormally, it directly leads to the inability to use normally, and human intervention is required.

[0005] Therefore, a more reliable clock anomaly handling method is urgently needed to ensure that the device can still operate normally when a clock anomaly suddenly occurs in the device, so as to improve the robustness and user experience of the access control device under abnormal conditions. Summary of the invention

[0006] The present invention aims to solve the problem of normal startup of access control equipment when the clock chip is damaged, the clock power supply battery cannot store electricity, or the clock crystal oscillator is aged and does not work, so as to ensure that the access control equipment can continue to verify the validity period of authority, effectively save the equipment entry and exit records, and effectively operate the equipment on holidays and time period groups.

[0007] The technical solution of the present invention is a method for handling clock exceptions based on an access control device. The access control device includes a microcontroller unit that can control and manage an access control system and has a storage chip, an external clock chip that can provide a time reference, an external crystal oscillator that provides a stable clock signal as a clock source, and an external power supply battery. The key lies in that an external storage module is added to the access control device, and an internal tick timer is added to the microcontroller unit; the external storage module is used to save the time A after the access control device is normally started and the clock is synchronized with the software platform, and each time a person enters and exits the record; based on the structure of the above access control device, the clock exception handling method is as follows: when the access control device is abnormally started, the exception handling program in the microcontroller unit calls the time A stored in the external storage module and the time point B in the last entry and exit record, compares the time A and the time point B, uses the larger time value as the timing time reference value, starts the tick timer to run and generates the running record time, generates and uploads the access control device startup abnormal alarm event to the software platform.

[0008] Further, the running record time generated by starting the tick timer is stored in the external storage module.

[0009] Specifically, the abnormal startup of the access control device is any one or more of the following situations: abnormal clock, battery failure, and external crystal oscillator aging.

[0010] More specifically, the above-mentioned clock abnormality determination criteria are: when the microcontroller unit and the external clock chip are in initialization or read-write communication, the external clock chip has no response, or the response data content does not conform to the protocol.

[0011] More specifically, the criterion for determining whether the battery is not storing electricity is as follows: each time the access control device is powered off and on, the clock is restored to the initial value of the chip register.

[0012] More specifically, the criterion for determining the aging of the external crystal oscillator is: a clock deviation greater than 60 seconds occurs repeatedly for more than 10 times.

[0013] Preferably, when the tick timer is started, it runs in seconds.

[0014] Preferably, time A is stored in the register of the external clock chip in hours, and is stored in the external storage module in the form of a timestamp in seconds plus a clock number; the above timestamp is in four-byte hexadecimal format; the above clock number is four bytes, and is accumulated by 1 each time it is stored.

[0015] Furthermore, the external storage module is an external flash memory device divided into 24 sectors and capable of being read and written up to 100,000 times; the above-mentioned time A and the start tick timer operation generate running record time which are saved in hours in the 24 sectors of the external flash memory device.

[0016] It should be noted that the above-mentioned entry and exit records include the door number, record type, and entry and exit time. The entry and exit time is converted into a timestamp in seconds, which is time point B.

[0017] The beneficial effects of the present invention are:

[0018] The present invention provides a method for handling clock anomalies based on access control equipment, which mainly solves the problems that when the clock chip is damaged, the clock power supply battery cannot store power, or the clock crystal oscillator is aged and does not work, the device can still be started and operated normally, and the validity period of authority can be verified, the entry and exit records of the device can be effectively saved, and the device holidays and time period groups can be effectively operated, thereby improving the robustness and user experience of the access control device under abnormal conditions.

[0019] In the present invention, when the access control device is started normally, after the access control device synchronizes the clock with the software platform, one copy of time A is saved in the clock chip register storage, which is operated by the clock chip and the crystal oscillator, and one copy is saved in the storage chip of the MCU. When normal personnel enter and exit, entry and exit records at different time points B are generated and stored in the external storage module, that is, the external FLASH. When the access control device is started, the initialization of the clock chip register fails. At this time, the device enters the clock abnormal mode, and the time A saved by the device and the time point B of the last entry and exit record are taken from the external FLASH respectively, and the time difference between A and B is compared. The larger value is taken as the timing time reference value C, and then the tick timer in the MCU is enabled, and the clock counting is performed based on the timing time reference value C.

[0020] After the present invention starts the abnormal handling program, the time of the access control device is within one hour of the accurate time. Because it can fully meet the access and exit requirements of the access control card authorized in units of one day, it ensures that the device performs device authority validity verification, entry and exit record preservation, and device holidays and time period group operation when the access control device is abnormally started. At the same time, the present invention can also generate abnormal alarm events and upload them to the background monitoring platform to notify the administrator to repair and replace them in time. If the device is synchronized with the background clock, the time B and the tick timer count are refreshed in real time. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a schematic diagram of relevant components in the access control device in the prior art.

[0022] Figure 2 It is a schematic diagram of relevant components in the access control device of the present invention. DETAILED DESCRIPTION

[0023] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] As attached Figure 1 As shown, in the prior art, when the clock is abnormal, the battery is not charged, or the external crystal oscillator is aged, the access control device cannot operate normally, affecting the entry and exit of the device, and the administrator cannot be reserved to handle the problem, resulting in a poor customer experience.

[0025] As attached Figure 2 As shown, in this embodiment, the access control device is improved, an internal tick timer program is added to the micro control unit (MCU for short) of the access control device, and an external storage module is added. In this embodiment, the external storage module is an external flash memory device (external FLASH for short), and an exception handling program is added to the software platform (i.e., the background monitoring platform) accordingly.

[0026] Process 1: Normal startup process

[0027] In this embodiment, when the access control device is started normally, the access control device actively synchronizes the clock with the software platform to obtain the synchronized time A, and the time information of time A includes year, month, day, hour, minute, second and week. Time A is directly transferred and written into the register of the external clock chip, and the external clock chip is self-operated with external crystal oscillator and battery power to ensure the normal counting of the clock. At the same time, time A is saved in the external FLASH in units of hours (according to the 24-hour system, divided into 24 sectors), that is, time A is synchronously saved in the external FLASH and the external clock chip.

[0028] For example, when the time synchronized between the access control device and the software platform is Monday, January 1, 2024, at 12:30, the above time is converted into a timestamp in seconds, that is, 1704083400, and then the clock number 0001 (accumulated by 1 each time) is added to convert it into hexadecimal form. Among them, the timestamp is converted into four bytes, the clock number is converted into four bytes, and a total of eight bytes are stored in the 12th sector of the external FLASH (starting from the 0x1000 address of the external FLASH, it is divided into 24 sectors. In order to ensure the life of the external FLASH read and write times of 100,000 times, the time is distributed in different sectors). If it is synchronized at 13 o'clock, it is stored in the 13th sector. During this period, if there is a normal device entering and exiting, the access control device will save the entry and exit records in the external FLASH. The saved records include (time, entry and exit door number, record type, etc.), and the time data corresponds to the record of time point B, and the time point B is converted into a timestamp in seconds.

[0029] Process 2: Abnormal startup process

[0030] When a clock anomaly occurs when the device is started, the access control device enters an abnormal clock operation state, and an access control device startup abnormality alarm event is immediately generated and uploaded to the software platform to remind the administrator to check, repair and replace the equipment.

[0031] The following uses a clock abnormality as an example to illustrate the abnormal startup process.

[0032] In the case of abnormal startup, the access control device immediately enables the initialization of the internal tick timer through the exception handling program in the micro control unit, takes out the time A saved in process 1 and compares it with the time point B in the last entry and exit record of the access control device, and takes the larger value as the timing time reference value C.

[0033] The tick count operation is performed in seconds with the timing time reference value C as the timing time reference value. Similarly, this operation record is saved in hours with a time stamp in 24 different sectors of the external FLASH.

[0034] If the access control device and the software platform synchronize the clock successfully during this period, the reference value and the timestamp saved in the external Flash will be refreshed in real time.

[0035] In the above clock anomalies, how does the device distinguish, that is, the criteria for determining the abnormal situation are:

[0036] 1. Read-write clock abnormality: When the MCU and the clock chip are in initialization or read-write communication, the clock chip has no response, or the response data content does not conform to the protocol. At this time, the device MCU determines that the read-write clock is abnormal.

[0037] 2. The battery does not store electricity: Under normal circumstances, after the time is written into the clock chip, based on the battery storage capacity, taking 15 days of capacity as an example, after writing the time, within 15 days, the clock chip can operate normally under battery power, keeping the clock running normally for 15 days. When the battery cannot store electricity, that is, each time the device is powered on and off, the clock returns to the initial value of the chip register. At this time, the device MCU determines that the battery does not store electricity.

[0038] 3. Aging of the external crystal oscillator. Normally, the device runs all day with a time error within 10 seconds. If the clock deviation is greater than 60 seconds for more than 10 times, the device MCU will determine that the external crystal oscillator is aging.

[0039] For the above three anomalies, the access control device reports different alarm events to the software platform, making it easier for administrators to know the causes and solutions.

Claims

1. A method for handling clock anomalies based on access control equipment, wherein the access control equipment includes a microcontroller unit with a storage chip that can control and manage the access control system, an external clock chip that can provide a time reference, an external crystal oscillator that provides a stable clock signal as a clock source, and an external power supply battery, characterized in that: An external storage module is added to the access control device, and an internal tick timer is added to the micro control unit; the external storage module is used to save the time A after the access control device and the software platform synchronize the clock after the access control device is normally started, and the record of each entry and exit of personnel; based on the structure of the above access control device, the clock exception handling method is: when the access control device is abnormally started, the exception handling program in the micro control unit calls the time A stored in the external storage module and the time point B in the last entry and exit record, compares the time A and the time point B, uses the larger time value as the timing time reference value, starts the tick timer to run and generate the running record time, generates and uploads the access control device startup abnormal alarm event to the software platform.

2. A method for handling clock anomalies based on access control equipment according to claim 1, characterized in that: The running record time generated by starting the tick timer is saved in the external storage module.

3. According to claim 1, a method for handling clock anomalies based on access control equipment is characterized in that: The abnormal startup of the access control device is specifically a combination of any one or more of the following situations: abnormal clock, battery failure, and external crystal oscillator aging.

4. A method for handling clock anomalies based on access control equipment according to claim 3, characterized in that: The judgment standard of the clock abnormality is: when the micro control unit and the external clock chip are in initialization or read-write communication, the external clock chip has no response, or the response data content does not conform to the protocol.

5. The method for handling clock anomalies based on access control equipment according to claim 3 is characterized in that: The criterion for determining whether the battery has no power is that each time the access control device is powered off and on, the clock is restored to the initial value of the chip register.

6. A method for handling clock anomalies based on access control equipment according to claim 3, characterized in that: The criterion for judging the aging of the external crystal oscillator is: the clock deviation is greater than 60 seconds repeatedly, and the number of occurrences exceeds 10 times.

7. A method for handling clock anomalies based on access control equipment according to claim 1, characterized in that: The number of seconds to run when the tick timer is started.

8. The method for handling clock anomalies based on access control equipment according to claim 1, characterized in that: Time A is stored in the register of the external clock chip in hours and in the external storage module in seconds as a timestamp plus a clock number; the timestamp is in four-byte hexadecimal format; the clock number is four bytes, and is accumulated by 1 each time it is stored.

9. The method for handling clock anomalies based on access control equipment according to claim 1, characterized in that: The external storage module is an external flash memory device divided into 24 sectors and capable of 100,000 read and write times; the time A and the start tick timer operation generate running record time which are saved in 24 sectors of the external flash memory device in units of hours.

10. The method for handling clock anomalies based on access control equipment according to claim 1, characterized in that: The entry and exit record includes the door number, record type, and entry and exit time. The entry and exit time is converted into a timestamp in seconds, which is time point B.