CN109903433B - Access control system and access control method based on face recognition - Google Patents

Access control system and access control method based on face recognition Download PDF

Info

Publication number
CN109903433B
CN109903433B CN201910097904.3A CN201910097904A CN109903433B CN 109903433 B CN109903433 B CN 109903433B CN 201910097904 A CN201910097904 A CN 201910097904A CN 109903433 B CN109903433 B CN 109903433B
Authority
CN
China
Prior art keywords
access control
command
face
camera
control unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910097904.3A
Other languages
Chinese (zh)
Other versions
CN109903433A (en
Inventor
罗康
董逢华
郭懿嵩
何涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Tianyu Julian Network Co ltd
Original Assignee
Wuhan Tianyu Julian Network Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Tianyu Julian Network Co ltd filed Critical Wuhan Tianyu Julian Network Co ltd
Priority to CN201910097904.3A priority Critical patent/CN109903433B/en
Publication of CN109903433A publication Critical patent/CN109903433A/en
Application granted granted Critical
Publication of CN109903433B publication Critical patent/CN109903433B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides an access control system and an access control method based on face recognition, wherein the system comprises the following steps: the camera is used for sending a face image to the micro control unit after acquiring a first session key between the camera and the intelligent gateway; the micro-control unit is used for calculating a face characteristic value based on the received face image; sending a face recognition command to the secure element; the safety element is used for comparing the face characteristic value in the received face recognition command with the characteristic value in the face database, obtaining a face recognition result according to the comparison result and returning the face recognition result to the micro control unit; the micro-control unit is also used for receiving the face recognition result and sending an access control operation command to the intelligent access control; and the intelligent access control is used for decrypting the received access control operation command by using the second session key after the second session key is obtained, and performing access control operation according to the obtained face recognition result. By applying the embodiment of the invention, the safety of the access control system is improved.

Description

Access control system and access control method based on face recognition
Technical Field
The invention relates to the field of intelligent access control, in particular to an access control system and an access control method based on face recognition.
Background
The access control system is suitable for various places, such as living communities, office buildings, factories, banks, machine rooms and the like, and can identify registered users for release and refuse non-registered users to enter. At present, most of access control systems adopt modes such as card swiping, password or fingerprint to identify the identity of a user, and along with the rapid development of a face recognition technology, a safer face recognition access control system needs to be provided.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides an access control system and an access control method based on face recognition so as to improve the safety of the access control system.
The invention is realized by the following steps:
in a first aspect, the invention provides a door control system based on face recognition, which comprises an intelligent gateway, a camera and an intelligent door control, wherein the intelligent gateway comprises a micro-control unit and a safety element,
the camera is used for sending a face image to the micro control unit after a first session key between the camera and the intelligent gateway is obtained;
the micro control unit is used for receiving the face image sent by the camera and calculating a face characteristic value based on the face image; sending a face recognition command to the secure element; the face recognition command comprises the face characteristic value;
the safety element is used for comparing a face characteristic value in the received face recognition command with a characteristic value in a preset face database, obtaining a face recognition result according to the comparison result and returning the face recognition result to the micro control unit;
the micro control unit is further used for receiving a face recognition result returned by the safety element aiming at the face recognition command; obtaining an access control operation command, and sending the access control operation command to the intelligent access control; the access control operation command is obtained by encrypting the face recognition result by using a second session key; the second session key is a session key between the intelligent gateway and the intelligent access control;
and the intelligent access control is used for receiving the access control operation command after the second session key is obtained, decrypting the received access control operation command by using the second session key to obtain a face recognition result, and performing access control operation according to the face recognition result.
Optionally, the micro control unit calculates a face feature value based on the face image, specifically:
carrying out face detection on the face image;
if the face image is detected to have one or more face regions, cutting the face image to obtain a face sub-image with a preset size; and calculating a face characteristic value for the face subgraph.
Optionally, the micro control unit is further configured to terminate execution of face feature value calculation based on the face image if a plurality of face regions are detected in the face image; or, cutting each face region to obtain each face subgraph with a preset size; calculating a face characteristic value for each face subgraph;
the safety element compares the face characteristic value in the received face recognition command with the characteristic value in a preset face database, and the method specifically comprises the following steps: if the face recognition command comprises a plurality of face characteristic values, comparing each face characteristic value with a characteristic value in a preset face database, if one comparison is successful, judging that the comparison result is successful, otherwise, judging that the comparison result is unsuccessful.
Optionally, the face database stores a corresponding relationship between the feature value and the user ID, and the secure element obtains a face recognition result according to the comparison result, specifically:
if the comparison result is successful, obtaining a target user ID corresponding to a target characteristic value successfully compared with the face characteristic value, searching a target authority corresponding to the target user ID in a preset authority table, and taking the target authority and the comparison result as a face recognition result;
and if the comparison result is unsuccessful, taking the comparison result as a face recognition result.
Optionally, the camera is specifically configured to obtain the first session key with the intelligent gateway in the following manner:
generating a camera random number, and sending a gateway identity authentication command to the micro control unit, wherein the gateway identity authentication command comprises the camera random number;
receiving a response command returned by the micro control unit, and carrying out identity verification on the intelligent gateway by using response data in the response command;
if the intelligent gateway is confirmed to pass the identity authentication, sending a camera identity authentication command to the micro control unit, so that the micro control unit obtains a first session key encrypted by a camera public key after confirming that the camera passes the identity authentication, and sending the encrypted first session key to the camera; the camera identity authentication command comprises a camera public key;
and decrypting the received encrypted first session key by using a prestored camera private key to obtain the first session key.
Optionally, the response data includes a gateway certificate, a gateway nonce, and a camera nonce signature value generated based on the camera nonce; the camera performs identity verification on the intelligent gateway by using the response data in the response command, specifically:
decrypting the camera random number signature value by using an intelligent gateway public key in a gateway certificate to obtain a first verification value, and if the camera random number is equal to the first verification value, determining a gateway verification result as that the intelligent gateway passes identity verification; otherwise, determining that the gateway authentication result is that the intelligent gateway fails the identity authentication.
Optionally, the micro control unit is specifically configured to obtain the first session key encrypted by the camera public key in the following manner:
sending a verification command to the secure element based on the received camera identity authentication command; receiving a camera verification result returned by the security element aiming at the verification command; and if the camera passes the authentication result, receiving a first session key which is sent by the security element and encrypted by a camera public key.
Optionally, the intelligent access control is further configured to encrypt an access control operation result with the second session key after the access control operation is performed, so as to obtain an access control operation response command; sending the access control operation response command to the micro control unit;
and the micro control unit is also used for receiving the access control operation response command, and decrypting the access control operation response command by using the second session key through the security element to obtain an access control decryption result.
Optionally, the micro control unit decrypts the access control operation response command by using the second session key through the security element to obtain an access control decryption result, which specifically includes: sending a decryption request for decrypting the access control operation response command to the security element; receiving an access control decryption result returned by the security element aiming at the decryption request; the decryption request comprises a first command header and a first encryption field in the entrance guard operation response command;
the security element is further configured to decrypt, after receiving the decryption request, the first encrypted field in the decryption request with the encrypted session key in the second session key to obtain an access control operation result and a first MAC; performing MAC verification based on the first command header, the access control operation result and the first MAC, and if the MAC verification result is that the MAC verification is passed, taking the access control operation result and the MAC verification result as access control decryption results; if the MAC verification result is that the MAC verification is not passed, taking the MAC verification result as an access control decryption result; and returning the access control decryption result to the micro control unit.
Optionally, the micro control unit is further configured to:
if the received access control decryption result is that the access control decryption result does not pass the MAC verification, clearing the session key, and setting the state of the intelligent access control to be an unauthenticated state;
and sending an identity authentication request to the intelligent access control so that the intelligent access control returns a gateway identity authentication command to the micro control unit aiming at the identity authentication request.
Optionally, the micro control unit obtains an access control operation command, specifically: sending an encryption request to the secure element, wherein the encryption request comprises a second command header and a face recognition result; obtaining a second encryption field returned by the security element aiming at the encryption request, and forming an access control operation command by using the second encryption field and the second command head;
the secure element is further configured to perform encryption calculation on a second command header and a face recognition result by using the MAC session key in the second session key after receiving the encryption request, so as to obtain a second ciphertext; determining a second MAC based on the obtained second ciphertext; encrypting the face recognition result and the second MAC by using an encryption session key in the second session key to obtain a second encryption field; returning the second encrypted field to the micro control unit.
Optionally, the system further includes a cloud platform, and the micro control unit is further configured to: and acquiring the state information of the camera and the intelligent access control, and sending the acquired state information to the cloud platform.
Optionally, the system is provided with a plurality of entrance guards, the intelligent entrance guard does the entrance guard with incidence relation among the plurality of entrance guards.
Optionally, the association relationship between the camera and the door lock is pre-stored in an equipment association table, the equipment association table is stored in the secure element, and the micro control unit sends the door lock operation request to the intelligent door lock, specifically:
sending a search request to a security element, wherein the search request comprises an identifier of the camera; the safety element searches the equipment association table according to the search request to obtain a target identifier of the intelligent access control associated with the identifier of the camera, and the obtained target identifier is returned to the micro control unit;
and receiving a target identifier returned by the secure element aiming at the search request, and sending the access control operation request to the intelligent access control with the target identifier.
Optionally, the micro control unit is further configured to send an image acquisition command to the camera after detecting a user instruction for adding a face image record; wherein the image acquisition command is obtained by encrypting the user instruction with the first session key; receiving an image to be added sent by the camera aiming at the image acquisition command; calculating a face characteristic value based on the image to be added, obtaining a user ID corresponding to the image to be added, and sending an adding command to the safety element; the adding command comprises a face characteristic value of the image to be added and a user ID corresponding to the face characteristic value;
the camera is further used for decrypting the received image acquisition command by using the first session key after receiving the image acquisition command to obtain a user instruction; sending an image to be added to the micro control unit according to the user instruction;
and the safety element is also used for correspondingly adding the face characteristic value of the image to be added in the adding command and the corresponding user ID thereof to the face database after receiving the adding command.
Optionally, the secure element is further configured to send a prompt message for prompting whether to add success to the micro control unit.
Optionally, the system further comprises a mobile terminal,
the mobile terminal is used for sending a device management command to the micro control unit after obtaining a third session key between the mobile terminal and the micro control unit; and after receiving the equipment management command, the micro control unit manages the camera and/or the intelligent access control based on the equipment management command.
In a second aspect, the present invention provides a door access control method based on face recognition, which is applied to any one of the above systems, and the method includes:
after the camera acquires a first session key between the camera and the intelligent gateway, the camera sends a face image to the micro control unit;
the micro control unit receives the face image sent by the camera and calculates a face characteristic value based on the face image; sending a face recognition command to the secure element; the face recognition command comprises the face characteristic value;
the safety element compares the face characteristic value in the received face recognition command with the characteristic value in a preset face database, obtains a face recognition result according to the comparison result, and returns the face recognition result to the micro control unit;
the micro control unit receives a face recognition result returned by the safety element aiming at the face recognition command; obtaining an access control operation command, and sending the access control operation command to the intelligent access control; the access control operation command is obtained by encrypting the face recognition result by using a second session key; the second session key is a session key between the intelligent gateway and the intelligent access control;
and after obtaining the second session key, the intelligent access control receives the access control operation command, decrypts the received access control operation command by using the second session key to obtain a face recognition result, and performs access control operation according to the face recognition result.
The invention has the following beneficial effects: by applying the embodiment of the invention, the safety element can be integrated in the intelligent gateway, and the face recognition result can be obtained by comparing the characteristic values of the safety element, so that the safety of the face recognition result is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of an access control system based on face recognition according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of an access control method based on face recognition according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problems of the prior art, the embodiment of the invention provides an access control system and an access control method based on face recognition.
Referring to fig. 1, fig. 1 is a view of an access control system based on face recognition, which includes an intelligent gateway, a camera and an intelligent access control, wherein the intelligent gateway includes a micro control unit and a security element,
the camera is used for sending a face image to the micro control unit after a first session key between the camera and the intelligent gateway is obtained;
the micro control unit is used for receiving the face image sent by the camera and calculating a face characteristic value based on the face image; sending a face recognition command to the secure element; the face recognition command comprises the face characteristic value;
the safety element is used for comparing a face characteristic value in the received face recognition command with a characteristic value in a preset face database, obtaining a face recognition result according to the comparison result and returning the face recognition result to the micro control unit;
the micro control unit is further used for receiving a face recognition result returned by the safety element aiming at the face recognition command; obtaining an access control operation command, and sending the access control operation command to the intelligent access control; the access control operation command is obtained by encrypting the face recognition result by using a second session key; the second session key is a session key between the intelligent gateway and the intelligent access control;
and the intelligent access control is used for receiving the access control operation command after the second session key is obtained, decrypting the received access control operation command by using the second session key to obtain a face recognition result, and performing access control operation according to the face recognition result.
The face image may be an image including a face, the face image may include one or more faces, and the format of the face image is not limited in the present invention, and may be, for example, JPEG format, bmp format, or the like. The camera can preset fixed time duration in real time or at intervals, and can also send a face image to the micro control unit after receiving a request command sent by the micro control unit. The encryption transmission of the face image can be selected, and the encryption transmission of the face image can also be omitted, which is not limited by the present invention.
By applying the embodiment of the invention, the safety element can be integrated in the intelligent gateway, and the face recognition result can be obtained by comparing the characteristic values of the safety element, so that the safety of the face recognition result is improved.
To protect the security of the private data, the face database may be stored in a secure element of the intelligent gateway. In order to improve the storage utilization rate and the speed of face comparison, the face database may not directly store the face image, but store the face image feature value.
In one implementation, the micro control unit calculates a face feature value based on the face image, specifically:
carrying out face detection on the face image;
if the face image is detected to have one or more face regions, cutting the face image to obtain a face sub-image with a preset size; and calculating a face characteristic value for the face subgraph.
The micro control unit may perform Face Detection on the received Face image by using an MTCNN (Joint Face Detection and Alignment using Multi-task shell compensated Networks) Face Detection algorithm, S3FD, SSD, and other Face Detection algorithms.
If only one face is detected in the face image, the operation is performed by one person, and then the face image can be cut to obtain a face sub-image with a preset size; and face subgraphs can be calculated by using the Mobilefacenet to obtain face characteristic values. The preset size can be preset according to requirements, and the face subgraph comprises a face. The safety element can compare the received face characteristic values with characteristic values in a face database one by one, and if the characteristic values which are successfully compared exist, the comparison result is judged to be successful; otherwise, judging the comparison result as unsuccessful. The Mobilefacenet is a deep learning method suitable for an embedded environment, and can save the calculation time of characteristic values.
The face database may store a corresponding relationship between the feature value and the user ID, and the secure element obtains a face recognition result according to the comparison result, specifically:
if the comparison result is successful, obtaining a target user ID corresponding to a target characteristic value successfully compared with the face characteristic value, searching a target authority corresponding to the target user ID in a preset authority table, and taking the target authority and the comparison result as a face recognition result;
and if the comparison result is unsuccessful, taking the comparison result as a face recognition result.
By applying the example of the present invention, after the comparison is successful, the user ID (identification) may also be returned. And searching the access control operation authority of the user in the authority table according to the user ID to be used as a target authority, so that the target authority in the face recognition result accords with the access control operation authority of the recognized user. In addition, the safety of privacy data such as face characteristic values and the like and the accuracy of recognition results can be ensured by carrying out face recognition in the safety element. In addition, the face database stored in the safety element can ensure the safety of the privacy data of the user. The face image is replaced by the face characteristic value, so that the storage space can be reduced, and the time consumed by face recognition can be reduced.
In another implementation manner, if a plurality of face regions are detected in the face image, the micro control unit may terminate execution of calculating a face feature value based on the face image; or, each face region can be cut to obtain each face subgraph with a preset size; and calculating the face characteristic value of each face subgraph.
Correspondingly, the safety element compares the face characteristic value in the received face recognition command with the characteristic value in a preset face database, and the specific steps are as follows: if the face recognition command comprises a plurality of face characteristic values, comparing each face characteristic value with a characteristic value in a preset face database, if one comparison is successful, judging that the comparison result is successful, otherwise, judging that the comparison result is unsuccessful.
If the target authority searched by the safety element is multiple, only one target authority with the highest or lowest authority or randomly selected and the comparison result can be used as a face recognition result; or, all the obtained target authorities and the comparison result may be used as the face recognition result.
If the face recognition result obtained by the intelligent access control contains a plurality of target permissions, the access control operation can be carried out according to the target permission with the highest or the lowest permission or randomly selected.
The camera and the intelligent access control can be regarded as external equipment except the intelligent gateway, the system can also comprise other external equipment such as an internet of things terminal, a mobile terminal and a cloud platform, the external equipment and a Micro Control Unit (MCU) can send commands to each other, the Micro control Unit and a Security Element (SE) can also send commands to each other, the commands can comprise a command head and data, and the data in the commands can be encrypted data or unencrypted data; the format of the command header may be set in advance according to requirements, for example, the command header may contain information such as a command type, a command parameter, a command counter, and a command length, where the command length is used to specify the length of data contained in the command. The command counter can be maintained by a command sender, the count value returns to zero after the bidirectional authentication is successful, and then the count value is accumulated every time an encryption command is sent, so that the replay attack is prevented.
The secure element may exist in a chip form and may have an arithmetic capability, and in order to prevent malicious analysis attacks by other devices and protect data security, an encryption/decryption logic circuit may be disposed in the chip, so that the secure element may complete asymmetric key encryption/decryption and/or symmetric key encryption/decryption processes to improve communication security. To improve the security of the intelligent gateway, a security element may be provided in the intelligent gateway.
Specifically, the external device and the micro control unit may communicate in a wired or wireless manner. There may be multiple external devices, and the WIreless communication mode includes one or more of WIFI (WIreless-Fidelity), bluetooth, Zigbee (Zigbee protocol), NFC (near field communication), and the like. The security element of the intelligent gateway can be connected with the micro control unit through an SPI (Serial Peripheral Interface) Interface, the micro control unit can be used as a host, and the security element can be used as a slave.
In order to improve the security of communication, before sending data or a command to the intelligent gateway, the external device may first obtain a session key with the intelligent gateway, where the session key between the camera and the intelligent gateway may be referred to as a first session key; the session key between the intelligent gateway and the intelligent entrance guard can be called a second session key; and so on.
The camera is specifically configured to obtain a first session key with the intelligent gateway in the following manner:
generating a camera random number, and sending a gateway identity authentication command to the micro control unit, wherein the gateway identity authentication command comprises the camera random number;
receiving a response command returned by the micro control unit, and carrying out identity verification on the intelligent gateway by using response data in the response command;
if the intelligent gateway is confirmed to pass the identity authentication, sending a camera identity authentication command to the micro control unit, so that the micro control unit obtains a first session key encrypted by a camera public key after confirming that the camera passes the identity authentication, and sending the encrypted first session key to the camera; the camera identity authentication command comprises a camera public key;
and decrypting the received encrypted first session key by using a prestored camera private key to obtain the first session key.
The camera random number may be generated by the camera using a random function or a hash function. The length of the camera random number may be preset, and may be 16 bytes, 32 bytes, and the like, for example.
Specifically, the response data may include a gateway certificate, a gateway nonce, and a camera nonce signature value generated based on the camera nonce. In order for the micro control unit to obtain safe and reliable response data, the micro control unit may send an acquisition command to the secure element based on the received gateway identity authentication command, and a data portion of the acquisition command may include a camera random number; the acquisition command may be used to acquire response data such as a gateway certificate, a gateway random number, and a camera random number signature value from the secure element. After receiving the acquisition command, the secure element may generate a camera random number signature value based on the camera random number in the acquisition command, obtain a gateway certificate, generate a gateway random number, and return the gateway certificate, the gateway random number, and the camera random number signature value to the micro control unit as response data.
Furthermore, the micro control unit may generate a response command based on the response data, and specifically may be: acquiring a preset command head, and filling the content of the command head according to the response data to obtain the command head of the response command; and taking the response data as the data part of the response command so as to obtain the response command. The specific content of the command header filled with the response data may be in an existing manner, and the details of the present invention are not repeated herein.
In one implementation, the generating, by the security element, a camera random number signature value may specifically be:
and signing the camera random number by using a prestored intelligent gateway private key to obtain a camera random number signature value.
The intelligent gateway private key can be pre-stored in the secure element, and the invention does not limit the specific signature mode, and can be the existing digital signature algorithm or the signature algorithm designed by the designer according to the requirements. Alternatively, in another embodiment, the camera random number signature value may be obtained by Base64 encoding or ASCII (American Standard Code for Information exchange) encoding of the external device random number.
The lengths of the gateway random number and the camera random number generated by the security element may be the same or different, and the way of generating the gateway random number may be: the secure element generates a gateway random number using a preset random function or hash function. The length of the gateway random number may be specified in advance, and may be, for example, 16 bytes, 32 bytes, 64 bytes, or the like.
The gateway certificate may be stored in the secure element in advance, and the secure element may directly obtain the gateway certificate stored in the secure element, or in other embodiments, the gateway certificate may also be stored in a device other than the secure element, and the secure element may obtain the gateway certificate from the other device. In order to improve the security of the gateway certificate, it may be preferable that the gateway certificate may be stored in the secure element in advance. The specific format of the gateway certificate is not limited in the present invention, and for example, the gateway certificate may be a public key certificate adopting an x.509 format, may also be an SSL (Secure socket layer) certificate, or may also be a gateway certificate in a custom format, and the gateway certificate may include an intelligent gateway public key.
For example, the micro control unit may receive a gateway identity authentication command sent by the intelligent access control, a data portion of the gateway identity authentication command may include an intelligent access control random number generated by the intelligent access control, and further, after the intelligent access control and the intelligent gateway pass authentication of both sides, the intelligent access control may obtain a second session key encrypted by the intelligent access control public key, and finally, decrypt the second session key to obtain the second session key.
The camera performs identity verification on the intelligent gateway by using the response data in the response command, which may specifically be:
decrypting the camera random number signature value by using an intelligent gateway public key in a gateway certificate to obtain a first verification value, and if the camera random number is equal to the first verification value, determining a gateway verification result as that the intelligent gateway passes identity verification; otherwise, determining that the gateway authentication result is that the intelligent gateway fails the identity authentication.
By applying the embodiment of the invention, the security element can be integrated in the intelligent gateway, and the gateway certificate can be obtained through the security element, the gateway random number and the signature value of the random number of the external equipment are generated, so that the response data provided by the intelligent gateway to the external equipment is prevented from being falsified, and the security of the intelligent gateway is improved.
After the intelligent gateway is determined not to pass the identity authentication, a gateway identity authentication command can be sent to the intelligent gateway again;
after the intelligent gateway is determined to pass the identity authentication, a camera identity authentication command can be sent to the micro-control unit, and the data part of the command can contain a camera certificate and a gateway random number signature value. The camera certificate may include a camera public key; the gateway random number signature value may be generated by the camera based on the gateway random number in the response command, and specifically may be: and signing the gateway random number by using a pre-stored camera private key to obtain a gateway random number signature value, or performing Base64 coding or ASCII coding on the gateway random number to obtain the gateway random number signature value. Or other reasonable ways may be used to generate the gateway nonce signature value.
The micro control unit, after receiving the camera identity authentication command, may be specifically configured to obtain the first session key encrypted with the camera public key in the following manner:
sending a verification command to the secure element based on the received camera identity authentication command; receiving a camera verification result returned by the security element aiming at the verification command; and if the camera passes the authentication result, receiving a first session key which is sent by the security element and encrypted by a camera public key.
And after receiving the verification command sent by the micro control unit, the safety element can perform identity verification on the camera and return a camera verification result to the micro control unit.
If the gateway random number signature value is obtained by signing the gateway random number by using a prestored camera private key, the security element performs identity verification on the camera, and specifically, the identity verification can be as follows:
decrypting the gateway random number signature value by using a camera public key in a camera certificate to obtain a second verification value, and if the gateway random number is equal to the second verification value, determining that the camera verification result is that the camera passes identity verification; otherwise, determining that the camera authentication result is that the camera fails the identity authentication.
In another implementation manner, if the gateway random number signature value is obtained by performing Base64 encoding or ASCII encoding on the gateway random number, the security element performs authentication on the camera, which may specifically be:
decoding the gateway random number signature value to obtain a second verification value, and if the gateway random number is equal to the second verification value, determining that the camera verification result is that the camera passes the identity verification; otherwise, determining that the camera authentication result is that the camera fails the identity authentication.
In order to facilitate subsequent secure communication, if the authentication result is that the camera passes the identity authentication, the secure element may further generate a random number as a first session key; in order to avoid tampering of the session key, the secure element may encrypt the first session key with a camera public key in the camera certificate, and return the encrypted first session key to the micro control unit; the micro control unit can thus obtain the first session key that has been encrypted with the camera public key and send the encrypted first session key to the camera.
To further ensure communication security, the generated session keys, including the first session key, the second session key, etc., may be valid for only one session duration. When either party of the communication requests to stop the session or does not perform the communication for a long time (the specific time duration can be customized by the user), the other party can judge that the session period is ended and set the session key as invalid. The authentication may be re-performed and a new session key generated before the next requested communication, i.e. before entering the next session.
The session key may include two parts, respectively: the encrypted session key and the MAC (Message authentication code) session key may have the same or different byte lengths, and preferably, for the convenience of simplifying the encrypted communication process, the byte lengths of the encrypted session key and the MAC session key may be set to be the same, for example, the session key may have a total of 32 bytes, the first 16 bytes may be the encrypted session key, and the last 16 bytes may be the MAC session key.
Before the camera communicates with the intelligent gateway, the camera and the intelligent gateway can both pass the authentication of the other party, so that the two parties can obtain the same first session key, the first session key can be used for communication between the camera and the intelligent gateway, and non-encryption communication or encryption communication with MAC can be carried out according to the requirement.
Similarly, before the intelligent entrance guard communicates with the intelligent gateway, both the intelligent entrance guard and the intelligent gateway can pass the authentication of the other party, so that both the intelligent entrance guard and the intelligent gateway can obtain the same second session key, the second session key can be used for communication between the intelligent entrance guard and the intelligent gateway, and unencrypted communication or encrypted communication with MAC can be performed according to the requirement.
By applying the embodiment of the invention, the bidirectional identity authentication between the intelligent gateway and the external equipment can be realized, and the reliability of the identities of both communication parties is ensured; a session key can be generated, so that subsequent encrypted communication can be performed by both identity authentication parties, and the communication safety is improved; the gateway certificate and the intelligent gateway private key can be stored in the security element, so that the storage security of confidential data and private data can be ensured; and the security can be further improved by generating random numbers by the security element, and carrying out data encryption and decryption processes and identity authentication.
After the intelligent entrance guard and the intelligent gateway both pass the identity authentication of the other party, the two parties can have the same second session key, and further can carry out encryption communication by using the second session key, so that the intelligent gateway can obtain the entrance guard operation result of the intelligent entrance guard conveniently and strengthen the management and control of the intelligent entrance guard; sending the access control operation response command to the micro control unit;
and the micro control unit is also used for receiving the access control operation response command, and decrypting the access control operation response command by using the second session key through the security element to obtain an access control decryption result.
The micro control unit can decrypt the access control operation response command by the second session key through the safety element, and the safety protection performance of the safety element is high, so that the safety of the decryption process can be improved, and the access control decryption result obtained by the micro control unit is safer and more reliable. If the security element determines that the access control operation response command is safe, the access control decryption result can include an access control operation result; otherwise, the access control operation result is not included; the reliability and the safety of the access control operation result obtained by the micro control unit are ensured.
In other implementation manners, the micro control unit may also decrypt the access control operation response command by using the second session key by itself to obtain an access control decryption result.
Access operations include, but are not limited to, opening an access door, closing an access door, and the like. The access control operation result comprises whether the access control operation is successful. The access control operation response command is encrypted by using the second session key, and the access control operation result can be checked only by decrypting the access control operation response command by using the second session key, so that the safe transmission of the access control operation result is ensured, and the communication safety is improved.
The micro control unit decrypts the access control operation response command by using the second session key through the security element to obtain an access control decryption result, which specifically can be:
sending a decryption request for decrypting the access control operation response command to the security element; receiving an access control decryption result returned by the security element aiming at the decryption request; the decryption request comprises a first command header and a first encryption field in the entrance guard operation response command;
the security element is further configured to decrypt, after receiving the decryption request, the first encrypted field in the decryption request with the encrypted session key in the second session key to obtain an access control operation result and a first MAC; performing MAC verification based on the first command header, the access control operation result and the first MAC, and if the MAC verification result is that the MAC verification is passed, taking the access control operation result and the MAC verification result as access control decryption results; if the MAC verification result is that the MAC verification is not passed, taking the MAC verification result as an access control decryption result; and returning the access control decryption result to the micro control unit.
The first command header and the first encryption field are respectively a command header and a data part in the response command of the entrance guard operation. The camera can fill a preset command head according to the data content of the access control operation result to obtain a first command head; and carrying out encryption calculation on the first command header and the access control operation result by using the MAC session key in the session key, and taking the obtained ciphertext as the first MAC. Encrypting the access control operation result and the first MAC by using an encryption session key in the session key, and taking the obtained ciphertext as a first encryption field; the access control operation response command formed by the first command head and the first encryption field can be sent to the intelligent gateway, and therefore the micro control unit can receive the access control operation response command.
The safety element performs MAC verification based on the first command header, the access control operation result and the first MAC, and specifically comprises the following steps:
carrying out encryption calculation on the first command header and the access control operation result by using an MAC session key in the session key to obtain a first ciphertext, determining a first verification message authentication code based on the obtained first ciphertext, and comparing whether the first verification message authentication code is the same as the first MAC or not; if the MAC verification result is the same as the MAC verification result, determining that the MAC verification result passes the MAC verification; otherwise, determining that the MAC verification result is not MAC verification.
The security element can decrypt the first encrypted field by using the encrypted session key to obtain an access control operation result and a first MAC; and then, carrying out encryption calculation on the first command header and the access control operation result by using the MAC session key, determining a first verification message authentication code based on the obtained first ciphertext, and comparing the first verification message authentication code with the first MAC, thereby realizing the integrity of verification data and ensuring the reliability of the data. Determining a first verification message authentication code based on the obtained first ciphertext, which may be: the last 16 bytes/32 bytes of the first cipher text are determined as the first verification message authentication code.
If the first command header and the first encryption field pass MAC verification, the access control operation response command received by the micro control unit is reliable, and then the security element can take an access control operation result and an MAC verification result as an access control decryption result and send the access control decryption result to the micro control unit, so that the micro control unit can obtain an access control operation result; if the first command header and the first encryption field do not pass MAC verification, the access control operation response command received by the micro control unit is unreliable, and then the security element can only take the MAC verification result as an access control decryption result and send the access control decryption result to the micro control unit, so that the micro control unit is prevented from obtaining the unreliable access control operation result, the reliability of the access control operation result obtained by the intelligent gateway is improved, and the security control of the intelligent access control is realized.
In order to further increase the security of the communication, the micro control unit is further configured to:
if the received access control decryption result is that the access control decryption result does not pass the MAC verification, clearing the session key, and setting the state of the intelligent access control to be an unauthenticated state;
and sending an identity authentication request to the intelligent access control so that the intelligent access control returns a gateway identity authentication command to the micro control unit aiming at the identity authentication request.
By applying the embodiment of the invention, for the command requiring data encryption and MAC verification, if the intelligent gateway judges that the MAC verification is not passed, the session key is cleared, so that the next operation can be stopped, the state of the intelligent access control is set to be an unauthenticated state, so that the bidirectional identity authentication between the intelligent gateway and the intelligent access control is carried out again, and then the second session key is regenerated, so that the communication with unreliable intelligent access control is avoided, and the communication safety is improved.
In order to facilitate the micro control unit to obtain a safe access control operation command, the micro control unit obtains the access control operation command, and specifically comprises: sending an encryption request to the secure element, wherein the encryption request comprises a second command header and a face recognition result; obtaining a second encryption field returned by the security element aiming at the encryption request, and forming an access control operation command by using the second encryption field and the second command head;
the secure element is further configured to perform encryption calculation on a second command header and a face recognition result by using the MAC session key in the second session key after receiving the encryption request, so as to obtain a second ciphertext; determining a second MAC based on the obtained second ciphertext; encrypting the face recognition result and the second MAC by using an encryption session key in the second session key to obtain a second encryption field; returning the second encrypted field to the micro control unit;
the method for determining the second MAC based on the obtained second ciphertext is not limited in the present invention, and may be, for example: the last 16 bytes/32 bytes of the second cipher text are taken as the second MAC.
After the intelligent access control obtains the access control operation command, the intelligent access control can also decrypt the second encrypted field by using an encrypted session key in a second session key to obtain a face recognition result and a second MAC; performing MAC verification based on the second command header, the face recognition result and the second MAC, and if the MAC verification is determined to be passed, performing access control operation according to the face recognition result; if the MAC verification is determined not to be passed, the second session key can be cleared, the state of the intelligent gateway can be set to be an unauthenticated state, so that bidirectional identity authentication between the intelligent gateway and the external equipment is carried out again, and then the second session key is regenerated.
The encryption request may be used to request to obtain a second encryption field, and the smart access control performs MAC verification based on the second command header, the face recognition result, and the second MAC, which specifically may be: carrying out encryption calculation on the second command header and the face recognition result by using the MAC session key in the second session key to obtain a second verification message authentication code, and comparing whether the second verification message authentication code is the same as the second MAC; if the MAC verification result is the same as the MAC verification result, determining that the MAC verification result is the passing MAC verification; otherwise, determining that the MAC verification result is not MAC verification. The integrity of the data is verified by comparing the second verification message authentication code to the second MAC.
In order to facilitate uniform monitoring of the external devices, the system further includes a cloud platform, and the micro control unit is further configured to: and acquiring the state information of the camera and the intelligent access control, and sending the acquired state information to the cloud platform.
Before the cloud platform communicates with the micro control unit, the cloud platform can obtain a session key between the cloud platform and the intelligent gateway, and then the micro control unit can send state information of external equipment except the cloud platform, such as cameras, intelligent access controls, mobile terminals and the like, to the cloud platform, so that the cloud platform can monitor the external equipment in a unified manner.
The system can be provided with a plurality of cameras and a plurality of access controls, and can be respectively deployed at a plurality of positions, each camera can execute the technical scheme of the invention according to the process, the cameras can be associated with the access controls, and the association relationship can be 1:1, 1: m, N: 1, etc. The intelligent entrance guard can be an entrance guard with an incidence relation between a plurality of entrance guards and a camera sending the face image. For example, the cameras comprise a camera 1.1, a camera 12 and a camera 1.3; the gate inhibition comprises gate inhibition 3.1, gate inhibition 3.2 and gate inhibition 3.3; camera 1.1 is relevant with entrance guard 3.1, gathers face image through camera 1.1, through intelligent gateway's processing and face identification back, can control opening of intelligent entrance guard 3.1.
In order to facilitate management of the association relationship, the association relationship between the camera and the access control may be stored in an equipment association table in advance, in order to improve the security of the equipment association table, the equipment association table may be stored in the security element, and the micro control unit sends the access control operation command to the intelligent access control, specifically:
sending a search request to a security element, wherein the search request comprises an identifier of the camera; the safety element searches the equipment association table according to the search request to obtain a target identifier of the intelligent access control associated with the identifier of the camera, and the obtained target identifier is returned to the micro control unit;
and receiving a target identifier returned by the safety element aiming at the search request, and sending the access control operation command to the intelligent access control with the target identifier.
The identification of camera is used for only marking the camera, and the identification of entrance guard is used for only marking entrance guard. The device association table can be preset according to requirements, and can be modified through the micro control unit or the safety element according to the requirements after the setting, and the device association table is stored in the safety element due to the fact that the safety performance of the safety element is high, so that malicious tampering by other terminal devices except the intelligent gateway can be avoided, and the safety of the device association table is improved.
In order to facilitate management of the face database, the micro-control unit is further configured to send an image acquisition command to the camera after detecting a user instruction for adding a face image record; wherein the image acquisition command is obtained by encrypting the user instruction with the first session key; receiving an image to be added sent by the camera aiming at the image acquisition command; calculating a face characteristic value based on the image to be added, obtaining a user ID corresponding to the image to be added, and sending an adding command to the safety element; the adding command comprises a face characteristic value of the image to be added and a user ID corresponding to the face characteristic value;
the camera is further used for decrypting the received image acquisition command by using the first session key after receiving the image acquisition command to obtain a user instruction; sending an image to be added to the micro control unit according to the user instruction;
and the safety element is also used for correspondingly adding the face characteristic value of the image to be added in the adding command and the corresponding user ID thereof to the face database after receiving the adding command.
The image acquisition command may be obtained by the secure element encrypting the user instruction with said first session key. The way of calculating the face feature value based on the image to be added may refer to the aforementioned process of calculating the face feature value based on the face image, and is not described herein again.
The invention does not limit the user ID corresponding to the image to be added obtained by the micro control unit, and can be, for example: acquiring a user ID input by a user through a human-computer interaction interface of the micro control unit; or a user ID sent by an administrator through the mobile terminal.
The face database contains one or a combination of the following fields: user ID for unique identification, face feature value, operation authority assigned by the administrator. The default value of the operation authority is the visitor authority, and then more operation authorities can be distributed by an administrator.
When the intelligent gateway receives a user instruction for adding face image records, corresponding records can be added in the face database through the safety element, and the management of the face database is realized.
And the safety element is also used for sending prompt information for prompting whether the addition is successful to the micro control unit.
In one implementation, the system further includes a mobile terminal,
the mobile terminal is used for sending a device management command to the micro control unit after obtaining a third session key between the mobile terminal and the micro control unit; and after receiving the equipment management command, the micro control unit manages the camera and/or the intelligent access control based on the equipment management command.
The mobile terminal comprises a mobile phone, a tablet, a computer and the like, the mobile terminal can also communicate with a cloud platform in a wireless mode, the intelligent gateway is remotely accessed through the cloud platform, the state of the camera and/or the intelligent access control can be checked, the camera and/or the intelligent access control can be added or deleted, the parameters of the camera and/or the intelligent access control can be set, the records of a face database in a safety element can be added or deleted, data can be transmitted to the intelligent security gateway, and the like through the mobile terminal which obtains corresponding authority through identity authentication.
Corresponding to the above embodiment of the access control system based on face recognition, an embodiment of the present invention provides an access control method based on face recognition, which is shown in fig. 2 and is applied to the above access control system based on face recognition, and the method includes:
s101, after the camera obtains a first session key between the camera and the intelligent gateway, sending a face image to the micro control unit;
s102, the micro control unit receives the face image sent by the camera and calculates a face characteristic value based on the face image; sending a face recognition command to the secure element; the face recognition command comprises the face characteristic value;
s103, the safety element compares a face characteristic value in the received face recognition command with a characteristic value in a preset face database, obtains a face recognition result according to the comparison result, and returns the face recognition result to the micro control unit;
s104, the micro control unit receives a face recognition result returned by the safety element aiming at the face recognition command; obtaining an access control operation command, and sending the access control operation command to the intelligent access control; the access control operation command is obtained by encrypting the face recognition result by using a second session key; the second session key is a session key between the intelligent gateway and the intelligent access control;
and S105, after the intelligent access control obtains the second session key, receiving the access control operation command, decrypting the received access control operation command by using the second session key to obtain a face recognition result, and performing access control operation according to the face recognition result.
By applying the embodiment of the invention, the safety element can be integrated in the intelligent gateway, and the face recognition result can be obtained by comparing the characteristic values of the safety element, so that the safety of the face recognition result is improved.
Optionally, the micro control unit calculates a face feature value based on the face image, including:
carrying out face detection on the face image;
if the face image is detected to have one or more face regions, cutting the face image to obtain a face sub-image with a preset size; and calculating a face characteristic value for the face subgraph.
Optionally, the method further includes:
if a plurality of face areas are detected in the face image, the micro control unit stops executing the calculation of the face characteristic value based on the face image; or, cutting each face region to obtain each face subgraph with a preset size; calculating a face characteristic value for each face subgraph;
the safety element compares the face characteristic value in the received face recognition command with the characteristic value in a preset face database, and the method comprises the following steps: if the face recognition command comprises a plurality of face characteristic values, comparing each face characteristic value with a characteristic value in a preset face database, if one comparison is successful, judging that the comparison result is successful, otherwise, judging that the comparison result is unsuccessful.
Optionally, the face database stores a corresponding relationship between the feature value and the user ID, and the secure element obtains a face recognition result according to the comparison result, including:
if the comparison result is successful, obtaining a target user ID corresponding to a target characteristic value successfully compared with the face characteristic value, searching a target authority corresponding to the target user ID in a preset authority table, and taking the target authority and the comparison result as a face recognition result;
and if the comparison result is unsuccessful, taking the comparison result as a face recognition result.
Optionally, the camera obtains the first session key with the intelligent gateway by:
generating a camera random number, and sending a gateway identity authentication command to the micro control unit, wherein the gateway identity authentication command comprises the camera random number;
receiving a response command returned by the micro control unit, and carrying out identity verification on the intelligent gateway by using response data in the response command;
if the intelligent gateway is confirmed to pass the identity authentication, sending a camera identity authentication command to the micro control unit, so that the micro control unit obtains a first session key encrypted by a camera public key after confirming that the camera passes the identity authentication, and sending the encrypted first session key to the camera; the camera identity authentication command comprises a camera public key;
and decrypting the received encrypted first session key by using a prestored camera private key to obtain the first session key.
Optionally, the response data includes a gateway certificate, a gateway nonce, and a camera nonce signature value generated based on the camera nonce; the camera uses the response data in the response command to perform identity verification on the intelligent gateway, and the method comprises the following steps:
decrypting the camera random number signature value by using an intelligent gateway public key in a gateway certificate to obtain a first verification value, and if the camera random number is equal to the first verification value, determining a gateway verification result as that the intelligent gateway passes identity verification; otherwise, determining that the gateway authentication result is that the intelligent gateway fails the identity authentication.
Optionally, the micro control unit obtains the first session key encrypted by the camera public key in the following manner:
sending a verification command to the secure element based on the received camera identity authentication command; receiving a camera verification result returned by the security element aiming at the verification command; and if the camera passes the authentication result, receiving a first session key which is sent by the security element and encrypted by a camera public key.
Optionally, the method further includes:
after the intelligent entrance guard executes entrance guard operation, encrypting an entrance guard operation result by using the second session key to obtain an entrance guard operation response command; sending the access control operation response command to the micro control unit;
and the micro control unit receives the access control operation response command, decrypts the access control operation response command by using the second session key through the security element, and obtains an access control decryption result.
Optionally, the micro control unit decrypts the access control operation response command by using the second session key through the security element, so as to obtain an access control decryption result, including: sending a decryption request for decrypting the access control operation response command to the security element; receiving an access control decryption result returned by the security element aiming at the decryption request; the decryption request comprises a first command header and a first encryption field in the entrance guard operation response command;
the method further comprises the following steps: after receiving the decryption request, the security element decrypts the first encryption field in the decryption request by using the encryption session key in the second session key to obtain an access control operation result and a first MAC; performing MAC verification based on the first command header, the access control operation result and the first MAC, and if the MAC verification result is that the MAC verification is passed, taking the access control operation result and the MAC verification result as access control decryption results; if the MAC verification result is that the MAC verification is not passed, taking the MAC verification result as an access control decryption result; and returning the access control decryption result to the micro control unit.
And (4) optional. If the access control decryption result received by the micro control unit is not verified by the MAC, the method further comprises,
the micro control unit clears the session key and sets the state of the intelligent access control to be an unauthenticated state;
and the micro control unit sends an identity authentication request to the intelligent access control unit, so that the intelligent access control unit returns a gateway identity authentication command to the micro control unit aiming at the identity authentication request.
Optionally, the micro control unit obtains an access control operation command, specifically: sending an encryption request to the secure element, wherein the encryption request comprises a second command header and a face recognition result; obtaining a second encryption field returned by the security element aiming at the encryption request, and forming an access control operation command by using the second encryption field and the second command head;
the method further comprises the following steps: after the secure element receives the encryption request, the MAC session key in the second session key is used for carrying out encryption calculation on the second command header and the face recognition result to obtain a second ciphertext; determining a second MAC based on the obtained second ciphertext; encrypting the face recognition result and the second MAC by using an encryption session key in the second session key to obtain a second encryption field; returning the second encrypted field to the micro control unit.
Optionally, the system further includes a cloud platform, and the method further includes:
the micro control unit obtains the state information of the camera and the intelligent access control, and sends the obtained state information to the cloud platform.
Optionally, the system is provided with a plurality of entrance guards, the intelligent entrance guard does the entrance guard with incidence relation among the plurality of entrance guards.
Optionally, the association relationship between the camera and the door lock is pre-stored in an equipment association table, the equipment association table is stored in the security element, and the micro control unit sends the door lock operation request to the intelligent door lock, including:
sending a search request to a security element, wherein the search request comprises an identifier of the camera; the safety element searches the equipment association table according to the search request to obtain a target identifier of the intelligent access control associated with the identifier of the camera, and the obtained target identifier is returned to the micro control unit;
and receiving a target identifier returned by the secure element aiming at the search request, and sending the access control operation request to the intelligent access control with the target identifier.
Optionally, the method further includes:
the micro control unit sends an image acquisition command to the camera after detecting a user instruction for adding face image record; wherein the image acquisition command is obtained by encrypting the user instruction with the first session key; receiving an image to be added sent by the camera aiming at the image acquisition command; calculating a face characteristic value based on the image to be added, obtaining a user ID corresponding to the image to be added, and sending an adding command to the safety element; the adding command comprises a face characteristic value of the image to be added and a user ID corresponding to the face characteristic value;
after receiving an image acquisition command, the camera decrypts the received image acquisition command by using the first session key to obtain a user instruction; sending an image to be added to the micro control unit according to the user instruction;
and after receiving an adding command, the safety element correspondingly adds the face characteristic value of the image to be added in the adding command and the user ID corresponding to the face characteristic value to the face database.
Optionally, the method further includes:
and the safety element sends prompt information for prompting whether the addition is successful or not to the micro control unit.
Optionally, the system further includes a mobile terminal, and the method further includes:
after obtaining a third session key between the mobile terminal and the micro control unit, the mobile terminal sends a device management command to the micro control unit; and after receiving the equipment management command, the micro control unit manages the camera and/or the intelligent access control based on the equipment management command.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the method embodiment, since it is substantially similar to the system embodiment, the description is simple, and the relevant points can be referred to the partial description of the system embodiment.
The present invention is not limited to the above preferred embodiments, and any modifications, equivalent substitutions, improvements, etc. within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (13)

1. An access control system based on face recognition comprises an intelligent gateway, a camera and an intelligent access control, wherein the intelligent gateway comprises a micro-control unit and a safety element,
the camera is used for sending a face image to the micro control unit after a first session key between the camera and the intelligent gateway is obtained;
the micro control unit is used for receiving the face image sent by the camera and calculating a face characteristic value based on the face image; sending a face recognition command to the secure element; the face recognition command comprises the face characteristic value; the micro control unit calculates a face characteristic value based on the face image, and specifically comprises:
carrying out face detection on the face image;
if the face image is detected to have one or more face regions, cutting the face image to obtain a face sub-image with a preset size; calculating a face characteristic value for the face subgraph;
the safety element is used for comparing a face characteristic value in the received face recognition command with a characteristic value in a preset face database, obtaining a face recognition result according to the comparison result and returning the face recognition result to the micro control unit;
the safety element compares the face characteristic value in the received face recognition command with the characteristic value in a preset face database, and the method specifically comprises the following steps: if the face recognition command comprises a plurality of face characteristic values, comparing each face characteristic value with a characteristic value in a preset face database, if one comparison is successful, judging that the comparison result is successful, otherwise, judging that the comparison result is unsuccessful; the face database stores the corresponding relation between the characteristic value and the user ID, and the safety element obtains a face recognition result according to the comparison result, specifically:
if the comparison result is successful, obtaining a target user ID corresponding to a target characteristic value successfully compared with the face characteristic value, searching a target authority corresponding to the target user ID in a preset authority table, and taking the target authority and the comparison result as a face recognition result;
if the comparison result is unsuccessful, taking the comparison result as a face recognition result;
the micro control unit is further used for receiving a face recognition result returned by the safety element aiming at the face recognition command; obtaining an access control operation command, and sending the access control operation command to the intelligent access control; the access control operation command is obtained by encrypting the face recognition result by using a second session key; the second session key is a session key between the intelligent gateway and the intelligent access control;
the micro control unit is further used for stopping executing the face characteristic value calculation based on the face image if a plurality of face areas are detected in the face image; or, cutting each face region to obtain each face subgraph with a preset size; calculating a face characteristic value for each face subgraph;
the intelligent access control is used for receiving the access control operation command after obtaining a second session key, decrypting the received access control operation command by using the second session key to obtain a face recognition result, and performing access control operation according to the face recognition result;
the intelligent access control is also used for encrypting an access control operation result by using the second session key after the access control operation is executed to obtain an access control operation response command; sending the access control operation response command to the micro control unit;
the micro control unit is further configured to receive the access control operation response command, and decrypt the access control operation response command with the second session key through the security element to obtain an access control decryption result;
the micro control unit decrypts the access control operation response command by using the second session key through the security element to obtain an access control decryption result, which specifically comprises the following steps: sending a decryption request for decrypting the access control operation response command to the security element; receiving an access control decryption result returned by the security element aiming at the decryption request; the decryption request comprises a first command header and a first encryption field in the entrance guard operation response command;
the security element is further configured to decrypt, after receiving the decryption request, the first encrypted field in the decryption request with the encrypted session key in the second session key to obtain an access control operation result and a first MAC; performing MAC verification based on the first command header, the access control operation result and the first MAC, and if the MAC verification result is that the MAC verification is passed, taking the access control operation result and the MAC verification result as access control decryption results; if the MAC verification result is that the MAC verification is not passed, taking the MAC verification result as an access control decryption result; and returning the access control decryption result to the micro control unit.
2. The system of claim 1, wherein the camera is specifically configured to obtain the first session key with the smart gateway by:
generating a camera random number, and sending a gateway identity authentication command to the micro control unit, wherein the gateway identity authentication command comprises the camera random number;
receiving a response command returned by the micro control unit, and carrying out identity verification on the intelligent gateway by using response data in the response command;
if the intelligent gateway is confirmed to pass the identity authentication, sending a camera identity authentication command to the micro control unit, so that the micro control unit obtains a first session key encrypted by a camera public key after confirming that the camera passes the identity authentication, and sending the encrypted first session key to the camera; the camera identity authentication command comprises a camera public key;
and decrypting the received encrypted first session key by using a prestored camera private key to obtain the first session key.
3. The system of claim 2, wherein the response data comprises a gateway certificate, a gateway nonce, and a camera nonce signature value generated based on the camera nonce; the camera performs identity verification on the intelligent gateway by using the response data in the response command, specifically:
decrypting the camera random number signature value by using an intelligent gateway public key in a gateway certificate to obtain a first verification value, and if the camera random number is equal to the first verification value, determining a gateway verification result as that the intelligent gateway passes identity verification; otherwise, determining that the gateway authentication result is that the intelligent gateway fails the identity authentication.
4. The system according to claim 1, characterized in that said micro control unit is specifically configured to obtain the first session key encrypted with the camera public key by:
sending a verification command to the secure element based on the received camera identity authentication command; receiving a camera verification result returned by the security element aiming at the verification command; and if the camera passes the authentication result, receiving a first session key which is sent by the security element and encrypted by a camera public key.
5. The system of claim 1, wherein the micro-control unit is further configured to:
if the received access control decryption result is that the access control decryption result does not pass the MAC verification, clearing the session key, and setting the state of the intelligent access control to be an unauthenticated state;
and sending an identity authentication request to the intelligent access control so that the intelligent access control returns a gateway identity authentication command to the micro control unit aiming at the identity authentication request.
6. The system of claim 1,
the micro control unit obtains an access control operation command, and specifically comprises the following steps: sending an encryption request to the secure element, wherein the encryption request comprises a second command header and a face recognition result; obtaining a second encryption field returned by the security element aiming at the encryption request, and forming an access control operation command by using the second encryption field and the second command head;
the secure element is further configured to perform encryption calculation on a second command header and a face recognition result by using the MAC session key in the second session key after receiving the encryption request, so as to obtain a second ciphertext; determining a second MAC based on the obtained second ciphertext; encrypting the face recognition result and the second MAC by using an encryption session key in the second session key to obtain a second encryption field; returning the second encrypted field to the micro control unit.
7. The system of claim 1, further comprising a cloud platform, the micro control unit further configured to: and acquiring the state information of the camera and the intelligent access control, and sending the acquired state information to the cloud platform.
8. The system of claim 1, wherein the system is provided with a plurality of entrance guards, and the intelligent entrance guard is an entrance guard with an association relationship between the entrance guards and the cameras.
9. The system according to claim 7, wherein the association relationship between the camera and the door lock is pre-stored in an equipment association table, the equipment association table is stored in the secure element, and the micro control unit sends the door lock operation request to the intelligent door lock, specifically:
sending a search request to a security element, wherein the search request comprises an identifier of the camera; the safety element searches the equipment association table according to the search request to obtain a target identifier of the intelligent access control associated with the identifier of the camera, and the obtained target identifier is returned to the micro control unit;
and receiving a target identifier returned by the secure element aiming at the search request, and sending the access control operation request to the intelligent access control with the target identifier.
10. The system of claim 1,
the micro control unit is also used for sending an image acquisition command to the camera after detecting a user instruction for adding face image records; wherein the image acquisition command is obtained by encrypting the user instruction with the first session key; receiving an image to be added sent by the camera aiming at the image acquisition command; calculating a face characteristic value based on the image to be added, obtaining a user ID corresponding to the image to be added, and sending an adding command to the safety element; the adding command comprises a face characteristic value of the image to be added and a user ID corresponding to the face characteristic value;
the camera is further used for decrypting the received image acquisition command by using the first session key after receiving the image acquisition command to obtain a user instruction; sending an image to be added to the micro control unit according to the user instruction;
and the safety element is also used for correspondingly adding the face characteristic value of the image to be added in the adding command and the corresponding user ID thereof to the face database after receiving the adding command.
11. The system of claim 10,
and the safety element is also used for sending prompt information for prompting whether the addition is successful to the micro control unit.
12. The system of claim 1, further comprising a mobile terminal for sending a device management command to the micro-control unit after obtaining a third session key with the micro-control unit; and after receiving the equipment management command, the micro control unit manages the camera and/or the intelligent access control based on the equipment management command.
13. An entrance guard control method based on face recognition is applied to the system of claim 1, and the method comprises the following steps:
after the camera acquires a first session key between the camera and the intelligent gateway, the camera sends a face image to the micro control unit;
the micro control unit receives the face image sent by the camera and calculates a face characteristic value based on the face image; sending a face recognition command to the secure element; the face recognition command comprises the face characteristic value;
the safety element compares the face characteristic value in the received face recognition command with the characteristic value in a preset face database, obtains a face recognition result according to the comparison result, and returns the face recognition result to the micro control unit;
the micro control unit receives a face recognition result returned by the safety element aiming at the face recognition command; obtaining an access control operation command, and sending the access control operation command to the intelligent access control; the access control operation command is obtained by encrypting the face recognition result by using a second session key; the second session key is a session key between the intelligent gateway and the intelligent access control;
and after obtaining the second session key, the intelligent access control receives the access control operation command, decrypts the received access control operation command by using the second session key to obtain a face recognition result, and performs access control operation according to the face recognition result.
CN201910097904.3A 2019-01-31 2019-01-31 Access control system and access control method based on face recognition Active CN109903433B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910097904.3A CN109903433B (en) 2019-01-31 2019-01-31 Access control system and access control method based on face recognition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910097904.3A CN109903433B (en) 2019-01-31 2019-01-31 Access control system and access control method based on face recognition

Publications (2)

Publication Number Publication Date
CN109903433A CN109903433A (en) 2019-06-18
CN109903433B true CN109903433B (en) 2022-02-11

Family

ID=66944531

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910097904.3A Active CN109903433B (en) 2019-01-31 2019-01-31 Access control system and access control method based on face recognition

Country Status (1)

Country Link
CN (1) CN109903433B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110609920B (en) * 2019-08-05 2022-03-18 华中科技大学 Pedestrian hybrid search method and system in video monitoring scene
CN110705357A (en) * 2019-09-02 2020-01-17 深圳中兴网信科技有限公司 Face recognition method and face recognition device
CN110796021B (en) * 2019-10-08 2022-07-19 中国建设银行股份有限公司 Identity authentication method and device applied to self-service equipment
CN110930574A (en) * 2019-11-26 2020-03-27 深圳神目信息技术有限公司 Access control method and system and intelligent device
CN111914637B (en) * 2020-06-28 2021-05-04 普瑞达建设有限公司 Intelligent face recognition integrated management method and system
CN112489282A (en) * 2020-12-02 2021-03-12 杭州国辰机器人科技有限公司 Entrance guard attendance checking method, system, computer equipment and storage medium
CN112738067B (en) * 2020-12-25 2023-03-24 中国农业银行股份有限公司 Face recognition method, device and equipment
CN113034769A (en) * 2021-03-03 2021-06-25 唐山市就业服务中心 Access control system and method based on face recognition
WO2022237550A1 (en) * 2021-05-11 2022-11-17 天地融科技股份有限公司 Access control authentication method, apparatus and system for preventing privacy leak
CN113869284B (en) * 2021-11-09 2022-05-03 深圳市中讯网联科技有限公司 Security image face privacy authority protection method and system
CN114495343B (en) * 2021-12-31 2024-02-13 深圳亿达天下科技有限公司 Entrance guard safety control management system and entrance guard safety control management method
CN114882630A (en) * 2022-04-27 2022-08-09 广东职业技术学院 Internet of things access control system and control method thereof

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102945366A (en) * 2012-11-23 2013-02-27 海信集团有限公司 Method and device for face recognition
CN108053530A (en) * 2017-12-17 2018-05-18 深圳禾思众成科技有限公司 A kind of intelligent access control system of the Yun Jiaduan based on face recognition
CN108650219A (en) * 2018-03-27 2018-10-12 王晓华 A kind of method for identifying ID, relevant apparatus, equipment and system
CN108712246A (en) * 2018-03-27 2018-10-26 王晓华 A kind of smart home device and system and passwords of visitors acquisition methods
CN109118616A (en) * 2018-07-09 2019-01-01 深圳市商汤科技有限公司 access control method and access control device
CN109243029A (en) * 2018-09-11 2019-01-18 河南省云乐科技有限公司 A kind of intelligent access control system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102945366A (en) * 2012-11-23 2013-02-27 海信集团有限公司 Method and device for face recognition
CN108053530A (en) * 2017-12-17 2018-05-18 深圳禾思众成科技有限公司 A kind of intelligent access control system of the Yun Jiaduan based on face recognition
CN108650219A (en) * 2018-03-27 2018-10-12 王晓华 A kind of method for identifying ID, relevant apparatus, equipment and system
CN108712246A (en) * 2018-03-27 2018-10-26 王晓华 A kind of smart home device and system and passwords of visitors acquisition methods
CN109118616A (en) * 2018-07-09 2019-01-01 深圳市商汤科技有限公司 access control method and access control device
CN109243029A (en) * 2018-09-11 2019-01-18 河南省云乐科技有限公司 A kind of intelligent access control system

Also Published As

Publication number Publication date
CN109903433A (en) 2019-06-18

Similar Documents

Publication Publication Date Title
CN109903433B (en) Access control system and access control method based on face recognition
JP7152466B2 (en) Secure communication method and smart lock system based thereon
CN108173662B (en) Equipment authentication method and device
CN110334503B (en) Method for unlocking one device by using the other device
KR101198120B1 (en) Iris information based 3-factor user authentication method for otp generation and secure two way authentication system of wireless communication device authentication using otp
JP6275653B2 (en) Data protection method and system
CN101005361B (en) Server and software protection method and system
WO2017071496A1 (en) Method and device for realizing session identifier synchronization
US9253162B2 (en) Intelligent card secure communication method
Fan et al. An efficient and DoS-resistant user authentication scheme for two-tiered wireless sensor networks
KR101753859B1 (en) Server and method for managing smart home environment thereby, method for joining smart home environment and method for connecting communication session with smart device
CN103544746A (en) Electronic access control system of dynamic bar code
CN109714360B (en) Intelligent gateway and gateway communication processing method
WO2018119623A1 (en) Method of unlocking electronic lock device, and client and electronic lock device thereof
CN109922047B (en) Image transmission system and method
KR20140046474A (en) Communication method utilizing fingerprint information for authentication
CN106027473B (en) Identity card card-reading terminal and cloud authentication platform data transmission method and system
CN109347813B (en) Internet of things equipment login method and system, computer equipment and storage medium
RU2645597C2 (en) Method of authentication in data hidden terminal transmission channel
CN109922022A (en) Internet of Things communication means, platform, terminal and system
CN113316149B (en) Identity security authentication method, device, system, wireless access point and medium
CN108650219B (en) User identity identification method, related device, equipment and system
CN112425116B (en) Intelligent door lock wireless communication method, intelligent door lock, gateway and communication equipment
KR101745482B1 (en) Communication method and apparatus in smart-home system
CN115550002A (en) TEE-based intelligent home remote control method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant