Door lock data updating method and device
By receiving the first and second door lock data of the smart door lock terminal device and using the time stamp comparison method, the delay or loss of smart door lock data when the network is unstable is solved, and the timely transmission and consistency of data are achieved.
Patent Information
- Application Number
- CN202411907929.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-03-28
AI Technical Summary
When the network signal is unstable or malfunctioning, the smart door lock terminal device cannot transmit the door lock data to the back-end platform in time, resulting in data delay or loss, affecting data consistency.
By receiving the first door lock data synchronized by the door lock terminal device at a preset time interval, the second door lock data is received in an abnormal state. Use time stamp comparison to determine the update order of data to ensure timely transmission and consistency of data.
It effectively reduces data delay or loss, ensures the consistency of door lock data recorded on the back-end platform, and improves the efficiency and reliability of data processing.
Smart Images

Figure CN119723716A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a door lock data updating method and device. Background Art
[0002] A smart door lock is an improvement on a traditional mechanical lock that is intelligently improved in terms of user security, identification, and manageability. It can use a non-mechanical key as the key of the smart door lock. For example, the non-mechanical keys it uses may include but are not limited to fingerprint locks, iris recognition, and contactless integrated circuit cards (Integrated Circuit Card).
[0003] The backend platform of a smart door lock refers to a management platform associated with the terminal device of the smart door lock, which can remotely detect, manage and control the status and functions of the door lock. At present, the data transmission methods between the smart door lock and the backend platform can include Wi-Fi transmission, Bluetooth transmission, and wireless communication transmission ZigBee.
[0004] However, when using the above-mentioned data transmission method for data transmission, a stable transmission path needs to be maintained. In the event of unstable network signals or network failures, the terminal device of the smart door lock will not be able to transmit the door lock data to the platform in a timely manner, resulting in data delays or loss in the door lock data recorded on the platform, resulting in a lack of consistency in the door lock data recorded on the platform. Summary of the invention
[0005] In view of this, an embodiment of the present application provides a door lock data updating method and device, which can reduce the occurrence of data delay or loss, thereby ensuring the consistency of the door lock data recorded on the back-end platform.
[0006] In a first aspect, an embodiment of the present application provides a door lock data update method, which is applied to a backend platform, and the method includes:
[0007] Receiving first door lock data synchronized by a door lock terminal device at a preset time interval, wherein the first door lock data in the door lock terminal device is stored in a local memory or a local area network device associated with the door lock terminal device;
[0008] Receiving second door lock data synchronized when the door lock terminal device is in an abnormal state; the second door lock data is used to indicate the door lock data when the door lock terminal device is in an abnormal state;
[0009] Obtaining a comparison result based on the time stamp of the first door lock data and the time stamp of the second door lock data and the latest time stamp of the door lock data recorded in the back-end platform;
[0010] The door lock data indicated by the comparison result is used as the updated door lock data.
[0011] In a second aspect, an embodiment of the present application provides a door lock data updating device, which is deployed on a back-end platform, and the device includes:
[0012] A first receiving module, used for receiving first door lock data synchronized by a door lock terminal device at a preset time interval, wherein the first door lock data in the door lock terminal device is stored in a local memory or a local area network device associated with the door lock terminal device;
[0013] A second receiving module is used to receive second door lock data synchronized when the door lock terminal device is in an abnormal state; the second door lock data is used to indicate the door lock data when the door lock terminal device is in an abnormal state;
[0014] A comparison module, configured to compare the time stamp of the first door lock data and the time stamp of the second door lock data with the latest time stamp of the door lock data recorded in the back-end platform to obtain a comparison result;
[0015] A determination module is used to use the door lock data indicated by the comparison result as updated door lock data.
[0016] In a third aspect, an embodiment of the present application provides a door lock data updating device, the device comprising:
[0017] Memory for storing computer programs;
[0018] The processor is used to execute the computer program so that the device executes the door lock data updating method described in the first aspect above.
[0019] In a fourth aspect, an embodiment of the present application provides a computer storage medium, wherein a computer program is stored on the computer-readable storage medium. When the computer program is executed, the device executing the computer program implements the door lock data updating method described in the first aspect above.
[0020] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0021] The embodiment of the present application provides a door lock data update method, which is applied to a back-end platform, and the method may include: receiving first door lock data synchronized by a door lock terminal device at a preset time interval, the first door lock data in the door lock terminal device is stored in a local memory or in a local area network device associated with the door lock terminal device, so that in the case of unstable network signal or network failure, the door lock terminal device can store the first door lock data generated in this case in a local memory, or in a local area network device associated with the door lock terminal device, and then, the first door lock data can be sent to the back-end platform at a preset time interval, so that the back-end platform can regularly receive the door lock data generated in the door lock terminal device. Then, the back-end platform can also receive the second door lock data synchronized when the door lock terminal device is in an abnormal state, that is, the door lock terminal device can automatically send the second door lock data to the back-end platform in an abnormal state. When the back-end platform receives the first door lock data and the second door lock data, it can compare the time stamp of the first door lock data and the time stamp of the second door lock data with the latest time stamp of the door lock data recorded in the back-end platform, so as to determine whether the received first door lock data and the second door lock data are repeated with the door lock data already recorded in the back-end platform according to the time stamp of the door lock data, and obtain a comparison result, which is used to indicate the door lock data recorded in the final back-end platform. Finally, the door lock data indicated by the comparison result can be used as the updated door lock data. It can be seen that the above method can ensure that the door lock terminal device transmits the door lock data stored in it to the back-end platform in a timely manner, thereby reducing the situation where there is data delay or loss in the door lock recorded in the back-end platform, and ensuring the consistency of the door lock data recorded on the back-end platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 A schematic diagram of an application scenario of a door lock data updating method provided in an embodiment of the present application;
[0024] Figure 2 A flow chart of a door lock data updating method provided in an embodiment of the present application;
[0025] Figure 3 A schematic diagram of the structure of a door lock data updating device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] Currently, the data transmission methods between the back-end platform and the door lock terminal device can include the following common transmission methods: Wi-Fi transmission, Bluetooth transmission, and ZigBee. Among them, Wi-Fi transmission means that the smart door lock can connect to the network through the built-in Wi-Fi module, and can send the collected user unlocking information, door lock status information and other door lock data to the back-end platform in real time. This transmission method has a faster transmission speed, but requires the door lock to have a stable Wi-Fi signal access capability, and this transmission method has high requirements for the network environment and is easily interfered by the surrounding Wi-Fi signals; Bluetooth transmission can be achieved through Bluetooth Low Energy (Bluetooth Low The door lock can be paired with the gateway of a specific APP on the user's mobile device (i.e. the APP corresponding to the door lock) through Bluetooth. When the door lock has data to upload, the data can be sent to the mobile device or gateway through the Bluetooth link, and then the mobile device or gateway uploads the data to the back-end platform through the mobile network. This transmission method has low power consumption and is suitable for battery-powered door lock terminal devices, but the transmission distance is limited, generally around 10 meters, and it is prone to unstable connections in complex environments; ZigBee is a low-power wireless communication technology. The door lock communicates with a nearby gateway through a ZigBee module, and the gateway transmits the data to the back-end platform through Ethernet or other network methods. This transmission method has self-organization and self-healing capabilities, and can better maintain communication stability in complex environments, but the equipment cost of this transmission method is high and the networking is complex.
[0028] That is, when the above data transmission method is used for data transmission, a stable transmission path needs to be maintained. In the case of unstable network signal or network failure, the terminal device of the smart door lock cannot transmit the door lock data to the platform in time, and the door lock data recorded in the platform is delayed or lost, resulting in the lack of consistency of the door lock data recorded on the platform. For example, in some areas with weak signal coverage, such as basements, elevator rooms, and remote corners, there may be weak or even no signal, which will cause the door lock to be unable to transmit the door lock data to the platform in time, and data delay or loss will occur. For example, in the underground parking lot of a large shopping mall, due to severe signal shielding, the data transmission of the door lock may be frequently interrupted; or, the line failure of the network operator, the network equipment failure (such as router failure, gateway failure, etc.) may affect the data transmission between the door lock and the back-end platform. For example, due to the aging of network equipment, hardware damage, etc., the network may be intermittently interrupted, so that the door lock data cannot be uploaded to the back-end platform, and the back-end platform cannot issue control instructions to the door lock in time.
[0029] Based on this, in order to solve the above problem, in an embodiment of the present application, the first door lock data synchronized by the door lock terminal device at a preset time interval is received, and the first door lock data in the door lock terminal device is stored in a local memory or in a local area network device associated with the door lock terminal device. Therefore, in the case of unstable network signal or network failure, the door lock terminal device can store the first door lock data generated in this case in a local memory, or in a local area network device associated with the door lock terminal device, and then, the first door lock data can be sent to the back-end platform at a preset time interval, so that the back-end platform can regularly receive the door lock data generated in the door lock terminal device. Then, the back-end platform can also receive the second door lock data synchronized when the door lock terminal device is in an abnormal state, that is, the door lock terminal device can automatically send the second door lock data to the back-end platform in an abnormal state. When the back-end platform receives the first door lock data and the second door lock data, it can compare the time stamp of the first door lock data and the time stamp of the second door lock data with the latest time stamp of the door lock data recorded in the back-end platform, so as to determine whether the received first door lock data and the second door lock data are repeated with the door lock data already recorded in the back-end platform according to the time stamp of the door lock data, and obtain a comparison result, which is used to indicate the door lock data recorded in the final back-end platform. Finally, the door lock data indicated by the comparison result can be used as the updated door lock data. It can be seen that the above method can ensure that the door lock terminal device transmits the door lock data stored in it to the back-end platform in a timely manner, thereby reducing the situation where there is data delay or loss in the door lock recorded in the back-end platform, and ensuring the consistency of the door lock data recorded on the back-end platform.
[0030] For example, one of the scenarios of the embodiments of the present application may be applied to Figure 1 The scenario shown. The scenario includes a door lock terminal device 101 and a server 102, wherein the door lock terminal device 101 is used to record door lock data, and the back-end platform can be deployed in the server 102. The server 102 adopts the implementation method provided by the embodiment of the present application, and is used to receive the first door lock data and the second door lock data synchronized by the door lock terminal device 101, and compare the time stamp of the first door lock data and the time stamp of the second door lock data with the latest time stamp of the door lock data recorded in the back-end platform to obtain a comparison result, and use the door lock data indicated by the comparison result as the updated door lock data.
[0031] First, in the above application scenario, although the action description of the implementation method provided in the embodiment of the present application is executed by the server 102; however, the embodiment of the present application is not limited in terms of the execution subject, as long as the actions disclosed in the implementation method provided in the embodiment of the present application are executed.
[0032] Secondly, the above scenario is only an example scenario provided by the embodiment of the present application, and the embodiment of the present application is not limited to this scenario.
[0033] The specific implementation of the door lock data updating method and device in the embodiment of the present application is described in detail below with reference to the accompanying drawings through embodiments.
[0034] See also Figure 2 , which is a flow chart of a door lock data updating method provided in an embodiment of the present application, combined with Figure 2 As shown, the method is applied to the backend platform and may specifically include:
[0035] S201: receiving first door lock data synchronized by a door lock terminal device at a preset time interval, wherein the first door lock data in the door lock terminal device is stored in a local memory or a local area network device associated with the door lock terminal device.
[0036] The first door lock data refers to the door lock data sent by the door lock terminal device to the backend platform at a preset time interval. The first door lock data is used to indicate the door lock data recorded by the door lock terminal device within the preset time interval. The door lock data may include but is not limited to unlocking records generated within the preset time interval, and battery power changes, etc. For example, the preset time interval may be 1 hour or 1 day, and this application does not specifically limit the preset time interval.
[0037] It should be noted that the network connection methods that the back-end platform can accept may include: Wi-Fi connection and Ethernet connection (wired network). Wi-Fi connection means that the door lock terminal device can have a built-in Wi-Fi module to establish a Wi-Fi network connection with the server of the back-end platform, so as to ensure that the door lock terminal device can send door lock data such as unlocking records and door lock status (such as battery power, fault information, etc.) to the server of the back-end platform in real time through the Wi-Fi network during operation. Ethernet connection means that for some fixed-installed door locks, they can be directly connected to the network switch through the Ethernet interface and communicate with the back-end platform server through Ethernet. When connected via Ethernet, the communication protocols adopted may include Transmission Control Protocol / Internet Protocol (TCP / IP) and Message Queuing Telemetry Transport (MQTT). The corresponding data interface may be an application programming interface based on representational state transfer (RESTful API). The back-end platform may provide a series of RESTful APIs. The door lock terminal device may interact with the back-end platform as an external system through a Hypertext Transfer Protocol (HTTP) request. For example, when the door lock terminal device needs to upload an unlocking record, a POST request may be used to send data in a data exchange format (JavaScript Object Notation, JSON) containing unlocking time, user information and other data to the specified API interface of the back-end platform. After receiving the request, the back-end platform stores the data and further processes it.
[0038] In addition, the present application does not specifically limit the connection method between the door lock terminal device and the back-end platform. For example, the door lock terminal device can be connected to the back-end platform via Wi-Fi transmission, Bluetooth transmission, ZigBee transmission and other transmission methods.
[0039] When the preset time interval is not reached or when the network signal is unstable or the network fails, the door lock terminal device can store the first door lock data generated during this period in the local storage or in the local area network device associated with the door lock terminal device, so that the door lock terminal device can send the first door lock data to the back-end platform at the preset time interval, ensuring that the back-end platform can obtain the basic status information and accumulated data of the door lock in a timely manner. For example, the preset time interval is 2 a.m. every day. When this time is reached, the door lock terminal device can automatically initiate a first door lock data synchronization request, and the back-end platform can receive the first door lock data sent by the door lock terminal device in response to the first door lock data synchronization request.
[0040] S202: Receive second door lock data synchronized when the door lock terminal device is in an abnormal state; the second door lock data is used to indicate door lock data when the door lock terminal device is in an abnormal state.
[0041] The second door lock data refers to the door lock data recorded when the door lock terminal device is in an abnormal state, and the door lock data may include but is not limited to unlocking records generated within a preset time interval, and battery power changes, etc. Among them, the door lock terminal device being in an abnormal state means that a specific event occurs in the door lock terminal device, and the specific event may include but is not limited to abnormal unlocking (such as frequent unlocking multiple times in one second, etc.), and low battery alarm, etc. That is, when a specific event occurs in the door lock terminal device, the second door lock data synchronization request is immediately triggered, so that the door lock data related to the specific event is transmitted to the back-end platform in real time, that is, the back-end platform can receive the second door lock data in response to the second door lock data synchronization request to ensure that the back-end platform can receive the door lock data related to the specific event in a timely manner. Further, after receiving the second door lock data, the back-end platform can immediately process and display the second door lock data.
[0042] S203: Compare the time stamp of the first door lock data and the time stamp of the second door lock data with the latest time stamp of the door lock data recorded in the backend platform to obtain a comparison result.
[0043] The time stamp of the first door lock data is used to indicate the time and sequence of generating the first door lock data, for example, the time stamp of the first door lock data may include a timestamp and a sequence number. The time stamp of the second door lock data is used to indicate the time and sequence of generating the second door lock data, for example, the time stamp of the second door lock data may include a timestamp and a sequence number.
[0044] Among them, the timestamp refers to the timestamp that the door lock terminal device adds to the door lock data when the door lock terminal device needs to upload the door lock data, which is used to mark the time when the door lock data is generated. The serial number refers to the number generated when the door lock data is generated, which is used to mark the order in which the door lock data is generated. For example, taking one day as a cycle, within a cycle, each time the door lock terminal device generates a door lock data, it will generate a serial number corresponding to the door lock data. For example, the serial number can start from 0 and is a 16-bit binary number. Each subsequent door lock data generated is incremented by 1. Within a cycle, the serial number corresponding to the door lock data generated by the door lock terminal device can be between 0-65535. When the door lock data generated by the door lock terminal device exceeds 65535, the serial number corresponding to the newly generated door lock data starts from 0.
[0045] When the first door lock data or the second door lock data between the door lock terminal devices is synchronized to the backend platform, the backend platform will record the latest time mark, such as the timestamp of the latest door lock data. When the door lock terminal device uploads the door lock data again, the backend platform will detect the sequence between the timestamps of the door lock data uploaded to the backend platform and the timestamps corresponding to the latest door lock data currently recorded, so as to obtain the comparison result of the door lock data, which is used to indicate the door lock data that can be stored in the backend platform, that is, the time mark of the door lock data indicated by the comparison result is later than the time mark of the door lock data already stored in the backend platform.
[0046] For example, the door lock terminal device opens the door 5 times in one second, and each door opening will generate corresponding door lock data. When data synchronization is performed separately, each door lock data has a corresponding timestamp. During the data synchronization process, each door lock data will be synchronized in turn. For example, the door lock data corresponding to the door opening event and its corresponding timestamp will be synchronized once per second.
[0047] Taking the synchronized door lock data as the first door lock data and the second door lock data as an example, if the time stamp of the first door lock data is greater than the latest time stamp of the door lock data recorded in the back-end platform, it means that the first door lock data is more recent data and can be used as updated data. The first door lock data can be added to the door lock data recorded in the back-end platform, and the time stamp of the first door lock data can be used as the latest time stamp of the door lock data recorded in the back-end platform. At the same time, the door lock data currently recorded in the back-end platform can be used as the comparison result, that is, the door lock data recorded in the back-end platform and the door lock data including the first door lock data can be used as the comparison result.
[0048] Taking timestamp as an example, if the timestamp of the first door lock data is later than the latest timestamp of the door lock data recorded in the back-end platform, the first door lock data can be added to the door lock data recorded in the back-end platform, and the timestamp of the first door lock data can be used as the latest timestamp of the door lock data recorded in the back-end platform. At the same time, the door lock data currently recorded in the back-end platform can be used as the comparison result.
[0049] Taking the serial number as an example, if the serial number of the first door lock data is greater than the latest serial number of the door lock data recorded in the back-end platform, the first door lock data can be added to the door lock data recorded in the back-end platform, and the serial number of the first door lock data can be used as the latest serial number of the door lock data recorded in the back-end platform. At the same time, the door lock data currently recorded in the back-end platform can be used as the comparison result.
[0050] If the time stamp of the second door lock data is greater than the latest time stamp of the door lock data recorded in the back-end platform, it means that the second door lock data is more recent data and can be used as updated data. The second door lock data can be added to the door lock data recorded in the back-end platform, and the time stamp of the second door lock data can be used as the latest time stamp of the door lock data recorded in the back-end platform. At the same time, the door lock data currently recorded in the back-end platform can be used as the comparison result, that is, the door lock data including the door lock data recorded in the back-end platform and the second door lock data can be used as the comparison result.
[0051] Taking timestamp as an example, if the timestamp of the second door lock data is later than the latest timestamp of the door lock data recorded in the back-end platform, the second door lock data can be added to the door lock data recorded in the back-end platform, and the timestamp of the second door lock data can be used as the latest timestamp of the door lock data recorded in the back-end platform. At the same time, the door lock data currently recorded in the back-end platform can be used as the comparison result.
[0052] Taking the serial number as an example, if the serial number of the second door lock data is greater than the latest serial number of the door lock data recorded in the back-end platform, the second door lock data can be added to the door lock data recorded in the back-end platform, and the serial number of the second door lock data can be used as the latest serial number of the door lock data recorded in the back-end platform. At the same time, the door lock data currently recorded in the back-end platform can be used as the comparison result.
[0053] If the time stamp of the first door lock data is not greater than (i.e. less than or equal to) the latest time stamp of the door lock data recorded in the back-end platform, the first door lock data can be regarded as redundant historical data, and the first door lock data can be automatically shielded to prevent the first door lock data from interfering with or overwriting the door lock data currently stored in the back-end platform. In addition, the door lock data currently recorded in the back-end platform can be used as the comparison result, that is, the door lock data already stored in the back-end platform and not containing the first door lock data can be used as the comparison result.
[0054] Taking timestamp as an example, if the timestamp of the first door lock data is not greater than the latest timestamp of the door lock data recorded in the back-end platform, the first door lock data can be regarded as redundant historical data and automatically shielded, and the door lock data currently recorded in the back-end platform can be used as the comparison result.
[0055] Taking the serial number as an example, if the serial number of the first door lock data is not greater than the latest serial number of the door lock data recorded in the back-end platform, the first door lock data can be regarded as redundant historical data and automatically shielded, and the door lock data currently recorded in the back-end platform can be used as the comparison result.
[0056] If the time stamp of the second door lock data is not greater than (i.e. less than or equal to) the latest time stamp of the door lock data recorded in the back-end platform, the second door lock data can be regarded as redundant historical data, and the second door lock data can be automatically shielded to prevent the second door lock data from interfering with or overwriting the door lock data currently stored in the back-end platform. In addition, the door lock data currently recorded in the back-end platform can be used as the comparison result, that is, the door lock data already stored in the back-end platform and not containing the second door lock data can be used as the comparison result.
[0057] Taking timestamp as an example, if the timestamp of the second door lock data is not greater than the latest timestamp of the door lock data recorded in the back-end platform, the second door lock data can be regarded as redundant historical data and automatically shielded, and the door lock data currently recorded in the back-end platform can be used as the comparison result.
[0058] Taking the serial number as an example, if the serial number of the second door lock data is not greater than the latest serial number of the door lock data recorded in the back-end platform, the second door lock data can be regarded as redundant historical data and automatically shielded, and the door lock data currently recorded in the back-end platform can be used as the comparison result.
[0059] In addition, if the back-end platform receives the first door lock data and / or the second door lock data with two identical serial numbers, it can perform verification based on the timestamps of the two door lock data with the same serial numbers to obtain a verification result, which is used to indicate the door lock data that can be stored in the back-end platform.
[0060] If the back-end platform receives the first door lock data and / or the second door lock data with the same serial number, if the time interval between the timestamps of the door lock data with the same serial number is greater than the preset period, the door lock data with the same serial number will be added to the back-end platform, and the door lock data currently recorded in the back-end platform will be used as the verification result. That is, when the back-end platform receives two door lock data with the same serial number, it can be compared based on the timestamps of the two door lock data. If the time interval between the timestamps of the two door lock data is greater than the preset period, taking the period of 1 day as an example, the time interval between the timestamps of the two door lock data is greater than 1 day, the two door lock data with the same serial number will be added to the back-end platform, and the door lock data currently recorded in the back-end platform can be used as the verification result, that is, the door lock data currently recorded in the back-end platform and the two door lock data with the same serial number can be used as the verification result.
[0061] If the back-end platform receives the first door lock data and / or the second door lock data with the same serial number, if the time interval between the timestamps of the door lock data with the same serial number is not greater than (i.e., less than or equal to) the preset period, the door lock data with the latest timestamp in the door lock data with the same serial number is added to the back-end platform, and the door lock data currently recorded in the back-end platform is used as the verification result. Taking a period of 1 day as an example, if the time interval between the timestamps of the two door lock data is not greater than 1 day, the door lock data with the latest timestamp in the two door lock data with the same serial number is added to the back-end platform, and the door lock data currently recorded in the back-end platform can be used as the verification result, that is, the door lock data currently recorded in the back-end platform and the door lock data with the latest timestamp in the two door lock data with the same serial number can be used as the verification result.
[0062] After the verification result is determined, the door lock data indicated by the verification result may be used as updated door lock data.
[0063] S204: Using the door lock data indicated by the comparison result as updated door lock data.
[0064] Finally, after the comparison result is determined, the door lock data indicated by the comparison result can be used as the updated door lock data, that is, the door lock data indicated by the comparison result can be used as the door lock data for storage in the back-end platform. Therefore, through the above method, the real-time, accuracy and consistency of the smart door lock data on the back-end platform can be ensured, thereby effectively improving the efficiency and reliability of processing door lock data, and further providing strong support for the optimization and upgrade of the smart door lock system.
[0065] In the embodiment of the present application, the method is applied to the back-end platform, and the method can receive the first door lock data synchronized by the door lock terminal device at a preset time interval. The first door lock data in the door lock terminal device is stored in a local memory or in a local area network device associated with the door lock terminal device. Therefore, in the case of unstable network signal or network failure, the door lock terminal device can store the first door lock data generated in this case in a local memory, or in a local area network device associated with the door lock terminal device. Then, the first door lock data can be sent to the back-end platform at a preset time interval, so that the back-end platform can regularly receive the door lock data generated in the door lock terminal device. Then, the back-end platform can also receive the second door lock data synchronized when the door lock terminal device is in an abnormal state, that is, the door lock terminal device can automatically send the second door lock data to the back-end platform in an abnormal state. When the back-end platform receives the first door lock data and the second door lock data, it can compare the time stamp of the first door lock data and the time stamp of the second door lock data with the latest time stamp of the door lock data recorded in the back-end platform, so as to determine whether the received first door lock data and the second door lock data are repeated with the door lock data already recorded in the back-end platform according to the time stamp of the door lock data, and obtain a comparison result, which is used to indicate the door lock data recorded in the final back-end platform. Finally, the door lock data indicated by the comparison result can be used as the updated door lock data. It can be seen that the above method can ensure that the door lock terminal device transmits the door lock data stored in it to the back-end platform in a timely manner, thereby reducing the situation where there is data delay or loss in the door lock recorded in the back-end platform, and ensuring the consistency of the door lock data recorded on the back-end platform.
[0066] The above are some specific implementations of the door lock data update method provided in the embodiment of the present application. Based on this, the present application also provides a corresponding device. The device provided in the embodiment of the present application will be introduced from the perspective of functional modularization.
[0067] See also Figure 3 , which is a schematic diagram of the structure of a door lock data updating device 300 provided in an embodiment of the present application. The device 300 is deployed on a back-end platform, and the device may include:
[0068] A first receiving module 301 is used to receive first door lock data synchronized by a door lock terminal device at a preset time interval, wherein the first door lock data in the door lock terminal device is stored in a local memory or a local area network device associated with the door lock terminal device;
[0069] The second receiving module 302 is used to receive second door lock data synchronized when the door lock terminal device is in an abnormal state; the second door lock data is used to indicate that the door lock terminal device is in an abnormal state;
[0070] A comparison module 303, configured to compare the time stamp of the first door lock data and the time stamp of the second door lock data with the latest time stamp of the door lock data recorded in the backend platform to obtain a comparison result;
[0071] The determination module 304 is configured to use the door lock data indicated by the comparison result as updated door lock data.
[0072] Optionally, the comparison module 303 includes:
[0073] A first adding unit, configured to add the first door lock data to the backend platform if the time stamp of the first door lock data is greater than the latest time stamp of the door lock data recorded in the backend platform, and use the door lock data currently recorded in the backend platform as a comparison result;
[0074] The second adding unit is used to add the second door lock data to the back-end platform if the time stamp of the second door lock data is greater than the latest time stamp of the door lock data recorded in the back-end platform, and use the door lock data currently recorded in the back-end platform as the comparison result.
[0075] Optionally, the device further comprises:
[0076] A first updating unit, configured to use the time stamp of the first door lock data as the latest time stamp of the door lock data recorded in the back-end platform when adding the first door lock data to the back-end platform;
[0077] The second updating unit is used to use the time stamp of the second door lock data as the latest time stamp of the door lock data recorded in the back-end platform when the second door lock data is added to the back-end platform.
[0078] Optionally, the comparison module 303 includes:
[0079] a first shielding unit, configured to shield the first door lock data if the time stamp of the first door lock data is not greater than the latest time stamp of the door lock data recorded by the back-end platform, and use the door lock data currently recorded in the back-end platform as a comparison result;
[0080] The second shielding unit is used to shield the second door lock data if the time stamp of the second door lock data is not greater than the latest time stamp of the door lock data recorded by the back-end platform, and use the door lock data currently recorded in the back-end platform as the comparison result.
[0081] Optionally, the time stamp of the first door lock data includes a timestamp and a serial number, and the time stamp of the second door lock data includes a timestamp and a serial number.
[0082] Optionally, the device further comprises:
[0083] A verification unit, configured to, upon receiving the first door lock data and / or the second door lock data of the same serial number, perform verification based on the timestamp of the door lock data of the same serial number to obtain a verification result;
[0084] A determination unit is used to use the door lock data indicated by the verification result as updated door lock data.
[0085] Optionally, the verification unit includes:
[0086] A third adding unit is configured to, when receiving the first door lock data and / or the second door lock data of the same serial number, add the door lock data of the same serial number to the back-end platform if the time interval between the timestamps of the door lock data of the same serial number is greater than a preset period, and use the door lock data currently recorded in the back-end platform as a verification result;
[0087] The fourth adding unit is used for receiving the first door lock data and / or the second door lock data with the same serial number. If the time interval between the timestamps of the door lock data with the same serial number is not greater than a preset period, the door lock data including the latest timestamp in the door lock data with the same serial number is added to the back-end platform, and the door lock data currently recorded in the back-end platform is used as the verification result.
[0088] The embodiments of the present application also provide corresponding devices and computer storage media for implementing the solutions provided by the embodiments of the present application.
[0089] The device includes a memory and a processor, the memory is used to store a computer program, and the processor is used to execute the computer program, so that the device executes the door lock data updating method described in any embodiment of the present application.
[0090] The computer storage medium stores a computer program. When the code is executed, the device running the computer program implements the door lock data updating method described in any embodiment of the present application.
[0091] The "first" and "second" in the names such as "first" and "second" (if any) mentioned in the embodiments of the present application are only used as name identifiers and do not represent the first or second in order.
[0092] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0093] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely schematic, in which the unit described as a separate component may or may not be physically separated, and the component prompted as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0094] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A door lock data updating method, characterized in that: Applied to the backend platform, the method includes: Receiving first door lock data synchronized by a door lock terminal device at a preset time interval, wherein the first door lock data in the door lock terminal device is stored in a local memory or a local area network device associated with the door lock terminal device; Receiving second door lock data synchronized when the door lock terminal device is in an abnormal state; the second door lock data is used to indicate the door lock data when the door lock terminal device is in an abnormal state; Obtaining a comparison result based on the time stamp of the first door lock data and the time stamp of the second door lock data and the latest time stamp of the door lock data recorded in the back-end platform; The door lock data indicated by the comparison result is used as the updated door lock data.
2. The method according to claim 1, characterized in that The time stamp based on the first door lock data and the time stamp of the second door lock data are compared with the latest time stamp of the door lock data recorded in the back-end platform to obtain a comparison result, including: If the time stamp of the first door lock data is greater than the latest time stamp of the door lock data recorded in the back-end platform, the first door lock data is added to the back-end platform, and the door lock data currently recorded in the back-end platform is used as the comparison result; If the time stamp of the second door lock data is greater than the latest time stamp of the door lock data recorded in the back-end platform, the second door lock data is added to the back-end platform, and the door lock data currently recorded in the back-end platform is used as the comparison result.
3. The method according to claim 2, characterized in that The method further comprises: When the first door lock data is added to the backend platform, the time stamp of the first door lock data is used as the latest time stamp of the door lock data recorded in the backend platform; When the second door lock data is added to the backend platform, the time stamp of the second door lock data is used as the latest time stamp of the door lock data recorded in the backend platform.
4. The method according to claim 1, characterized in that: The time stamp based on the first door lock data and the time stamp of the second door lock data are compared with the latest time stamp of the door lock data recorded in the back-end platform to obtain a comparison result, including: If the time stamp of the first door lock data is not greater than the latest time stamp of the door lock data recorded by the back-end platform, the first door lock data is shielded, and the door lock data currently recorded in the back-end platform is used as the comparison result; If the time stamp of the second door lock data is not greater than the latest time stamp of the door lock data recorded by the back-end platform, the second door lock data is shielded, and the door lock data currently recorded in the back-end platform is used as the comparison result.
5. The method according to any one of claims 1 to 4, characterized in that: The time mark of the first door lock data includes a timestamp and a serial number, and the time mark of the second door lock data includes a timestamp and a serial number.
6. The method according to claim 5, characterized in that The method further comprises: When receiving the first door lock data and / or the second door lock data with the same serial number, verifying based on the timestamp of the door lock data with the same serial number to obtain a verification result; The door lock data indicated by the verification result is used as the updated door lock data.
7. The method according to claim 6, characterized in that When the first door lock data and / or the second door lock data with the same serial number are received, verification is performed based on the timestamp of the door lock data with the same serial number to obtain a verification result, including: When receiving the first door lock data and / or the second door lock data of the same serial number, if the time interval between the timestamps of the door lock data of the same serial number is greater than a preset period, the door lock data of the same serial number is added to the back-end platform, and the door lock data currently recorded in the back-end platform is used as the verification result; When the first door lock data and / or the second door lock data with the same serial number are received, if the time interval between the timestamps of the door lock data with the same serial number is not greater than a preset period, the door lock data including the latest timestamp in the door lock data with the same serial number is added to the back-end platform, and the door lock data currently recorded in the back-end platform is used as the verification result.
8. A door lock data updating device, characterized in that: Deployed on the backend platform, the device includes: A first receiving module, used for receiving first door lock data synchronized by a door lock terminal device at a preset time interval, wherein the first door lock data in the door lock terminal device is stored in a local memory or a local area network device associated with the door lock terminal device; A second receiving module is used to receive second door lock data synchronized when the door lock terminal device is in an abnormal state; the second door lock data is used to indicate the door lock data when the door lock terminal device is in an abnormal state; A comparison module, configured to compare the time stamp of the first door lock data and the time stamp of the second door lock data with the latest time stamp of the door lock data recorded in the back-end platform to obtain a comparison result; A determination module is used to use the door lock data indicated by the comparison result as updated door lock data.
9. A door lock data updating device, characterized in that: The device comprises: Memory for storing computer programs; A processor, configured to execute the computer program so that the device executes the door lock data updating method as claimed in any one of claims 1 to 7.
10. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the computer program is executed by a processor, the door lock data updating method according to any one of claims 1 to 7 is implemented.