Embodiment
It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can combine mutually.Below with reference to the accompanying drawings and describe the present invention in detail in conjunction with the embodiments.
The present invention program is understood better in order to make those skilled in the art person, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the embodiment of a part of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, should belong to the scope of protection of the invention.
It should be noted that, term " first ", " second " etc. in instructions of the present invention and claims and above-mentioned accompanying drawing are for distinguishing similar object, and need not be used for describing specific order or precedence.Should be appreciated that the data used like this can be exchanged in the appropriate case, so as embodiments of the invention described herein can with except here diagram or describe those except order implement.In addition, term " comprises " and " having " and their any distortion, intention is to cover not exclusive comprising, such as, contain those steps or unit that the process of series of steps or unit, method, system, product or equipment is not necessarily limited to clearly list, but can comprise clearly do not list or for intrinsic other step of these processes, method, product or equipment or unit.
Embodiment 1
According to the embodiment of the present invention, provide a kind of embodiment of the method that can be performed by the application's iris identification equipment embodiment, it should be noted that, can perform in the computer system of such as one group of computer executable instructions in the step shown in the process flow diagram of accompanying drawing, and, although show logical order in flow charts, in some cases, can be different from the step shown or described by order execution herein.
Alternatively, in the present embodiment, the communication means of above-mentioned iris identification equipment can be applied on iris identification equipment 100 as shown in Figure 1, to communicate between the iris identification equipment 100 shown in Fig. 1 and host computer 200.Wherein, host computer 200 can be the system that PC or other embedded systems, Single Chip Microcomputer (SCM) system, dsp system, FPGA/CPLD system etc. have certain " control, computing " ability.Iris identification equipment 100 and host computer 200 are linked together by interface, wherein, this interface can be wired, wireless, can be the interface that iris identification equipment 100 can be connected with host computer 200 arbitrarily by serial ports, USB interface, network interface etc.When iris identification equipment 100 sends data to host computer 200, be arranged on the interface of the interface on iris identification equipment 100 as transmit leg, the interface on host computer 200 is as the interface of take over party; When host computer 200 sends data to iris identification equipment 100, be arranged on the interface of the interface on host computer 200 as transmit leg, be arranged on the interface of the interface on iris identification equipment 100 as take over party.Wherein, after data to be sent are sent to the interface of transmit leg by transmit leg, data to be sent are kept in the buffer memory of transmit leg interface by transmit leg interface, and data to be sent are sent to take over party by wired or wireless mode by the interface of transmit leg.The interface of take over party first receives the data that transmit leg is sent, and the data received is stored in the buffer memory of take over party's interface, and then the data in buffer memory is sent to the internal memory of take over party, to process the data received.Fig. 2 is the structural representation of iris identification equipment, and in the present embodiment, the CPU in the main circuit board shown in Fig. 2 can perform the communication means of the iris identification equipment in the present embodiment.
The communication means of the iris identification equipment that the embodiment of the present invention provides as shown in Figure 3.As shown in Figure 3, the communication means of this iris identification equipment comprises the steps:
Step S302, receives and is used to indicate from host computer the instruction that iris identification equipment carries out the operation of iris image process.
Step S304, resolves the operation of the iris image process indicated by instruction.
Step S306, performs the operation of iris image process, and the execution result that the operation that record performs iris image process obtains.
Step S308, sends to host computer by execution result.
Iris identification equipment can receive the instruction from host computer, and this instruction is used to indicate iris identification equipment and operates accordingly.After the operation of iris identification equipment according to the iris image process indicated by the instruction received, the corresponding module in iris identification equipment is driven to perform the operation of iris image process.Wherein, the operation of iris image process can comprise any one operation following: extract iris feature, preserve the identification etc. of iris feature, comparison iris feature and iris feature.
In addition, after iris identification equipment receives instruction, other operations can also be performed according to instruction, comprise: control hummer sound or not sound, control LED is bright or do not work.The bright suggesting effects that can play such as hummer sound or LED; Such as, start to extract iris feature, LED is bright, and after feature extraction success, LED goes out, and hummer rings a sound, points out client iris identification equipment to perform which of operation in this way in stage.Certainly, other operations can also comprise iris feature and search, delete etc., do not limit the operation of iris image process herein, be only used to illustrate the present embodiment for example.
In the present embodiment, the operation needing iris identification equipment to perform is informed iris identification equipment by the form sending instruction by host computer, and execution result is sent to host computer after performing the operation of iris image process according to instruction by iris identification equipment.Mutual by between host computer and iris identification equipment, the operation of iris image process can be completed by iris identification equipment, and be not only by the iris camera collection iris image shown in Fig. 1, and the iris image collected is sent to host computer, is carried out the operation of above-mentioned iris image process by host computer.In the present embodiment, iris identification equipment receives the instruction that host computer sends the operation performing iris image process, thus performs the operation of concrete iris image process, and does not need host computer to perform the operation of concrete iris image process.The operation that iris identification equipment performs is indicated by host computer, so host computer knows the operation performed by iris identification equipment, simultaneously, iris identification equipment is after executing corresponding operation, execution result is sent to host computer, host computer can be known, and whether iris identification equipment executes the operation indicated by it, and the execution result that can transmit according to iris identification equipment judges that whether the operation that iris identification equipment performs is correct, judges next step operation needing iris identification equipment even further according to execution result.By above-described embodiment, solve host computer and iris identification equipment in prior art and cannot know the problem of the mode of operation of the other side, thus reach the effect that host computer and iris identification equipment can know the duty of both sides.
Such as, host computer sends the instruction carrying out the operation of user's registration to iris identification equipment, after iris identification equipment parses from instruction " user's registration ", iris identification equipment starts to gather iris image, and extract the iris feature of the iris image collected, and after the iris feature of this extraction and the ID of user are associated together, be kept in iris identification equipment.Then, iris identification equipment sends the execution result of " succeeding in registration " to host computer.After host computer receives the instruction of succeeding in registration, can also continue to send the instruction carrying out the operation of iris recognition from host computer to iris identification equipment, after iris identification equipment parses from instruction " iris recognition ", iris identification equipment starts to gather iris image, then the iris feature in iris image is extracted, and the iris feature of extraction is compared with the iris feature stored in iris identification equipment, obtain recognition result, then the recognition result obtained is sent to host computer.Host computer and iris identification equipment can carry out the operation of iris image process according to above-mentioned reciprocal process.
Particularly, the operation parsing the iris image process indicated by instruction comprises: extract the data layout in instruction, and whether the data layout of decision instruction is correct; When judging that data layout is correct, extracting from instruction and being used to indicate the command character that iris identification equipment performs the operation of iris image process; And according to the operation corresponding to command character look-up command character, and using the operation that the finds operation as iris image process.
In order to ensure the correctness of the communication between host computer and iris identification equipment, before extracting the command character in instruction, first by judging whether data layout correctly judges that whether the instruction received is correct, when the instruction determining to receive is correct, just perform the operation corresponding to command character in instruction.
Further, whether the data layout of decision instruction correctly comprises: the mark obtaining the communication protocol type that instruction adopts; The command id of the instruction of communication protocol type definition is adopted according to the identifier lookup of communication protocol type; Extract the command id in instruction; And judge that whether the command id extracted is consistent with the command id found, when the command id extracted is consistent with the command id found, determine that the data layout of instruction is correct.
Wherein, before the mark of obtaining communication protocol type, also obtain instruction leader and know, instruction head is designated determined value, for identifying this instruction.
The communication protocol adopted below in conjunction with the present embodiment is described above-mentioned instruction, and the instruction in this embodiment can comprise following byte:
1st byte: leader knows " HDR ", fixed value.
2nd byte: stream format " FMT ", decides the data layout that the 2nd byte FMT (not containing) is later.
3rd byte: command character " CMD ", for representing operational order.
4-7 byte: data length " LEN ", represent DATA district data number (byte is unit).
8th byte rises: the data DATA of LEN byte altogether.If LEN=0, then without this region.
8+LEN byte: School Affairs CHK is the data stream XOR value not containing HDR and CHK.
It should be noted that, when formulation agreement, FMT field and CMD field can reversed positions, the verification mode of data can select the multiple verification modes such as exclusive or check, parity checking, CRC check, or even do not add verification, len field also can be put into after " HDR ", and len field only can indicate the data length in DATA district, also can indicate length etc. the multiple combination mode of the length of whole order or wherein any part.Provide only a kind of mode wherein herein, and done detailed explanation in this kind of mode, but should be appreciated that, this mode is not and for limiting the agreement that the present embodiment adopts.
Basic command character, as: 0x41, user registers; 0x43, user identifies.Certain command character can also be other forms, indicates more fill order, only illustrates herein, does not limit the command character in the embodiment of the present invention.
Such as, iris identification equipment receives " user's registration " instruction from host computer, and this instruction is as follows:
Wherein, it is 11 that the leader of this instruction knows " HDR ", and the stream format " FMT " of instruction is 22, and command character " CMD " is 41, and it represents being operating as " registered user " of the required execution of iris identification equipment indicated by this instruction, and data length " LEN " is
user ID is
check bit is 63.
After iris identification equipment receives above-mentioned instruction, determine the command id that this communication protocol type is corresponding, i.e. stream format FMT " be 22; and the command id extracted in the instruction received also is 22; then determine that the command id found is 22 with the stream format of the instruction received, determine that the data layout of this instruction is correct.In addition, before judging that data layout is whether correct, can also the leader knowledge of first decision instruction whether be 11, if leader is known correct, then determine that this instruction indicates iris identification equipment to perform the instruction of corresponding operating really, if not, then judge this instruction errors, do discard processing.
Before extraction command character, can also judge according to " LEN " in instruction that whether the data in DATA district are identical with the number of the byte shared by the instruction received with the byte number that other characters take altogether.If identical, then the command character " CMD " extracted in instruction is 41, and finds out corresponding being operating as " registered user " of this command character.Now, iris identification equipment gathers iris image and extracts iris feature, extracts the ID of the user carried in instruction
the ID of the user carried in the iris feature of extraction and this instruction is associated together, and association results is kept in iris identification equipment.
Such as, iris identification equipment receives " user's registration " instruction from host computer, and this instruction is as follows:
Wherein, it is 11 that the leader of this instruction knows " HDR ", and the stream format " FMT " of instruction is 22, and command character " CMD " is 43, and it represents being operating as " user's identification " of the required execution of iris identification equipment indicated by this instruction, and data length " LEN " is
check bit is 61.
After iris identification equipment receives this instruction, judge that head is designated 11, stream format is 22, data length is 8, and removes leader knowledge 11 and check bit 61 to the data received, and then remainder data is carried out the process of step-by-step distance, and compare 61 of the XOR value obtained and check bit, if consistent, illustrate that this instruction is correct instruction, work can be carried out according to the operation indicated by this instruction.Iris identification equipment extracts command character 43 from this instruction, and what this command character was corresponding be operating as carries out user's identification.After iris identification equipment determines the work indicated by this instruction, start to gather iris image, and extract iris feature, the iris feature of this iris feature and storage is utilized to compare, with the user ID finding the iris image that mates with this iris feature corresponding, thus achieve the object utilizing iris image to carry out iris recognition.
It should be noted that, can be the storer being arranged on iris identification equipment for storing the equipment of the execution result of iris identification equipment in above-described embodiment, can also be the external memorizer etc. be connected on iris identification equipment.
When execution result being sent to host computer, identical communication protocol can be adopted to generate reply data, and execution result is arranged in reply data as acknowledge character, and the reply data of generation is sent to host computer.
For above-mentioned two examples, the instruction that iris equipment receives " user's registration ", the reply data obtaining execution result generation is as follows:
Wherein, the head of this reply data is designated 11, and stream format is 22, and acknowledge character is 00, succeed in registration for representing, operational order is 41, represents " user's registration ", namely this response is the response made for the instruction of " user's registration ", and data length is 0, check bit 63.
After host computer receives reply data, whether correctly will verify leader knowledge, stream format, check bit equally, after determining that foregoing is all correct, extracting acknowledge character is 00, and now host computer knows iris identification equipment successful registration user.Host computer can continue instruction iris identification equipment and carry out other work, can also terminate current mutual, until again need to send new instruction to iris identification equipment during the work of instruction iris identification equipment.
The instruction that iris identification equipment receives " user's identification ", the reply data obtaining execution result generation is as follows:
send to host computer; Wherein
for user ID.
It is 00 that host computer extracts acknowledgement command, determines iris identification equipment identification user success, and extract user ID from this reply data.The process of the reply data of host computer verification " user's identification " is identical with the process of the reply data of verification " user registers ", repeats no more herein.
Pass through above-described embodiment, host computer generates instruction and reply data with iris identification equipment according to identical communication protocol, thus the communication achieved between host computer and iris identification equipment, operation performed by the other side is all known to make both sides, in addition, because all or part of function of the process of iris image completes by iris identification equipment, and host computer only needs to send instruction, process the reply data received, simplify the logic function of host computer, in addition, iris identification equipment can perform most functions of carrying out iris image process, can be used alone, also be easy to be integrated in other electronic equipments, be convenient to the use of iris identification equipment.
Embodiment 2
The embodiment of the present invention additionally provides a kind of communication means of host computer.Fig. 4 is the process flow diagram of the communication means of host computer according to the embodiment of the present invention.As shown in the figure, the communication means of this host computer comprises the steps:
Step S402, host computer sends to iris identification equipment and is used to indicate the instruction that iris identification equipment performs the operation of iris image process.
Step S404, host computer receives the reply data from iris identification equipment response instruction.
Step S406, the execution result that the operation that host computer resolves the process of iris identification equipment execution iris image from reply data obtains.
Step S408, host computer preserves execution result.
In the present embodiment, the operation needing iris identification equipment to perform is informed iris identification equipment by the form sending instruction by host computer, and the reply data received from the instruction of iris device responds, this reply data comprises the execution result obtained after iris identification equipment performs the operation of iris image process according to instruction.Mutual by between host computer and iris identification equipment, the operation of iris image process can be completed by iris identification equipment, and be not only by the iris camera collection iris image shown in Fig. 1, and the iris image collected is sent to host computer, is carried out the operation of above-mentioned iris image process by host computer.In the present embodiment, host computer just sends the instruction of the operation performing iris image process to iris identification equipment, and does not perform the operation of concrete iris image process.Host computer sends instruction to iris identification equipment, iris identification equipment is made to know what operation of this execution, and the operation that iris identification equipment performs is indicated by host computer, so host computer knows the operation performed by iris identification equipment, simultaneously, iris identification equipment is after executing corresponding operation, execution result is sent to host computer, host computer can be known, and whether iris identification equipment executes the operation indicated by it, and the execution result that can transmit according to iris identification equipment judges that whether the operation that iris identification equipment performs is correct, next step operation needing iris identification equipment is judged even further according to execution result.By above-described embodiment, solve host computer and iris identification equipment in prior art and cannot know the problem of the mode of operation of the other side, thus reach the effect that host computer and iris identification equipment can know the duty of both sides.
Particularly, after preservation execution result, this communication means also comprises: whether the operation of the iris image process of host computer indicated by execution result decision instruction is successful; Judge the operation failure of the iris image process indicated by instruction at host computer after, again send instruction to iris identification equipment; Judge the successful operation of the iris image process indicated by instruction at host computer after, generate new instruction.
Host computer after receive the execution result sent from iris identification equipment, can judge the operation of the iris identification equipment whether iris image process of successful execution indicated by this instruction.If judge the operation of the iris image process indicated by the instruction that successful execution host computer sends from execution result, then generate new instruction.This new instruction can be the operation that instruction iris identification equipment performs new iris image process, can also be the instruction that instruction does not temporarily need to communicate.If judge that from execution result iris identification equipment performs the operation failure of the iris image process indicated by host computer, then host computer can send above-mentioned instruction to iris identification equipment again, with the operation indicating iris identification equipment to re-execute the iris image process indicated by above-mentioned instruction.
Such as, the instruction that host computer sends carries out user's identification for indicating iris identification equipment, and the reply data that iris identification equipment returns is
wherein, the acknowledge character of the 4th byte is 00, represents user's identifying operation success that iris identification equipment carries out.If the acknowledge character of the 4th byte of the reply data received is 01, then represent user's identifying operation failure that iris identification equipment carries out.So, host computer is resolved to acknowledge character when being 00, can continue to send next instruction to iris identification equipment, also can not do next step action; If resolving the command character obtained is 01, then can repeat to send the instruction that instruction iris identification equipment carries out user's identification.
Particularly, send to iris identification equipment the operation being used to indicate the process of iris identification equipment execution iris image to comprise: host computer carries out the fractionation of high position data and low data to the command character in instruction; The host computer adjustment position of high position data in command character, is first sent to iris identification equipment to make high position data; And host computer sends high position data and low data successively.
In communication process between host computer and iris identification equipment, due to any one sexadecimal number that communication information may be between 0-255, therefore may occur the information sequence of instruction or the information sequence of reply data identical with the control sequence of some interface, thus cause the situation that the information being transferred to interface is retained by interface.In order to prevent the appearance of this situation, the present embodiment adopts the mode splitting order to communicate.Concrete method is: when host computer sends instruction, and instruction splits and then sends after generating the operational order being used to indicate the process of iris identification equipment execution iris image by host computer.That is: high 4 of each byte in the information sequence of instruction are taken apart with low 4, to add after high 4 gt 4 that certain " specific character " is as odd byte, first sends, low 4 add that this " specific character " is as even byte equally, rear transmission, forms new information sequence and sends.Wherein, specific character recovers the information sequence after fractionation for the ease of iris identification equipment.And iris identification equipment is when receiving the information sequence of instruction, low 4 bit bytes arrived first are to moving to left after 4, and 4 bit bytes arrived after adding, form 1 byte, namely revert to the information sequence of the instruction before fractionation.
It should be noted that, just describe a kind of fractionation mode above, other split mode and also have a lot, high 4 and low 4 of such as each byte respectively send as a byte separately, or form two bytes through some simple calculations, or even multiple new byte sends etc., also have or even do not do any fractionation and directly send raw data.
Pass through above-described embodiment, host computer generates instruction and reply data with iris identification equipment according to identical communication protocol, thus the communication achieved between host computer and iris identification equipment, operation performed by the other side is all known to make both sides, in addition, because all or part of function of the process of iris image completes by iris identification equipment, and host computer only needs to send instruction, process the reply data received, simplify the logic function of host computer, in addition, iris identification equipment can perform most functions of carrying out iris image process, can be used alone, also be easy to be integrated in other electronic equipments, be convenient to the use of iris identification equipment.
Embodiment 3
The embodiment of the present invention additionally provides a kind of iris identification equipment.The iris identification equipment that the communication means of the iris identification equipment of the embodiment of the present invention can be provided by the embodiment of the present invention performs, and the iris identification equipment of the embodiment of the present invention also may be used for the communication means performing the iris identification equipment that the embodiment of the present invention provides.
Alternatively, in the present embodiment, iris identification equipment 100 is for communicating with host computer 200.Wherein, host computer 200 can be the system that PC or other embedded systems, Single Chip Microcomputer (SCM) system, dsp system, FPGA/CPLD system etc. have certain " control, computing " ability.Iris identification equipment 100 and host computer 200 are linked together by interface, wherein, this interface can be wired, wireless, can be the interface that iris identification equipment 100 can be connected with host computer 200 arbitrarily by serial ports, USB interface, network interface etc.Fig. 2 is the structural representation of iris identification equipment, and in the present embodiment, the CPU in the main circuit board shown in Fig. 2 can perform the communication means of the iris identification equipment in the present embodiment.
Fig. 5 is the schematic diagram of the iris identification equipment according to the embodiment of the present invention.As shown in the figure, this iris identification equipment comprises: receiving element 10, resolution unit 20, performance element 30 and transmitting element 40.
Receiving element 10 is used to indicate from host computer the instruction that iris identification equipment carries out the operation of iris image process for receiving.
Resolution unit 20 is for resolving the operation of the iris image process indicated by instruction.
Performance element 30 is for performing the operation of iris image process, and the execution result that the operation that record performs iris image process obtains.And
Transmitting element 40 is for sending to host computer by execution result.
Iris identification equipment can receive the instruction from host computer, and this instruction is used to indicate iris identification equipment and operates accordingly.After the operation of iris identification equipment according to the iris image process indicated by the instruction received, the corresponding module in the iris identification equipment in iris identification equipment is driven to perform the operation of iris image process.Wherein, the operation of iris image process can comprise any one operation following: extract iris feature, preserve the identification etc. of iris feature, comparison iris feature and iris feature.
In addition, after iris identification equipment receives instruction, other operations can also be performed according to instruction, comprise: control hummer sound or not sound, control LED is bright or do not work.The bright suggesting effects that can play such as hummer sound or LED; Such as, start to extract iris feature, LED is bright, and after feature extraction success, LED goes out, and hummer rings a sound, points out client iris identification equipment to perform those steps in this way.Certainly, other operations can also comprise iris feature and search, delete etc., do not limit the operation of iris image process herein, be only used to illustrate the present embodiment for example.
In the present embodiment, the operation needing iris identification equipment to perform is informed iris identification equipment by the form sending instruction by host computer, and execution result is sent to host computer after performing the operation of iris image process according to instruction by iris identification equipment.Mutual by between host computer and iris identification equipment, the operation of iris image process can be completed by iris identification equipment, and be not only by the iris camera collection iris image shown in Fig. 1, and the iris image collected is sent to host computer, is carried out the operation of above-mentioned iris image process by host computer.In the present embodiment, iris identification equipment receives the instruction that host computer sends the operation performing iris image process, thus performs the operation of concrete iris image process, and does not need host computer to perform the operation of concrete iris image process.The operation that iris identification equipment performs is indicated by host computer, so host computer knows the operation performed by iris identification equipment, simultaneously, iris identification equipment is after executing corresponding operation, execution result is sent to host computer, host computer can be known, and whether iris identification equipment executes the operation indicated by it, and the execution result that can transmit according to iris identification equipment judges that whether the operation that iris identification equipment performs is correct, judges next step operation needing iris identification equipment even further according to execution result.By above-described embodiment, solve host computer and iris identification equipment in prior art and cannot know the problem of the mode of operation of the other side, thus reach the effect that host computer and iris identification equipment can know the duty of both sides.
Such as, host computer sends the instruction carrying out the operation of user's registration to iris identification equipment, after iris identification equipment parses from instruction " user's registration ", iris identification equipment starts to gather iris image, and extract the iris feature of the iris image collected, and after the iris feature of this extraction and the ID of user are associated together, be kept in iris identification equipment.Then, iris identification equipment sends the execution result of " succeeding in registration " to host computer.After host computer receives the instruction of succeeding in registration, can also continue to send the instruction carrying out the operation of iris recognition from host computer to iris identification equipment, after iris identification equipment parses from instruction " iris recognition ", iris identification equipment starts to gather iris image, then the iris feature in iris image is extracted, and the iris feature of extraction is compared with the iris feature stored in iris identification equipment, obtain recognition result, then the recognition result obtained is sent to host computer.Host computer and iris identification equipment can carry out the operation of iris image process according to above-mentioned reciprocal process.
Particularly, resolution unit comprises: judge module, and for extracting the data layout in instruction, and whether the data layout of decision instruction is correct.Extraction module, for when judging that data layout is correct, extracting and being used to indicate the command character that iris identification equipment performs the operation of iris image process from instruction.And determination module, for according to the operation corresponding to command character look-up command character, and using the operation that the finds operation as iris image process.
In order to ensure the correctness of the communication between host computer and iris identification equipment, before extracting the command character in instruction, first by judging whether data layout correctly judges that whether the instruction received is correct, when the instruction determining to receive is correct, just perform the operation corresponding to command character in instruction.
Further, submodule is obtained, for obtaining the mark of the communication protocol type that instruction adopts; Search submodule, for adopting the command id of the instruction of communication protocol type definition according to the identifier lookup of communication protocol type; Extract submodule, for extracting the command id in the instruction that receives; Judge submodule, whether consistent with the command id found for judging the command id extracted; And determine submodule, for when the command id extracted is consistent with the command id found, determine that the data layout of instruction is correct.
Further, transmitting element comprises: the first generation module, for generating the acknowledge character being used to indicate execution result according to execution result.Second generation module, generates for the communication protocol adopted according to instruction the reply data meeting communication protocol by acknowledge character.Sending module, for sending to host computer by the reply data of generation.
The communication protocol adopted below in conjunction with the present embodiment is described above-mentioned instruction, and the instruction in this embodiment can comprise following byte:
1st byte: leader knows " HDR ", fixed value.
2nd byte: stream format " FMT ", decides the data layout that the 2nd byte FMT (not containing) is later.
3rd byte: command character " CMD ", for representing operational order.
4-7 byte: data length " LEN ", represent DATA district data number (byte is unit).
8th byte rises: the data DATA of LEN byte altogether.If LEN=0, then without this region.
8+LEN byte: School Affairs CHK is the data stream XOR value not containing HDR and CHK.
Basic command character, as: 0x41, user registers; 0x43, user identifies.Certain command character can also be other forms, indicates more fill order, only illustrates herein, does not limit the command character in the embodiment of the present invention.
Such as, iris identification equipment receives " user's registration " instruction from host computer, and this instruction is as follows:
Wherein, it is 11 that the leader of this instruction knows " HDR ", and the stream format " FMT " of instruction is 22, and command character " CMD " is 41, and it represents being operating as " registered user " of the required execution of iris identification equipment indicated by this instruction, and data length " LEN " is
user ID is
check bit is 63.
After iris identification equipment receives above-mentioned instruction, determine the command id that this communication protocol type is corresponding, i.e. stream format FMT " be 22; and the command id extracted in the instruction received also is 22; then determine that the command id found is 22 with the stream format of the instruction received, determine that the data layout of this instruction is correct.In addition, before judging that data layout is whether correct, can also the leader knowledge of first decision instruction whether be 11, if leader is known correct, then determine that this instruction indicates iris identification equipment to perform the instruction of corresponding operating really, if not, then judge this instruction errors, do discard processing.
Before extraction command character, can also judge according to " LEN " in instruction that whether the data in DATA district are identical with the number of the byte shared by the instruction received with the byte number that other characters take altogether.If identical, then the command character " CMD " extracted in instruction is 41, and finds out corresponding being operating as " registered user " of this command character.Now, iris identification equipment gathers iris image and extracts iris feature, extracts the ID of the user carried in instruction
the ID of the user carried in the iris feature of extraction and this instruction is associated together, and association results is kept in iris identification equipment.
Such as, iris identification equipment receives " user's registration " instruction from host computer, and this instruction is as follows:
Wherein, it is 11 that the leader of this instruction knows " HDR ", and the stream format " FMT " of instruction is 22, and command character " CMD " is 43, and it represents being operating as " user's identification " of the required execution of iris identification equipment indicated by this instruction, and data length " LEN " is
check bit is 61.
After iris identification equipment receives this instruction, judge that head is designated 11, stream format is 22, data length is 8, and removes leader knowledge 11 and check bit 61 to the data received, and then remainder data is carried out the process of step-by-step distance, and compare 61 of the XOR value obtained and check bit, if consistent, illustrate that this instruction is correct instruction, work can be carried out according to the operation indicated by this instruction.Iris identification equipment extracts command character 43 from this instruction, and what this command character was corresponding be operating as carries out user's identification.After iris identification equipment determines the work indicated by this instruction, start to gather iris image, and extract iris feature, the iris feature of this iris feature and storage is utilized to compare, with the user ID finding the iris image that mates with this iris feature corresponding, thus achieve the object utilizing iris image to carry out iris recognition.
It should be noted that, can be the storer being arranged on iris identification equipment for storing the equipment of the execution result of iris identification equipment in above-described embodiment, can also be the external memorizer etc. be connected on iris identification equipment.
When execution result being sent to host computer, identical communication protocol can be adopted to generate reply data, and execution result is arranged in reply data as acknowledge character, and the reply data of generation is sent to host computer.
For above-mentioned two examples, the instruction that iris equipment receives " user's registration ", the reply data obtaining execution result generation is as follows:
Wherein, the head of this reply data is designated 11, and stream format is 22, and acknowledge character is 00, succeed in registration for representing, operational order is 41, represents " user's registration ", namely this response is the response made for the instruction of " user's registration ", and data length is 0, check bit 63.
After host computer receives reply data, whether correctly will verify leader knowledge, stream format, check bit equally, after determining that foregoing is all correct, extracting acknowledge character is 00, and now host computer knows iris identification equipment successful registration user.Host computer can continue instruction iris identification equipment and carry out other work, can also terminate current mutual, until again need to send new instruction to iris identification equipment during the work of instruction iris identification equipment.
The instruction that iris identification equipment receives " user's identification ", the reply data obtaining execution result generation is as follows:
send to host computer; Wherein
for user ID.
It is 00 that host computer extracts acknowledgement command, determines iris identification equipment identification user success, and extract user ID from this reply data.The process of the reply data of host computer verification " user's identification " is identical with the process of the reply data of verification " user registers ", repeats no more herein.
Pass through above-described embodiment, host computer generates instruction and reply data with iris identification equipment according to identical communication protocol, thus the communication achieved between host computer and iris identification equipment, operation performed by the other side is all known to make both sides, in addition, because all or part of function of the process of iris image completes by iris identification equipment, and host computer only needs to send instruction, process the reply data received, simplify the logic function of host computer, in addition, iris identification equipment can perform most functions of carrying out iris image process, can be used alone, also be easy to be integrated in other electronic equipments, be convenient to the use of iris identification equipment.
Embodiment 4
The embodiment of the present invention additionally provides a kind of host computer.Fig. 6 is the schematic diagram of the host computer according to the embodiment of the present invention.This host computer is used for communicating with iris identification equipment, and as shown in Figure 6, this host computer comprises:
Transmitting element 61 is used to indicate for sending to iris identification equipment the instruction that iris identification equipment performs the operation of iris image process.
Receiving element 63 is for receiving the reply data from iris identification equipment response instruction.
The execution result that resolution unit 65 obtains for the operation of resolving the process of iris identification equipment execution iris image from reply data.And
Storage unit 67 is for preserving execution result.
In the present embodiment, the operation needing iris identification equipment to perform is informed iris identification equipment by the form sending instruction by host computer, and the reply data received from the instruction of iris device responds, this reply data comprises the execution result obtained after iris identification equipment performs the operation of iris image process according to instruction.Mutual by between host computer and iris identification equipment, the operation of iris image process can be completed by iris identification equipment, and be not only by the iris camera collection iris image shown in Fig. 1, and the iris image collected is sent to host computer, is carried out the operation of above-mentioned iris image process by host computer.In the present embodiment, host computer just sends the instruction of the operation performing iris image process to iris identification equipment, and does not perform the operation of concrete iris image process.Host computer sends instruction to iris identification equipment, make what operation of this execution of iris identification equipment, and the operation that iris identification equipment performs is indicated by host computer, so host computer knows the operation performed by iris identification equipment, simultaneously, iris identification equipment is after executing corresponding operation, execution result is sent to host computer, host computer can be known, and whether iris identification equipment executes the operation indicated by it, and the execution result that can transmit according to iris identification equipment judges that whether the operation that iris identification equipment performs is correct, next step operation needing iris identification equipment is judged even further according to execution result.By above-described embodiment, solve host computer and iris identification equipment in prior art and cannot know the problem of the mode of operation of the other side, thus reach the effect that host computer and iris identification equipment can know the duty of both sides.
Particularly, after preservation execution result, this host computer also comprises: judging unit, for after preservation execution result, coming to the same thing corresponding to the operation judging the execution result whether iris image process of and instruction instruction, wherein, when the result corresponding to the operation judging iris image process that execution result and instruction indicates is not identical, transmitting element sends instruction to iris identification equipment again, during coming to the same thing corresponding to the operation judging the iris image process indicated by execution result and instruction, generate new instruction.
Host computer after receive the execution result sent from iris identification equipment, can judge the operation of the iris identification equipment whether iris image process of successful execution indicated by this instruction.If judge the operation of the iris image process indicated by the instruction that successful execution host computer sends from execution result, then generate new instruction.This new instruction can be the operation that instruction iris identification equipment performs new iris image process, can also be the instruction that instruction does not temporarily need to communicate.If judge that from execution result iris identification equipment performs the operation failure of the iris image process indicated by host computer, then host computer can send above-mentioned instruction to iris identification equipment again, with the operation indicating iris identification equipment to re-execute the iris image process indicated by above-mentioned instruction.
Such as, the instruction that host computer sends carries out user's identification for indicating iris identification equipment, and the reply data that iris identification equipment returns is
wherein, the acknowledge character of the 4th byte is 00, represents user's identifying operation success that iris identification equipment carries out.If the acknowledge character of the 4th byte of the reply data received is 01, then represent user's identifying operation failure that iris identification equipment carries out.So, host computer is resolved to acknowledge character when being 00, can continue to send next instruction to iris identification equipment, also can not do next step action; If resolving the command character obtained is 01, then can repeat to send the instruction that instruction iris identification equipment carries out user's identification.
Alternatively, transmitting element comprises: split module, for carrying out the fractionation of high position data and low data to the command character in instruction; Adjusting module, for adjusting the position of high position data in command character, is first sent to iris identification equipment to make high position data; And sending module, for sending high position data and low data successively.
In communication process between host computer and iris identification equipment, due to any one sexadecimal number that communication information may be between 0-255, therefore may occur the information sequence of instruction or the information sequence of reply data identical with the control sequence of some interface, thus cause the situation that the information being transferred to interface is retained by interface.In order to prevent the appearance of this situation, the present embodiment adopts the mode splitting order to communicate.Concrete method is: when host computer sends instruction, and instruction splits and then sends after generating the operational order being used to indicate the process of iris identification equipment execution iris image by host computer.That is: high 4 of each byte in the information sequence of instruction are taken apart with low 4, to add after high 4 gt 4 that certain " specific character " is as odd byte, first sends, low 4 add that this " specific character " is as even byte equally, rear transmission, forms new information sequence and sends.Wherein, specific character recovers the information sequence after fractionation for the ease of iris identification equipment.And iris identification equipment is when receiving the information sequence of instruction, low 4 bit bytes arrived first are to moving to left after 4, and 4 bit bytes arrived after adding, form 1 byte, namely revert to the information sequence of the instruction before fractionation.
Pass through above-described embodiment, host computer generates instruction and reply data with iris identification equipment according to identical communication protocol, thus the communication achieved between host computer and iris identification equipment, operation performed by the other side is all known to make both sides, in addition, because all or part of function of the process of iris image completes by iris identification equipment, and host computer only needs to send instruction, process the reply data received, simplify the logic function of host computer, in addition, iris identification equipment can perform most functions of carrying out iris image process, can be used alone, also be easy to be integrated in other electronic equipments, be convenient to the use of iris identification equipment.
If the integrated unit in above-described embodiment using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in the storage medium that above computer can read.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words or all or part of of this technical scheme can embody with the form of software product, this computer software product is stored in storage medium, comprises all or part of step of some instructions in order to make one or more computer equipment (can be personal computer, server or the network equipment etc.) perform method described in each embodiment of the present invention.
In the above embodiment of the present invention, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the part described in detail, can see the associated description of other embodiments.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.