CN-122027238-A - Offline authentication method, terminal device, server, device and storage medium
Abstract
The disclosure provides an offline authentication method, terminal equipment, a server, equipment and a storage medium, relates to the technical field of computers, and particularly relates to the fields of intelligent access control, attendance equipment, internet of things and the like. The method comprises the steps that under the condition of a networking state, a terminal device receives an incremental data packet and a first MD5 check value and a version number corresponding to the incremental data packet, under the condition that the networking state is switched to a non-network or weak network triggering offline state, the terminal device extracts the previously received incremental data packet from a local authority database, the terminal device calculates the MD5 check value corresponding to the incremental data packet to obtain a second MD5 check value, and under the condition that the first MD5 check value is consistent with the second MD5 check value, the terminal device performs local offline authentication based on the incremental data packet.
Inventors
- CHU JIAQI
- ZHANG CHAO
- WANG CHAO
Assignees
- 北京百度网讯科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260120
Claims (20)
- 1. An offline authentication method, comprising: Under the networking state, the terminal equipment receives an incremental data packet, and a first MD5 check value and a version number corresponding to the incremental data packet; Under the condition that the network state is switched to the off-line state triggered by no-network or weak-network, the terminal equipment extracts the increment data packet received before from a local authority database; The terminal equipment calculates an MD5 check value corresponding to the incremental data packet to obtain a second MD5 check value; and under the condition that the first MD5 check value is consistent with the second MD5 check value, the terminal equipment performs local offline authentication based on the incremental data packet.
- 2. The method of claim 1, further comprising: and under the condition that the first MD5 check value is consistent with the second MD5 check value, merging the update data in the incremental data packet into the local right database, and synchronously updating the local version number according to the version number to obtain a merged and updated local right database.
- 3. The method of claim 1, further comprising: and under the condition that the first MD5 check value is inconsistent with the second MD5 check value, discarding the incremental data packet, and attempting to switch from the offline state to the networking state by the terminal equipment so as to initiate a retransmission request of the incremental data packet until the number of times of the attempt or the attempt time reaches a threshold value.
- 4. The method of claim 1, further comprising: And under the condition that the first MD5 check value is inconsistent with the second MD5 check value, discarding the incremental data packet, and keeping the offline state by the terminal equipment, and waiting for initiating a retransmission request of the incremental data packet when networking next time.
- 5. The method of any of claims 1-4, wherein the delta data packet is generated from newly added employee data; the incremental data packet comprises an identifier of the new employee, authentication information of the new employee, access authority information of the new employee and access time strategy of the new employee.
- 6. The method according to any one of claims 1-4, wherein the first MD5 check value is used to check the integrity of newly added employee data.
- 7. The method of any one of claims 1-6, wherein the terminal device comprises at least one of an attendance device and a smart access terminal.
- 8. The method of claim 2, further comprising: And under the offline state, the terminal equipment uses the local authority database after merging and updating to carry out attendance authentication decision on staff.
- 9. The method of any of claims 1-6, further comprising: Under the condition of networking state, the terminal equipment receives the full data packet, and a third MD5 check value and a version number corresponding to the full data packet; under the condition that the network state is switched to the off-line state triggered by no-network or weak-network, the terminal equipment extracts the full data packet received before from a local authority database; The terminal equipment calculates an MD5 check value corresponding to the full data packet to obtain a fourth MD5 check value; and under the condition that the third MD5 check value is consistent with the fourth MD5 check value, the terminal equipment performs local off-line authentication based on the full data packet.
- 10. An offline authentication method, comprising: under the networking state, the server issues an incremental data packet and a first MD5 check value and version number corresponding to the incremental data packet, so that the terminal equipment decides whether to perform local offline authentication according to the incremental data packet.
- 11. The method of claim 10, further comprising: The method comprises the steps that a server maintains a right database of a cloud, wherein the right database comprises right data and version numbers corresponding to the right data; in the event of the rights data update, the server generates the delta data packet.
- 12. The method of claim 11, wherein the rights data includes authentication information of the employee, access rights information of the employee, and access time policies of the employee.
- 13. The method according to any of claims 10-12, wherein in case of the rights data update, a server generates the delta data packet comprising: and under the condition that the authority data is updated, the server generates the incremental data packet according to the authority data and the version number corresponding to the authority data.
- 14. The method of claim 13 wherein the delta package includes employee data that has been changed since a last version.
- 15. The method of any of claims 1-14, further comprising: and under the condition of networking state, the server transmits the full-quantity data packet and a third MD5 check value and version number corresponding to the full-quantity data packet so that the terminal equipment decides whether to perform local offline authentication or not according to the full-quantity data packet.
- 16. A terminal device, comprising: The receiving module is used for receiving the incremental data packet and the first MD5 check value and version number corresponding to the incremental data packet from the server under the condition of the networking state; The extraction module is used for extracting the previously received incremental data packet from a local authority database under the condition that the network state is switched to the off-line state triggered by the non-network or the weak network; the check value calculation module is used for calculating the MD5 check value corresponding to the incremental data packet to obtain a second MD5 check value; and the offline authentication decision module is used for carrying out local offline authentication based on the incremental data packet under the condition that the first MD5 check value is consistent with the second MD5 check value.
- 17. A server, comprising: And the sending module is used for sending an incremental data packet and a first MD5 check value and a version number corresponding to the incremental data packet to the terminal equipment under the condition of a networking state so as to enable the terminal equipment to decide whether to perform local offline authentication according to the incremental data packet.
- 18. An electronic device, comprising: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-15.
- 19. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-15.
- 20. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-15.
Description
Offline authentication method, terminal device, server, device and storage medium Technical Field The disclosure relates to the field of computer technology, and in particular relates to the fields of intelligent access control, attendance checking equipment, the Internet of things and the like. Background In the scenes of intelligent access control, attendance checking equipment, internet of things and the like, terminal equipment often needs to operate in an offline environment (such as a network fault or a remote area), and authority authentication in an offline state needs to be solved. Disclosure of Invention The disclosure provides an offline authentication method, a terminal device, a server, a device and a storage medium. According to an aspect of the present disclosure, there is provided an offline authentication method, including: Under the networking state, the terminal equipment receives an incremental data packet and a verification value and a version number of a fifth version (MD 5) of a first Message Digest Algorithm corresponding to the incremental data packet; under the condition that the network state is switched to the off-line state triggered by the non-network or the weak network, the terminal equipment extracts the increment data packet received before from the local authority database; the terminal equipment calculates an MD5 check value corresponding to the incremental data packet to obtain a second MD5 check value; And under the condition that the first MD5 check value is consistent with the second MD5 check value, the terminal equipment performs local offline authentication based on the incremental data packet. According to another aspect of the present disclosure, there is provided an offline authentication method, including: Under the networking state, the server issues the incremental data packet and a first MD5 check value and version number corresponding to the incremental data packet, so that the terminal equipment decides whether to perform local offline authentication according to the incremental data packet. According to another aspect of the present disclosure, there is provided a terminal device including: The receiving module is used for receiving the incremental data packet and the first MD5 check value and version number corresponding to the incremental data packet from the server under the condition of the networking state; The extraction module is used for extracting the previously received incremental data packet from the local authority database under the condition of switching from the networking state to the off-line state triggered by the off-line state or the weak network; the check value calculation module is used for calculating the MD5 check value corresponding to the incremental data packet to obtain a second MD5 check value; and the offline authentication decision module is used for carrying out local offline authentication based on the incremental data packet under the condition that the first MD5 check value is consistent with the second MD5 check value. According to another aspect of the present disclosure, there is provided a server including: And the sending module is used for sending the incremental data packet and the first MD5 check value and version number corresponding to the incremental data packet to the terminal equipment under the networking state condition so as to enable the terminal equipment to decide whether to perform local offline authentication or not according to the incremental data packet. According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods provided by any one of the embodiments of the present disclosure. According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform a method provided according to any one of the embodiments of the present disclosure. According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a method provided according to any of the embodiments of the present disclosure. It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification. Drawings The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein: FIG. 1 is a schematic diagram of a distributed cluster processing