The content of the invention
The present invention provides a kind of biometric discrimination method and device based on Multi-thread control, and this method enables to biological door
The operating efficiency of taboo is high, and man-machine interaction is smooth, and user experience is good;And the command collision between multiple threads can be avoided to ask
Topic.
In order to solve the above technical problems, present invention offer technical scheme is as follows:
A kind of biometric discrimination method based on Multi-thread control, including for gathering biometric image and extracting biological characteristic
First thread, the 3rd thread for the second thread being authenticated using biological characteristic and for carrying out man-machine interaction, wherein:
The first thread includes:
Gather biometric image;
Sent to the 3rd thread and open display interface signal, to open display interface;
Sent to the 3rd thread and update display interface signal, to be shown, wherein in the renewal display interface signal
Include the biometric image;
Extract the biological characteristic of the biometric image;
The biological characteristic is sent to the second thread;
Judge whether to meet the condition for closing interface, display interface signal is closed if so, then being sent to the 3rd thread, to close
Close display interface;
Second thread includes:
The biological characteristic sent using first thread is authenticated, if certification passes through, to first thread and the 3rd thread
Send certification pass signal.
A kind of biological identification device based on Multi-thread control, including for gathering biometric image and extracting biological characteristic
First module, the 3rd module for the second module being authenticated using biological characteristic and for carrying out man-machine interaction, wherein:
First module includes:
Collecting unit, for gathering biometric image;
Display interface signal transmitting unit is opened, display interface signal is opened for being sent to the 3rd module, it is aobvious to open
Show interface;
Display interface signal transmitting unit is updated, display interface signal is updated for being sent to the 3rd module, to be shown
Show, wherein including the biometric image in the renewal display interface signal;
Extraction unit, the biological characteristic for extracting the biometric image;
Biological characteristic transmitting element, for sending the biological characteristic to the second module;
First closes boundary condition judging unit, for judging whether to meet the condition for closing interface, if so, then to the 3rd
Module, which is sent, closes display interface signal, to close display interface;Second module includes:
Authentication unit, the biological characteristic for being sent using the first module is authenticated, if certification passes through, to the first mould
Block and the 3rd module send certification pass signal.
The invention has the advantages that:
Compared with the order of single thread in the prior art performs each step, the present invention gathers biometric image by first thread
And biological characteristic is extracted, it is authenticated by the second thread using biological characteristic, man-machine interaction, first is carried out using the 3rd thread
Thread, the second thread and the 3rd thread parallel are performed, and transfer the interaction completed between thread by signal stream so that biological gate inhibition
Operating efficiency it is high, and in man-machine interaction, the almost real-time image that user sees, man-machine interaction is smooth, user's body
The property tested is good.
Also, inventor also found, even if the recognition methods of biological gate inhibition is simply divided into three threads, each thread
Corresponding order can be performed according to the judgement of itself, if the signal circulation between the arrangement of the step of thread and each thread is arranged not
Rationally, it will result in the situation of command collision.Such as the 3rd thread needs to be controlled according to the signal of first thread and the second thread
The operations such as display interface opening processed, closing and display, conflict if the signal of first thread and the second thread is present, the 3rd thread
Display also occurs chaotic (including switching chaotic, display confusion etc.).
The present invention only controls the 3rd thread to open and close display interface by the signal of first thread, is not in display
The switch at interface is chaotic;In addition, display interface needs the biological figure of renewal display interface signal display sent according to first thread
As, it is necessary to show the authentication result (certification pass signal) that the second thread is sent, according to time relationship, first thread, which is sent, to be updated
Display interface signal is before the second thread sends authentication result, that is, to have shown after biometric image, then shows authentication result,
It is not in the display confusion of display interface.Therefore, the present invention can avoid the command collision problem between multiple threads.
In summary, the biometric discrimination method of the invention based on Multi-thread control enables to the work of biological gate inhibition to imitate
Rate is high, and man-machine interaction is smooth, and user experience is good;And the command collision problem between multiple threads can be avoided.
Embodiment
To make the technical problem to be solved in the present invention, technical scheme and advantage clearer, below in conjunction with accompanying drawing and tool
Body embodiment is described in detail.
On the one hand, the embodiment of the present invention provides a kind of biometric discrimination method based on Multi-thread control, such as Fig. 1 and Fig. 2 institutes
Show, including for gathering biometric image and extracting the first thread of biological characteristic, for be authenticated using biological characteristic
Two threads and the 3rd thread for carrying out man-machine interaction, first thread, the second thread and the 3rd thread parallel are performed, they it
Between by signal stream transfer complete thread between interaction, wherein:
As shown in figure 1, first thread includes:
Step 101:Gather biometric image;The harvester collection biometric image of the biological gate inhibition of first thread control.
Step 102:Sent to the 3rd thread and open display interface signal, the 3rd thread is received after display interface signal,
Display interface can be opened, display is ready for.
Step 101 and 102 is without strict sequencing relation.
Step 103:Sent to the 3rd thread and update display interface signal, to be shown, wherein updating display interface letter
Biometric image is included in number;3rd thread is received after renewal display interface signal, display interface can be refreshed, display is adopted
The biometric image collected.
Step 104:Extract the biological characteristic of biometric image;First thread using specific algorithm to biometric image at
Reason, extracts biological characteristic (characteristic value, characteristic vector or eigenmatrix etc.), for example, if recognition of face, can use volume
Product neutral net etc. extracts face characteristic, if fruit is iris recognition, the methods such as Gabor filtering can be used to extract iris special
Levy.
Step 105:Biological characteristic is sent to the second thread;The biological characteristic extracted is sent to the second line by first thread
Journey, so that the second thread is authenticated.
Step 106:Judge whether to meet the condition for closing interface, display interface is closed if so, then being sent to the 3rd thread
Signal, to close display interface;3rd thread is received after closing display interface signal, closes display interface;Close interface
Condition has a variety of situations, general, if certification is finished, (including certification a variety of feelings such as leaves by, certification time-out, user
Condition), for example, can think after first thread receives the certification pass signal of the second thread transmission (after authentication authorization and accounting success)
The condition for closing interface is met, a kind of this situation is only enumerated here, is specifically listed again when other situations are mentioned later.
As shown in Fig. 2 the second thread includes:
Step 201:The biological characteristic sent using first thread is authenticated, if certification passes through, to first thread and
3rd thread sends certification pass signal;First thread is received after certification pass signal, that is, thinks to meet the bar for closing interface
Part, the 3rd thread is received after certification pass signal, can be pointed out (sound is exported and/or image is shown), and now give birth to
Thing gate inhibition can open the door.
First thread (including step 101 to step 106) and the second thread (step 201) are parallel each other, are not had
Whether there is strict time order and function relation.
Compared with the order of single thread in the prior art performs each step, the present embodiment passes through the biological figure of first thread collection
Picture simultaneously extracts biological characteristic, is authenticated by the second thread using biological characteristic, and man-machine interaction is carried out using the 3rd thread, the
One thread, the second thread and the 3rd thread parallel are performed, and transfer the interaction completed between thread by signal stream so that biological door
The operating efficiency of taboo is high, and in man-machine interaction, the almost real-time image that user sees, man-machine interaction is smooth, user
Experience property is good.
Also, inventor also found, even if the recognition methods of biological gate inhibition is simply divided into three threads, each thread
Corresponding order can be performed according to the judgement of itself, if the signal circulation between the arrangement of the step of thread and each thread is arranged not
Rationally, it will result in the situation of command collision.Such as the 3rd thread needs to be controlled according to the signal of first thread and the second thread
The operations such as display interface opening processed, closing and display, conflict if the signal of first thread and the second thread is present, the 3rd thread
Display also occurs chaotic (including switching chaotic, display confusion etc.).
If opening display interface signal for example, being sent from first thread to the 3rd thread, display interface is opened, and by second
Thread sends to the 3rd thread and closes display interface signal, and closing display interface, (this is very common, because certification success is latter
As can all close display interface), if first thread does not know that the second thread have sent closing display interface signal, then the
One thread can send to the 3rd thread and open display interface signal again, open display interface so that after the authentication has been successful can not
Normal switching-off display interface, causes switch chaotic.
The present embodiment only controls the 3rd thread to open (step 102) and closes (step 106) by the signal of first thread
Display interface, is not in the switch confusion of display interface;In addition, the renewal that display interface is sent according to first thread shows boundary
Face signal shows biometric image, then shows the authentication result (certification pass signal) that the second thread is sent, i.e. first display in real time
Biometric image, then after authentication result is obtained, refreshes display screen, shows authentication result, be not in the display of display interface
It is chaotic.Therefore, the present embodiment can avoid the command collision problem between multiple threads.
To sum up, the biometric discrimination method based on Multi-thread control of the present embodiment enables to the operating efficiency of biological gate inhibition
Height, man-machine interaction is smooth, and user experience is good;And the command collision problem between multiple threads can be avoided.
On the basis of above-described embodiment, also include before gathering biometric image (step 101) in first thread:
Step 100:Judge whether to meet the condition of collection, if so, then going to collection biometric image, otherwise, repeat
This step;In the present embodiment, first thread can be created after biological gate inhibition enters biometric identification process, but will not be at once
Operation, only when judging to meet acquisition condition, can just run first thread (it is of course also possible to enter biological in biological gate inhibition
After identification process, first thread is not created immediately, only when judging to meet acquisition condition, can just be created and be run First Line
Journey).
It can judge whether to meet the condition of collection by various methods, the present embodiment is by user with biological gate inhibition's
Distance judges, if for example, the distance of user and biological gate inhibition are less than certain value, preferably 50cm, then it is assumed that meet collection
Condition.Now, on the judgement for meeting the condition for closing interface in step 106, if the distance of user and biological gate inhibition are big
In certain value, preferably 50cm, then it is assumed that user has been moved off, that is, meet the condition for closing interface.If also, keeper logs in
To biological gate inhibition, and when pressing the collection button of correlation, it is also assumed that meeting the condition of collection.
Also, after judging to meet the condition of collection, first thread can be sent out signal and wake up or create the second thread
(it can be described behind detailed process) with the 3rd thread.
Now, in first thread, in the step of judging whether to meet the condition for closing interface (step 106), if not meeting,
Then go to the condition (step 100) for judging whether to meet collection;If once certification does not pass through, first thread repeats each
Step, resurveys biometric image, carries out certification again, until by or time-out (overtime specific judgment step is follow-up
It can introduce).
The present embodiment judges whether to perform first thread by judging whether to meet the condition of collection, it is to avoid First Line
Journey dry running (gathers biometric image) always in the case of no user, optimizes implementation procedure, and it is unnecessary to reduce
Overhead, save the energy;And carry out multiple certification, it is ensured that the accuracy rate of certification.
Further, in the second thread, the biological characteristic sent using first thread is authenticated before (step 201) also
Including:
Step 200:Judge whether to meet the condition of certification, if so, then going to the biological characteristic sent using first thread
It is authenticated, otherwise, repeats this step;In the present embodiment, it can be created after biological gate inhibition enters biometric identification process
Second thread, but will not run at once, only when judging to meet authentication condition, it can just run the second thread and (certainly, also may be used
So that after biological gate inhibition enters biometric identification process, the second thread is not created immediately, only when judging to meet authentication condition,
It can create and run the second thread).
It can judge whether to meet the condition of certification by various methods, the present embodiment is meeting collection by first thread
The signal sent in the case of condition judges, for example, first thread sends authentication signal (foregoing wake-up signal), the second line
Journey, which is received, thinks the condition for meeting certification after authentication signal, be ready to carry out follow-up process;Or first thread sends biological
Feature, the second thread, which is received, thinks the condition for meeting certification after biological characteristic, be ready to carry out follow-up process.
Also, in the second thread, in the step of being authenticated using biological characteristic, if certification does not pass through, go to judgement
Whether the condition (step 200) of certification is met;If once certification does not pass through, the second thread repeats each step, again
Receive biometric image, carry out certification again, until by or it is overtime (extended meeting introduction after overtime specific judgment step).
If in addition, certification does not pass through, authentification failure signal can also be sent to the 3rd thread, the 3rd thread can be carried
Show.
The present embodiment judges whether to perform the second thread by judging whether to meet the condition of certification, it is to avoid the second line
Journey dry running, optimizes implementation procedure, reduces unnecessary overhead, saves the energy;And carry out multiple certification, it is ensured that
The accuracy rate of certification.
When carrying out multiple certification, situation about can not be exited in order to avoid certification always is, it is necessary to set the judgement step of time-out
Suddenly, it is specially:Also include in second thread:
Judge whether certification is overtime, if it is, sending certification timeout signal to first thread and the 3rd thread;Now,
The condition at the closing interface in step 106 can be to receive certification timeout signal, and the 3rd thread can be pointed out.
Time-out can be controlled by practice and certification number of times, if more than setting time or more than certification number of times is set, i.e.,
Think time-out, when overtime, that is, think epicycle (a wheel certification refers to the multiple certification carried out before the timeout) authentification failure.And this
Step is with other steps in the second thread and in the absence of strict precedence relationship.
The present embodiment judges to terminate the cyclic process of multiple certification by time-out, it is to avoid what certification always can not be exited
Situation.
3rd thread can have a variety of situations, and one embodiment is provided here, specifically, the 3rd thread includes:
Step 301:Judge whether to meet the condition for opening display interface, if so, then opening display interface, otherwise, go to
Next step;In the present embodiment, the 3rd thread can be created, but will not stand after biological gate inhibition enters biometric identification process
Operation is carved, only when judging to meet the condition for opening display interface, the 3rd thread can be just run (it is of course also possible in biology
Gate inhibition enters after biometric identification process, and the 3rd thread is not created immediately, only when judging to meet the condition for opening display interface,
It can just create and run the 3rd thread).
It can judge whether to meet the condition for opening display interface by various methods, the present embodiment is existed by first thread
The signal sent in the case of meeting acquisition condition judges, for example, first thread, which is sent, opens display interface signal (this implementation
Example is used as wake-up signal to open display interface signal), the 3rd thread is received to be thought to open aobvious after opening display interface signal
Show the condition at interface, open display interface, and be ready to carry out follow-up process.
Step 302:Judge whether to meet the condition for updating display interface, if so, then updating display interface, otherwise, go to
Next step;In the present embodiment, the renewal display interface signal for receiving first thread transmission thinks that meeting renewal shows boundary
The condition in face.
Step 303:Judge whether to meet the condition pointed out, if so, then being pointed out, otherwise, go to next step;
In the present embodiment, the authentication result for receiving the transmission of the second thread thinks to meet the condition pointed out, and authentication result is to recognize
Demonstrate,prove successfully, then point out user authentication to pass through, if authentication result is an authentification failure, point out user to re-start certification, and
And user can also be pointed out to be coordinated, such as closer or far from biological gate inhibition, if authentication result is certification time-out, point out to use
Family authentification failure.
Step 304:Judge whether to meet the condition for closing display interface, if so, then closing display interface, and go to judgement
Whether meet the condition (step 301) for opening display interface, otherwise, directly go to and judge whether to meet the bar for opening display interface
Part step 301);In the present embodiment, the closing display interface signal of first thread transmission is received, that is, thinks to close display interface
Condition.
3rd thread of the present embodiment can avoid showing what is caused confusion caused by the command collision between multiple threads
Problem, and make it that display is more smooth.
Citing description is carried out to the present invention with a preferred embodiment below:
First thread includes:
Step 100 ':Judge whether collection flag bit is true, if so, performing next step, otherwise, repeats this step;
Wherein, the distance of collection user and biological gate inhibition in real time, if during apart from less than 50cm, collection flag bit is set into true;
Step 101 ':Gather biometric image;
Step 102 ':Sent to the 3rd thread and open display interface signal, be designated as S1;
Step 103 ':Sent to the 3rd thread and update display interface signal, be designated as S2, wherein updating in display interface signal
Include biometric image;
Step 104 ':Extract the biological characteristic of biometric image;
Step 105 ':Biological characteristic is sent to the second thread, S3 is designated as;
Step 106 ':Judge whether to receive certification pass signal S6 or certification timeout signal S5, if so, then to the 3rd thread
Send and close display interface signal, be designated as S4, collection flag bit is set to false, and go to step 100 ', otherwise, directly go to step
Rapid 100 ';
Second thread includes:
Step 200 ':Judge whether to receive biological characteristic S3, if so, then performing next step, otherwise, repeat this step
Suddenly;
Step 201 ':It is authenticated, if certification passes through, is sent to first thread and the 3rd thread using biological characteristic S3
Certification pass signal, is designated as S6, otherwise, sends authentification failure signal to the 3rd thread, is designated as S7, and go to step 200 ';
Step 202 ':Judge whether certification is overtime, if it is, sending certification time-out letter to first thread and the 3rd thread
Number, S5 is designated as, and go to step 200 ', otherwise, directly go to step 200 ';
3rd thread includes:
Step 301 ':Judge whether to receive opening display interface signal S1, if so, then opening display interface, otherwise, go to
Next step;
Step 302 ':Judge whether to receive renewal display interface signal S2, if so, then updating display interface, otherwise, go to
Next step;
Step 303 ':Judge whether to receive certification pass signal S6, authentification failure signal S7 or certification timeout signal S5, if
It is then to be pointed out, otherwise, goes to next step;
Step 304 ':Judge whether to receive closing display interface signal S4, if so, then closing display interface, and go to step
Rapid 301 ', otherwise, directly go to step 301 '.
On the other hand, the embodiment of the present invention provides a kind of biological identification device based on Multi-thread control, as shown in figure 3,
Including for gathering biometric image and extracting the first module 1 of biological characteristic, for be authenticated using biological characteristic second
Module 2 and the 3rd module 3 for carrying out man-machine interaction, wherein:
First module 1 includes:
Collecting unit 11, for gathering biometric image;
Display interface signal transmitting unit 12 is opened, display interface signal is opened for being sent to the 3rd module, to open
Display interface;
Display interface signal transmitting unit 13 is updated, display interface signal is updated for being sent to the 3rd module, to carry out
It has been shown that, biometric image is included wherein updating in display interface signal;
Extraction unit 14, the biological characteristic for extracting biometric image;
Biological characteristic transmitting element 15, for sending biological characteristic to the second module;
First closes boundary condition judging unit 16, for judging whether to meet the condition for closing interface, if so, then to the
Three modules, which are sent, closes display interface signal, to close display interface;
Second module 2 includes:
Authentication unit 21, the biological characteristic for being sent using the first module is authenticated, if certification passes through, to first
Module and the 3rd module send certification pass signal.
The biological identification device based on Multi-thread control of the present embodiment enables to the operating efficiency of biological gate inhibition high, people
Machine interaction is smooth, and user experience is good;And the command collision problem between multiple modules can be avoided.
On the basis of above-described embodiment, also include before collecting unit:
Acquisition condition judging unit, for judging whether to meet the condition of collection, if so, collecting unit is then gone to, otherwise,
Repeat acquisition condition judging unit;
Also, the first closing boundary condition judging unit is further used for:If not meeting, go to acquisition condition and judge single
Member.
The present embodiment judges whether to perform the first module by acquisition condition judging unit, it is to avoid the first module air transport
OK, implementation procedure is optimized, unnecessary overhead is reduced, the energy is saved;And carry out multiple certification, it is ensured that certification
Accuracy rate.
Further, also include before authentication unit in the second module:
Authentication condition judging unit, for judging whether to meet the condition of certification, if so, authentication unit is then gone to, otherwise,
Repeat authentication condition judging unit;
Also, authentication unit is further used for:If certification does not pass through, authentication condition judging unit is gone to.
The present embodiment judges whether to perform the second module by authentication condition judging unit, it is to avoid the second module air transport
OK, implementation procedure is optimized, unnecessary overhead is reduced, the energy is saved;And carry out multiple certification, it is ensured that certification
Accuracy rate.
When carrying out multiple certification, situation about can not be exited in order to avoid certification always is, it is necessary to set the judgement of time-out
Correlation unit, be specially:Also include in second module:
Overtime judging unit, for judging whether certification is overtime, if it is, sending and recognizing to the first module and the 3rd module
Demonstrate,prove timeout signal.
The present embodiment terminates the cyclic process of multiple certification by overtime judging unit, it is to avoid certification always can not moved back
Situation about going out.
3rd module can have a variety of situations, and one embodiment is provided here, specifically, the 3rd module includes:
Display interface judging unit is opened, for judging whether to meet the condition for opening display interface, if so, then opening aobvious
Show interface, otherwise, go to renewal display interface judging unit;
Display interface judging unit is updated, for judging whether to meet the condition for updating display interface, if so, then updating aobvious
Show interface, otherwise, go to implied condition judging unit;
Implied condition judging unit, for judging whether to meet the condition pointed out, if so, then pointed out, otherwise,
Go to the second closing boundary condition judging unit;
Second closes boundary condition judging unit, for judging whether to meet the condition for closing display interface, if so, then closing
Display interface is closed, and goes to opening display interface judging unit, otherwise, opening display interface judging unit is directly gone to.
3rd module of the present embodiment can avoid showing what is caused confusion caused by the command collision between multiple modules
Problem, and make it that display is more smooth.
Described above is the preferred embodiment of the present invention, it is noted that for those skilled in the art
For, on the premise of principle of the present invention is not departed from, some improvements and modifications can also be made, these improvements and modifications
It should be regarded as protection scope of the present invention.