Summary of the invention
Fundamental purpose of the present invention is to provide a kind of finger prints processing device and control method thereof and control device, to solve finger prints processing device and host computer communication mode is single, the problem that use occasion is limited.
To achieve these goals, according to an aspect of the present invention, a kind of control method of finger prints processing device is provided.
Control method according to finger prints processing device of the present invention comprises: obtain user fingerprints information by the first transmission channel; According to user fingerprints information generating process information; The communication link mark that inquiry is preset, wherein, communication link mark comprises the first mark and the second mark, when finger prints processing device is connected to host computer, communication link flag set is the second mark, when finger prints processing device receives host computer order, communication link flag set is the first mark; When the communication link inquired is masked as the first mark, by the first transmission channel transmission process information to host computer; When the communication link inquired is masked as the second mark, according to keypad character coded format, process information is encoded; And by the process information after the second transmission channel transfer encoding to host computer, wherein, the first transmission channel and the second transmission channel are the Different Logic transmission channel in Same Physical transmission channel.
Further, before obtaining user fingerprints information by the first transmission channel, method also comprises: receive the fingerprint collecting order that host computer issues, wherein, obtain user fingerprints information by the first transmission channel to comprise: control fingerprint sensor according to fingerprint collecting order and gather user fingerprints information; And obtain the user fingerprints information that collects of fingerprint sensor by the first transmission channel.
Further, before obtaining user fingerprints information by the first transmission channel, method also comprises: detect whether there is finger contact fingerprint sensor, wherein, obtaining user fingerprints information by the first transmission channel to comprise: when finger contact fingerprint sensor having been detected, controlling fingerprint sensor and gathering user fingerprints information; And obtain the user fingerprints information that collects of fingerprint sensor by the first transmission channel.
Further, fingerprint sensor is connected with infrared detecting device, and before whether detection has finger contact fingerprint sensor, the method also comprises: when infrared detecting device detects user, controls fingerprint sensor and is converted to mode of operation by park mode.
Further, comprise according to user fingerprints information generating process information: judge whether registered fingerprint quantity is less than preset fingerprint amount threshold; When registered fingerprint quantity is less than preset fingerprint amount threshold, user fingerprints information and registered fingerprint are compared; Using comparison result as process information; And when registered fingerprint quantity is more than or equal to preset fingerprint amount threshold, using user fingerprints information as process information.
Further, process information is carried out coding according to keypad character coded format comprise: when according to comparison result generating process information, according to the standard of keypad protocol, comparison result is converted into ASCII character, when user fingerprints information is as process information, user fingerprints information is carried out Base64 coding, form character visible, and according to the standard of keypad protocol, character visible is converted into ASCII character.
To achieve these goals, according to a further aspect in the invention, a kind of control device of finger prints processing device is provided.
The first transmission channel and the second transmission channel is comprised according to the control device of finger prints processing device of the present invention, wherein, first transmission channel and the second transmission channel are the Different Logic transmission channel in Same Physical transmission channel, this control device also comprises: acquisition module, for obtaining user fingerprints information by the first transmission channel; Generation module, for according to user fingerprints information generating process information; Enquiry module, for inquiring about default communication link mark, wherein, communication link mark comprises the first mark and the second mark, when finger prints processing device is connected to host computer, communication link flag set is the second mark, and when finger prints processing device receives host computer order, communication link flag set is the first mark; And coding module, during for being masked as the second mark when the communication link inquired, according to keypad character coded format, process information is encoded, wherein, when the communication link inquired is masked as the first mark, first transmission channel is used for transmission process information to host computer, and when the communication link inquired is masked as the second mark, the second transmission channel is used for the process information after by coding and transfers to host computer.
Further, this control device also comprises: receiver module, for before gathering user fingerprints information by the first transmission channel, receive the fingerprint collecting order that host computer issues, wherein, acquisition module comprises: first gathers submodule, gathers user fingerprints information for controlling fingerprint sensor according to fingerprint collecting order; And first obtains submodule, for obtaining user fingerprints information by the first transmission channel.
Further, this control device also comprises: detection module, for before gathering user fingerprints information by the first transmission channel, detect and whether have finger contact fingerprint sensor, wherein, acquisition module comprises: second gathers submodule, for when finger contact fingerprint sensor having been detected, having controlled fingerprint sensor and gathering user fingerprints information; And second obtains submodule, for obtaining user fingerprints information by the first transmission channel.
Further, generation module comprises: judge submodule, for judging whether registered fingerprint quantity is less than preset fingerprint amount threshold; Comparer module, for when registered fingerprint quantity is less than preset fingerprint amount threshold, compares user fingerprints information and registered fingerprint; First generate submodule, for using comparison result as process information; And second generates submodule, for when registered fingerprint quantity is more than or equal to preset fingerprint amount threshold, using user fingerprints information as process information.
Further, coding module comprises: the first encoding submodule, for when according to comparison result generating process information, according to the standard of keypad protocol, comparison result is converted into ASCII character; And second encoding submodule, for when user fingerprints information is as process information, user fingerprints information is carried out Base64 coding, form character visible, and according to the standard of keypad protocol, character visible is converted into ASCII character.
To achieve these goals, according to another aspect of the invention, a kind of finger prints processing device is provided.
Finger prints processing device according to the present invention comprises the control device of any one finger prints processing device provided by the invention.
By the present invention, adopt the control method of the finger prints processing device comprised the following steps: obtain user fingerprints information by the first transmission channel, according to user fingerprints information generating process information, the communication link mark that inquiry is preset, when the communication link inquired is masked as the first mark, by the first transmission channel transmission process information to host computer, when the communication link inquired is masked as the second mark, according to keypad character coded format, process information is encoded, and by the process information after the second transmission channel transfer encoding to host computer, wherein, first transmission channel and the second transmission channel are the Different Logic transmission channel in Same Physical transmission channel, by two logical transport channels operation, to adapt to communicate from different host computers, thus can with the host exchanging data shielding mass storage class USB port, again can with the host exchanging data only supporting HID keyboard communication class USB port, solve finger prints processing device and host computer communication mode is single, the problem that use occasion is limited, and then reach finger prints processing device and host computer communication mode is flexible, applicable situation is not limited, automatically the effect of different communication methods can be adopted according to different host computer.
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.
First the finger prints processing device that this embodiment provides is introduced.
Fig. 1 is the building-block of logic of the finger prints processing device according to the embodiment of the present invention, and as shown in Figure 1, this finger prints processing device comprises CPU, power supply, USB port, acousto-optic hint device, sensor and infrared detector.
CPU is the control center of fingerprint treating apparatus; Power supply can be built-in electric storage device, also can connect outside civil power for power supply change-over device; USB port is for connecting host computer; Acousto-optic hint device controls by CPU, realizes the object such as alarm, duty prompting; Sensor has mode of operation and park mode, when being in mode of operation, user's finger contacts sensor, CPU controls the collection that sensor completes finger print information, there is no user's feeler within the predetermined time, sensor is park mode by working mode change, when being in park mode and infrared detector detects user near finger prints processing device, CPU controls sensor and is converted to mode of operation by park mode, to carry out the preparation gathering finger print information, by the switching of two kinds of mode of operations, energy-saving and cost-reducing effect can be reached.Wherein carried out the mode of translative mode by the testing result of infrared detector, steering logic is simple, and before user restrains fingerprint, can wake sensor up in time.
Wherein, when finger prints processing device is connected with host computer by USB port, this host computer can for supporting the main frame of non-Large Copacity class storage protocol USB port, such as support the computing machine of self-defined HID communication class USB port, this computing machine can send instructions via under USB port, host computer can resolve the report descriptor of HID equipment (being also finger prints processing device) when enumerating, according to the agreement in report descriptor and HID device talk, needs mainly according to oneself actual communication in self-defined HID equipment realize report descriptor, reach the object with upper machine communication, some agreements of oneself can be added in the data of communication, for convenience of description, such host computer is defined as first kind host computer by this embodiment, such as support the USB port printer of HID keyboard communications protocol, this printer can receive the data uploaded via USB port, but itself can not send instructions down, and equally for convenience of description, such host computer is defined as Equations of The Second Kind host computer by this embodiment.
When finger prints processing device is to above-mentioned any host computer transmission data, can automatically adopt different mode of operations according to inhomogeneity host computer, concrete steering logic is as follows:
The Same Physical transmission channel of USB port arranges two different logical transport passages, and wherein the first transmission channel carries out data transmission based on HID basic agreement, and the second transmission channel is as master control passage, and this tunnels analogy HID keypad protocol carries out data transmission.Finger prints processing device can work in both modes, and one is monitoring mode, and another kind is management mode, and wherein, monitoring mode is the mode of operation of acquiescence:
When monitoring mode runs, if user restrain fingerprint on a sensor and finger prints processing device does not receive the instruction that host computer issues time, finger print information is obtained by the first transmission channel, then recognizer program obtains process information according to the control algolithm preset to finger print information process, process information is encoded according to keypad character coding by coded program again, be converted into the coded message of keyboard format, process information after coding is uploaded to the host computer of connection by the second last transmission channel, the data that can realize finger prints processing device and Equations of The Second Kind host computer under this pattern are transmitted,
If after finger prints processing device receives the instruction that host computer issues, finger prints processing device is converted to management mode by monitoring mode and runs, when management mode is run, according to after the instruction that the host computer received issues, finger print information is obtained by the first transmission channel, then recognizer program obtains process information according to the control algolithm preset and the instruction issued to finger print information process, process information is uploaded to the host computer of connection by last first transmission channel, and the data that can realize finger prints processing device and first kind host computer under this pattern are transmitted.
Adopt the finger prints processing device that this embodiment provides, by two logical transport channels operation, to adapt to communicate from different host computers, thus can with the host exchanging data shielding mass storage class USB port, access the USB interface of self-defined HID control mode, again can with the host exchanging data supporting HID keyboard communication class USB port, access the USB interface that the HID in embedded main device controls, reach finger prints processing device and host computer communication mode is flexible, applicable situation is not limited, automatically can adopt the effect of different communication methods according to different host computer.
Secondly, introduce the control device of the finger prints processing device that this embodiment provides, it should be noted that, any one control device all can be applicable to any one above-mentioned finger prints processing device below.
Fig. 2 is the control device theory diagram of finger prints processing device according to a first embodiment of the present invention, as shown in Figure 2, this control device comprises the first transmission channel 50, second transmission channel 60, acquisition module 10, generation module 20, enquiry module 30 and coding module 40, wherein, first transmission channel 50 and the second transmission channel 60 are the Different Logic transmission channel in Same Physical transmission channel, first transmission channel 50 can carry out data transmission based on HID basic agreement, and the second transmission channel 60 can carry out data transmission based on HID keypad protocol.
Acquisition module 10 is for obtaining user fingerprints information by the first transmission channel 50, the collection of finger print information can be completed by fingerprint sensor, then acquisition module 10 gets finger print information via the first transmission channel 50, particularly, carry out fingerprint by user's trigger sensor automatically to gather, fingerprint collecting is carried out in the instruction that also can issue according to host computer, communication link mark is set in control device inside as global variable, when finger prints processing device powers on, the set that is initialised of communication link mark is the second mark, when finger prints processing device receives host computer order, the set of communication link mark is the first mark.
After getting user fingerprints information, generation module 20 is according to user fingerprints information generating process information, can according to the needs of environment for use, prestore in inside corresponding Processing Algorithm, process is carried out to user fingerprints information and obtains process information, the alignment algorithm etc. of such as fingerprint, also can carry out the process of finger print information according to the host computer order received.
After carrying out finger print information process, enquiry module 30 inquires about the communication link mark preset, to determine to adopt which passage to carry out data transmission.
When finger prints processing device does not receive the order of host computer, but carry out fingerprint by user's trigger sensor and automatically gather, now communication link mark is still the second mark of acquiescence, then coding module 40 is encoded to process information according to keypad character coded format, make the process information after encoding meet HID keypad protocol, then via the second transmission channel 60, the process information after coding is transferred to host computer.
When finger prints processing device receives the order of host computer, control sensor according to host computer instruction and carry out fingerprint collecting, now communication link mark is set to the first mark by the second mark given tacit consent to, this host computer USB port supports self-defined HID communications protocol, and the first transmission channel 50 thus can be utilized directly process information to be transferred to host computer.
The control device of the finger prints processing device adopting this embodiment to provide, by two logical transport channels operation, to adapt to communicate from different host computers, thus can with the host exchanging data shielding mass storage class USB port, access the USB interface of self-defined HID control mode, again can with the host exchanging data only supporting HID keyboard communication class USB port, access the USB interface that the HID in embedded main device controls, reach finger prints processing device and host computer communication mode is flexible, applicable situation is not limited, automatically the effect of different communication methods can be adopted according to different host computer.
Preferably, in order to Real-time Obtaining host computer type, the control device shown in Fig. 2 also comprises receiver module and detection module.Wherein, when the host computer that finger prints processing device connects is aforesaid first kind host computer, user by host computer to finger prints processing device transmitting order to lower levels, such as when user carries out fingerprint register or fingerprint comparison needs to gather finger print information, corresponding control command is inputted to host computer, fingerprint collecting order is sent to finger prints processing device by host computer, the fingerprint collecting order that receiver module issues for receiving host computer.After receiver module receives acquisition, first of acquisition module gathers submodule and controls fingerprint sensor collection user fingerprints information according to fingerprint collecting order, then first submodule is obtained by the first transmission channel acquisition user fingerprints information, simultaneously, after receiving the order that host computer issues, communication link mark is set to the first mark by the second mark given tacit consent to, completes to make the first transmission channel and transmit with the data of host computer.
When the host computer that finger prints processing device connects is aforesaid Equations of The Second Kind host computer, user cannot by host computer to finger prints processing device transmitting order to lower levels, now, the right-falling stroke sensor as long as user press...withes one's finger, when detection module detects the action of user, second of acquisition module gathers submodule and controls fingerprint sensor collection user fingerprints information, then second submodule is obtained by the first transmission channel acquisition user fingerprints information, owing to not receiving the order that host computer issues, then communication link mark is still the second mark of acquiescence, now need the coding data that will transmit being carried out to keyboard format, by the second transmission channel by coding after data upload to host computer.
Preferably, the generation module in control device shown in Fig. 2 comprise judge submodule, comparer module, first generate submodule and second generate submodule.When obtaining process information according to finger print information, using fingerprint quantity registered in finger prints processing device as Rule of judgment, to carry out different process, wherein, judge that submodule judges whether registered fingerprint quantity is less than preset fingerprint amount threshold, when registered fingerprint quantity is less than preset fingerprint amount threshold, user fingerprints information and registered fingerprint are compared, and then first generates submodule using comparison result as process information, when registered fingerprint quantity is more than or equal to preset fingerprint amount threshold, do not carry out fingerprint comparison, second generate submodule directly using finger print information as process information.When obtaining the fingerprint with user fingerprints information match in registered fingerprint, also namely comparison result be comparison correct time, first generates submodule can get user ID corresponding to user fingerprints information, and user ID is uploaded to host computer as comparison result; When not obtaining the fingerprint with user fingerprints information match in registered fingerprint, also when namely comparison result is comparison mistake, first generates submodule can generate information corresponding to comparison mistake and be uploaded to host computer, and simultaneously fingerprint comparison device exports the prompting of comparison mistake by sound, the information such as optical, electrical.
Adopt the preferred embodiment, when registered fingerprint quantity is more than or equal to preset fingerprint amount threshold, long low-response consuming time of comparing, does not now carry out the comparison of fingerprint in finger prints processing device, but finger print information is directly sent to host computer, the comparison of fingerprint is completed by host computer.Finger prints processing device only carries out fingerprint comparison when registered fingerprint quantity is less than preset fingerprint amount threshold, thus can export fingerprint comparison result faster, avoids finger prints processing device not respond the problem of the poor user experience brought for a long time.
Further preferably, coding module 40 comprises the first encoding submodule and the second encoding submodule, wherein, when process information is comparison result, first encoding submodule is used for, according to the standard of keypad protocol, comparison result is converted into ASCII character, and when user fingerprints information is as process information, the second encoding submodule is used for user fingerprints information to carry out Base64 coding, form character visible, and according to the standard of keypad protocol, character visible is converted into ASCII character.
This optimal way is adopted to complete information coding, if when fingerprint comparison is carried out in finger prints processing device inside, do not need to carry out base64 coding, the ASCII coding of comparison result according to the keyboard of simulation is returned, not comparison in device, but send to background server to carry out online comparison pair user fingerprints information, first base64 coding to be carried out to user fingerprints information, simulating keyboard carries out ASCII coding again, coding step is simple, adopt different coding steps for different content, coded treatment speed is fast.
The control device that Fig. 3 and Fig. 5 respectively illustrates this second embodiment is operated in schematic diagram during different mode, as shown in Fig. 3 or Fig. 5, the control device of this second embodiment comprise fingerprint collecting unit (also i.e. acquisition module), fingerprint processing unit, fingerprint comparison unit (the function combination of fingerprint processing unit and fingerprint comparison unit with embodiment illustrated in fig. 2 in the function of generation module identical), storage unit, the first transmission channel, the second transmission channel, monitoring and scheduling unit (function of monitoring and scheduling unit and embodiment illustrated in fig. 2 in enquiry module).
Wherein, fingerprint collecting unit is used for the collection of completing user finger print information; Fingerprint processing unit has been used for carrying out the image processing process such as filtering to collecting finger print information; The registered finger print information that fingerprint comparison unit is used for the finger print information after by process and storage is compared; Storage unit is for storing registered finger print information; The effect of the first transmission channel and the second transmission channel all corresponding and embodiment illustrated in fig. 2 in transmission channel identical, repeat no more herein; Monitoring and scheduling unit is used for determining to adopt which passage and host computer to carry out data transmission.
The control device of this embodiment is based on HID agreement, devise two transmission channel mode of operation, data transmission is realized respectively based on HID simulating keyboard agreement and HID custom protocol, in Same Physical transmission channel, realize two logical transport passage, and the embedded main device of the main frame shielding large storage protocol class device or the support HID keypad protocol initiatively do not sent instructions down is overcome by the formulation of mode of operation, the problem of finger prints processing device cannot be used.
Particularly, corresponding to the difference completing transmission channel when data are transmitted, control device in this embodiment has two kinds of mode of operations, also be management mode and monitoring mode, the finger prints processing device comprising this control device also should have these two kinds of mode of operations mutually, the mode of operation of acquiescence is monitoring mode, in device, communication link mark (a specific global variable namely in device built-in type program) is defaulted as 0, when host computer sends instruction to finger prints processing device, communication link mark will be reset, and be set to 1 by 0.
As shown in Figure 3 and Figure 4, when host computer sends instructions under finger prints processing device, data command will be issued in the first transmission channel, after treating apparatus detects host computer instruction, now monitoring and scheduling unit reads communication link mark, and sending mode switching command gives the second transmission channel, notify its now mode of operation do and switch, mode of operation is adjusted to management mode, only has the first transmission channel and host computer to carry out data transmission.Finger prints processing device is resolved, the instruction of process host computer, the corresponding operation of process, such as this instruction is for completing fingerprint comparison, then fingerprint comparison unit is when carrying out fingerprint comparison, on-line working or off-line working is judged to be by registered fingerprint quantity (being also preset fingerprint amount threshold), such as registered fingerprint quantitative value is defaulted as 100 pieces, this value can be arranged in management mode, when fingerprint quantity registered in device equals 100 pieces, realize online comparison, the fingerprint characteristic that fingerprint collecting unit collects is uploaded, by host computer comparison process, otherwise directly will complete comparison in device, comparison result is returned to host computer, reply to host computer.
Use for the convenience of the user, this device supports FPC and UPEK two kinds of semiconductor transducers respectively, and can increase infrared detection device detection human body near come trigger sensor enter duty by dormant state.
As shown in Figure 5 and Figure 6, when control device works in monitoring mode, finger prints processing device is that dependence second transmission channel completes to the data that host computer transmits, if when the order that host computer issues being detected, directly return management mode operation, otherwise finger prints processing plant running is in park mode, carry out the detection of user's finger.When there being user to restrain fingerprint on a sensor, fingerprint collecting unit gathers fingerprint image via the first transmission channel, and the feature that takes the fingerprint obtains finger print information, monitoring and scheduling unit reads communication link mark, control the first transmission channel and finger print information is transferred to the second transmission channel, then whether the registered fingerprint quantity of monitoring and scheduling unit inspection exceedes preset fingerprint amount threshold, also the relation of fingerprint register number and threshold value is namely judged, when registered fingerprint quantity is more than or equal to preset fingerprint amount threshold, first first finger print information is carried out Base64 coding and form character visible, keyboard format coding is translated into afterwards according to keypad character coding schedule, fingerprint feature information after coding is directly uploaded to host computer by the second transmission channel, reply to host computer, when registered fingerprint quantity is less than preset fingerprint amount threshold, fingerprint characteristic comparison is done via fingerprint comparison unit, when comparison is passed through, read the user ID that the user fingerprints information passed through of comparison is corresponding, and user ID is translated into keyboard format coding according to keypad character coding schedule, comparison result after coding is returned to host computer, reply to host computer, obstructed out-of-date in comparison, comparison is pointed out not pass through by forms such as acousto-optic-electrics to user, and comparison failure information can be sent to host computer simultaneously.
When control device works in management mode, the setting of fingerprint register, fingerprint comparison and preset fingerprint amount threshold can be completed; When control device works in monitoring mode, the comparison of fingerprint only can be completed.
When carrying out fingerprint register, finger prints processing device being connected on computing machine, carrying out user fingerprints registration by management software tools.Click the user fingerprints registration in management tool, host computer sends fingerprint register instruction to finger prints processing device, because receiving the order from host computer, communication link mark (types of variables is unsigned int) in finger prints processing device is set to 1, after this zone bit of monitoring and scheduling unit judges in device, instruction is issued to the first transmission channel.First transmission channel first sending mode switching command gives the second transmission channel, notify that now mode of operation is done to switch, mode of operation is adjusted to management mode, and namely the second transmission channel is without the need to carrying out command operating, and all instruction process complete by the first transmission channel process.First transmission channel, after pattern of finishing the work switches, carries out fingerprint collecting according to the instruction of host computer, according to preset fingerprint amount threshold in device, determines that the user fingerprints registered is preserved the need of in treating apparatus.
If registered fingerprint quantity equals preset fingerprint amount threshold in finger prints processing device, without the need to preserving the fingerprint of new user registration again in finger prints processing device, then user profile and finger print information are directly uploaded to computing machine by finger prints processing device, to be saved in background server.If registered fingerprint quantity is less than preset fingerprint amount threshold in device, the finger print information of new user's registration not only will be safeguarded in background server, need to preserve in device simultaneously, after then the user fingerprints collected is preserved by finger prints processing device, by the first transmission channel, user profile and finger print information are directly uploaded to computing machine, now finger prints processing device runs under management mode, can be considered standard form HID fingerprint device.
When carrying out preset fingerprint amount threshold and arranging, finger prints processing device is connected on computing machine, is completed the setting of preset fingerprint amount threshold by the management software tools on computing machine.The preset fingerprint amount threshold clicked in management tool is arranged, host computer sending threshold value arranges instruction to finger prints processing device, because receiving the order from host computer, communication link mark in device is set to 1, after this zone bit of monitoring and scheduling unit judges in device, instruction is issued to the first transmission channel.The preset fingerprint amount threshold arranged writes in Flash by the first transmission channel, and refreshes value corresponding in internal memory.
When carrying out fingerprint comparison, there are following two kinds of working conditions:
The first, the fingerprint comparison under management mode: be connected on computing machine by finger prints processing device, carries out user fingerprints comparison by management software tools.Click the user fingerprints comparison in management tool, upper computer software sends fingerprint comparison instruction to finger prints processing device, because receiving the order from host computer, communication link mark in device is set to 1, after this zone bit of monitoring and scheduling unit judges in device, instruction is issued to the first transmission channel.First transmission channel first sending mode switching command gives the second transmission channel, notify its now mode of operation do and switch, mode of operation is adjusted to management mode, and namely the second transmission channel is without the need to carrying out command operating, and all instruction process complete by the first transmission channel process.First transmission channel, after pattern of finishing the work switches, carries out fingerprint collecting according to fingerprint collecting instruction, according to device preset fingerprint amount threshold, determines user fingerprints whether comparison in device.If when in device, registered fingerprint quantity equals preset fingerprint amount threshold, the user fingerprints information collected is uploaded to host computer by device, if when in device, registered fingerprint quantity is less than preset fingerprint amount threshold, in device, the fingerprint characteristic preserved in the finger print information collected and device is compared, comparison result is uploaded to host computer.This timer runs under management mode, can be considered standard form HID fingerprint device.
The second, the fingerprint comparison under monitoring mode: be connected on printer by finger prints processing device, printer cannot send instruction to device, and because not receiving host computer order, the communication link mark in device is still default value 0.Second transmission channel waits for the finger print information that the first transmission channel collects, when there being finger contact to arrive fingerprint sensor, first transmission channel gathers finger print information, the finger print information collected is sent to the second transmission channel, after second transmission channel receives finger print information, first in judgment means, whether registered fingerprint quantity is less than preset fingerprint amount threshold, if registered fingerprint quantity is less than preset fingerprint amount threshold in device, carry out comparison in device, comparison result information is uploaded to printer.If registered fingerprint quantity equals preset fingerprint amount threshold in device, finger print information is directly uploaded to printer by device, and the feature received is transmitted through the network to background server and compares by printer plug-in.When to printer information upload, if when the information uploaded is finger print information, first finger print information to be uploaded is carried out Base64 coding, form character visible, according to the standard of keypad protocol, character visible is carried out conversion ASCII character afterwards, the finger print information the most at last after coding is uploaded to printer; If when the information uploaded is comparison result information, only character visible is carried out conversion ASCII character according to the standard of keypad protocol by comparison result information, then the comparison result information after coding is uploaded to printer.
Finally, introduce the control method of the finger prints processing device that this embodiment provides, it should be noted that, it should be noted that, the control device of the finger prints processing device that can be provided by the embodiment of the present invention in the control method of the finger prints processing device of the embodiment of the present invention is performed, and the control device of the finger prints processing device of the embodiment of the present invention also may be used for the control method performing the finger prints processing device that the embodiment of the present invention provides.
Fig. 7 is the control method process flow diagram of finger prints processing device according to a first embodiment of the present invention, and as shown in Figure 7, the method comprises following step S102 to step S110.
Step S102: obtain user fingerprints information by the first transmission channel.
Finger prints processing device arranges the first transmission channel and the second transmission channel, and two transmission channels are the Different Logic transmission channel in Same Physical transmission channel.The collection of finger print information can be completed by fingerprint sensor, then finger print information is got via the first transmission channel, particularly, carry out fingerprint by user's trigger sensor automatically to gather, fingerprint collecting is carried out in the instruction that also can issue according to host computer, communication link mark is set in control device inside as global variable, when finger prints processing device is connected to host computer, communication link mark is initialized to the second mark, when finger prints processing device receives host computer order, the set of communication link mark is the first mark.
Step S104: according to user fingerprints information generating process information.
After getting user fingerprints information, according to user fingerprints information generating process information, can according to the needs of environment for use, the corresponding Processing Algorithm prestored in inside, process is carried out to user fingerprints information and obtains process information, the alignment algorithm etc. of such as fingerprint, also can carry out the process of finger print information according to the host computer order received.
Step S106: the communication link mark that inquiry is preset, to determine to adopt which passage to carry out data transmission.
Step S108: when the communication link inquired is masked as the first mark, by the first transmission channel transmission process information to host computer.
Step S110: when the communication link inquired is masked as the second mark, according to keypad character coded format, process information is encoded, and by the process information after the second transmission channel transfer encoding to host computer.
When finger prints processing device does not receive the order of host computer, but carry out fingerprint by user's trigger sensor and automatically gather, now communication link mark is still the second mark of acquiescence, then process information is encoded according to keypad character coded format by step S110, make the process information after encoding meet HID keypad protocol, then via the second transmission channel, the process information after coding is transferred to host computer.When finger prints processing device receives the order of host computer, control sensor according to host computer instruction and carry out fingerprint collecting, now communication link mark is set to the first mark by the second mark given tacit consent to, this host computer supports HID keyboard communication class USB port, and the first transmission channel thus can be utilized directly process information to be transferred to host computer.
The control method of the finger prints processing device adopting this embodiment to provide, by two logical transport channels operation, to adapt to communicate from different host computers, thus can with the host exchanging data shielding mass storage class USB port, access the USB interface of self-defined HID control mode, again can with the host exchanging data only supporting HID keypad protocol, access the USB interface of the HID keypad protocol in embedded main device, reach finger prints processing device and host computer communication mode is flexible, applicable situation is not limited, automatically the effect of different communication methods can be adopted according to different host computer.
Preferably, before step S102, this control method also comprises: receive the fingerprint collecting order that host computer issues, wherein, step S102 comprises according to fingerprint collecting order control fingerprint sensor collection user fingerprints information, the user fingerprints information collected by the first transmission channel acquisition fingerprint sensor.
Preferably, before step S102, this control method also comprises: detect whether there is finger contact fingerprint sensor, wherein, step S102 comprises when finger contact fingerprint sensor having been detected, control fingerprint sensor and gather user fingerprints information, the user fingerprints information collected by the first transmission channel acquisition fingerprint sensor.
Preferably, fingerprint sensor is connected with infrared detecting device, and before whether detection has finger contact fingerprint sensor, the method also comprises use infrared detecting device and carries out user's detection, when infrared detecting device detects user, control fingerprint sensor and be converted to mode of operation by park mode.By the switching of two kinds of mode of operations, can reach the effect of saving power supply, wherein be carried out the mode of translative mode by the testing result of infrared detector, steering logic is simple, and before user restrains fingerprint, can wake sensor up in time.
Preferably, step S104 comprises and judges whether registered fingerprint quantity is less than preset fingerprint amount threshold, when registered fingerprint quantity is less than preset fingerprint amount threshold, user fingerprints information and registered fingerprint are compared, according to comparison result generating process information, when registered fingerprint quantity is more than or equal to preset fingerprint amount threshold, directly finger print information is uploaded to host computer as process information.
Adopt the preferred embodiment, when registered fingerprint quantity is more than or equal to preset fingerprint amount threshold, long low-response consuming time of comparing, does not now carry out the comparison of fingerprint in finger prints processing device, but finger print information is directly sent to host computer, the comparison of fingerprint is completed by host computer.Finger prints processing device only carries out fingerprint comparison when registered fingerprint quantity is less than preset fingerprint amount threshold, thus can export fingerprint comparison result faster, avoids finger prints processing device not respond the problem of the poor user experience brought for a long time.
Further preferably, when process information is finger print information, in step s 110, when process information is encoded according to keypad character coded format, process information first can be carried out Base64 coding, form character visible, then according to the standard of keypad protocol, character visible is converted into ASCII character; When process information is comparison result information, in step s 110, when being encoded according to keypad character coded format by process information, directly according to the standard of keypad protocol, comparison result is converted into ASCII character.
This optimal way is adopted to complete information coding, if when fingerprint comparison is carried out in finger prints processing device inside, do not need to carry out base64 coding, the ASCII coding of comparison result according to the keyboard of simulation is returned, not comparison in device, but send to background server to carry out online comparison pair user fingerprints information, first base64 coding to be carried out to user fingerprints information, simulating keyboard carries out ASCII coding again, coding step is simple, adopt different coding steps for different content, coded treatment speed is fast.
Fig. 8 is the control method process flow diagram of finger prints processing device according to a second embodiment of the present invention, as shown in Figure 8, after finger prints processing device connects host computer, first initialization is carried out to communication link mark, then the instruction receiving host computer is judged whether, when receiving host computer instruction, reset communication link mark.Inquiring after communication link mark is reset, the first transmission channel receives instruction, and finger prints processing device enters management mode work, performs the instruction that receives.If do not receive instruction, communication link mark is still the mark of acquiescence, then inquire communication link mark when not being reset, finger prints processing device enters monitoring mode, now detect and whether have fingerprint to restrain, if there is fingerprint to restrain, then gather user fingerprints feature, and whether current registered fingerprint quantity exceedes preset fingerprint register quantity in judgment means, when exceeding preset fingerprint register quantity, through being uploaded to host computer by the second transmission channel after processing the user fingerprints characteristic information collected, when not exceeding preset fingerprint register quantity, compare with registered fingerprint characteristic after the user fingerprints characteristic information collected being carried out process, and comparison result is back to host computer via the second transmission channel.
From above description, can find out, present invention achieves following technique effect: by two logical transport channels operation, to adapt to communicate from different host computers, thus can with the host exchanging data shielding mass storage class USB port, access the USB interface of self-defined HID control mode, again can with the host exchanging data only supporting HID keyboard communication class USB port, access the USB interface that the embedded HID keypad protocol initiatively do not sent instructions down in main device controls, finger prints processing device and host computer communication mode flexible, applicable situation is not limited, automatically different communication methods can be adopted according to different host computer.
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, but in some cases, can be different from the step shown or described by order execution herein.
Obviously, those skilled in the art should be understood that, above-mentioned of the present invention each module or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on network that multiple calculation element forms, alternatively, they can realize with the executable program code of calculation element, thus, they can be stored and be performed by calculation element in the storage device, or they are made into each integrated circuit modules respectively, or the multiple module in them or step are made into single integrated circuit module to realize.Like this, the present invention is not restricted to any specific hardware and software combination.
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.