Access card verification system and method

By setting the storage location of the device serial number and rolling code value in the access control card, the rolling code verification of the access control card on multiple devices is realized, which solves the security problem caused by the inability to communicate in real time in the existing technology and improves the flexibility of the system. and security.

CN118506481BActive Publication Date: 2024-10-01HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410943790.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-10-01
Estimated Expiration
2044-07-15

AI Technical Summary

Technical Problem

When the existing access control card verification system cannot communicate in real time between various access control devices, it is impossible to implement rolling code verification of one access control card on multiple access control devices, resulting in limited security.

Method used

By setting the unique device serial number of each access control device and the storage location of the rolling code value in the access control card, the card swipe event is used to obtain and compare the rolling code value. If they are consistent, the rolling code value is updated to avoid synchronization to other devices and realize individual access control. Rolling code verification of the device.

Benefits of technology

Even when there is no real-time communication between access control devices, rolling code verification of access control cards on multiple devices can still be achieved, improving security security and the flexibility of the solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118506481B_ABST
    Figure CN118506481B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a system and method for access card verification. For any access control device in various access control devices at different locations, the access control device is used to obtain the pre-set device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value in the target access control card, and the rolling code length, and use the above information to obtain the rolling code value stored for the access control device in the target access control card. If the rolling code value stored for the access control device in the target access control card is consistent with the rolling code value stored for the target access control card in the access control device, then the target access control card is determined to be a non-copy access control card, and the corresponding rolling code values ​​in the target access control card and the access control device are updated. Since each access control device is correspondingly set with its own rolling code value. Therefore, when the rolling code value of the access control device is updated, it is not necessary to synchronize the rolling code value to other access control devices. In this way, even if real-time communication is not possible, rolling code verification of one access control card on multiple access control devices can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of access control and security technology, and in particular to an access control card verification system and method. Background Art

[0002] At present, the access control card is prevented from being copied by means of rolling code verification. In the related art, for multiple access control devices corresponding to the same access control card, the rolling code values ​​of the multiple access control devices are usually set to the same rolling code value. After the rolling code verification is passed, the rolling code values ​​of the multiple access control devices need to be updated. For example, when the access control card is swiped at the access control device 1, the access control device 1 will update the rolling code value stored in itself, and it is also necessary to notify the access control device 2, the access control device 3, and the access control device 4 to also synchronously update the rolling code value stored in themselves. This requires that each access control device be connected to the network, so that when the rolling code value of one of the access control devices changes, the changed rolling code value can be synchronized to other access control devices. However, using this method to implement rolling code verification of an access control card on multiple access control devices requires real-time communication between the access control devices. Access control cards are usually used in outdoor scenarios such as large parks. In such scenarios, the various access control devices may not be able to communicate in real time. In this case, the above method cannot be used to implement rolling code verification of one access control card on multiple access control devices. Therefore, there is an urgent need for a method that can still implement rolling code verification of one access control card on multiple access control devices when the various access control devices cannot communicate in real time. Summary of the invention

[0003] The purpose of the embodiment of the present application is to provide an access card verification system and method, so as to realize rolling code verification of one access card in multiple access control devices when the access control devices cannot communicate in real time. The specific technical solution is as follows:

[0004] In a first aspect, an embodiment of the present application provides an access card verification method, which is applied to an access control device, and the method includes:

[0005] In response to the user's input operation, the first device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value of the target access control card and the rolling code length are set in the access control device, the rolling code values ​​of multiple access control devices are stored in the target access control card, each of the access control devices is located at a different position, the total serial number of the starting physical block storing the rolling code value of each access control device in the target access control card is the same, the rolling code length of the rolling code value stored in the target access control card by each access control device is the same, the rolling code value stored in the target access control card by each access control device is stored in sequence according to the size of the first device serial number of each access control device, the target access control card includes multiple sectors, each sector includes i physical blocks, and each physical block includes j bytes;

[0006] In response to a card swiping event triggered by a target access control card, obtaining a first device serial number of the access control device, a total serial number of a starting physical block storing a rolling code value of the target access control card, and a rolling code length;

[0007] Calculate a first storage position of a first device sequence number of rolling code values ​​among a plurality of rolling code values ​​having a length of the rolling code length and stored sequentially starting from the physical block having the total sequence number of the starting physical block;

[0008] Read data having a length of the rolling code length from the first storage position as a first rolling code value;

[0009] If the first rolling code value is consistent with the second rolling code value stored in the access control device for the target access control card, the target access control card is determined to be a non-copy access control card, and the first rolling code value stored in the target access control card is updated to a third rolling code value, and the second rolling code value stored in the access control device is updated to the third rolling code value.

[0010] In a possible embodiment, the method further includes:

[0011] If the first rolling code value is not read from the access control device, determining that the target access control card is a non-duplicate access control card, generating a fourth rolling code value and storing it in the first storage location and the access control device;

[0012] If the first rolling code value is read from the access control device, a step of determining whether the first rolling code value is consistent with a second rolling code value stored in the access control device for the target access control card is performed.

[0013] In a possible embodiment, the calculating of the first storage position of the rolling code value of the first device sequence number among the multiple rolling code values ​​stored in sequence starting from the physical block with the total sequence number of the starting physical block and having a length equal to the rolling code length includes:

[0014] Obtain a sum of the first quantity and the physical block sequence number of the starting physical block in the sector where it is located, divide the sum by i-1, and add the value obtained by the division operation to the sector number of the sector where the starting physical block is located to obtain a first storage sector number; wherein the first quantity is obtained by obtaining the product of the difference between the first device sequence number of the access control device minus one and the rolling code length, and dividing the product by j; the physical block sequence number of the starting physical block in the sector where it is located is obtained by performing a modulo operation on the total sequence number of the starting physical block and i; the sector number of the sector where the starting physical block is located is obtained by performing a division operation on the total sequence number of the starting physical block and i;

[0015] Obtaining a sum of the first number and the physical block sequence number of the starting physical block in the sector where the first number is located, performing a modulo operation on the sum and i-1 to obtain a first storage physical block sequence number;

[0016] The product of the difference between the first device serial number of the access control device and one and the rolling code length is obtained, and a modulo operation is performed on the product and j to obtain a first storage starting byte number.

[0017] In a possible embodiment, the method further includes:

[0018] In response to the change instruction, changing the first device serial number of the access control device to the second device serial number indicated by the change instruction;

[0019] Among them, the change instruction is sent to the access control device when the rolling code value stored in the first storage position in the target access control card is moved to the second storage position, and the second storage position is the position of the second device serial number rolling code value among the multiple rolling code values ​​with a length of the rolling code length, which are stored sequentially starting from the physical block with the total serial number of the starting physical block.

[0020] In a possible embodiment, the method further includes:

[0021] Acquire access card authority information in a database in the access control device, the access card authority information being used to indicate an access card that can pass identity authentication, and the access card authority information being stored in the database in the form of an encrypted string;

[0022] Decrypting the access card permission information to obtain the decrypted access card permission information;

[0023] If the target access card is an access card that can pass identity authentication, then execute the steps of obtaining the first device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value of the target access card, and the rolling code length in response to the card swiping event triggered by the target access card.

[0024] In a second aspect, the embodiments of the present application also provide a door access control device;

[0025] The access control device comprises:

[0026] A setting module, for setting, in response to an input operation of a user, a first device serial number of the access control device, a total serial number of a starting physical block for storing a rolling code value in a target access control card, and a rolling code length in the access control device, wherein the target access control card stores rolling code values ​​of a plurality of access control devices, wherein each of the access control devices is located at a different position, wherein the total serial number of a starting physical block for storing a rolling code value in the target access control card of each of the access control devices is the same, wherein the rolling code length of a rolling code value stored in the target access control card by each of the access control devices is the same, wherein the rolling code values ​​stored in the target access control card by each of the access control devices are stored in sequence according to the size of the first device serial number of each of the access control devices, wherein the target access control card includes a plurality of sectors, wherein each sector includes i physical blocks, and each physical block includes j bytes;

[0027] An acquisition module, configured to acquire, in response to a card swiping event triggered by a target access control card, a first device serial number of the access control device, a total serial number of a starting physical block storing a rolling code value of the target access control card, and a rolling code length;

[0028] A calculation module, used for calculating a first storage position of a first device sequence number of rolling code values ​​among a plurality of rolling code values ​​having a length of the rolling code length and stored sequentially starting from the physical block having the total sequence number of the starting physical block;

[0029] A reading module, configured to read data having a length of the rolling code length from the first storage position as a first rolling code value;

[0030] A determination module is used to determine that the target access card is a non-copy access card if the first rolling code value is consistent with the second rolling code value stored in the access control device for the target access card, and to update the first rolling code value stored in the target access card to a third rolling code value, and to update the second rolling code value stored in the access control device to the third rolling code value.

[0031] In a third aspect, an embodiment of the present application further provides an access card verification system, the access card verification system comprising a plurality of access control devices, each of the access control devices being located at a different position;

[0032] The access control device is used for:

[0033] In response to the user's input operation, the first device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value of the target access control card and the rolling code length are set in the access control device, the total serial number of the starting physical block storing the rolling code value in the target access control card of each access control device is the same, the rolling code length of the rolling code value stored in the target access control card by each access control device is the same, the rolling code value stored in the target access control card by each access control device is stored in sequence according to the size of the first device serial number of each access control device, the target access control card includes a plurality of sectors, each sector includes i physical blocks, and each physical block includes j bytes;

[0034] In response to a card swiping event triggered by a target access control card, obtaining a first device serial number of the access control device, a total serial number of a starting physical block storing a rolling code value of the target access control card, and a rolling code length;

[0035] Calculate a first storage position of a first device sequence number of rolling code values ​​among a plurality of rolling code values ​​having a length of the rolling code length and stored sequentially starting from the physical block having the total sequence number of the starting physical block;

[0036] Read data having a length of the rolling code length from the first storage position as a first rolling code value;

[0037] If the first rolling code value is consistent with the second rolling code value stored in the access control device for the target access control card, the target access control card is determined to be a non-copy access control card, and the first rolling code value stored in the target access control card is updated to a third rolling code value, and the second rolling code value stored in the access control device is updated to the third rolling code value.

[0038] In a possible embodiment, the access control device is specifically used for:

[0039] Obtain a sum of the first quantity and the physical block sequence number of the starting physical block in the sector where it is located, divide the sum by i-1, and add the value obtained by the division operation to the sector number of the sector where the starting physical block is located to obtain a first storage sector number; wherein the first quantity is obtained by obtaining the product of the difference between the first device sequence number of the access control device minus one and the rolling code length, and dividing the product by j; the physical block sequence number of the starting physical block in the sector where it is located is obtained by performing a modulo operation on the total sequence number of the starting physical block and i; the sector number of the sector where the starting physical block is located is obtained by performing a division operation on the total sequence number of the starting physical block and i;

[0040] Obtaining a sum of the first number and the physical block sequence number of the starting physical block in the sector where the first number is located, performing a modulo operation on the sum and i-1 to obtain a first storage physical block sequence number;

[0041] The product of the difference between the first device serial number of the access control device and one and the rolling code length is obtained, and a modulo operation is performed on the product and j to obtain a first storage starting byte number.

[0042] In a possible embodiment, the access card verification system further includes a server;

[0043] The server is used to move the rolling code value stored in the first storage position in the target access control card to a second storage position in response to the change operation, wherein the second storage position is a position of a second device sequence number of rolling code values ​​among a plurality of rolling code values ​​having a length equal to the rolling code length and stored sequentially starting from the physical block with the total sequence number of the starting physical block;

[0044] The access control device is used to change the first device serial number of the access control device to the second device serial number indicated by the change instruction in response to the change instruction.

[0045] In a possible embodiment, the access control device is further used for:

[0046] Acquire access card authority information in a database in the access control device, the access card authority information being used to indicate an access card that can pass identity authentication, and the access card authority information being stored in the database in the form of an encrypted string;

[0047] Decrypting the access card permission information to obtain the decrypted access card permission information;

[0048] If the target access card is an access card that can pass identity authentication, then execute the steps of obtaining the first device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value of the target access card, and the rolling code length in response to the card swiping event triggered by the target access card.

[0049] In a possible embodiment, the access control device is further used for:

[0050] If the first rolling code value is not read from the access control device, determining that the target access control card is a non-duplicate access control card, generating a fourth rolling code value and storing it in the first storage location and the access control device;

[0051] If the first rolling code value is read from the access control device, a step of determining whether the first rolling code value is consistent with a second rolling code value stored in the access control device for the target access control card is performed.

[0052] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for access card verification described above is implemented.

[0053] In a fifth aspect, an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the access card verification methods described above.

[0054] Beneficial effects of the embodiments of the present application:

[0055] The access card verification system and method provided by the embodiment of the present application, for any access control device in each access control device at different locations, the access control device is used to respond to the user's input operation, set the first device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value of the target access control card, and the rolling code length in the access control device; in response to the card swiping event triggered by the target access control card, obtain the device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value in the target access control card, and the rolling code length, and use the above information to obtain the rolling code value stored for the access control device in the target access control card, and determine whether the rolling code value stored for the access control device in the target access control card and the rolling code value stored for the target access control card in the access control device are consistent. If they are consistent, it is determined that the target access control card is a non-copy access control card, and the rolling code value stored for the access control device in the target access control card and the rolling code value stored for the target access control card in the access control device are updated. Since each access control device is correspondingly set with its own rolling code value. Therefore, when updating the rolling code value of the access control device, there is no need to synchronize the rolling code value to other access control devices. In this way, even if the access control devices cannot communicate in real time, one access card can be verified by rolling codes on multiple access control devices, thereby improving security and flexibility of the solution.

[0056] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the embodiments of the present application or the technical solutions in 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 embodiments can also be obtained based on these drawings.

[0058] Figure 1 A schematic diagram of using an access card to verify access control equipment in the related art;

[0059] Figure 2 A first schematic diagram of the access card verification method provided in an embodiment of the present application;

[0060] Figure 3 A schematic diagram of using an access control card to perform access control verification on an access control device provided in an embodiment of the present application;

[0061] Figure 4 A first schematic diagram of a storage area in a target access card provided in an embodiment of the present application;

[0062] Figure 5 A second schematic diagram of a storage area in a target access card provided in an embodiment of the present application;

[0063] Figure 6 A second schematic diagram of the access card verification method provided in an embodiment of the present application;

[0064] Figure 7 A third schematic diagram of the access card verification method provided in the embodiment of the present application;

[0065] Figure 8 A schematic diagram of a door access control device provided in an embodiment of the present application;

[0066] Fig. 9 A schematic diagram of an access card verification system provided in an embodiment of the present application;

[0067] Fig.10 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0068] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 based on the present application belong to the scope of protection of the present application.

[0069] In this application, the terms "first", "second", etc. are used to distinguish between the same or similar items with basically the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there a limit on the quantity and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of various examples, the first rolling code value can be referred to as the second rolling code value, and similarly, the second rolling code value can be referred to as the first rolling code value. In some cases, the first rolling code value and the second rolling code value are separate and different rolling code values.

[0070] Rolling code verification: A security verification mechanism that uses the principle of physical randomness. A generator is embedded in the access card to continuously generate random numbers, and is used in conjunction with the encryption algorithm agreed upon in advance by the access control system to generate a unique dynamic password. Each rolling code value can only be used once, and the validity period varies from a few seconds to a few minutes.

[0071] M1 card: A contactless IC card that uses wireless radio frequency technology to achieve identity authentication and access control authority management through close communication with access control equipment.

[0072] Access control device: It can read and verify the rolling code values ​​of different areas of the M1 card by configuring parameters, and authenticate the user's authority through the data read from the M1 card, thereby controlling the user's access control authority.

[0073] Physical access control cards generally use low-cost M1 cards, which only have storage and logical encryption capabilities but no data computing capabilities. Therefore, such cards are less secure and have the risk of being copied. Once an M1 card is copied, the copy will copy all the information of the original card, resulting in the copy having the same permissions as the original card. Therefore, once an M1 card is used as an access control card, it will cause security risks.

[0074] To solve this technical problem, the related art proposes to prevent the access card from being copied by rolling code verification. Usually, for multiple access control devices in the same access control card, the rolling code values ​​of the multiple access control devices are set to the same rolling code value. After the rolling code verification is passed, the rolling code values ​​of the multiple access control devices need to be updated. For example, the application scenario of the park is introduced as follows. Figure 1As shown, the park includes four access control devices, namely, access control device 1, access control device 2, access control device 3 and access control device 4, and the distance between each access control device is relatively far, wherein the solid arrow indicates that the access control card background management system is connected to the access control device 1, access control device 2, access control device 3 and access control device 4 through the network, and the dotted arrow indicates that the access control card can perform access control verification on access control device 1, access control device 2, access control device 3 and access control device 4. For example, the users of the park can use the access control card to perform access control verification on access control device 1, access control device 2, access control device 3 and access control device 4. Since the rolling code value for each access control device in the access control card is the same rolling code value, when the access control card is swiped on the access control device 1, the access control device 1 will update the rolling code value stored in itself, and it is also necessary to notify the access control device 2, access control device 3 and access control device 4 to synchronously update the rolling code value stored in themselves. If only the rolling code value for the access card in access control device 1 is updated, and the rolling code values ​​for the access card in other access control devices are not updated synchronously, the rolling code value for the access card in access control device 1 will be different from the rolling code values ​​for the access card in other access control devices, which will cause the subsequent rolling code verification of the access card in other access control devices to fail. Therefore, in order to implement the solution of rolling code verification of one access card in multiple access control devices, real-time communication between various access control devices is required, so that when the rolling code value of one access control device for the access card changes, it can notify other access control devices to synchronously update the rolling code values ​​stored in themselves. However, in order to implement rolling code verification of one access card in multiple access control devices using this method, each access control device needs to be able to communicate in real time. Access control cards are usually used in outdoor scenes such as large parks. In this scene, each access control device may not be able to communicate in real time. In this case, the above method cannot be used to implement rolling code verification of one access card in multiple access control devices.

[0075] To solve this technical problem, the present application proposes a method for verifying access card, which is applied to access control devices, such as Figure 2 As shown, the method comprises the following steps:

[0076] S201: In response to the user's input operation, the first device serial number of the access control device, the starting physical block total serial number of the target access control card storing the rolling code value, and the rolling code length are set in the access control device, the target access control card stores the rolling code values ​​of multiple access control devices, each access control device is located at a different position, the starting physical block total serial number of the rolling code value stored in the target access control card by each access control device is the same, the rolling code length of the rolling code value stored in the target access control card by each access control device is the same, the rolling code value stored in the target access control card by each access control device is stored in sequence according to the size of the first device serial number of each access control device, each sector includes i physical blocks, and each physical block includes j bytes.

[0077] S202: In response to a card swiping event triggered by a target access control card, obtain a first device serial number of the access control device, a total serial number of a starting physical block storing a rolling code value of the target access control card, and a rolling code length.

[0078] S203: Calculate the first storage position of the rolling code value of the first device sequence number among the multiple rolling code values ​​whose length is the rolling code length and which are stored sequentially starting from the physical block with the total sequence number of the starting physical block.

[0079] S204: Read data having a length equal to the rolling code length from the first storage position as the first rolling code value.

[0080] S205: If the first rolling code value is consistent with the second rolling code value stored in the access control device for the target access control card, determine that the target access control card is a non-copy access control card, and update the first rolling code value stored in the target access control card to a third rolling code value, and update the second rolling code value stored in the access control device to a third rolling code value.

[0081] In the embodiment of the present application, for any access control device in each access control device at different locations, the access control device is used to respond to the user's input operation, set the first device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value of the target access control card, and the rolling code length in the access control device; in response to the card swiping event triggered by the target access control card, obtain the device serial number of the access control device, the total serial number of the physical block starting to store the rolling code value in the target access control card, and the rolling code length of the rolling code value, use the above information to obtain the rolling code value stored for the access control device in the target access control card, determine whether the rolling code value stored for the access control device in the target access control card and the rolling code value stored for the target access control card in the access control device are consistent, if consistent, determine that the target access control card is a non-copy access control card, and update the rolling code value stored for the access control device in the target access control card and the rolling code value stored for the target access control card in the access control device. Since each access control device is correspondingly set with its own rolling code value. Therefore, when updating the rolling code value of the access control device, there is no need to synchronize the rolling code value to other access control devices. In this way, even if the access control devices cannot communicate in real time, one access card can be verified by rolling codes on multiple access control devices, thereby improving security and flexibility of the solution.

[0082] An example, such as Figure 3 As shown, Figure 3A schematic diagram of using an access control card to perform access control verification on an access control device provided in an embodiment of the present application. The dotted arrows indicate that the target access control card can perform access control verification on access control device 1, access control device 2, access control device 3, and access control device 4. That is, the target access control card stores the rolling code values ​​of multiple access control devices, each access control device is in a different position, and each access control device stores a different rolling code value in the target access control card, but the total serial number of the starting physical block for each access control device to store the rolling code value in the target access control card is the same, the rolling code length of each access control device to store the rolling code value in the target access control card is the same, and when each access control device stores the rolling code value in the target access control card, it is stored in sequence according to the device serial number of each access control device. For example, the rolling code value stored in the target access card by access control device 1 is rolling code value 1, the rolling code value stored in the target access card by access control device 2 is rolling code value 2, the rolling code value stored in the target access card by access control device 3 is rolling code value 3, and the rolling code value stored in the target access card by access control device 4 is rolling code value 4. In one example, the user can pre-set the device serial number of access control device 1, the total serial number of the starting physical block storing the rolling code value of the target access card, and the rolling code length in access control device 1. In this way, when the user uses the target access card to perform access control verification on the access control device 1, in response to the card swiping event triggered by the target access card, the access control device 1 obtains its own device serial number, the total serial number of the starting physical block where the target access card starts to store the rolling code value, and the rolling code length of the rolling code value, and uses the above information to calculate the storage position where the rolling code value of the access control device 1 starts to be stored in the target access card, and reads data with a length of the rolling code length from the storage position as the rolling code value of the access control device 1 stored in the target access card, and determines whether the rolling code value stored for the access control device 1 in the target access card is consistent with the rolling code value stored in the access control device 1 for the target access card. If they are consistent, it is determined that the target access card is a non-copy access card, and the rolling code value stored for the access control device 1 in the target access card and the rolling code value stored for the target access card in the access control device 1 are updated, without the need to synchronously update the rolling code value stored for other access control devices in the target access card. In this case, there is no need to connect the access card to the access control device 1, the access control device 2, the access control device 3 and the access control device 4 through the network through the access control card background management system.

[0083] In the embodiment of the present application, the user can use the access card to verify the access control device, or use the mobile terminal with the access card to verify the access control device. Exemplarily, the mobile terminal may include a smart phone, a smart watch, etc. No more examples are given here.

[0084] Access control devices can be outdoor phones, fence phones, unit outdoor phones, etc., which are used to restrict the identities of people entering and leaving.

[0085] In actual application scenarios, card swiping events often occur when a user needs to enter or exit a target area. In order to promptly detect access card duplication, the following descriptions are based on the example of the access control device that currently triggers the card swiping event. Other situations are the same as the current triggering event, so no further elaboration is given here.

[0086] The above S201-S205 are described in detail below.

[0087] In S201, the staff can input the parameters to be set for the access control device in the access control device, and the parameters can be the device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value of the target access control card, and the rolling code length. The access control device responds to the input operation of the staff and sets the above parameters in the access control device.

[0088] The first device serial number of the access control device is used to indicate the ranking of the rolling code value of the access control device in the rolling code values ​​that can be stored in the target access control card. For example, if the first device serial number of the access control device is 10, it means that the target access control card can store several rolling code values ​​of the access control device, and the rolling code value of the access control device is the 10th rolling code value among the several rolling code values ​​that can be stored in the target access control card. The total serial number of the starting physical block is the total serial number of the physical block used to start storing the rolling code value in the target access control card. For example, when the total serial number of the starting physical block is 8, it means that the target access control card starts to store the rolling code value from the first physical block in the third sector. The rolling code length is the rolling code length of the rolling code value stored in the target access control card.

[0089] The target access control card stores rolling code values ​​of multiple access control devices, each of which is located in a different position. For example, if the target area is a certain community, the access control devices are the community access control devices and unit building access control devices of the community.

[0090] In the embodiment of the present application, the access control card will pre-maintain the corresponding relationship between different access control devices and different storage locations, so as to store the rolling code values ​​of different access control devices in the corresponding storage locations.

[0091] It should be noted that the rolling code value stored in the target access control card by each access control device is different, but the total serial number of the starting physical block in which each access control device stores the rolling code value in the target access control card is the same, the rolling code length of the rolling code value stored in the target access control card by each access control device is the same, and when each access control device stores the rolling code value in the target access control card, it is stored in sequence according to the size of the device serial number of each access control device.

[0092] It should be noted that the access control card will be divided into multiple sectors, each sector includes i physical blocks, and each physical block includes j bytes. As shown in Table 1 below, the access control card is divided into 16 sectors, namely sector 1, sector 2, ..., sector 16. Each sector has 4 physical blocks, namely physical block 0, physical block 1, physical block 2 and physical block 3. The access control card has 64 physical blocks, numbered 0-63. Physical blocks 0, physical blocks 1, and physical blocks 2 of each sector are data blocks, which can be used to store the rolling code values ​​of each access control device. Physical block 3 is a control block, which is used to store keys and control data block access data. For example, key A and key B are accessed in the control block. Key A and key B are used to encrypt the data stored in the target access control card. Among them, physical block 0 in sector 1 is used to store fixed information such as the manufacturer code and card number of the access control card. As shown in Table 2 below, the control block includes 16 bytes, bytes 0-5 are used to store key A, bytes 6-9 are used to control data block access data, and bytes 10-15 are used to store key B.

[0093] Table 1 A sector division table of access control card

[0094] ;

[0095] Table 2 A table of byte division within a control block

[0096] ;

[0097] In S202, the card swiping event is an event triggered by the operation of placing the access card in the card reading area of ​​the access control device when the user needs to enter the target area.

[0098] The access control device responds to the card swiping event and reads the rolling code value of the target access control card. In addition, the access control device can also read other relevant information of the target access control card except the rolling code value, for example, the card number of the target access control card.

[0099] In S203: calculating the first storage position of the rolling code value of the first device sequence number among the multiple rolling code values ​​stored in sequence starting from the physical block with the total sequence number of the starting physical block and having a length equal to the rolling code length, including:

[0100] S2031: Obtain the sum of the first quantity and the physical block serial number of the starting physical block in the sector where it is located, divide the sum by i-1, and add the value obtained by the division operation to the sector number of the sector where the starting physical block is located to obtain the first storage sector number; wherein the first quantity is obtained by obtaining the product of the difference between the first device serial number of the access control device minus one and the rolling code length, and dividing the product by j; the physical block serial number of the starting physical block in the sector where it is located is obtained by performing a modulo operation on the total serial number of the starting physical block and i; the sector number of the sector where the starting physical block is located is obtained by performing a division operation on the total serial number of the starting physical block and i.

[0101] The first number is the number of physical blocks occupied by the rolling code value of the access control device that has been stored before the rolling code value of the access control device with the first device serial number is stored in the target access control card.

[0102] In a possible embodiment, if the rolling code values ​​of each access control device are stored in the target access control card in sequence and without interval, the product in the first quantity can be the product of the difference between the device serial number of the access control device minus one and the rolling code length. As an example, in this case, the expression of the first quantity is: ((devid-1)×numlen) / j, where devid is the first device serial number of the access control device, numlen is the rolling code length, j is the number of bytes included in the physical block, and / is a division operation.

[0103] As an example, in this case, devid is 8, numlen is 3, j is 16, the rolling code length of each rolling code value is 3 bytes, the number of bytes occupied by 7 rolling code values ​​in the target access control card is 21, and each physical block includes 16 bytes, then the number of physical blocks occupied before storing the rolling code value of the 8th access control device can be 1.

[0104] In a possible embodiment, if the rolling code values ​​of each access control device are stored in the target access control card in sequence and at a certain interval, the product in the first quantity is the product of the difference between the device serial number of the access control device minus one and the sum of the rolling code length and the interval length. As an example, in this case, the expression of the first quantity is: ((devid-1)×(numlen+spalen)) / j, where devid is the first device serial number of the access control device, numlen is the rolling code length, spalen is the interval distance between the storage locations of any two rolling code values ​​in the target access control card, j is the number of bytes included in the physical block, / is a division operation, and the interval distances between the storage locations of the rolling code values ​​of different access control devices in the target access control card are the same.

[0105] As an example, in this case, devid is 8, numlen is 3, spalen is 1, j is 16, the rolling code length of each rolling code value is 3 bytes, and there is one byte interval, which means that the number of bytes occupied by the 7 rolling code values ​​in the target access control card is 28, and each physical block includes 16 bytes, so the number of physical blocks occupied before storing the rolling code value of the 8th access control device can be 1.

[0106] The physical block number of the starting physical block in the sector is the physical block number of the physical block in the target access card for starting to store the rolling code value in the sector. For example, the second physical block in the second sector of the target access card starts to store the rolling code value.

[0107] The physical block number of the starting physical block in the sector is obtained by dividing the total number of the starting physical block and i. The total number of the starting physical block is the ranking of the starting physical block in all the physical blocks included in the target access card. For example, if the total number of the starting physical block is 25, it means that the starting physical block is the 25th physical block in the target access card. i is the number of physical blocks included in each sector. As an example, the expression for calculating the physical block number of the starting physical block in the sector can be: bckid%i, where bckid is the total number of the starting physical block, i is the number of physical blocks included in the sector, and % is the modulo operation.

[0108] For example, if bckid is 25 and i is 4, the physical block number of the starting physical block in the sector is 0.

[0109] The sector number of the sector where the starting physical block is located is the sector number of the sector where the physical block used to start storing the rolling code value in the target access control card is located. The sector number of the sector where the starting physical block is located is obtained by dividing the total serial number of the starting physical block and i. As an example, the expression of the sector number of the sector where the starting physical block is located can be: (bckid / i)+1, or: (bckid+i-1) / i. It should be noted that (bckid / i) is the division of bckid and i rounded down, and (bckid+i-1) / i is the division of bckid and i rounded up. For example, if bckid is 25 and i is 4, the sector number of the sector where the starting physical block is located is 7.

[0110] The first storage sector number indicates the sector number of the sector where the physical block for starting to store the rolling code value of the access control device with the first device serial number in the target access control card is located. As an example, the specific expression for calculating the first storage sector number can be: (((devid-1)×numLen) / j+bckid%i) / (i-1)+(bckid / i)+1, where devid is the first device serial number of the access control device, numlen is the rolling code length, j is the number of bytes included in the physical block, / is a division operation, bckid is the total serial number of the starting physical block, i is the number of physical blocks included in the sector, and % is a modulo operation.

[0111] like Figure 4 As shown, Figure 4 A schematic diagram of the storage area in the target access control card provided in an embodiment of the present application is used to represent a portion of the storage area in the target access control card. In this figure, only sectors 1, 2 and 3 are shown, wherein sector 1 includes physical block 0, physical block 1, physical block 2 and physical block 3, sector 2 includes physical block 0, physical block 1, physical block 2 and physical block 3, sector 3 includes physical block 0, physical block 1, physical block 2 and physical block 3, and dotted lines are used to distinguish between sectors. For example, when bckid is 8, numlen is 3, devId is 8, j is 16, and i is 4, the sector number of the sector where the starting physical block is located can be calculated as 3 according to (bckid / i)+1, and the physical block sequence number of the starting physical block in the sector where it is located can be calculated as 0 according to bckId%i. Then, according to ((devId-1)×numLen) / j, the number of physical blocks occupied by the rolling code value of the access control device that has been stored in the target access control card before the rolling code value of the access control device with the first device sequence number is stored is 1, so the first storage sector number is (1+0) / 3+3=3.

[0112] S2032: Obtain the sum of the first quantity and the physical block sequence number of the starting physical block in the sector, perform a modulo operation on the sum and i-1 to obtain a first storage physical block sequence number.

[0113] The first storage physical block serial number indicates the physical block serial number of the physical block in the sector where the physical block for starting to store the rolling code value of the access control device whose device serial number is the first device serial number is located in the target access control card.

[0114] In a possible embodiment, the specific expression for calculating the first storage physical block number can be: (((devId-1)×numLen) / j)+(bckId%i))%(i-1), wherein devid is the first device number of the access control device, numlen is the rolling code length, j is the number of bytes included in the physical block, / is a division operation, bckid is the total number of the starting physical block, i is the number of physical blocks included in each sector, and % is a modulo operation.

[0115] An example, such as Figure 4 As shown, bckid is 8, numlen is 3, devId is 8, j is 16, and i is 4. According to ((devId-1)×numLen) / j, the number of physical blocks occupied by the rolling code value of the access control device that has been stored before the rolling code value of the access control device with the first device serial number is stored in the target access control card is 1. According to bckId%i, the physical block serial number of the starting physical block in the sector is 0. The i-th physical block of each sector does not store the rolling code value, so the first storage physical block serial number is (0+1)%3=1.

[0116] S2033: Obtain the product of the difference between the first device serial number of the access control device minus one and the rolling code length, perform a modulo operation on the product and j, and obtain the first storage starting byte number.

[0117] The first storage start byte number represents the byte number in the physical block where the rolling code value of the access control device with the first device serial number is stored in the target access control card. In a possible embodiment, the specific expression for calculating the first storage start byte number may be: ((devId-1)×numLen)%j, where devid is the first device serial number of the access control device, numlen is the rolling code length, j is the number of bytes included in the physical block, and % is a modulo operation.

[0118] When the rolling code value is stored in the target access control card, it usually starts at byte 0 in the physical block. Therefore, it is only necessary to calculate the number of physical blocks occupied by the rolling code value stored before the rolling code value of the access control device with the first device serial number is stored in the target access control card, and perform a modulo operation on the number and j to obtain the first storage starting byte number. Figure 5 As shown, Figure 5 Another schematic diagram of the storage area of ​​the target access card provided in the embodiment of the present application shows that the physical block in the target access card includes 16 bytes, numbered 0 to 15. For example, assuming that devid is 17, numlen is 4, and j is 16, the first starting byte number is 0.

[0119] In S204, if the rolling code value of the complete rolling code length of the access control device is stored in the physical block where the first storage location is located, data with a length of the rolling code length is directly read from the physical block as the first rolling code value. If the rolling code value of the complete rolling code length of the access control device is not stored in the physical block where the first storage location is located, that is, the rolling code value is stored across sectors or across physical blocks, it is necessary to read data with a length of the rolling code length from the physical block where the first storage location is located and the next physical block corresponding to the physical block as the first rolling code value.

[0120] In S205, if the first rolling code value is inconsistent with the second rolling code value stored in the access control device for the target access control card, the target access control card is determined to be a duplicate access control card. When the target access control card is a duplicate access control card, the administrator and the cardholder can be notified according to the card number of the target access control card, and the access control card corresponding to the card number can be locked.

[0121] The second rolling code value stored for the target access control card in the access control device is stored in a reversibly encrypted manner to ensure the security of the rolling code value to a greater extent.

[0122] like Figure 6 As shown, the embodiment of the present application also provides a flow chart of a method for verifying a door access card, the method further comprising:

[0123] S206: If the first rolling code value is not read from the access control device, determining that the target access control card is a non-duplicate access control card, generating a fourth rolling code value and storing it in the first storage location and the access control device;

[0124] S207: If the first rolling code value is read from the access control device, a step of determining whether the first rolling code value is consistent with a second rolling code value stored in the access control device for the target access control card is executed.

[0125] Since the target access control card does not have the first rolling code value before, the fourth rolling code value can be directly written as the first rolling code value into the storage position corresponding to the access control device in the target access control card.

[0126] In actual use, the physical block storing the rolling code value of the access control device in the target access control card may be damaged. When the physical block storing the rolling code value of the access control device in the target access control card is damaged and cannot work properly, the rolling code value of the access control device in the target access control card can be moved to a physical block that can work properly and is idle by changing the device serial number of the access control device. In this way, the target access control card can continue to be used, and the target access control card will not be scrapped due to the damage of a physical block, thereby increasing the service life of the target access control card.

[0127] In this embodiment of the present application, the method further includes:

[0128] S208: In response to the change instruction, changing the first device serial number of the access control device to the second device serial number indicated by the change instruction;

[0129] Among them, the change instruction is sent to the access control device when the rolling code value stored in the first storage position in the target access control card is moved to the second storage position, and the second storage position is the position of the second device serial number rolling code value among the multiple rolling code values ​​with a length of the rolling code length, which are stored sequentially starting from the physical block with the total serial number of the starting physical block.

[0130] In one example, when it is determined that the physical block in the target access card used to store the rolling code value of the access control device is damaged, the administrator moves the rolling code value stored in the target access card at the first storage location to the second storage location in the server, and sends a change instruction to the corresponding access control device, so that the access control device can respond to the change instruction and change the first device serial number of the access control device to the second device serial number indicated by the change instruction.

[0131] In order to further improve the security of the target access card, the method further includes:

[0132] S209: Acquire access card permission information from a database in the access control device. The access card permission information is used to indicate an access card that can pass identity authentication. The access card permission information is stored in the database in the form of an encrypted string.

[0133] Decrypt the access card permission information to obtain the decrypted access card permission information;

[0134] If the target access card is an access card that can pass identity authentication, the steps of obtaining the first device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value of the target access card, and the rolling code length are executed in response to the card swiping event triggered by the target access card.

[0135] In a possible embodiment, the access control authority information is used to indicate an access control card that cannot pass identity authentication. Accordingly, if the target access control card is an access control card that cannot pass identity authentication, the rolling code verification is not performed on the target access control card.

[0136] In a possible embodiment, the access card permission information may be the card number of the access card, which is usually stored in binary form in physical block 0 in sector 1 of the access card. Therefore, when storing it in the database of the access control device, the card number of the binary access card may be first converted into a decimal card number, then converted into a string, and the string is encrypted using a reversible encryption method, and the encrypted string is stored in the database. Storing the access card number in the database in the form of a string ensures the convenience of the access control device in searching for the rolling code value in the database. Storing the access card number in the database in an encrypted form means that even if the database of the access control device is cracked, the corresponding target access card cannot be matched based on the stored string card number, thereby improving the security of the access control device in searching for the rolling code value in the database.

[0137] The present application also provides a schematic diagram of a method for verifying an access card. Figure 7 As shown, including:

[0138] S701: Start.

[0139] S702: Responding to a card swiping event.

[0140] S703: Determine whether the card number of the target access card is in the database.

[0141] S704: If not: the target access card verification fails, and the verification is reported to the authority authentication module for processing.

[0142] The permission authentication module is used to perform permission verification and access control operations based on the authentication result of the target access control card.

[0143] S705: If yes, perform rolling code verification.

[0144] S706: Obtain the device serial number of the access control device, the rolling code length, and the total serial number of the physical block in the target access control card for starting to store the rolling code value.

[0145] S707: Calculate the sector number where the rolling code value corresponding to the access control device is stored in the target access control card, the physical block number in the sector, and the starting byte number in the physical block, and obtain the storage location of the rolling code value for the access control device in the target access control card.

[0146] S708: Perform key verification on the storage location.

[0147] In order to further improve the security of the storage location of the rolling code value in the embodiment of the present application, the access control device also maintains keys of different storage locations. Before the access control device performs rolling code verification on the target access control card, it first performs key verification on the target access control card. Only after the key verification is passed, can the rolling code value be read or written. Before reading the rolling code value of the target access control card, key verification is first performed. Only after the key verification is passed, can the rolling code value stored in the target access control card be read, which further improves the security of the rolling code value stored in the target access control card.

[0148] S709: Determine whether the key verification is successful.

[0149] S710: If the key verification fails, the target access card verification fails and is reported to the authority authentication module for processing.

[0150] S711: If the key verification is successful, the rolling code value of the access control device is obtained in the target access control card according to the calculated storage location.

[0151] S712: Searching for the rolling code value corresponding to the encrypted target access control card in the database of the access control device, and decrypting the rolling code value corresponding to the target access control card.

[0152] S713: Determine whether the rolling code value corresponding to the target access control card stored in the database of the access control device is 0.

[0153] S714: If yes, determine that the target access control card has not been subjected to rolling code verification in the access control device.

[0154] S715: Determine that the rolling code verification is successful, and update the rolling code value of the access control device stored in the target access control card and the rolling code value of the target access control card stored in the access control device, and report to the authority authentication module for processing.

[0155] S716: If not, determine whether the rolling code value of the access control device stored in the target access control card is consistent with the rolling code value of the target access control card stored in the access control device;

[0156] S717: If they are consistent, execute the operations of S714 and S715.

[0157] S718: If they are inconsistent, it is determined that the rolling code verification has failed, and the server is notified that there is a duplicate card of the target access control card, and the authority authentication module is reported for processing.

[0158] S719: End.

[0159] The present application also provides a door access control device; Figure 8 As shown, the access control equipment includes:

[0160] A setting module 801 is used to set, in response to an input operation of a user, the first device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value of the target access control card, and the rolling code length in the access control device, wherein the rolling code values ​​of multiple access control devices are stored in the target access control card, and each of the access control devices is located at a different position. The total serial number of the starting physical block storing the rolling code value of each access control device in the target access control card is the same, and the rolling code length of the rolling code value stored in the target access control card by each access control device is the same. The rolling code values ​​stored in the target access control card by each access control device are stored in sequence according to the size of the first device serial number of each access control device. The target access control card includes multiple sectors, each sector includes i physical blocks, and each physical block includes j bytes;

[0161] An acquisition module 802 is used to obtain, in response to a card swiping event triggered by a target access control card, a first device serial number of the access control device, a total serial number of a starting physical block storing a rolling code value of the target access control card, and a rolling code length;

[0162] The calculation module 803 is used to calculate the first storage position of the first device sequence number of the rolling code values ​​among the multiple rolling code values ​​whose length is the rolling code length and which are stored sequentially starting from the physical block with the total sequence number of the starting physical block;

[0163] A reading module 804 is used to read data having a length equal to the rolling code length from the first storage position as a first rolling code value;

[0164] Determination module 805 is used to determine that the target access card is a non-copy access card if the first rolling code value is consistent with the second rolling code value stored in the access control device for the target access card, and update the first rolling code value stored in the target access card to a third rolling code value, and update the second rolling code value stored in the access control device to the third rolling code value.

[0165] The present application also provides an access card verification system. Fig. 9 As shown, the access card verification system includes multiple access control devices 901, each of which is located at a different position;

[0166] The access control device 901 is used for:

[0167] In response to the user's input operation, the first device serial number of the access control device, the total serial number of the starting physical block for storing the rolling code value of the target access control card, and the rolling code length are set in the access control device, the total serial number of the starting physical block for storing the rolling code value in the target access control card of each access control device is the same, the rolling code length of the rolling code value stored in the target access control card of each access control device is the same, the rolling code value stored in the target access control card by each access control device is stored in sequence according to the size of the first device serial number of each access control device, the target access control card includes a plurality of sectors, each sector includes i physical blocks, and each physical block includes j bytes;

[0168] In response to a card swiping event triggered by a target access control card, obtaining a first device serial number of the access control device, a total serial number of a starting physical block storing a rolling code value of the target access control card, and a rolling code length;

[0169] Calculate the first storage position of the first device sequence number of the rolling code values ​​among the multiple rolling code values ​​having a length of the rolling code length and stored sequentially starting from the physical block with the total sequence number of the starting physical block;

[0170] Read data having a length of the rolling code from the first storage position as a first rolling code value;

[0171] If the first rolling code value is consistent with the second rolling code value stored in the access control device for the target access control card, the target access control card is determined to be a non-copy access control card, and the first rolling code value stored in the target access control card is updated to a third rolling code value, and the second rolling code value stored in the access control device is updated to the third rolling code value.

[0172] In a possible embodiment, the access control device 901 is specifically used for:

[0173] Obtain the sum of the first quantity and the physical block sequence number of the starting physical block in the sector where it is located, divide the sum by i-1, and add the value obtained by the division operation to the sector number of the sector where the starting physical block is located to obtain a first storage sector number; wherein the first quantity is obtained by obtaining the product of the difference between the first device sequence number of the access control device minus one and the rolling code length, and dividing the product by j; the physical block sequence number of the starting physical block in the sector where it is located is obtained by performing a modulo operation on the total sequence number of the starting physical block and i; the sector number of the sector where the starting physical block is located is obtained by performing a division operation on the total sequence number of the starting physical block and i;

[0174] Obtaining a sum of the first number and the physical block sequence number of the starting physical block in the sector where the starting physical block is located, performing a modulo operation on the sum and i-1 to obtain a first storage physical block sequence number;

[0175] The product of the difference between the first device serial number of the access control device and one and the rolling code length is obtained, and a modulo operation is performed on the product and j to obtain a first storage starting byte number.

[0176] In a possible embodiment, the access card verification system further includes a server 902;

[0177] The server 902 is used to move the rolling code value stored in the first storage position of the target access control card to a second storage position in response to the change operation, where the second storage position is a position of a second device serial number of rolling code values ​​among a plurality of rolling code values ​​whose length is the rolling code length and which are sequentially stored starting from the physical block with the total serial number of the starting physical block;

[0178] The access control device 901 is used to change the first device serial number of the access control device to the second device serial number indicated by the change instruction in response to the change instruction.

[0179] In a possible embodiment, the access control device 901 is further used for:

[0180] Obtain access card permission information from a database in the access control device, the access card permission information being used to indicate an access card that can pass identity authentication, and the access card permission information being stored in the database in the form of an encrypted string;

[0181] Decrypting the access card permission information to obtain the decrypted access card permission information;

[0182] If the target access card is an access card that can pass identity authentication, then execute the steps of obtaining the first device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value of the target access card, and the rolling code length in response to the card swiping event triggered by the target access card.

[0183] In a possible embodiment, the access control device 901 is further used for:

[0184] If the first rolling code value is not read from the access control device, determining that the target access control card is a non-copy access control card, generating a fourth rolling code value and storing it in the first storage location and the access control device;

[0185] If the first rolling code value is read from the access control device, a step of determining whether the first rolling code value is consistent with a second rolling code value stored in the access control device for the target access control card is performed.

[0186] The present application also provides an electronic device, such as Fig.10 As shown, including:

[0187] Memory 1001, used for storing computer programs;

[0188] The processor 1002 is used to implement the following steps when executing the program stored in the memory 1001:

[0189] In response to the user's input operation, the first device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value of the target access control card, and the rolling code length are set in the access control device, the rolling code values ​​of multiple access control devices are stored in the target access control card, each of the access control devices is located at a different position, the total serial number of the starting physical block storing the rolling code value of each access control device in the target access control card is the same, the rolling code length of the rolling code value stored in the target access control card by each access control device is the same, the rolling code value stored in the target access control card by each access control device is stored in sequence according to the size of the first device serial number of each access control device, the target access control card includes multiple sectors, each sector includes i physical blocks, and each physical block includes j bytes;

[0190] In response to a card swiping event triggered by a target access control card, obtaining a first device serial number of the access control device, a total serial number of a starting physical block storing a rolling code value of the target access control card, and a rolling code length;

[0191] Calculate the first storage position of the first device sequence number of the rolling code values ​​among the multiple rolling code values ​​having a length of the rolling code length and stored sequentially starting from the physical block with the total sequence number of the starting physical block;

[0192] Read data having a length of the rolling code from the first storage position as a first rolling code value;

[0193] If the first rolling code value is consistent with the second rolling code value stored in the access control device for the target access control card, the target access control card is determined to be a non-copy access control card, and the first rolling code value stored in the target access control card is updated to a third rolling code value, and the second rolling code value stored in the access control device is updated to the third rolling code value.

[0194] Furthermore, the electronic device may further include a communication bus and / or a communication interface, and the processor 1002, the communication interface, and the memory 1001 communicate with each other via the communication bus.

[0195] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0196] The communication interface is used for communication between the above electronic device and other devices.

[0197] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0198] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0199] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned access card verification methods are implemented.

[0200] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the steps of any access card verification method in the above-mentioned embodiments.

[0201] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.

[0202] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0203] Each embodiment in this specification is described in a related 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 access control device and access control card verification system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0204] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. An access card verification system, characterized in that: The system includes a plurality of access control devices, each of which is located at a different position; The access control device is used to: in response to a user's input operation, set the first device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value of the target access control card, and the rolling code length in the access control device, the total serial number of the starting physical block storing the rolling code value in the target access control card of each access control device is the same, the rolling code length of the rolling code value stored in the target access control card by each access control device is the same, the rolling code value stored in the target access control card by each access control device is stored in sequence according to the size of the first device serial number of each access control device, the target access control card includes a plurality of sectors, each sector includes i physical blocks, and each physical block includes j bytes; In response to a card swiping event triggered by the target access control card, obtaining a first device serial number of the access control device, a total serial number of a starting physical block storing a rolling code value of the target access control card, and a rolling code length; Calculate a first storage position of a first device sequence number of rolling code values ​​among a plurality of rolling code values ​​having a length of the rolling code length and stored sequentially starting from the physical block having the total sequence number of the starting physical block; Read data having a length of the rolling code length from the first storage position as a first rolling code value; If the first rolling code value is consistent with the second rolling code value stored in the access control device for the target access control card, the target access control card is determined to be a non-copy access control card, and the first rolling code value stored in the target access control card is updated to a third rolling code value, and the second rolling code value stored in the access control device is updated to the third rolling code value; The access control device is specifically used for: Obtain a sum of the first quantity and the physical block sequence number of the starting physical block in the sector where it is located, divide the sum by i-1, and add the value obtained by the division operation to the sector number of the sector where the starting physical block is located to obtain a first storage sector number; wherein the first quantity is obtained by obtaining the product of the difference between the first device sequence number of the access control device minus one and the rolling code length, and dividing the product by j; the physical block sequence number of the starting physical block in the sector where it is located is obtained by performing a modulo operation on the total sequence number of the starting physical block and i; the sector number of the sector where the starting physical block is located is obtained by performing a division operation on the total sequence number of the starting physical block and i; Obtaining a sum of the first quantity and the physical block sequence number of the starting physical block in the sector where the first quantity is located, performing a modulo operation on the sum and i-1 to obtain a first storage physical block sequence number; The product of the difference between the first device serial number of the access control device and one and the rolling code length is obtained, and a modulo operation is performed on the product and j to obtain a first storage starting byte number.

2. The access card verification system according to claim 1, characterized in that: The access card verification system also includes a server; The server is configured to, in response to a change operation, move the rolling code value stored in the first storage position in the target access control card to a second storage position, where the second storage position is a position of a second device sequence number of rolling code values ​​among a plurality of rolling code values ​​having a length of the rolling code length and stored sequentially starting from the physical block with the total sequence number of the starting physical block; and send a change instruction to the access control device; The access control device is used to change the first device serial number of the access control device to the second device serial number indicated by the change instruction in response to the change instruction.

3. The access card verification system according to claim 1, characterized in that: The access control device is also used for: Acquire access card authority information in a database in the access control device, the access card authority information being used to indicate an access card that can pass identity authentication, and the access card authority information being stored in the database in the form of an encrypted string; Decrypting the access card permission information to obtain the decrypted access card permission information; If the target access card is an access card that can pass identity authentication, then execute the steps of obtaining the first device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value of the target access card, and the rolling code length in response to the card swiping event triggered by the target access card.

4. The access card verification system according to claim 1, characterized in that: The access control device is also used for: If the first rolling code value is not read from the access control device, determining that the target access control card is a non-duplicate access control card, generating a fourth rolling code value and storing it in the first storage location and the access control device; If the first rolling code value is read from the access control device, a step of determining whether the first rolling code value is consistent with a second rolling code value stored in the access control device for the target access control card is performed.

5. A method for verifying an access card, characterized in that: Applied to access control equipment, the method includes: In response to the user's input operation, the first device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value of the target access control card and the rolling code length are set in the access control device, the rolling code values ​​of multiple access control devices are stored in the target access control card, each of the access control devices is located at a different position, the total serial number of the starting physical block storing the rolling code value of each access control device in the target access control card is the same, the rolling code length of the rolling code value stored in the target access control card by each access control device is the same, the rolling code value stored in the target access control card by each access control device is stored in sequence according to the size of the first device serial number of each access control device, the target access control card includes multiple sectors, each sector includes i physical blocks, and each physical block includes j bytes; In response to a card swiping event triggered by a target access control card, obtaining a first device serial number of the access control device, a total serial number of a starting physical block storing a rolling code value of the target access control card, and a rolling code length; Calculate a first storage position of a first device sequence number of rolling code values ​​among a plurality of rolling code values ​​having a length of the rolling code length and stored sequentially starting from the physical block having the total sequence number of the starting physical block; Read data having a length of the rolling code length from the first storage position as a first rolling code value; If the first rolling code value is consistent with the second rolling code value stored in the access control device for the target access control card, the target access control card is determined to be a non-copy access control card, and the first rolling code value stored in the target access control card is updated to a third rolling code value, and the second rolling code value stored in the access control device is updated to the third rolling code value; The calculating of the first storage position of the first device sequence number rolling code value among the multiple rolling code values ​​having a length of the rolling code length and stored sequentially starting from the physical block having the total sequence number of the starting physical block comprises: Obtain a sum of the first quantity and the physical block sequence number of the starting physical block in the sector where it is located, divide the sum by i-1, and add the value obtained by the division operation to the sector number of the sector where the starting physical block is located to obtain a first storage sector number; wherein the first quantity is obtained by obtaining the product of the difference between the first device sequence number of the access control device minus one and the rolling code length, and dividing the product by j; the physical block sequence number of the starting physical block in the sector where it is located is obtained by performing a modulo operation on the total sequence number of the starting physical block and i; the sector number of the sector where the starting physical block is located is obtained by performing a division operation on the total sequence number of the starting physical block and i; Obtaining a sum of the first quantity and the physical block sequence number of the starting physical block in the sector where the first quantity is located, performing a modulo operation on the sum and i-1 to obtain a first storage physical block sequence number; The product of the difference between the first device serial number of the access control device and one and the rolling code length is obtained, and a modulo operation is performed on the product and j to obtain a first storage starting byte number.

6. The method according to claim 5, characterized in that The method further comprises: In response to the change instruction, changing the first device serial number of the access control device to the second device serial number indicated by the change instruction; Among them, the change instruction is sent to the access control device when the rolling code value stored in the first storage position in the target access control card is moved to the second storage position, and the second storage position is the position of the second device serial number rolling code value among the multiple rolling code values ​​with a length of the rolling code length, which are stored sequentially starting from the physical block with the total serial number of the starting physical block.

7. The method according to claim 5, characterized in that The method further comprises: Acquire access card authority information in a database in the access control device, the access card authority information being used to indicate an access card that can pass identity authentication, and the access card authority information being stored in the database in the form of an encrypted string; Decrypting the access card permission information to obtain the decrypted access card permission information; If the target access card is an access card that can pass identity authentication, then execute the steps of obtaining the first device serial number of the access control device, the total serial number of the starting physical block storing the rolling code value of the target access card, and the rolling code length in response to the card swiping event triggered by the target access card.

8. The method according to claim 5, characterized in that The method further comprises: If the first rolling code value is not read from the access control device, determining that the target access control card is a non-duplicate access control card, generating a fourth rolling code value and storing it in the first storage location and the access control device; If the first rolling code value is read from the access control device, a step of determining whether the first rolling code value is consistent with a second rolling code value stored in the access control device for the target access control card is performed.

Citation Information

Patent Citations

  • Anti-copying encryption method of IC cards of access control system

    CN108280504A

  • Anti-copy and anti-tamper method for IC card

    CN109753837A

  • Updating method and device for authorization data in access control machine and electronic equipment

    CN115424381A

  • Vehicle remote control key matching method and system

    CN117351595A

  • Entrance guard card verification method, system and device

    CN118072427A