本发明的实施方式Embodiments of the invention
请参阅图1,图1为本申请实施例提供的人证核实方法的应用场景示意图。所述应用场景包括:Please refer to FIG. 1. FIG. 1 is a schematic diagram of an application scenario of a method for verifying a person's certificate provided by an embodiment of the application. The application scenarios include:
(1)终端。终端通过输入设备获取人脸图及身份信息,并将人脸图及身份信息发送至服务器以使服务器进行人证核实,所述终端可以为智能手机、智能手表、笔记本电脑、平板电脑或者台式电脑等电子设备,图1中的终端与服务器连接。(1) Terminal. The terminal obtains the face image and identity information through the input device, and sends the face image and identity information to the server to enable the server to verify the identity. The terminal may be a smart phone, a smart watch, a notebook computer, a tablet computer, or a desktop computer And other electronic equipment, the terminal in Figure 1 is connected to the server.
(2)服务器。服务器为后台提供人证核实服务器的计算机设备,所述服务器可以为服务器集群、分布式服务器或者云服务器等,图1中的服务器与终端连接。(2) Server. The server is a computer device that provides a backend verification server. The server may be a server cluster, a distributed server, or a cloud server. The server in FIG. 1 is connected to the terminal.
(3)第三方接口。第三方接口一般指公安系统接口,又简称为公安接口。(3) Third-party interface. The third-party interface generally refers to the public security system interface, also referred to as the public security interface for short.
图1中的各个主体工作过程如下:终端通过摄像头、键盘或者语音输入设备等获取进行人证核实的人脸图及身份信息,所述身份信息包括身份证号码,并将所述人脸图及身份信息发送至后端服务器,服务器接收人脸图及身份信息,根据所述身份信息判断是否存储有与所述身份信息对应的第一人脸底图,其中,所述第一人脸底图为分值大于或者等于第一预设分值阈值的人脸底图,所述第一人脸底图的分值来源于第三方接口对所述第一人脸底图进行人证核实时返回的比对分值,用于描述所述第一人脸底图与所述第三方接口存储的人脸底图的相似度,若存储有所述第一人脸底图,将所述人脸图与所述第一人脸底图进行比对以得到人证核实的比对结果。The working process of each subject in Figure 1 is as follows: the terminal obtains the face image and identity information for verification of the identity card through a camera, keyboard or voice input device, etc., the identity information includes the ID number, and the face image and The identity information is sent to the back-end server, and the server receives the face map and identity information, and determines whether a first face base map corresponding to the identity information is stored according to the identity information, wherein the first face base map It is a face base map with a score greater than or equal to the first preset score threshold. The score of the first face base map comes from the third-party interface to verify the real-time return of the first face base map The comparison score of is used to describe the similarity between the first face base map and the face base map stored in the third-party interface. If the first face base map is stored, the face The image is compared with the first face base image to obtain a comparison result verified by the person certificate.
需要说明的是,图1中仅仅示意出台式电脑作为终端,在实际操作过程中,终端的类型不限于图1中所示,所述终端还可以为智能手机、智能手表、笔记本电脑或者平板电脑等电子设备,上述人证核实方法的应用场景仅仅用于说明本申请技术方案,并不用于限定本申请技术方案,上述连接关系还可以有其他形式。It should be noted that Figure 1 only shows a desktop computer as a terminal. In actual operation, the type of terminal is not limited to that shown in Figure 1. The terminal can also be a smart phone, a smart watch, a notebook computer, or a tablet computer. For electronic devices such as electronic devices, the application scenarios of the above-mentioned personal identification verification method are only used to illustrate the technical solutions of this application, and are not used to limit the technical solutions of this application. The above-mentioned connection relationship may also have other forms.
请参阅图2,图2为本申请实施例提供的人证核实方法的第一个示意性流程图。该人证核实方法应用于图1中的服务器中,以完成人证核实方法的全部或者部分功能。如图2所示,该方法包括以下步骤S210-S240:Please refer to FIG. 2. FIG. 2 is a first schematic flowchart of a method for verifying a person's certificate according to an embodiment of the application. The method for verifying the person's certificate is applied to the server in FIG. 1 to complete all or part of the functions of the method for verifying the person's certificate. As shown in Figure 2, the method includes the following steps S210-S240:
S210、接收人脸图及身份信息,所述身份信息包括身份证号码。S210. Receive a face image and identity information, where the identity information includes an ID number.
其中,人脸图指人脸图像,身份信息包括身份证号。Among them, the face image refers to a face image, and the identity information includes an ID number.
具体地,终端可以通过摄像头拍摄人脸图,并通过键盘或者语音设备等获取用户输入的身份信息,并将人脸图和身份信息通过有线网络或者无线网络发送至进行人证核实的后端服务器,服务器接收到人脸图和身份信息后对所述人脸图进行人证核实。Specifically, the terminal can take a face image through a camera, and obtain the identity information input by the user through a keyboard or voice device, etc., and send the face image and identity information to the back-end server for verification of the identity through a wired or wireless network After receiving the face image and identity information, the server verifies the face image.
S220、根据所述身份信息判断是否存储有与所述身份信息对应的第一人脸底图,其中,所述第一人脸底图为分值大于或者等于第一预设分值阈值的人脸底图,所述第一人脸底图的分值来源于第三方接口对所述第一人脸底图进行人证核实时返回的比对分值,用于描述所述第一人脸底图与所述第三方接口存储的人脸底图的相似度。S220. Determine, according to the identity information, whether a first face base map corresponding to the identity information is stored, wherein the first face base map is a person whose score is greater than or equal to a first preset score threshold Face base map, the score of the first face base map is derived from the real-time comparison score returned by the third-party interface for verification of the first face base map, used to describe the first face The similarity between the base map and the face base map stored in the third-party interface.
其中,人脸底图是指进行人证核实过程中比对的依据,将人脸图和人脸底图进行比对以判断人脸图和人脸底图是否相似或者一致,进而判断人证核实的用户身份。Among them, the face base map refers to the basis for comparison in the process of verifying the personal evidence. The face map and the face base map are compared to determine whether the face map and the face base map are similar or consistent, and then to determine the personal evidence Verified user identity.
所述第一人脸底图为分值大于或者等于第一预设分值阈值的人脸底图,所述第一预设分值阈值与所述第一人脸底图的准确度成正比关系,所述第一预设分值阈值设置的越高,第一人脸底图与第三方的公安接口中存储的人脸底图越相似,人脸图与所述第一人脸底图进行人证核实的结果越接近于人脸图通过调用第三方的公安接口进行人证核实的结果。其中,所述第一人脸底图的分值来源于第三方接口对所述第一人脸底图进行人证核实时返回的比对分值,用于描述所述第一人脸底图与所述第三方接口存储的人脸底图的相似度,具体地,第一人脸底图的分值是由第三方的公安接口对第一人脸底图对应的人脸图进行人证核实时返回的比对分值,也就是来源于第一人脸底图和第三方的公安系统接口中的人脸底图比对时由公安接口按照内部算法进行比对返回的比对分值,用于描述所述第一人脸底图与第三方的公安接口中存储的人脸底图的相似度,所述第一人脸底图与第三方的公安接口中存储的人脸底图的相似度与比对分值成正比关系,比对分值越高,所述第一人脸底图与第三方的公安接口中存储的人脸底图的越相似。若第一人脸底图对应的人脸图在进行人证核实时由公安接口返回的分值大于或者等于第一预设分值阈值,服务器将所述第一人脸底图对应的人脸图保存为第一人脸底图。进一步地,所述第一预设分值阈值可以根据实际业务对人证核实精确度的需求进行设置,若实际业务对人证核实精确度的需求较高,可以将第一预设分值阈值设置较大,第一预设分值阈值越大,第一人脸底图和公安系统接口中的人脸底图相似度越高,人证核实的结果越精确,第一预设分值阈值越低,第一人脸底图和公安系统接口中的人脸底图相似度相应降低,人证核实的结果相对不精确,一般情况下,为了保证人证核实的可靠性,第一预设分值阈值要设置的远远高于公安系统接口验证通过的底线。需要说明的是,在人证核实的过程中,默认第三方的公安接口中存储的人脸底图是真实可靠的,进而以第三方的公安接口中存储的人脸底图为人证核实的基准。比如,以满分为100分为例,第一预设分值阈值设置为90分,按照人脸底图从公安接口获得的分值将人脸底图进行分类,将人脸图的比对分值大于或者等于90分的人脸图划分为第一人脸底图,也可以称为可靠底图。The first face base map is a face base map with a score greater than or equal to a first preset score threshold, and the first preset score threshold is proportional to the accuracy of the first face base map Relationship, the higher the first preset score threshold is set, the more similar the first face base map is to the face base map stored in the third-party public security interface, and the face map is similar to the first face base map The result of personal identification verification is closer to the result of human identification verification by calling the public security interface of a third party on the face map. Wherein, the score of the first face base map is derived from the comparison score returned in real time by the third-party interface for verification of the first face base map, and is used to describe the first face base map The degree of similarity with the face map stored in the third-party interface. Specifically, the score of the first face map is verified by the third-party public security interface on the face map corresponding to the first face map. The comparison score returned by the kernel in real time is the comparison score returned by the public security interface according to the internal algorithm when the first face base map is compared with the face base map in the third-party public security system interface. , Used to describe the similarity between the first face base map and the face base map stored in the third-party public security interface, and the first face base map is similar to the face base map stored in the third-party public security interface The similarity of is proportional to the comparison score. The higher the comparison score, the more similar the first face base map is to the face base map stored in the third-party public security interface. If the score value returned by the public security interface of the face map corresponding to the first face base map is greater than or equal to the first preset score threshold during the verification of the human face in real time, the server converts the face corresponding to the first face base map The picture is saved as the first face base picture. Further, the first preset score threshold may be set according to actual business requirements for the accuracy of the verification of the personal identification. If the actual business requires high accuracy of verification of the identification, the first preset threshold may be set The larger the setting, the larger the first preset score threshold, the higher the similarity between the first face base map and the face base map in the public security system interface, and the more accurate the result of the verification of the human ID, the first preset score threshold The lower the lower, the similarity between the first face base map and the face base map in the public security system interface will be reduced accordingly, and the result of the verification of the personal identification is relatively inaccurate. Generally, in order to ensure the reliability of the verification of the personal identification, the first preset score The value threshold should be set much higher than the bottom line of the public security system interface verification. It should be noted that during the verification process, the default face base map stored in the third-party public security interface is true and reliable, and the face base map stored in the third-party public security interface is used for verification. Benchmark. For example, taking the full score as 100 points, the first preset score threshold is set to 90 points, and the face base maps are classified according to the scores obtained from the public security interface of the face base maps, and the face maps are compared. The face map with a value greater than or equal to 90 points is divided into the first face base map, which may also be called a reliable base map.
具体地,服务器接收到终端上传的人脸图及身份信息后,根据身份信息判断服务器本地数据库中是否存储有与该身份信息对应的第一人脸底图,若服务器中存储有与该身份信息对应的第一人脸底图,先将该人脸图和服务器本地的第一人脸底图进行比对,若服务器中未存储有与该身份信息对应的第一人脸底图,可以将人脸图与第二人脸底图进行比对,或者调用第三方的公安接口进行人证核实的比对,调用第三方的公安接口,一方面会延长人证核实的接口响应时间,另一方面第三方的公安接口是付费调用,需要支出调用费用。Specifically, after the server receives the face image and identity information uploaded by the terminal, it judges based on the identity information whether the first face base map corresponding to the identity information is stored in the server’s local database, and if the identity information is stored in the server Corresponding to the first face base map, first compare the face map with the first face base map local to the server. If the first face base map corresponding to the identity information is not stored in the server, you can compare The face image is compared with the second face base image, or the third-party public security interface is called for the comparison of human identification verification, and the third-party public security interface is called. On the one hand, it will prolong the interface response time of human identification verification. On the other hand, the third-party public security interface is paid to call, and the call fee needs to be paid.
进一步地,根据所述身份信息判断是否存储有与所述身份信息对应的第一人脸底图有两种方式:Further, there are two ways to determine whether the first face base map corresponding to the identity information is stored according to the identity information:
1)通过在服务器的数据库中是否查找到与该身份信息对应的第一人脸底图的方式。直接根据身份信息去服务器的数据库中查找是否存在该人脸图的第一人脸底图,若数据库的数据量比较大,查找时间会适当延长。1) Check whether the first face base map corresponding to the identity information is found in the database of the server. Directly according to the identity information, go to the database of the server to find whether the first face base image of the face image exists. If the amount of data in the database is relatively large, the search time will be appropriately extended.
2)通过预设标识或者关键字的方式。服务器为数据库中存储有人脸底图的身份信息建立预设标识,进行人证核实时,先根据身份信息去查找该预设标识,若能查找到该身份信息对应的预设标识,判断数据库中存储有与该身份信息对应的第一人脸底图,若未能查找到与该身份信息对应的预设标识,判断数据库中未存储有与该身份信息对应的第一人脸底图。也可以通过设置关键字的方式,比如设置的关键字为“TRUE”,判断数据库中存储有与该身份信息对应的第一人脸底图,设置的关键字为“FALSE”,判断数据库中未存储有与该身份信息对应的第一人脸底图。由于预设标识或者关键字相对于数据库中的数据量较小,可以提高判断的效率,从而缩短人证核实的时间。2) By means of preset logos or keywords. The server establishes a preset identifier for the identity information of the base map of the human face stored in the database, and performs real-time verification of the human identity. The preset identifier is first searched according to the identity information. If the preset identifier corresponding to the identity information can be found, the database is judged The first face base map corresponding to the identity information is stored, and if the preset identifier corresponding to the identity information cannot be found, it is determined that the first face base map corresponding to the identity information is not stored in the database. It is also possible to set keywords, for example, if the keyword is set to "TRUE", it is determined that the first face base map corresponding to the identity information is stored in the database, and the keyword is set to "FALSE" to determine that there is no The first face base map corresponding to the identity information is stored. Since the preset identifier or keyword is smaller than the amount of data in the database, the efficiency of judgment can be improved, thereby shortening the time for verification of the witness.
需要说明的是,人脸底图一般来源于服务器接收终端上传的人脸图,也就是服务器将分值满足要求的人脸图保存为人脸底图,以方便后续进行同一身份信息的人证核实。一般情况下,在进行人证核实时,若没有人脸底图或者人脸图与人脸底图比对不通过,服务器会去调用公安接口进行人证核实,公安系统的个人信息由于其权威性一般认为是可靠的,公安接口接收到进行人证核实的调用后,会根据身份信息将人脸图与公安系统的数据库中存储的与该身份信息对应的人脸图采用公安系统内部的比对算法进行比对,公安接口会将比对结果和该人脸图与公安系统内的人脸底图进行比对的分值等信息返回给服务器,从而服务器获取该人脸图与公安接口中人脸底图的比对分值,以此确定该人脸图与公安系统中留存的人脸底图的相似度,进而判断该人脸图与人脸活体的相似度,需要说明的是,在人证核实过程中,默认是以公安系统中留存的人脸底图作为比对基础,也就是默认公安系统中留存的人脸底图是最接近活体真实人脸的。It should be noted that the face base map is generally derived from the face map uploaded by the terminal received by the server, that is, the server saves the face map whose score meets the requirements as a face base map to facilitate subsequent verification of the same identity information. . Under normal circumstances, in real-time verification of personal identification, if there is no face base map or the comparison between the face map and the face base map fails, the server will call the public security interface for verification. The personal information of the public security system is due to its authority. Sexuality is generally considered to be reliable. After the public security interface receives the call to verify the identity, it will compare the face map with the face map stored in the database of the public security system according to the identity information using the internal comparison of the public security system. The algorithm is compared, and the public security interface will return information such as the comparison result and the score of the comparison between the face image and the face base image in the public security system to the server, so that the server obtains the face image and the public security interface The comparison score of the face base map is used to determine the similarity between the face map and the face base map saved in the public security system, and then to determine the similarity between the face map and the human face. It should be noted that, In the process of verification, the default is to use the base map of the face stored in the public security system as the basis for comparison, that is, the base map of the face stored in the public security system is the closest to the real face of the living body.
S230、若存储有所述第一人脸底图,将所述人脸图与所述第一人脸底图进行比对以得到人证核实的比对结果。S230: If the first face base map is stored, compare the face map with the first face base map to obtain a verification result of the verification.
具体地,若服务器判断存储有与该身份信息对应的第一人脸底图,将该人脸图与所述第一人脸底图进行比对以获得比对结果,由于所述第一人脸底图与公安接口的人脸底图相似度很高,作为人证核实比较可靠,无论人证核实验证是否通过,都可以将人证核实的结果作为最终的比对结果。由于第一人脸底图的分值越高,表明第一人脸底图与第三方的公安接口中存储的该身份信息对应的人脸底图越相似,由于认为公安接口中存储的该身份信息对应的人脸底图是真实可靠的,第一人脸底图与公安接口中存储的该身份信息对应的人脸底图越相似,可以认为人脸图与第一人脸底图的比对结果越接近人脸图与公安接口中该身份信息对应的人脸底图的比对结果,可以判断人脸图与第一人脸底图的比对结果越可靠,从而获得的比对结果越精确。Specifically, if the server determines that the first face base map corresponding to the identity information is stored, the face map is compared with the first face base map to obtain the comparison result, because the first person The face base map is very similar to the face base map of the public security interface, and it is more reliable as a personal certificate verification. The result of the personal certificate verification can be used as the final comparison result regardless of whether the personal certificate verification verification is passed. Since the score of the first face base map is higher, it indicates that the first face base map is more similar to the face base map corresponding to the identity information stored in the public security interface of the third party, because the identity stored in the public security interface is considered The face base map corresponding to the information is true and reliable. The more similar the first face base map and the face base map corresponding to the identity information stored in the public security interface are, the ratio of the face map to the first face base map can be considered The closer the result is to the comparison result of the face map and the face base map corresponding to the identity information in the public security interface, the more reliable the comparison result of the face map and the first face base map can be judged, and the comparison result obtained The more precise.
进一步地,S240、若未存储有所述第一人脸底图,将所述人脸图与所述第二人脸底图进行比对,或者调用第三方接口进行人证核实。Further, in S240, if the first face base map is not stored, compare the face map with the second face base map, or call a third-party interface for verification.
其中,所述第二人脸底图为分值大于或者等于所述第二预设分值阈值并且小于所述第一预设分值阈值的人脸底图。比如,以满分为100分为例,按照人脸底图从公安接口获得的分值将人脸底图进行分类,将人脸图的分值大于或者等于90分的人脸底图划分为第一人脸底图,将人脸图的分值小于90分并且大于或者等于60分的人脸底图划分为第二人脸底图,也可以称为普通底图,其中,普通底图为公安接口对作为普通底图的人脸图验证通过但根据分值表明没那么精确的人脸图,普通底图的底限是公安接口对该人脸图验证通过。Wherein, the second face base map is a face base map with a score greater than or equal to the second preset score threshold and less than the first preset score threshold. For example, taking the full score as 100 points, the face base map is classified according to the score obtained from the public security interface of the face base map, and the face base map with a face map score greater than or equal to 90 points is divided into the first A face base map, which divides the face base map whose score is less than 90 points and greater than or equal to 60 points into a second face base map, which can also be called a normal base map, where the normal base map is The public security interface passes the verification of the face image as a common base map, but according to the score, the face map is not so accurate. The bottom limit of the common base map is that the public security interface verifies the face map.
具体地,若没有所述第一人脸底图,将所述人脸图与第二人脸底图进行比对以判断所述人脸图验证是否通过。由于所述第二人脸底图可靠性不那么高,如果比对通过,表明人脸图与第三方的公安接口的人脸底图具有相似性,可以作为最终的比对结果,若比对不通过,考虑到所述第二人脸底图与公安接口的人脸底图的差异,进一步调用第三方的公安接口进行该人脸图的人证核实,最终通过公安接口获得可靠的人证核实结果。Specifically, if the first face base map is not available, the face map is compared with the second face base map to determine whether the verification of the face map passes. Since the reliability of the second face base map is not so high, if the comparison is passed, it indicates that the face map is similar to the face base map of the third-party public security interface and can be used as the final comparison result. No, considering the difference between the second face base map and the face base map of the public security interface, the third-party public security interface is further invoked to verify the face map, and finally a reliable personal identification is obtained through the public security interface Verify the results.
或者,服务器若未存储有与该身份信息对应的第一人脸底图,调用第三方接口进行人证核实以从所述第三方接口获得人证核实的比对结果。没有人脸底图或者没有第一人脸底图,都可以通过调用第三方的公安接口,通过公安接口进行人证核实,从公安接口获得人证核实的结果,从公安接口获得的人证核实结果包括人证核实通过或者人证核实未通过及人证核实过程中人脸图和公安接口中人脸底图的比对分值等信息,公安接口内部进行人证核实时有自己内部比对算法,由于公安接口的权威性,一般认为公安接口的数据和比对结果是精确并且可靠的。Alternatively, if the server does not store the first face base map corresponding to the identity information, the third-party interface is invoked to perform the identification verification to obtain the comparison result of the identification verification from the third-party interface. If there is no face base map or the first face base map, you can call the public security interface of a third party to verify the personal identification through the public security interface, obtain the verification result from the public security interface, and obtain the personal identification verification from the public security interface. The results include information such as the comparison score between the face map and the face base map in the public security interface during the verification of the personal certificate or the failure of the verification of the personal certificate, and the internal comparison of the personal certificate in the public security interface in real time. Algorithm, due to the authority of the public security interface, it is generally believed that the data and comparison results of the public security interface are accurate and reliable.
服务器将获得的人证核实通过或者人证核实未通过的比对结果进行显示,或者返回上述步骤中获得的人证核实的比对结果至终端以通过终端提示给用户。The server displays the comparison result of the obtained ID verification or the ID verification, or returns the comparison result of the ID verification obtained in the above steps to the terminal to prompt the user through the terminal.
本申请实施例提供的人证核实方法,在实现人证核实接口优化时,若接收到进行人证核实的人脸图及身份信息,根据身份信息判断是否存储有与所述身份信息对应的第一人脸底图,其中,第一人脸底图为分值大于或者等于第一预设分值阈值的人脸底图,所述第一人脸底图的分值来源于第三方接口对所述第一人脸底图进行人证核实时返回的比对分值,用于描述所述第一人脸底图与所述第三方接口存储的人脸底图的相似度,若存储有第一人脸底图,将人脸图与第一人脸底图进行比对以得到人证核实的比对结果,本申请实施例中,通过将人证核实中人脸图与可靠的第一人脸底图进行比对以直接获得比对通过或者不通过的比对结果,能够提高人证核实的精确度,同时减少调用第三方接口的次数,从而实现通过减少接口响应时间提高人证核实的效率,并且由于减少调用付费的第三方接口而节省人证核实的资金成本。According to the method for verification of person identification provided by the embodiment of this application, when the interface for verification of the person identification is optimized, if a face image and identity information for verification of the person's certificate are received, it is judged according to the identity information whether there is a second corresponding to the said identity information. A face base map, where the first face base map is a face base map with a score greater than or equal to a first preset score threshold, and the score of the first face base map comes from a third-party interface pair The comparison score value returned by the first face base map for verification in real time is used to describe the similarity between the first face base map and the face base map stored in the third-party interface, if stored The first face base map, the face map is compared with the first face base map to obtain the comparison result of the witness verification. In the embodiment of this application, the face map in the verification verification is compared with the reliable first face map. A face base map is compared to directly obtain the comparison result of the comparison passed or failed, which can improve the accuracy of the verification of the witness, and at the same time reduce the number of calls to the third-party interface, thereby realizing the improvement of the witness by reducing the interface response time The efficiency of the verification, and the capital cost of the verification of the human certificate is saved due to the reduction of the third-party interface of the payment.
请参阅图3,图3为本申请实施例提供的人证核实方法的第二个示意性流程图。如图3所示,该方法包括以下步骤S310-S380:Please refer to FIG. 3. FIG. 3 is a second schematic flowchart of a method for verifying a person's certificate according to an embodiment of the application. As shown in Figure 3, the method includes the following steps S310-S380:
S310、接收人脸图及身份信息,所述身份信息包括身份证号码。S310. Receive a face image and identity information, where the identity information includes an ID number.
具体地,步骤S310可以参阅图2所示实施例的步骤S210,将步骤S210的内容以引用方式包含于此,在此不再赘述。Specifically, step S310 can refer to step S210 of the embodiment shown in FIG. 2, and the content of step S210 is included here by reference, and will not be repeated here.
S320、根据所述身份信息判断是否存储有与所述身份信息对应的分级人脸底图,其中,所述分级人脸底图分为所述第一人脸底图和第二人脸底图,所述第二人脸底图为分值大于或者等于所述第二预设分值阈值并且小于所述第一预设分值阈值的人脸底图。S320. Determine whether a hierarchical face base map corresponding to the identity information is stored according to the identity information, wherein the hierarchical face base map is divided into the first face base map and the second face base map The second face base map is a face base map with a score greater than or equal to the second preset score threshold and less than the first preset score threshold.
其中,分级人脸底图是指将人脸底图按照预设标准进行分级,级别越高的人脸底图与用户的活体人脸越相似,进行人证核实时比对的结果越精确,人证核实的结果越可靠。所述分级人脸底图分为所述第一人脸底图和第二人脸底图,所述第一人脸底图为分值大于或者等于第一预设分值阈值的人脸底图,所述第一人脸底图的分值来源于第三方接口对所述第一人脸底图进行人证核实时返回的比对分值,用于描述所述第一人脸底图与所述第三方接口存储的人脸底图的相似度,所述第二人脸底图为分值大于或者等于所述第二预设分值阈值并且小于所述第一预设分值阈值的人脸底图。比如,以满分为100分为例,按照从公安接口获得的人脸图的比对分值将大于或者等于90分的人脸图划分为第一人脸底图,及将人脸图的比对分值小于90分并且大于或者等于60分的人脸图划分为普通底图,其中,普通底图为公安接口对作为普通底图的人脸图验证通过但根据人脸图的比对分值表明没那么精确的人脸图,普通底图的底线是公安接口对该人脸图验证通过。Among them, the hierarchical face base map refers to the classification of the face base map according to preset standards. The higher the level, the more similar the face base map is to the user’s live face, and the more accurate the result of real-time comparison of human evidence will be. The more reliable the result of the verification of the personal certificate. The hierarchical face base map is divided into the first face base map and the second face base map, and the first face base map is a face base with a score greater than or equal to a first preset score threshold In the figure, the score of the first face base map is derived from the comparison score returned in real time by the third-party interface for verification of the first face base map, which is used to describe the first face base map Similarity with the face base map stored in the third-party interface, where the second face base map has a score greater than or equal to the second preset score threshold and less than the first preset score threshold Face base map. For example, taking the full score as 100 points, according to the comparison score value of the face image obtained from the public security interface, the face image greater than or equal to 90 points is divided into the first face base image, and the ratio of the face image is divided Face images with scores of less than 90 points and greater than or equal to 60 points are divided into ordinary base images, where the ordinary base image is verified by the public security interface against the face image as the ordinary base image, but according to the comparison score of the face image The value indicates that the face image is not so accurate. The bottom line of the ordinary base image is that the public security interface verifies the face image.
具体地,服务器接收到终端上传的人脸图及身份信息后,根据身份信息判断服务器本地数据库中是否存储有与该身份信息对应的分级人脸底图,若服务器中存储有与该身份信息对应的分级人脸底图,先将该人脸图和服务器本地的分级人脸底图进行比对,若服务器中未存储有与该身份信息对应的分级人脸底图,调用第三方的公安接口进行人证核实的比对,调用第三方的公安接口,一方面会延长人证核实的接口响应时间,另一方面第三方的公安接口是付费调用,需要支出调用费用。Specifically, after the server receives the face image and identity information uploaded by the terminal, it judges based on the identity information whether there is a hierarchical face base map corresponding to the identity information stored in the server’s local database, if the server stores a base map corresponding to the identity information First compare the face map with the local hierarchical face map of the server. If the hierarchical face map corresponding to the identity information is not stored in the server, call the third-party public security interface Comparing the ID verification and invoking the third-party public security interface will extend the response time of the ID verification interface on the one hand. On the other hand, the third-party public security interface is a paid call and requires a call fee.
进一步地,根据所述身份信息判断是否存储有与所述身份信息对应的分级人脸底图也有两种方式:Further, there are also two ways to determine whether a hierarchical face base map corresponding to the identity information is stored according to the identity information:
1)通过在服务器的数据库中是否查找到与该身份信息对应的人脸底图的方式。直接根据身份信息去服务器的数据库中查找是否存在该人脸图的分级人脸底图,若数据库的数据量比较大,查找时间会适当延长。1) Check whether the face base map corresponding to the identity information is found in the database of the server. Directly according to the identity information, go to the database of the server to find whether there is a hierarchical face base map of the face map. If the amount of data in the database is relatively large, the search time will be appropriately extended.
2)通过预设标识或者关键字的方式。服务器为数据库中存储有分级人脸底图的身份信息建立预设标识,进行人证核实时,先根据身份信息去查找该预设标识,若能查找到与该身份信息对应的预设标识,判断数据库中存储有与该身份信息对应的人脸底图,若未能查找到与该身份信息对应的预设标识,判断数据库中未存储有与该身份信息对应的人脸底图。也可以通过设置关键字的方式,比如设置的关键字为“TRUE”,判断数据库中存储有与该身份信息对应的人脸底图,设置的关键字为“FALSE”,判断数据库中未存储有与该身份信息对应的人脸底图。由于预设标识或者关键字相对于数据库中的数据量较小,可以提高判断的效率,从而缩短人证核实的时间。2) By means of preset logos or keywords. The server establishes a preset identifier for the identity information stored in the database with the hierarchical face base map, and performs real-time verification of human identification. The preset identifier is first searched for according to the identity information. If the preset identifier corresponding to the identity information can be found, It is determined that the face base map corresponding to the identity information is stored in the database, and if the preset identifier corresponding to the identity information cannot be found, it is determined that the face base map corresponding to the identity information is not stored in the database. You can also set keywords. For example, if the keyword is set to "TRUE", it is determined that the face base map corresponding to the identity information is stored in the database, and the keyword is set to "FALSE", and it is determined that there is no The base map of the face corresponding to the identity information. Since the preset identifier or keyword is smaller than the amount of data in the database, the efficiency of judgment can be improved, thereby shortening the time for verification of the witness.
S330、若存储有所述分级人脸底图,判断所述分级人脸底图是否包括所述第一人脸底图。S330: If the hierarchical face base map is stored, determine whether the hierarchical face base map includes the first face base map.
具体地,服务器接收到终端上传的人脸图及身份信息后,根据身份信息判断服务器本地数据库中是否存储有与该身份信息对应的分级人脸底图,若服务器判断本地数据库中存储有与该身份信息对应的分级人脸底图,进一步判断是否存储有与所述身份信息对应的第一人脸底图,其中,所述第一人脸底图为分值大于或者等于第一预设分值阈值的人脸底图。若服务器判断存储有所述身份信息对应的第一人脸底图,由于默认第一人脸底图的可靠性,将所述人脸图与所述第一人脸底图进行比对,直接获得人证核实的比对结果。Specifically, after the server receives the face image and identity information uploaded by the terminal, it judges whether there is a hierarchical face base map corresponding to the identity information stored in the local database of the server according to the identity information. The hierarchical face base map corresponding to the identity information is further determined whether a first face base map corresponding to the identity information is stored, wherein the first face base map has a score greater than or equal to the first preset score The face base map of the threshold value. If the server determines that the first face base map corresponding to the identity information is stored, due to the reliability of the default first face base map, the face map is compared with the first face base map and directly Obtain the comparison result verified by the witness.
S340、若包括所述第一人脸底图,将所述人脸图与所述第一人脸底图进行比对;S340: If the first face base map is included, compare the face map with the first face base map;
S350、得到人证核实的比对结果。S350. Obtain a comparison result verified by a person certificate.
具体地,若服务器判断存储有所述第一人脸底图,将所述人脸图与所述第一人脸底图通过人脸识别技术进行比对以判断人证核实的身份验证是否通过,无论人证核实的身份验证是否通过,都作为人证核实的结果。Specifically, if the server determines that the first face base map is stored, it compares the face map with the first face base map through face recognition technology to determine whether the identity verification of the identity verification is passed. , Regardless of whether the identity verification of the personal identification verification is passed, it will be regarded as the result of the identification verification.
S360、若所述分级人脸底图不包括所述第一人脸底图,判定所述分级人脸底图仅包括第二人脸底图;S360: If the graded face base map does not include the first face base map, determine that the graded face base map only includes a second face base map;
S370、将所述人脸图与第二人脸底图进行比对以判断所述人脸图验证是否通过。S370. Compare the face image with the second face base image to determine whether the face image is verified.
具体地,在本申请实施例中,将所述分级人脸底图分为两级,其中一级为可靠性较高的第一人脸底图,另一级为可靠性相对较低但也是经第三方公安接口验证通过的第二人脸底图,所述第二人脸底图为分值大于或者等于所述第二预设分值阈值并且小于所述第一预设分值阈值的人脸底图,所述第二预设分值阈值的底线为第三方的公安接口对人脸图人证核实验证通过的分值,但也可以高于第三方的公安接口对人脸图人证核实验证通过的分值。Specifically, in the embodiment of the present application, the hierarchical face base map is divided into two levels, where one level is the first face base map with high reliability, and the other level is the relatively low reliability but also A second face base map verified by a third-party public security interface, where the second face base map has a score greater than or equal to the second preset score threshold and less than the first preset score threshold The bottom line of the face map, the bottom line of the second preset score threshold is the score of the third-party public security interface’s verification of the facial image, but it can also be higher than the third-party public security interface’s The points passed by the verification verification.
由于在本申请实施例中将所述分级人脸底图分为两级,若服务器判断存储有所述分级人脸底图,并且进一步判断所述分级人脸底图未包括有所述第一人脸底图,可以判定所述分级人脸底图仅包括有可靠性相对第一人脸底图较低的第二人脸底图,将所述人脸图与第二人脸底图进行比对以判断所述人脸图验证是否通过,若所述人脸图验证通过,进入步骤S350,也就是获得所述人证核实的比对结果,若所述人脸图验证未通过,进入步骤S380,调用第三方接口的公安接口进行更可靠的人证核实,从所述第三方接口获取所述人证核实的比对结果。Since the hierarchical face base map is divided into two levels in this embodiment of the application, if the server determines that the hierarchical face base map is stored, and further determines that the hierarchical face base map does not include the first The face base map, it can be determined that the graded face base map only includes the second face base map whose reliability is lower than the first face base map, and the face map is compared with the second face base map. The comparison is used to determine whether the verification of the face image is passed. If the verification of the face image is passed, step S350 is entered, that is, the comparison result of the verification of the person certificate is obtained. If the verification of the face image is not passed, enter Step S380: Invoke the public security interface of the third-party interface to perform more reliable verification of the human certificate, and obtain the comparison result of the verification of the human certificate from the third-party interface.
S380、若所述人脸图验证未通过,或者若未存储有所述分级人脸底图,调用第三方接口进行人证核实以从所述第三方接口获得所述人证核实的比对结果。S380. If the face map verification fails, or if the hierarchical face base map is not stored, call a third-party interface for personal identification verification to obtain a comparison result of the identification verification from the third-party interface .
具体地,步骤S380可以参阅图2所示实施例的步骤S240,将步骤240的内容以引用的方式包含于此,在此不再赘述。Specifically, step S380 may refer to step S240 of the embodiment shown in FIG. 2, and the content of step 240 is included here by reference, which will not be repeated here.
本申请实施例实现人证核实过程优化时,若服务器接收到人证核实的人脸图及身份信息,先根据所述身份信息判断是否存储有所述身份信息对应的分级人脸底图,若存储有所述分级人脸底图,进一步判断所述分级人脸底图是否包括可靠性较高的第一人脸底图,若包括所述第一人脸底图,将所述人脸图与所述第一人脸底图进行比对以得到人证核实的比对结果,或者是所述分级人脸底图仅包括可靠性相对较低的第二人脸底图,若人脸图与第二人脸底图比对不通过,或者未存储所述分级人脸底图,再调用第三方的公安接口进行可靠的人证核实,从而实现尽可能通过可靠性较高的第一人脸底图的分级比对,获得较准确的人证核实结果,减少调用付费的第三方的公安接口的接口响应时间,能够提高人证核实的精确度和效率。When the embodiment of the application realizes the optimization of the verification process of the human identification, if the server receives the face image and identity information verified by the human identification, it first determines whether there is a hierarchical face base map corresponding to the identity information according to the identity information. The hierarchical face base map is stored, and it is further determined whether the hierarchical face base map includes a first face base map with higher reliability. If the first face base map is included, the face map is Compare with the first face base map to obtain the comparison result of the identification verification, or the graded face base map only includes the second face base map with relatively low reliability, if the face map The comparison with the second face base map fails, or the hierarchical face base map is not stored, and then the third-party public security interface is called for reliable verification of the person’s identification, so as to achieve the first person with higher reliability as possible The hierarchical comparison of face maps can obtain more accurate identification verification results, reduce the interface response time of calling the public security interface of a paid third party, and improve the accuracy and efficiency of identification verification.
请参阅图4,图4为本申请实施例提供的人证核实方法的第三个示意性流程图。如图4所示,该方法包括以下步骤S410-S470:Please refer to FIG. 4. FIG. 4 is a third schematic flowchart of a method for verifying a person's certificate according to an embodiment of the application. As shown in Figure 4, the method includes the following steps S410-S470:
S410、接收人脸图及身份信息,所述身份信息包括身份证号码;S410. Receive a face image and identity information, where the identity information includes an ID number;
S420、根据所述身份信息判断是否存储有与所述身份信息对应的第一人脸底图,其中,所述第一人脸底图为分值大于或者等于第一预设分值阈值的人脸底图;S420. Determine whether a first face base map corresponding to the identity information is stored according to the identity information, wherein the first face base map is a person whose score is greater than or equal to a first preset score threshold Face map
S430、若存储有所述第一人脸底图,将所述人脸图与所述第一人脸底图进行比对;S430: If the first face base map is stored, compare the face map with the first face base map;
S440、得到人证核实的比对结果。S440. Obtain a comparison result verified by a person certificate.
具体地,步骤S410-S440可以参阅图2所示实施例的步骤S210-S230,将步骤S210-S230的内容以引用的方式包含于此,在此不再赘述。Specifically, steps S410-S440 may refer to steps S210-S230 of the embodiment shown in FIG. 2, and the contents of steps S210-S230 are included here by reference, and will not be repeated here.
S450、若未存储有所述第一人脸底图,根据所述身份信息判断是否存储有与所述身份信息对应的第二人脸底图,其中,所述第二人脸底图为分值大于或者等于所述第二预设分值阈值并且小于所述第一预设分值阈值的人脸底图;S450. If the first face base map is not stored, determine whether a second face base map corresponding to the identity information is stored according to the identity information, wherein the second face base map is A face base map with a value greater than or equal to the second preset score threshold and less than the first preset score threshold;
S460、若存储有所述第二人脸底图,将所述人脸图与所述第二人脸底图进行比对以判断所述人脸图验证是否通过。S460. If the second face map is stored, compare the face map with the second face map to determine whether the face map verification is passed.
具体地,在本申请实施例中,也是将人脸底图分为两级,其中一级为可靠性较高的第一人脸底图,另一级为可靠性相对较低但也是经第三方的公安接口验证通过的第二人脸底图。Specifically, in the embodiment of the present application, the face base map is also divided into two levels, where one level is the first face base map with higher reliability, and the other level is the first face base map with relatively low reliability but also the first level. The base map of the second face verified by the three-party public security interface.
服务器接收到人证核实的人脸图及身份信息后,根据所述身份信息直接根据人脸底图的优先级从高到低逐级进行判断,也就是根据所述身份信息首先判断是否存储有与所述身份信息对应的第一人脸底图,若存储有所述第一人脸底图,将所述人脸图与所述第一人脸底图进行比对直接得到人证核实的比对结果,若未存储有所述第一人脸底图,进一步根据所述身份信息判断是否存储有与所述身份信息对应的第二人脸底图,其中,所述第二人脸底图为分值大于或者等于所述第二预设分值阈值并且小于所述第一预设分值阈值的人脸底图,若存储有所述第二人脸底图,将所述人脸图与所述第二人脸底图进行比对以判断所述人脸图验证是否通过,若所述人脸图验证通过,进入步骤S440,从而获得所述人证核实的比对结果,若所述人脸图验证未通过,进入步骤S470,再通过调用第三方接口进行人证核实以从所述第三方接口获得所述人证核实的比对结果。After the server receives the face image and identity information verified by the human ID, it directly judges whether there is a face map based on the identity information from high to low, that is, according to the identity information, it first determines whether there is The first face base map corresponding to the identity information, if the first face base map is stored, compare the face map with the first face base map to obtain a personal ID verification directly As a result of the comparison, if the first face base map is not stored, it is further judged based on the identity information whether a second face base map corresponding to the identity information is stored, wherein the second face base map The picture shows a base map of a face with a score greater than or equal to the second preset score threshold and less than the first preset threshold. If the second face base map is stored, the face The image is compared with the second face base image to determine whether the face image verification is passed. If the face image verification passes, step S440 is entered to obtain the verification result of the person ID. If the facial image verification fails, the process proceeds to step S470, and the third-party interface is called to perform the verification of the human identification to obtain the comparison result of the verification of the human identification from the third-party interface.
S470、若所述人脸图验证未通过,或者未存储有所述第二人脸底图,调用第三方接口进行人证核实以从所述第三方接口获得所述人证核实的比对结果。S470: If the face map verification fails, or the second face base map is not stored, call a third-party interface for verification of the verification to obtain the verification result of the verification from the third-party interface .
具体地,步骤S470可以参阅图2所示实施例的步骤S240,将步骤240的内容以引用的方式包含于此,在此不再赘述。Specifically, step S470 may refer to step S240 of the embodiment shown in FIG. 2, and the content of step 240 is included here by reference, and will not be repeated here.
本申请实施例中,服务器接收到人证核实的人脸图及身份信息后,根据所述身份信息直接根据人脸底图的优先级从高到低逐级进行判断,也就是根据所述身份信息首先判断是否存储有与所述身份信息对应的第一人脸底图,若存储有所述第一人脸底图,将所述人脸图与所述第一人脸底图进行比对直接得到人证核实的比对结果,若未存储有所述第一人脸底图,进一步根据所述身份信息判断是否存储有与所述身份信息对应的第二人脸底图,若存储有所述第二人脸底图,将所述人脸图与所述第二人脸底图进行比对以判断所述人脸图验证是否通过,若所述人脸图验证通过,直接获得所述人证核实的比对结果,若所述人脸图验证未通过,或者未存储有所述第一人脸底图和所述第二人脸底图,再通过调用第三方接口进行人证核实以从所述第三方接口获得所述人证核实的比对结果,由于首先判断是否存储有可靠性较高的第一人脸底图,针对存储有可靠性较高的第一人脸底图的情形,可以缩短人证核实的过程,从而更快的获得较准确的人证核实结果,进一步提高人证核实的精确度和效率。In the embodiment of the present application, after the server receives the face image and identity information verified by the human certificate, it directly judges according to the priority of the face base map from high to low according to the identity information, that is, according to the identity The information first determines whether the first face base map corresponding to the identity information is stored, and if the first face base map is stored, compare the face map with the first face base map The comparison result of the verification of the personal identification is directly obtained. If the first face base map is not stored, it is further judged according to the identity information whether a second face base map corresponding to the identity information is stored. In the second face base map, the face map is compared with the second face base map to determine whether the verification of the face map is passed, and if the verification of the face map passes, the obtained face map is directly obtained According to the comparison result of the verification of the person's certificate, if the verification of the face image fails, or the first face base image and the second face base image are not stored, then the third-party interface is called for the person identification The verification is to obtain the comparison result of the verification of the person certificate from the third-party interface. Since it is first judged whether the first face base map with higher reliability is stored, the first face base map with higher reliability is stored. The situation in the figure can shorten the process of verification of the witness, thereby obtaining more accurate verification results of the verification more quickly, and further improving the accuracy and efficiency of verification.
请参阅图5,图5为本申请实施例提供的人证核实方法的一个交互流程示意图。如图5所示,所述过程包括以下步骤:Please refer to FIG. 5. FIG. 5 is a schematic diagram of an interaction process of the method for verifying a person's certificate according to an embodiment of the application. As shown in Figure 5, the process includes the following steps:
S5001、前端通过拍摄获取人脸图及通过输入设备获取身份信息,所述身份信息包括身份证号码。S5001. The front-end obtains a face image through shooting and obtains identity information through an input device, where the identity information includes an ID number.
具体地,进行人证核实时,前端设备通过前置摄像头或者后置摄像头等摄像设备拍摄人脸图像,并且通过前端设备的输入组件接收用户通过语音或者文字输入的身份证号码等唯一识别用户身份的身份信息。一般情况下,身份信息包括身份证号等可以唯一确定用户身份的信息。前端获取人证核实中需要的人脸图及身份信息后,将所述人脸图和身份信息发送至后端的服务器进行人证核实,并在服务器人证核实结束后从后端服务器获取人证核实结果进行显示。Specifically, for real-time verification, the front-end device captures facial images through camera devices such as the front camera or rear camera, and the input component of the front-end device receives the ID number entered by the user through voice or text to uniquely identify the user. Identity information. In general, the identity information includes information such as an ID number that can uniquely determine the identity of a user. After the front-end obtains the face image and identity information required for verification of the human ID, it sends the face image and identity information to the back-end server for verification of the human ID, and obtains the human ID from the back-end server after the verification of the server’s ID The verification result is displayed.
S5002、服务器接收前端发送的人脸图及身份信息,调用人证核实服务进行人证核实。S5002. The server receives the face image and identity information sent by the front-end, and invokes the identification verification service for identification verification.
S5003、服务器调用人证核实服务进行人证核实,判断服务器是否存储有与该身份信息对应的分级人脸底图,若服务器未保存有与该身份信息对应的分级人脸底图,进入步骤S5005,调用第三方的公安接口进行人证核实,若服务器保存有与该身份信息对应的分级人脸底图,进入步骤S5004,优先使用本地的保存人脸底图进行人证核实,以减少调用第三方的公安接口进行人证核实的次数。S5003. The server invokes the identification verification service for identification verification, and determines whether the server stores a hierarchical face base map corresponding to the identity information. If the server does not store a hierarchical face base map corresponding to the identity information, go to step S5005 , Call the public security interface of the third party to verify the personal identification. If the server saves the hierarchical face base map corresponding to the identity information, enter step S5004, and use the local saved face base map for personal identification verification first to reduce the number of calls. The number of times that the public security interface of the three parties has verified the personal identification.
S5004、服务器将接收到的人脸图与本地存储的分级人脸底图进行比对。S5004. The server compares the received face map with a locally stored hierarchical face base map.
具体地,若服务器保存有与该身份信息对应的分级人脸底图,将获得的人脸图与该分级人脸底图进行比对。由于分级人脸底图中只是不同人脸底图与第三方的公安接口中的人脸底图的相似度不同,而分级人脸底图与人脸图的比对过程没什么不同,以人脸图与所述第一人脸底图进行比对为例来说明人脸图与分级人脸底图的比对过程,在一个实施例中,所述将所述人脸图与所述第一人脸底图进行比对以得到人证核实的比对结果的步骤包括:Specifically, if the server saves a hierarchical face base map corresponding to the identity information, the obtained face map is compared with the hierarchical face base map. Since the base map of the graded face is only different in the similarity of the base map of the face in the third-party public security interface, the comparison process of the base map of the graded face and the face map is not different. The comparison between the figure and the first face image is taken as an example to illustrate the process of comparing the face image and the graded face image. In one embodiment, the face image is compared with the first face image. The steps of comparing the face base map to obtain the verification result of the personal identification include:
通过人脸识别获取所述人脸图与所述第一人脸底图的相似度;Acquiring the similarity between the face image and the first face base image through face recognition;
判断所述相似度是否大于或者等于相似度预设阈值;Judging whether the similarity is greater than or equal to a preset threshold of similarity;
若所述相似度大于或者等于所述相似度预设阈值,判定人证核实比对通过;If the similarity is greater than or equal to the preset threshold of similarity, it is determined that the verification and comparison of the personal certificate is passed;
若所述相似度小于所述相似度预设阈值,判定人证核实比对未通过。If the similarity is less than the preset threshold of the similarity, it is determined that the verification and comparison of the personal certificate fails.
具体地,人脸图与分级人脸底图比对,是采用人脸识别然后进行比对的过程,通过人脸识别,根据人脸特征,比如人脸的五官特征,具体可以根据五官特征在人脸上的位置、形状、大小及各部位比例的比对,识别出人脸图与分级人脸底图的相似度,该相似度比如可以设置为80 %,若人脸图与分级人脸底图满足相似度要求,人脸图与分级人脸底图比对通过,人脸图与分级人脸底图不满足相似度要求,人脸图与分级人脸底图比对不通过,并可根据具体算法获取人脸相似度的分值。进一步地,还可以结合检测到的人脸的明显特征,比如,人脸的某个位置是否有伤疤形状或者痣等明显特征,由于这些明显特征容易区分,可以先检测是否有这些明显特征,根据这些明显特征进行人脸比对,然后再根据人脸五官特征进行比对。Specifically, the comparison between the face map and the graded face base map is a process of using face recognition and then comparing. Through face recognition, according to facial features, such as facial features, specific features can be based on facial features. The position, shape, size and proportion of each part of the face are compared, and the similarity between the face map and the base map of the graded face is recognized. The similarity can be set to 80%, for example, if the face map is compared with the graded face The base map meets the similarity requirements, the face map and the graded face base map pass, the face map and the graded face base map do not meet the similarity requirements, the face map and the graded face base map do not pass, and The score of face similarity can be obtained according to specific algorithms. Further, it can also be combined with the obvious features of the detected face, for example, whether there are obvious features such as scar shape or mole in a certain position of the face. Since these obvious features are easy to distinguish, you can first detect whether there are these obvious features. These obvious features are compared to the face, and then the facial features are compared.
更进一步地,对于相似度可以有两种统计方式:Furthermore, there are two statistical methods for similarity:
(一)将人脸五官的综合相似度设置为100%,五官每部分各占20%,统计五官的五部分相似度累积之和是否满足80 %的要求;(1) Set the comprehensive similarity of the facial features to 100%, and each part of the facial features accounts for 20%, and calculate whether the cumulative sum of the similarities of the five senses meets the requirement of 80%;
(二)分别统计五官各部分的相似度,将五官的每部分相似度设置为100%,要求五官的各部分的相似度分别达到80 %的要求,相对来说,这种方式要求的相似度更精确,比对的结果更准确。(2) Calculate the similarity of each part of the five sense organs separately, set the similarity of each part of the five sense organs to 100%, and require the similarity of each part of the five sense organs to meet the requirements of 80%, relatively speaking, the similarity required by this method More accurate, more accurate than the result.
更具体地,人脸图与分级人脸底图比对过程包括以下步骤:More specifically, the process of comparing the face map with the graded face base map includes the following steps:
S50041、服务器判断该分级人脸底图是否包含有第一人脸底图,第一人脸底图又可以称为可靠底图,如果该分级人脸底图有可靠的第一人脸底图,进入步骤S50042,若该分级人脸底图未包含有可靠底图,该分级人脸底图仅为第二人脸底图,也就是为普通底图,将获得的人脸图与普通底图进行比对,进入步骤S5006。S50041. The server judges whether the hierarchical face base map contains the first face base map. The first face base map can also be called a reliable base map. If the hierarchical face base map has a reliable first face base map , Enter step S50042, if the graded face base map does not contain a reliable base map, the graded face base map is only the second face base map, that is, the normal base map, and the obtained face map is compared with the normal base map. The graphs are compared, and step S5006 is entered.
其中,第一人脸底图是指服务器存储的从第三方的公安接口获得的比对分值超过第一预设分值阈值从而可以判断与公安接口中存储的所述身份信息对应的人脸底图满足相似度要求的人脸图。判断是否是可靠底图是从该人脸底图对应的分值进行判断,因此,针对每一人脸底图会有对应的分值字段数据,该分值一般来源于通过公安接口进行人证核实时公安接口返回的分值。以100分为例,定义一个高分值,例如90分,当人脸图的分值大于这个分值时,就认为这个底图是可靠的,定义为可靠底图,也就是第一人脸底图;低于这个分值,但是也经公安接口验证通过的人脸底图定义为普通底图,也就是第二人脸底图。进一步地,当服务接口去调用公安接口时,返回的分值大于等于这个高分值,则把该分级人脸底图升级为可靠底图。需要说明的是,分解人脸底图是服务器原来通过各种途径获得并预先存储的该身份信息对应的人脸图,比如,在购买保险产品的业务过程中,用户第一次在一单位办理业务时提交的人脸图进第三方的公安接口人证核实通过后,服务器将获得的人脸图存储作为分级人脸底图,后续该用户在该单位办理其他业务需要进行人证核实时,该人脸图可以作为人证核实过程中比对的分级人脸底图,进行人证核实时,会要求用户提供当前人脸图,同时提供用户的一些个人信息作为身份信息,比如手机号、身份证号、姓名或者性别等,从而通过身份信息将用户的当前人脸图和底图进行匹配比对。Wherein, the first face base map refers to that the comparison score value obtained from the third-party public security interface stored by the server exceeds the first preset score threshold, so that the face corresponding to the identity information stored in the public security interface can be determined A face image whose base image meets the similarity requirements. Judging whether the base map is reliable is based on the score corresponding to the face base map. Therefore, there will be a corresponding score field data for each face base map. The score is generally derived from the verification of the human certificate through the public security interface. The score returned by the public security interface at the time. Taking 100 points as an example, define a high score, such as 90 points. When the score of the face image is greater than this value, the base image is considered reliable and defined as a reliable base image, which is the first face Bottom map: The face map that is lower than this score, but has also been verified by the public security interface, is defined as a normal map, which is the second face map. Further, when the service interface calls the public security interface, and the returned score is greater than or equal to the high score, the hierarchical face base map is upgraded to a reliable base map. It should be noted that the decomposed face map is the face map corresponding to the identity information that the server originally obtained through various channels and stored in advance. For example, in the business process of purchasing insurance products, the user is the first time to do this in a company After the face image submitted during the business is verified by the third-party public security interface, the server will store the obtained face image as a hierarchical face base map, and then the user needs to conduct real-time human identification verification in other businesses in the unit. The face map can be used as a hierarchical face base map for comparison during the verification process. For real-time verification, the user will be required to provide the current face map and provide some personal information of the user as identity information, such as mobile phone number, ID number, name or gender, etc., to match the user’s current face map with the base map through the identity information.
S50042、服务器判断第一人脸底图的生成时长是否超过预设时长阈值。S50042: The server judges whether the generation duration of the first face base map exceeds a preset duration threshold.
具体地,服务器判断第一人脸底图的生成时长是否超过预设时长阈值,也就是判断第一人脸底图的时效性,若所述生成时长未超过所述预设时长阈值,所述第一人脸底图满足时效性,所述第一人脸底图可以作为有效底图进行人证核实,若所述生成时长超过所述预设时长阈值,所述第一人脸底图不满足时效性,将所述第一人脸底图降为第二人脸底图。进行人证核实时,判断第一人脸底图是否满足时效性要求。通过设置第一人脸底图的时效性,可以保证当公安系统信息更改时,第一人脸底图能及时跟上更新,进而通过保证第一人脸底图及时更新,从而提高人证核实的精确性和可靠性。增加可靠底图的时效性,例如一个月,也就是这个可靠底图可以维持一个月,一个月后把该可靠底图降级为普通底图,并且覆盖原来的普通底图,分数设置为一个较低的分数,以100分为例,例如设置为50分,这个分数只要是公安接口比对不通过的分数就行,下次进行人证比对的时候,如果人脸信息更新了,这个分级人脸底图也能及时跟上更新。这里的人脸的信息更新,一般是指随着年龄的增长,人脸轮廓也有轻微的变化,比如身份证过期了重新补办的情形。Specifically, the server determines whether the generation duration of the first face base map exceeds a preset duration threshold, that is, determines the timeliness of the first face base map. If the generation duration does not exceed the preset duration threshold, the The first face base map satisfies the timeliness, the first face base map can be used as a valid base map for personal verification, and if the generation time exceeds the preset duration threshold, the first face base map does not To satisfy the timeliness, the first face base map is reduced to the second face base map. Perform real-time verification of human identification to determine whether the first face base map meets the timeliness requirements. By setting the timeliness of the first face base map, it can be ensured that when the public security system information changes, the first face base map can be updated in time, and then by ensuring that the first face base map is updated in time, so as to improve the verification Accuracy and reliability. Increase the timeliness of the reliable basemap, for example, one month, that is, the reliable basemap can be maintained for one month. After one month, the reliable basemap is downgraded to a normal basemap, and the original normal basemap is overwritten, and the score is set to a higher For low scores, take 100 points for example. For example, set to 50 points. This score can be as long as the public security interface fails the comparison. The next time the person-to-card comparison is performed, if the face information is updated, this grading person The face map can also be updated in time. The face information update here generally refers to the slight change in the contour of the face as the age grows, such as the situation where the ID card is expired and reissued.
由于人脸随着年龄而变化,为了提高比对的准确性,可以给可靠底图设置时效性,比如设置一个星期或者一个月等不同的时长。进一步地,针对不同年龄段的容貌变化规律,可以针对不同年龄段设置不同的时长,比如,由于青少年的容貌处于长身体的阶段,容貌变化较快,可以设置较短的时效,老年人和中年人由于容貌稳定,可以设置相对较长的时效,同时,在年龄的变化阶段,可以设置较短的时效,比如30岁、50岁或者60岁等容貌产生变化的年龄门槛,可以设置较短的时效。Since the face changes with age, in order to improve the accuracy of the comparison, you can set the timeliness of the reliable base map, such as setting different durations such as one week or one month. Further, according to the appearance change law of different age groups, different time periods can be set for different age groups. For example, because the appearance of young people is in the stage of long body, the appearance changes quickly, and a shorter time limit can be set. Because of the stable appearance of young people, a relatively long time limit can be set. At the same time, a shorter time limit can be set during the age change stage. For example, the age threshold of 30, 50, or 60 years old can be set to be shorter. The time limit.
针对设置了时效的可靠底图,需要判断可靠底图是否过期。若可靠底图过了时效性,进入步骤S50044,若可靠底图未过期,进入步骤S50043。For the reliable basemap with time-sensitive setting, it is necessary to judge whether the reliable basemap is out of date. If the reliable basemap has expired, go to step S50044, if the reliable basemap has not expired, go to step S50043.
S50043、服务器将人脸图与第一人脸底图比对以判断人脸图与第一人脸底图比对是否通过,并获得比对结果。S50043. The server compares the face image with the first face base image to determine whether the comparison between the face image and the first face base image passes, and obtains the comparison result.
具体地,当调用后端服务的人证核实接口时,先判断是否存在这个人的第一人脸底图,也就是可靠底图,如果存在,直接跟这个可靠底图进行比对,比对结果也就是分为比对未通过,进入步骤S50045,或者比对通过,进入步骤S50046。无论比对结果是否通过都直接把比对结果返回给前端,不调用第三方的公安接口。Specifically, when calling the back-end service's person verification interface, first determine whether the person's first face base map, which is a reliable base map, exists, and if it exists, directly compare it with this reliable base map. The result is that the comparison is not passed, and step S50045 is entered, or the comparison is passed, and step S50046 is entered. Regardless of whether the comparison result is passed or not, the comparison result is directly returned to the front end, and the third-party public security interface is not called.
S50044、服务器将第一人脸底图降为第二人脸底图。S50044. The server reduces the first face base map to the second face base map.
具体地,服务器将第一人脸底图降为第二人脸底图,可以通过将所述第一人脸底图的分值修改为小于所述第一预设分值阈值并且大于或者等于所述第二预设分值阈值的值,也就是将第一人脸底图的分值按照预先设置修改为第一人脸底图的第一预设分值阈值以下,比如,以100分为例,若第一预设分值阈值为90,可以将第一人脸底图的分值设置为70,进入步骤S5006,将人脸图与第二人脸底图进行比对。Specifically, the server reduces the first face base map to the second face base map by modifying the score of the first face base map to be less than the first preset score threshold and greater than or equal to The value of the second preset score threshold is to modify the score of the first face base map to be below the first preset score threshold of the first face base map, for example, 100 points As an example, if the first preset score threshold is 90, the score of the first face base map can be set to 70, and step S5006 is entered to compare the face map with the second face base map.
S5005、若服务器判断没有与该身份信息对应的分级人脸底图,服务器调用第三方的公安接口,将获得的人脸图发送至公安接口,进入步骤S5009,通过公安接口进行人证核实以获得人证核实的比对结果。S5005. If the server judges that there is no hierarchical face base map corresponding to the identity information, the server calls the public security interface of the third party, and sends the obtained face image to the public security interface, and then enters step S5009 to verify the identity through the public security interface. The comparison result of personal certificate verification.
S5006、服务器将人脸图与第二人脸底图进行比对,进入步骤S5007。S5006. The server compares the face map with the second face base map, and then proceeds to step S5007.
S5007、服务器人脸图与第二人脸底图比对,若比对通过,进入步骤S5008,获得比对结果,若比对不通过,由于第二人脸底图为普通底图,可靠性不稳定,进入步骤S5005,进一步调用公安接口进行人证核实,以通过公安接口获得可靠的人证核实结果。S5007. The server face map is compared with the second face base map. If the comparison passes, step S5008 is entered to obtain the comparison result. If the comparison fails, the second face base map is a normal base map, which is reliable If it is unstable, step S5005 is entered, and the public security interface is further invoked to verify the identity, so as to obtain a reliable identity verification result through the public security interface.
S5008、若服务器对人脸图与第二人脸底图比对通过,将比对通过作为比对结果,并后续将比对结果发送至前端。S5008. If the server passes the comparison between the face image and the second face base image, the comparison is passed as the comparison result, and the comparison result is subsequently sent to the front end.
S5009、公安接口接收服务器发送的人脸图及身份信息,根据获得的人脸图及身份信息采用公安接口内部算法进行比对,进入步骤S5010。S5009. The public security interface receives the face image and identity information sent by the server, and compares the obtained face image and identity information using the internal algorithm of the public security interface, and then enters step S5010.
具体地,当服务器接口去调用公安接口时,公安接口会返回人证核实的人脸图的比对分值,这个分值是由公安接口根据上传的人脸图和公安存储的该身份信息对应的人脸底图比对得出的,同时还会返回一个比对通过或者失败的结果,然后把该人脸图及对应的分值保存起来,当下次再调用公安接口时,返回的分值大于保存的分级人脸底图时,覆盖原来的分级人脸底图和分值并记录更新时间。Specifically, when the server interface calls the public security interface, the public security interface will return the comparison score value of the face image verified by the human certificate. This score is based on the uploaded face image and the identity information stored by the public security. The face base map is compared, and a result of the comparison passed or failed will be returned at the same time, and then the face map and the corresponding score will be saved, and the score will be returned when the public security interface is called next time When it is larger than the saved graded face basemap, overwrite the original graded face basemap and score and record the update time.
S5010、公安接口判断该人脸图进行人证核实的比对是否通过。S5010: The public security interface judges whether the comparison of the face image for verification of the person's identity is passed.
具体地,一般认为公安内部存储的人脸底图等个人信息是稳定和可靠的,由于公安内部存储的人脸底图的可靠性,获得的人证核实结果一般也是作为最后的人证核实结果。公安接口采用内部算法比对人脸图和公安内部预存的人脸底图,获得比对结果,若公安接口比对通过,进入步骤S5011,若公安接口比对未通过,进入步骤S5013。Specifically, it is generally believed that the personal information such as the face map stored in the public security is stable and reliable. Due to the reliability of the face map stored in the public security, the obtained verification result is generally regarded as the final verification result. . The public security interface uses an internal algorithm to compare the face image with the face base map pre-stored in the public security to obtain the comparison result. If the public security interface passes the comparison, step S5011 is entered, and if the public security interface fails the comparison, step S5013 is entered.
S5011、若公安接口进行人证核实比对通过,进入步骤S5012。S5011, if the public security interface has passed the verification and comparison of the person's certificate, go to step S5012.
S5012、公安接口将比对通过的比对结果和比对分值返还至服务器,进入步骤S5015,由服务器获得比对结果,并进一步返还至前端。S5012. The public security interface returns the comparison result and the comparison score value that have passed the comparison to the server, and proceeds to step S5015, where the server obtains the comparison result, and further returns it to the front end.
S5013、若公安接口进行人证核实比对未通过,进入步骤S5014;S5013. If the public security interface fails to pass the verification and comparison of the person's certificate, proceed to step S5014;
S5014、公安接口生成比对未通过的比对结果,同时生成比对分值,并将比对未通过的结果及比对分值返还给服务器,进入步骤S5015。其中,比对分值是由公安接口根据人脸图与公安接口内部存储的人脸底图经过人脸识别进行相似性的比较,比对分值的分值越高,人脸图与公安接口内部存储的人脸底图越相似,表明人脸图和证件一致,人证一致性核实越可靠,比对分值的分值越低,人脸图与公安接口内部存储的人脸底图越不相似,表明人脸图和证件不一致的可能性增强,人证一致性核实可靠性相对较低,分值低到预设的程度,就是人证核实比对未通过的结果。S5014. The public security interface generates a comparison result that fails the comparison, and at the same time generates a comparison score value, and returns the failed comparison result and the comparison score value to the server, and step S5015 is performed. Among them, the comparison score is compared by the public security interface based on the face image and the face base map stored in the public security interface through face recognition. The higher the score, the higher the score, the face image and the public security interface The more similar the internally stored face base maps are, it indicates that the face map is consistent with the ID, and the more reliable the verification of the identity of the witness is, and the lower the comparison score is, the more the face map is stored in the public security interface. The lack of similarity indicates that the possibility of inconsistency between the face image and the ID is increased. The reliability of the verification of the identity of the ID is relatively low, and the score is as low as the preset level, which is the result of the failed verification of the ID.
S5015、服务器将获得的人证核实的比对结果返还至前端以完成人证核实。其中,人证核实的比对结果来源包括以下三种:S5015. The server returns the comparison result of the obtained ID verification to the front end to complete the ID verification. Among them, the sources of the comparison results of the verification of the witnesses include the following three types:
(1)服务器将人脸图与第一人脸底图进行比对。由于第一人脸底图的可靠性,直接将比对结果作为人证核实的比对结果返还至前端;(1) The server compares the face image with the first face base image. Due to the reliability of the base map of the first face, the comparison result is directly returned to the front end as the comparison result of the verification of the person certificate;
(2)服务器将人脸图与第二人脸底图进行比对。若比对通过,说明人脸图与第二人脸底图有一定的相似性,将比对结果返还至终端,若人脸图与第二人脸底图比对不通过,进一步调用公安接口,将公安接口的比对结果作为人证核实的结果。(2) The server compares the face image with the second face base image. If the comparison is passed, it means that the face image has a certain similarity with the second face base image, and the comparison result is returned to the terminal. If the face image and the second face base image fail to be compared, the public security interface is further called , And use the comparison result of the public security interface as the result of the verification of the personal certificate.
(3)通过公安接口获得人证核实的比对结果。若服务器没有底图,或者人脸图与第二人脸底图的比对不通过,服务器调用公安接口进行人证核实,将公安接口的比对结果作为人证核实的比对结果返还至前端,进入步骤S5016,也就是通过前端显示人证核实的比对结果。(3) Obtain the verification result of the person certificate through the public security interface. If the server does not have a base map, or the comparison between the face map and the second face base map fails, the server calls the public security interface to verify the identity, and returns the comparison result of the public security interface as the verification result to the front end , Go to step S5016, that is, display the comparison result of the verification of the human ID through the front end.
进一步地,调用公安接口进行人证核实时,若公安接口对该人脸图人证核实比对通过,可以根据公安接口返回的分值数据更新服务器的分级人脸底图以使服务器的分级人脸底图及时进行升级更新,提高后续人证核实的可靠性。上述方法还包括以下步骤:Further, the public security interface is called for real-time identification verification. If the public security interface passes the verification and comparison of the facial image, it can update the server's hierarchical face base map according to the score data returned by the public security interface to make the server classify people The face map is updated in time to improve the reliability of follow-up verification. The above method also includes the following steps:
S5017、服务器判断是否获得公安接口的比对通过的结果。若获得公安接口比对通过的结果,进入步骤S50171,若公安接口进行人证核实时比对未通过,进入步骤S5015,将人证核实未通过的结果直接返还至前端。S5017: The server judges whether the result of the comparison of the public security interface is obtained. If the result of the comparison of the public security interface is obtained, step S50171 is entered. If the real-time verification of the public security interface fails to pass the verification, step S5015 is entered, and the result of the verification of the identity verification is directly returned to the front end.
S50171、若服务器获得公安接口比对通过的结果,获得公安接口返回的比对分值,进入步骤S50172。S50171: If the server obtains the result of the comparison of the public security interface, obtains the comparison score value returned by the public security interface, and proceeds to step S50172.
具体地,若服务器获得第三方的公安接口比对通过的结果,获取从所述第三方接口获得的所述比对结果中包含的所述人脸图的分值,进入步骤S50172,判断所述人脸图的分值是否大于或者等于第二预设分值阈值,若所述人脸图的分值大于或者等于所述第二预设分值阈值,将所述人脸图及其分值进行存储。Specifically, if the server obtains the comparison result of the third-party public security interface, obtains the score of the face image included in the comparison result obtained from the third-party interface, and then proceeds to step S50172 to determine the Whether the score of the face image is greater than or equal to the second preset score threshold, if the score of the face image is greater than or equal to the second preset score threshold, the face image and its score Store it.
S50172、判断该比对分值是否大于或者等于第一预设分值阈值。S50172: Determine whether the comparison score is greater than or equal to a first preset score threshold.
具体地,判断该比对分值是否大于或者等于第一预设分值阈值,也就是判断该该比对分值是否大于预设的可靠底图的可靠分值,若该比对分值大于预设的可靠底图的可靠分值,表明服务器该次获得的人脸图很可靠,进入步骤S50173,也就是服务器将该人脸图作为可靠底图保存为第一人脸底图,并保存更新时间,后续人证核实时若该第一人脸底图还在预设有效性期限内,将该第一人脸底图作为进行人证核实的可靠底图,由于可靠底图的比对结果无论是否通过,均可以直接作为人证核实的结果,从而避免调用公安接口,不但可以提高人证核实的效率,还可以节省调用公安接口进行人证核实需要的费用。比如,以100分为例,若预设的可靠底图的可靠分值为80分,而公安接口返还的分值为95分,就可以将该人脸图作为可靠底图进行保存。Specifically, it is determined whether the comparison score is greater than or equal to the first preset score threshold, that is, it is determined whether the comparison score is greater than the reliable score of the preset reliable base map, and if the comparison score is greater than The preset reliability score of the reliable basemap indicates that the face image obtained by the server this time is reliable, and step S50173 is entered, that is, the server saves the face image as the reliable basemap as the first face basemap, and saves it Update time, real-time follow-up verification. If the first face base map is still within the preset validity period, the first face base map will be used as a reliable base map for verification, due to the comparison of reliable base maps Whether the result is passed or not, it can be directly used as the result of the identification verification, thus avoiding calling the public security interface, which not only improves the efficiency of the identification verification, but also saves the cost of calling the public security interface for identification verification. For example, taking 100 points for example, if the preset reliable base map has a reliable score of 80 points, and the public security interface returns a score of 95 points, the face image can be saved as a reliable base map.
若该比对分值小于第一预设分值阈值,判断该人脸图不能作为可靠底图,进入步骤S50174,判断比对分值是否大于第二人脸底图的分值,若该次人脸图返回的分值大于原先存储的第二人脸底图的分值或者原先没有第二人脸底图,表明该次人脸图比原来的第二人脸底图或者比原来没有第二人脸底图时与公安接口中的人脸图相比更可靠,可以将该次人脸图替换掉原来的第二人脸底图或者保存为第二人脸底图,提高后续人证核实的效率和可靠性。因此,若服务器判断该比对分值小于预设的可靠底图的可靠分值,进入步骤S50174。If the comparison score is less than the first preset score threshold, it is determined that the face image cannot be used as a reliable base image, and step S50174 is entered to determine whether the comparison score is greater than the score of the second face base image. The score returned by the face image is greater than the score of the originally stored second face basemap or there is no second face basemap, indicating that the face image is better than the original second face basemap or has no second face basemap. The two-face base map is more reliable than the face map in the public security interface. This face map can be replaced with the original second face base map or saved as the second face base map to improve subsequent identification Verify the efficiency and reliability. Therefore, if the server determines that the comparison score is less than the preset reliable score of the reliable basemap, step S50174 is entered.
S50174、判断所述人脸图的分值是否大于或者等于第二预设分值阈值。S50174: Determine whether the score of the face image is greater than or equal to a second preset score threshold.
S50175、若所述人脸图的分值大于或者等于所述第二预设分值阈值,将所述人脸图及其分值进行存储。S50175: If the score of the face image is greater than or equal to the second preset score threshold, store the face image and its score.
具体地,若服务器判断该分值大于已有第二人脸底图的分值,或者若原先没有底图,将该底图替换已有第二人脸底图及其分值,或者将该人脸图保存为第二人脸底图,以提高后续人证核实的效率,并节省后续人证核实调用公安接口的费用。若服务器判断该分值不大于第二人脸底图的分值,则直接将公安接口返回的比对结果返还至前端,也就是进入步骤S5015。Specifically, if the server determines that the score is greater than the score of the existing second face basemap, or if there is no original basemap, the basemap replaces the existing second face basemap and its score, or The face map is saved as a second face base map to improve the efficiency of subsequent identification verification and save the cost of calling the public security interface for subsequent identification verification. If the server determines that the score is not greater than the score of the second face base map, it directly returns the comparison result returned by the public security interface to the front end, that is, step S5015 is entered.
在本申请实施例中,通过在人证核实过程中引入分级人脸底图,尤其是第一人脸底图,可以带来以下有益效果:1)可以使得人脸底图库中的人脸底图比对结果更精确;2)减少调用公安接口的调用次数,节省资金成本和减少接口响应的时间;3)由于设置了可靠的第一人脸底图的时效性,能够保证当公安系统信息更改时,服务器的分级人脸底图及时跟上更新,从而提高服务器进行人证核实的精确性。In the embodiment of the present application, by introducing a hierarchical face base map, especially the first face base map, during the verification process of the personal identification, the following beneficial effects can be brought: 1) The face base in the face base library can be made The comparison result is more accurate; 2) Reduce the number of calls to the public security interface, save capital costs and reduce interface response time; 3) The timeliness of the reliable first face base map is set to ensure that the public security system information When changing, the server's hierarchical face base map keeps up with the update in time, so as to improve the accuracy of the server's identification verification.
需要说明的是,上述各个实施例所述的人证核实方法,可以根据需要将不同实施例中包含的技术特征重新进行组合,以获取组合后的实施方案,但都在本申请要求的保护范围之内。It should be noted that the method for verifying the identification of persons described in the above embodiments can recombine the technical features contained in the different embodiments as needed to obtain a combined implementation plan, but they are all within the scope of protection claimed by this application. within.
请参阅图6,图6为本申请实施例提供的应用于客户端的人证核实装置的示意性框图。对应于上述人证核实方法,本申请实施例还提供一种人证核实装置。如图6所示,该人证核实装置包括用于执行上述应用于客户端的人证核实方法的单元,该装置可以被配置于终端等计算机设备中。具体地,请参阅图6,该人证核实装置600包括接收单元601、第一判断单元602及第一比对单元603。Please refer to FIG. 6. FIG. 6 is a schematic block diagram of a device for verifying a person's certificate applied to a client according to an embodiment of the application. Corresponding to the above-mentioned method for verifying a person's certificate, an embodiment of the application also provides a device for verifying a person's certificate. As shown in FIG. 6, the personal identification verification device includes a unit for executing the above-mentioned personal identification verification method applied to the client, and the device may be configured in a computer device such as a terminal. Specifically, referring to FIG. 6, the personal identification verification device 600 includes a receiving unit 601, a first determining unit 602, and a first comparing unit 603.
其中,接收单元601,用于接收人脸图及身份信息,所述身份信息包括身份证号码;Wherein, the receiving unit 601 is configured to receive a face image and identity information, where the identity information includes an ID number;
第一判断单元602,用于根据所述身份信息判断是否存储有与所述身份信息对应的第一人脸底图,其中,所述第一人脸底图为分值大于或者等于第一预设分值阈值的人脸底图,所述第一人脸底图的分值来源于第三方接口对所述第一人脸底图进行人证核实时返回的比对分值,用于描述所述第一人脸底图与所述第三方接口存储的人脸底图的相似度;The first determining unit 602 is configured to determine whether a first face base map corresponding to the identity information is stored according to the identity information, wherein the first face base map has a score greater than or equal to the first predetermined A face base map with a score threshold. The score of the first face base map is derived from the comparison score returned in real time by the third-party interface for verification of the first face base map, used for description The similarity between the first face base map and the face base map stored in the third-party interface;
第一比对单元603,用于若存储有所述第一人脸底图,将所述人脸图与所述第一人脸底图进行比对以得到人证核实的比对结果。The first comparison unit 603 is configured to, if the first face base map is stored, compare the face map with the first face base map to obtain a verification result of the personal identification.
请参阅图7,图7为本申请实施例提供的应用于客户端的人证核实装置的另一个示意性框图。如图7所示,在该实施例中,第一判断单元602包括:Please refer to FIG. 7. FIG. 7 is another schematic block diagram of the device for verifying a person's certificate applied to a client according to an embodiment of the application. As shown in FIG. 7, in this embodiment, the first determining unit 602 includes:
第一判断子单元6021,用于根据所述身份信息判断是否存储有与所述身份信息对应的分级人脸底图,其中,所述分级人脸底图分为所述第一人脸底图和第二人脸底图,所述第二人脸底图为分值大于或者等于所述第二预设分值阈值并且小于所述第一预设分值阈值的人脸底图;The first judgment subunit 6021 is configured to judge whether a hierarchical face base map corresponding to the identity information is stored according to the identity information, wherein the hierarchical face base map is divided into the first face base map And a second face base map, where the second face base map is a face base map with a score greater than or equal to the second preset score threshold and less than the first preset score threshold;
第二判断子单元6022,用于若存储有所述分级人脸底图,判断所述分级人脸底图是否包括所述第一人脸底图;The second judging subunit 6022 is configured to determine whether the graded face base map includes the first face base map if the graded face base map is stored;
第一比对单元603,用于若所述分级人脸底图包括所述第一人脸底图,将所述人脸图与所述第一人脸底图进行比对以得到人证核实的比对结果;The first comparing unit 603 is configured to compare the face image with the first face base image if the graded face base map includes the first face base map to obtain personal identification verification The comparison result;
所述人证核实装置600还包括:The personal identification verification device 600 further includes:
判定单元604,用于若所述分级人脸底图不包括所述第一人脸底图,判定所述分级人脸底图仅包括第二人脸底图;A determining unit 604, configured to determine that the graded face base map only includes a second face base map if the graded face base map does not include the first face base map;
第二比对单元605,用于将所述人脸图与所述第二人脸底图进行比对以判断所述人脸图验证是否通过;The second comparison unit 605 is configured to compare the face image with the second face base image to determine whether the face image verification is passed;
第一获取单元606,用于若所述人脸图验证通过,获取所述人证核实的比对结果;The first obtaining unit 606 is configured to obtain the comparison result of the verification of the person certificate if the verification of the face image is passed;
调用单元607,用于若所述人脸图验证未通过,或者若未存储有所述分级人脸底图,调用第三方接口进行人证核实以从所述第三方接口获取所述人证核实的比对结果。The calling unit 607 is configured to, if the face map verification fails, or if the hierarchical face base map is not stored, call a third-party interface for personal identification verification to obtain the identification verification from the third-party interface The comparison result.
在一个实施例中,所述人证核实装置600还包括:In an embodiment, the personal identification verification device 600 further includes:
第二判断单元,用于若未存储有所述第一人脸底图,根据所述身份信息判断是否存储有与所述身份信息对应的第二人脸底图,其中,所述第二人脸底图为分值大于或者等于所述第二预设分值阈值并且小于所述第一预设分值阈值的人脸底图;The second determining unit is configured to determine whether a second face base map corresponding to the identity information is stored according to the identity information if the first face base map is not stored, wherein the second person The face base map is a face base map with a score greater than or equal to the second preset score threshold and less than the first preset score threshold;
第二比对单元,用于若存储有所述第二人脸底图,将所述人脸图与所述第二人脸底图进行比对以判断所述人脸图验证是否通过;The second comparison unit is configured to, if the second face base map is stored, compare the face map with the second face base map to determine whether the verification of the face map passes;
第一获取单元,用于若所述人脸图验证通过,获取所述人证核实的比对结果;The first obtaining unit is configured to obtain the comparison result of the verification of the person certificate if the verification of the face image is passed;
调用单元,用于若所述人脸图验证未通过,或者若未存储有所述第二人脸底图,调用第三方接口进行人证核实以从所述第三方接口获取所述人证核实的比对结果。The calling unit is configured to, if the face image verification fails, or if the second face base image is not stored, call a third-party interface for identification verification to obtain the identification verification from the third-party interface The comparison result.
在一个实施例中,所述第一比对单元603包括:In an embodiment, the first comparison unit 603 includes:
获取子单元6031,用于通过人脸识别获取所述人脸图与所述第一人脸底图的相似度;The obtaining subunit 6031 is configured to obtain the similarity between the face image and the first face base image through face recognition;
第二判断子单元6032,用于判断所述相似度是否大于或者等于相似度预设阈值;The second judging subunit 6032 is used to judge whether the similarity is greater than or equal to a preset threshold of similarity;
第一判定子单元6033,用于若所述相似度大于或者等于所述相似度预设阈值,判定人证核实比对通过;The first judging subunit 6033 is configured to judge that the verification and comparison of the personal certificate is passed if the similarity is greater than or equal to the preset similarity threshold;
第二判定子单元6034,用于若所述相似度小于所述相似度预设阈值,判定人证核实比对未通过。The second judging subunit 6034 is configured to judge that the verification and comparison of the personal certificate fails if the similarity is less than the preset similarity threshold.
请继续参阅图7,如图7所示,在该实施例中,所述人证核实装置600还包括:Please continue to refer to FIG. 7. As shown in FIG. 7, in this embodiment, the personal identification verification device 600 further includes:
第三判断单元608,用于判断所述第一人脸底图的生成时长是否超过预设时长阈值;The third determining unit 608 is configured to determine whether the generation time length of the first face base map exceeds a preset time length threshold;
修改单元609,用于若所述生成时长超过所述预设时长阈值,将所述第一人脸底图降为第二人脸底图。The modifying unit 609 is configured to reduce the first face base map to a second face base map if the generation time length exceeds the preset time length threshold.
在一个实施例中,所述修改单元609,用于将所述第一人脸底图的分值修改为小于所述第一预设分值阈值并且大于或者等于所述第二预设分值阈值的值。In one embodiment, the modification unit 609 is configured to modify the score of the first face base map to be less than the first preset score threshold and greater than or equal to the second preset score The value of the threshold.
请继续参阅图7,如图7所示,在该实施例中,所述人证核实装置600还包括:Please continue to refer to FIG. 7. As shown in FIG. 7, in this embodiment, the personal identification verification device 600 further includes:
第二获取单元610,用于获取从所述第三方接口获得的所述比对结果中包含的所述人脸图的分值;The second obtaining unit 610 is configured to obtain the score of the face image included in the comparison result obtained from the third-party interface;
第四判断单元611,用于判断所述人脸图的分值是否大于或者等于第二预设分值阈值;The fourth determining unit 611 is configured to determine whether the score of the face image is greater than or equal to a second preset score threshold;
存储单元612,用于若所述人脸图的分值大于或者等于所述第二预设分值阈值,将所述人脸图及其分值进行存储。The storage unit 612 is configured to store the face image and its score if the score of the face image is greater than or equal to the second preset score threshold.
需要说明的是,所属领域的技术人员可以清楚地了解到,上述人证核实装置和各单元的具体实现过程,可以参考前述方法实施例中的相应描述,为了描述的方便和简洁,在此不再赘述。It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned identification verification device and each unit can be referred to the corresponding description in the foregoing method embodiment. For the convenience and brevity of the description, it is not here. Repeat it again.
同时,上述人证核实装置中各个单元的划分和连接方式仅用于举例说明,在其它实施例中,可将人证核实装置按照需要划分为不同的单元,也可将人证核实装置中各单元采取不同的连接顺序和方式,以完成上述人证核实装置的全部或部分功能。At the same time, the division and connection of the various units in the above-mentioned identification verification device are only used as examples. In other embodiments, the identification verification device may be divided into different units as required, or each of the identification verification devices may be divided into different units. The units adopt different connection sequences and methods to complete all or part of the functions of the above-mentioned identification verification device.
上述人证核实装置可以实现为一种计算机可读指令的形式,该计算机可读指令可以在如图8所示的计算机设备上运行。The above-mentioned personal identification verification device may be implemented in a form of computer-readable instructions, and the computer-readable instructions may run on a computer device as shown in FIG. 8.
请参阅图8,图8是本申请实施例提供的一种计算机设备的示意性框图。该计算机设备800可以是台式机电脑或者服务器等计算机设备,也可以是其它设备中的组件或者部件。Please refer to FIG. 8. FIG. 8 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 800 may be a computer device such as a desktop computer or a server, or may be a component or component in other devices.
参阅图8,该计算机设备800包括通过系统总线801连接的处理器802、存储器和网络接口805,其中,存储器可以包括计算机可读存储介质803和内存储器804。该计算机可读存储介质803可存储操作系统8031和计算机可读指令8032。该计算机可读指令8032被执行时,可使得处理器802实现上述各个人证核实方法实施例中的步骤,或者,实现上述各装置实施例中各模块/单元的功能。Referring to FIG. 8, the computer device 800 includes a processor 802, a memory, and a network interface 805 connected through a system bus 801, where the memory may include a computer-readable storage medium 803 and an internal memory 804. The computer-readable storage medium 803 can store an operating system 8031 and computer-readable instructions 8032. When the computer readable instruction 8032 is executed, the processor 802 can realize the steps in the above-mentioned personal identification verification method embodiments, or realize the functions of the various modules/units in the above-mentioned device embodiments.
该处理器802用于提供计算和控制能力,以支撑整个计算机设备800的运行。The processor 802 is used to provide calculation and control capabilities to support the operation of the entire computer device 800.
该内存储器804为计算机可读存储介质803中的计算机可读指令8032的运行提供环境,该计算机可读指令8032被处理器802执行时,可使得处理器802执行以上各实施例中所描述的人证核实方法的步骤。The internal memory 804 provides an environment for the operation of the computer-readable instructions 8032 in the computer-readable storage medium 803. When the computer-readable instructions 8032 are executed by the processor 802, the processor 802 can execute the operations described in the above embodiments. Steps of the verification method of personal identification.
该网络接口805用于与其它设备进行网络通信。本领域技术人员可以理解,图8中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备800的限定,具体的计算机设备800可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。例如,在一些实施例中,计算机设备可以仅包括存储器及处理器,在这样的实施例中,存储器及处理器的结构及功能与图8所示实施例一致,在此不再赘述。The network interface 805 is used for network communication with other devices. Those skilled in the art can understand that the structure shown in FIG. 8 is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 800 to which the solution of the present application is applied. The specific computer device 800 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement. For example, in some embodiments, the computer device may only include a memory and a processor. In such an embodiment, the structures and functions of the memory and the processor are consistent with the embodiment shown in FIG. 8 and will not be repeated here.
应当理解,在本申请实施例中,处理器802可以是中央处理单元
(Central Processing Unit,CPU),该处理器802还可以是其它通用处理器、数字信号处理器
(Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable
Gate Array,FPGA) 或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that in this embodiment of the application, the processor 802 may be a central processing unit
(Central Processing Unit, CPU), the processor 802 may also be other general-purpose processors, digital signal processors
(Digital Signal Processor, DSP), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (Field-Programmable
Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
本领域普通技术人员可以理解的是实现上述实施例的方法中的全部或部分流程,是可以通过计算机可读指令来完成,该计算机可读指令可存储于一计算机可读存储介质。该计算机可读指令被该计算机系统中的至少一个处理器执行,以实现以上各实施例中所描述的人证核实方法的步骤。A person of ordinary skill in the art can understand that all or part of the processes in the methods of the foregoing embodiments can be implemented by computer-readable instructions, which can be stored in a computer-readable storage medium. The computer-readable instructions are executed by at least one processor in the computer system to implement the steps of the personal identification verification method described in the above embodiments.
因此,本申请还提供一种计算机可读存储介质。该计算机可读存储介质可以为非易失性的计算机可读存储介质,该计算机可读存储介质存储有计算机可读指令,该计算机可读指令被处理器执行时使处理器执行以上各实施例中所描述的人证核实方法的步骤。Therefore, this application also provides a computer-readable storage medium. The computer-readable storage medium may be a non-volatile computer-readable storage medium, and the computer-readable storage medium stores computer-readable instructions. When the computer-readable instructions are executed by a processor, the processor executes the above embodiments. The steps of the verification method described in.
一种计算机可读指令产品,当其在计算机上运行时,使得计算机执行以上各实施例中所描述的人证核实方法的步骤。A computer-readable instruction product, when it runs on a computer, causes the computer to execute the steps of the method for verifying personal identification described in the above embodiments.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink) DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Persons of ordinary skill in the art can understand that all or part of the processes in the methods of the foregoing embodiments can be implemented by instructing relevant hardware through computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage. In the medium, when the computer-readable instructions are executed, they may include the processes of the foregoing method embodiments. Wherein, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and/or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not a limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
所述计算机可读存储介质可以是前述设备的内部存储单元,例如设备的硬盘或内存。所述计算机可读存储介质也可以是所述设备的外部存储设备,例如所述设备上配备的插接式硬盘,智能存储卡(Smart
Media Card, SMC)等。The computer-readable storage medium may be an internal storage unit of the aforementioned device, such as a hard disk or memory of the device. The computer-readable storage medium may also be an external storage device of the device, such as a plug-in hard disk or a smart memory card (Smart Memory Card) equipped on the device.
Media Card, SMC) etc.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may realize that the units and algorithm steps of the examples described in the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two, in order to clearly illustrate the hardware and software Interchangeability. In the above description, the composition and steps of each example have been generally described in terms of function. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
以上所述,仅为本申请的具体实施方式,但本申请明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above are only specific implementations of this application, but the scope of protection stated in this application is not limited to this. Any person skilled in the art can easily think of various equivalents within the technical scope disclosed in this application. Modifications or replacements, these modifications or replacements shall be covered within the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.