CN101876951B - Recognition method of multiple card-base card reader and communication method of host computer and multiple card-base card reader - Google Patents

Recognition method of multiple card-base card reader and communication method of host computer and multiple card-base card reader Download PDF

Info

Publication number
CN101876951B
CN101876951B CN2009102369908A CN200910236990A CN101876951B CN 101876951 B CN101876951 B CN 101876951B CN 2009102369908 A CN2009102369908 A CN 2009102369908A CN 200910236990 A CN200910236990 A CN 200910236990A CN 101876951 B CN101876951 B CN 101876951B
Authority
CN
China
Prior art keywords
card
reader
smart card
bus driver
base
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN2009102369908A
Other languages
Chinese (zh)
Other versions
CN101876951A (en
Inventor
陆舟
于华章
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Feitian Technologies Co Ltd
Original Assignee
Feitian Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Feitian Technologies Co Ltd filed Critical Feitian Technologies Co Ltd
Priority to CN2009102369908A priority Critical patent/CN101876951B/en
Priority to US13/059,538 priority patent/US8775709B2/en
Priority to PCT/CN2010/078215 priority patent/WO2011050740A1/en
Publication of CN101876951A publication Critical patent/CN101876951A/en
Application granted granted Critical
Publication of CN101876951B publication Critical patent/CN101876951B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a recognition method of a multiple card-base card reader, relating to the field of intelligent card readers. The method comprises the steps of: establishing connection between the multiple card-base card reader and a host computer, wherein the host computer loads a card reader equipment bus drive; obtaining equipment information of the multiple card-base card reader by the card reader equipment bus drive, creating physical equipment objects according to the equipment information; installing and loading an intelligent card functional drive for each physical equipment object by the host computer; and creating a new intelligent card equipment record in a resource manager of an intelligent card service by the intelligent card service in the host computer according to the loaded intelligent card functional drive and the registered intelligent card drive library, and recognizing the multiple card-base card reader as a plurality of intelligent card equipment. The invention also discloses a communication method of the host computer and the multiple card-base card reader.

Description

Identification multiple card-base card reader and and multiple card-base card reader method for communicating
Technical field
IC-card card reader of the present invention field, particularly a kind of identification multiple card-base card reader and and multiple card-base card reader method for communicating.
Background technology
IC (Integrated Circuit, integrated circuit) card is another the novel information instrument that after magnetic card, occurs.It is a microelectronic chip to be embedded meet in the card base of ISO 7816 standards, makes card form.At present, IC-card has been widely applied to a lot of fields such as finance, traffic, social security, and for example, the bus card that we often use is exactly a kind of of IC-card.
The IC-card read write line is the bridge between IC-card and application system, in the ISO international standard, is referred to as IFD (Interface Device, interfacing equipment).General common IC-card adopts radio-frequency technique and IFD to carry out communication, and promptly the CPU in the IFD links to each other with IC-card through an interface circuit and communicates.Wherein, the IC-card interface circuit is a vital part in the IC-card read write line, according to the difference of real application systems, can select parallel communications, half duplex series communication and different IC-card read-write chip such as I2C communicates by letter.
In realizing process of the present invention, the inventor finds that there is following shortcoming at least in prior art:
When the IC-card card reader comprised a plurality of deck, main frame can't be discerned this IC-card card reader, thereby can't realize and the exchanges data of this card reader, instruction transmitting-receiving etc.
Summary of the invention
In order to make main frame can discern the smart card reader that comprises a plurality of decks, it is a kind of to the recognition methods of deck card reader and based on the main frame of this recognition methods and the communication means between the multiple card-base card reader that the embodiment of the invention provides.Said technical scheme is following:
A kind of identification multiple card-base card reader reaches and the multiple card-base card reader method for communicating, and said method comprises:
Multiple card-base card reader and main frame connect, and said main frame loads the reader device bus driver;
Said reader device bus driver is obtained the facility information of said multiple card-base card reader, and creates physical device object according to said facility information;
Said main frame is that the intelligent card function driving is installed and loaded to each said physical device object, and drives the smart card Driver Library of a standard of registration for each intelligent card function;
The smart card Driver Library that smart card service in the said main frame drives and registers according to the intelligent card function that loads; In the explorer of said smart card service, create new smart card device record, said multiple card-base card reader is identified as a plurality of smart card devices;
Said said multiple card-base card reader is identified as after a plurality of smart card devices, said method also comprises:
Said reader device bus driver is sent interrupt request and is given each smart card device, and receives the look-at-me that each smart card device returns;
Said reader device bus driver is resolved said look-at-me, and the interrupt type that parses is passed to the intelligent card function driving of respective smart cards equipment;
The intelligent card function of corresponding each smart card device drives through the state of its smart card Driver Library to its deck of smart card service report, and the state of said deck comprises not to be had card, have card not power on or have card to power on;
When communicating with said multiple card-base card reader, said method comprises:
Intelligent card function drives the smart card operation request of sending according to upper layer application, generates smart card operating instruction;
Said intelligent card function drives the application mutex;
When the application mutex is unsuccessful, said smart card operating instruction is hung up, wait for success application;
When the success of application mutex, said intelligent card function drives said smart card operating instruction is sent to said reader device bus driver, and said reader device bus driver issues said smart card operating instruction to said multiple card-base card reader; Smart card in the corresponding said multiple card-base card reader deck is carried out the said smart card operating instruction that receives, and the link order execution result; Said reader device bus driver receives said execution result, and with said execution result to the upper strata application report, and discharge said mutex.
Said reader device bus driver is obtained the facility information of said multiple card-base card reader, and creates physical device object according to said facility information, specifically comprises:
Said reader device bus driver is received the inquiry request of the reader device information of obtaining that main frame issues;
According to said inquiry request, said reader device bus driver is obtained reader device information;
Said reader device bus driver is according to the reader device information creating physical device object of obtaining.
Said main frame issues the inquiry request through the plug and play manager to said reader device bus driver.
Said according to said inquiry request, said reader device bus driver is obtained reader device information, specifically comprises:
Said reader device bus driver responds said inquiry request, generates the inquiry instruction, and said inquiry instruction is sent to said multiple card-base card reader;
Said multiple card-base card reader is obtained device descriptor, and said device descriptor is returned to said reader device bus driver.
In the said device descriptor with the type of single character representation deck.
The number of said physical device object is identical with the deck number of said multiple card-base card reader.
Can communicate through two communication pipes between said reader device bus driver and the said multiple card-base card reader: bulk transfer pipeline and interruption transmission pipeline;
Accordingly, said interrupt request is sent through said interruption transmission pipeline.
The said look-at-me of said parsing, and the interrupt type that parses passed to corresponding to the intelligent card function of smart card device drive, specifically comprise:
Said reader device bus driver is resolved said look-at-me, obtains the corresponding interrupt type of said look-at-me, smart card device and intelligent card function and drives;
Upgrade the subset status list in the said reader device bus driver, said subset status list is used to write down the state of said each deck of multiple card-base card reader;
Through said subset status list each deck state of said multiple card-base card reader being mapped to said intelligent card function drives.
The smart card operation request that said intelligent card function drives according to upper layer application generates smart card operating instruction, specifically comprises:
The smart card request call function DeviceIOControl that service managerZ-HU sends according to upper layer application, and the concrete operation of indication in said function parameters;
After the smart card Driver Library is resolved said function, send function to the intelligent card function driving;
Said intelligent card function drives the data encapsulation that receives is generated the smart card operating instruction that meets the CCID agreement, and the 6th the said intelligent card function of byte representation in the said smart card operating instruction drives the numbering of pairing said multiple card-base card reader deck.
Smart card in the said multiple card-base card reader deck is finished behind the operational order that receives, and through the bulk transfer pipeline execution result of instruction is sent to said reader device bus driver, and discharges the hardware resource of said multiple card-base card reader.
The d/d while of said mutex, the intelligent card function that next bar of being hung up by the reader device bus driver instructs drives and successfully obtains said mutex.
The beneficial effect that technical scheme provided by the invention is brought is:
Recognition methods through a kind of multiple card-base card reader; Multiple card-base card reader can be identified as a plurality of card reader by main frame; And main frame can be monitored the state variation of card in each " card reader "; Make multiple card-base card reader can support to have in the card reader situation of the similar and different deck of a plurality of types; And share a communication bus for a plurality of decks in the multiple card-base card reader, and a plurality of decks in the said multiple card-base card reader can replace, utilize to mutual exclusion carry out data interaction between communication port and the main frame, transmitting-receiving is instructed and is laid a good foundation;
Through the invention provides the communication means between a kind of main frame and the multiple card-base card reader; Can make a plurality of decks in the multiple card-base card reader share a communication bus, and a plurality of decks in the said multiple card-base card reader can replace, utilize to mutual exclusion communication port to carry out data interaction, transmitting-receiving instruction.
Description of drawings
Fig. 1 is the process flow diagram of the recognition methods of a kind of multiple card-base card reader of providing in the embodiment of the invention 1;
Fig. 2 is a kind of main frame that provides in the embodiment of the invention 2 and the communication means between the multiple card-base card reader.
Embodiment
For making the object of the invention, technical scheme and advantage clearer, will combine accompanying drawing that embodiment of the present invention is done to describe in detail further below.
Embodiment 1
The embodiment of the invention 1 provides a kind of recognition methods of multiple card-base card reader, need to prove, the IC-card card reader that the embodiment of the invention 1 provides comprises at least two decks.Referring to Fig. 1, this method comprises:
Step 101: reader device is connected to main frame through usb bus, and the operating system of main frame is found new USB device, and operating system loads the reader device bus driver;
After reader device and main frame connected, the standard of following CCID (USB Chip/Smart Card Interface Devices-USB, chip intelligent card equipment) agreement was carried out the transmitting-receiving of mutual, the instruction of data through usb bus.
Step 102: the reader device bus driver receives the request of obtaining reader device information that the operating system of main frame issues;
Wherein, the operating system of main frame can issue the inquiry request to the reader device bus driver through plug and play manager (Plug and Play Manager), and request obtains reader device information.
Step 103: the reader device bus driver is obtained reader device information;
Concrete, this step can comprise the steps:
(1) the inquiry request of reader device bus driver operation response system generates the inquiry instruction and sends to card reader, obtains the device descriptor of equipment;
(2) in the device descriptor that returns of card reader with the type of single character representation deck, comprise several characters in the device descriptor that promptly card reader is returned and just represent this card reader to have several decks;
For example, the device descriptor that card reader is returned is A, representes that this card reader has only a deck, and the deck type is the A type; The device descriptor that card reader is returned is ABAC, representes that this card reader has four decks, and the type of No. 1 deck is the A type, and the type of No. 2 decks is a Type B, and the type of No. 3 decks is the A type, and the type of No. 4 decks is the C type.In the present embodiment, the device descriptor that returns with card reader is that CCS is an example, and promptly the card reader in the present embodiment has three decks, and the type of No. 1 deck is the C type, and the type of No. 2 decks is the C type, and the type of No. 3 decks is the S type.
Step 104: the reader device bus driver is according to reader device information creating physical device object;
After the reader device bus driver gets access to the device descriptor that card reader returns, according to deck type of representing in the device descriptor and deck number, create corresponding physical device object, corresponding with the deck of card reader respectively.
The device descriptor that returns with card reader is that CCS is an example, and the reader device bus is created 3 physical device object, and is corresponding respectively with 3 decks.
Step 105: the operating system of main frame is installed and is loaded intelligent card function for the physical device object of having created and drives, and each intelligent card function drives the smart card Driver Library of a standard of registration.
Wherein, operating system is that the function of the smart card device of the pairing deck installation of each physical device object respective type drives (being called for short intelligent card function drives), and each intelligent card function drives the smart card Driver Library of registering a standard.
In the present embodiment, the operating system installation of main frame and loaded three intelligent card functions drive with card reader in three decks corresponding, be respectively the intelligent card function driving of C, C, S type.
Need to prove; The smart card Driver Library is used to provide the framework of a standard that the service controller of intelligent card function driving and smart card service is carried out alternately; In the middle of the embodiment of the invention, it is identical that three intelligent card functions drive pairing smart card Driver Library.
Need to prove that the smart card service can comprise service controller, explorer and database.Wherein, service controller be used to manage the smart card service, receive the request that drives from intelligent card function, management resource manager etc.; Explorer is used for adding new smart card device at database and writes down, perhaps deletes existing smart card device record etc.
Step 106: add new smart card device record in the smart card service in the middle of main frame.
Wherein, the smart card Driver Library that the smart card service drives and registers according to the intelligent card function that loads is created new smart card device record in the explorer of smart card service.
In embodiments of the present invention, created three smart card device records in the explorer of smart card service, respectively with card reader in three decks corresponding.So, three smart card devices in main frame, just occurred, main frame can be operated each smart card device separately, sends or receive smart card operating instruction through reader device bus driver and smart card device.
By the end of step 106, multiple card-base card reader is identified as a plurality of smart card devices by main frame.
Introduce the condition monitoring process of blocking on each deck of the multiple card-base card reader that is identified as a plurality of smart card devices (card reader) below:
Here need to prove that the state of each deck includes but not limited in the card reader: do not have card, have card not power on, power on.Wherein, after multiple card-base card reader was identified as a plurality of card reader by main frame, if the deck in the card reader does not have the IC-card sheet to insert, deck just was in no card state; If the IC-card sheet inserts deck, but main frame does not issue the instruction that powers on, or give the electricity instruction under the main frame, then deck is in has not power-up state of card; If the IC-card card inserts deck, main frame issues the instruction that powers on, and after the smart card response also successfully returned ATR (Answer To Reset, reset answer), deck was in power-up state.
Step 107: the reader device bus driver is sent interrupt request to card reader through interrupting transmission pipeline;
Need to prove, can communicate through two communication pipes between reader device bus driver and the card reader: bulk transfer pipeline and interruption transmission pipeline.
Wherein, the bulk transfer pipeline is used to carry out the transmission of data, as power on, down electricity instruction and other smart card operating instruction, main frame and card reader are carried out data interaction according to the mode answered of answering through the bulk transfer pipeline; Interrupt transmission pipeline, be used to transmit asynchronous event, like plug-in card, pull out card and card short circuit etc., card reader will be sent signal to main frame through the interruption transmission pipeline.
Wherein, in embodiments of the present invention, if do not have the insertion or the pull action of card in the card reader deck, then this interrupt request is hung up.
Step 108: the reader device bus driver receives the look-at-me that reader device is returned;
After having card to insert in the card reader deck, can send the look-at-me that card insertion is arranged to the reader device bus driver through interrupting transmission pipeline, be example still with 3 decks, concrete look-at-me can for:
No. 1 deck inserts card 0x5003
No. 2 deck inserts card 0x500c
No. 3 deck inserts card 0x5030
Accordingly, in the card reader use,, also can send the look-at-me that has card to extract to the reader device bus driver through interrupting transmission pipeline if when having card to extract in the card reader deck, concrete look-at-me can for:
No. 1 deck is extracted card 0x5002
No. 2 deck is extracted card 0x5008
No. 3 deck is extracted card 0x5020
Step 109: the reader device bus driver is resolved the look-at-me that receives and interrupt type is passed to the corresponding intelligent card function and drives;
Wherein, The reader device bus driver is resolved the look-at-me that receives; Obtain corresponding interrupt type of this signal and smart card device, intelligent card function driving; Upgrade the subset status list in the reader device bus driver, and through this subset status list the state variation situation of deck in the card reader is mapped to intelligent card function and drives.
Wherein, need to prove that the reader device bus driver can be set up a subset status list that is used for writing down card reader deck state after creating the smart card device success, include card and do not have the card two states.
For example; If what write down in the subset status list in the reader device bus driver is that No. 1 deck is no card state; The reader device bus driver receives look-at-me 0x5003; Then the reader device bus driver is revised No. 1 corresponding Xiang Weiyou card state of deck in its subset status list, simultaneously this state is mapped to intelligent card function and drives on 1.
Step 110: intelligent card function drives through the state variation of smart card Driver Library to smart card service report deck;
Concrete, the function that intelligent card function driving 1 provides through the smart card Driver Library
(SmartcardExtension->ReaderFunction [RDF_CARD_TRACKING]=RockeyCardTracking; ) revise intelligent card state is followed the tracks of expression intelligent card state in the I/O request package in the smart card Driver Library 1 parameter for card is arranged; And smart card deck status tracking I/O request package sent to the service controller of smart card service; Service controller has card to insert smart card device to the upper strata application report; Simultaneously explorer with the status modifier of smart card device for card being arranged, the record in the storehouse that Updates Information.
Present embodiment provides a kind of recognition methods of multiple card-base card reader; Pass through said method; Multiple card-base card reader can be identified as a plurality of card reader by main frame; And main frame can be monitored the state variation of card in each " card reader "; Make multiple card-base card reader can support to have in the card reader situation of the similar and different deck of a plurality of types, and share a communication bus for a plurality of decks in the multiple card-base card reader, a plurality of decks in the said multiple card-base card reader can replace, utilize to mutual exclusion carry out data interaction between communication port and the main frame, transmitting-receiving is instructed and is laid a good foundation.
It is a kind of based on the main frame of above-mentioned recognition methods and the communication means between the multiple card-base card reader that the embodiment of the invention also provides.Promptly in the reader device bus driver after upper strata application report card reader has card; Upper layer application just can be sent instruction through the reader device bus driver on demand and specified deck in the card reader; To smart card carry out as power on, PPS (Protocol and Pramateter Select, agreement and parameter are selected), operation such as read and write data.
Here need to prove that the service controller in the smart card service also is used to receive the application request from upper layer application, according to application request call function DeviceIOControl that receives and the concrete operation of indication in its parameter.
For example in function DeviceIOControl; The value representation action type of parameter d wIoCotrolCode; Through the desired operation of smart card Driver Library analytical function DeviceIOControl, intelligent card function drives the result who parses according to the smart card Driver Library and generates the smart card operating instruction that meets the CCID agreement then.
Wherein, DeviceIOControl provides the parameter of calling except that dwIoControlCode, also to comprise following parameter:
Figure GDA0000095816390000081
The smart card Driver Library is used to provide the framework of a standard that the service controller of intelligent card function driving and smart card service is carried out alternately; After the smart card Driver Library is resolved DeviceIOControl, drive four functions below sending to intelligent card function:
SmartcardExtension->ReaderFunction[RDF_CARD_POWER]=RockeyCardPower;
SmartcardExtension->ReaderFunction[RDF_TRANSMIT]=RockeyTransmit;
SmartcardExtension->ReaderFunction[RDF_CARD_TRACKING]=RockeyCardTracking;
SmartcardExtension->ReaderFunction[RDF_SET_PROTOCOL]=RockeySetProtocol;
Intelligent card function drives according to these four functions and generates instruction, and the control smart card device carries out power-on and power-off, data transmission, tracking card state and operation such as agreement is set; Correspondingly, intelligent card function drive also be through above four functions to smart card Driver Library return message, the smart card Driver Library is reported to smart card service and upper layer application through DeviceIOControl then.
Referring to Fig. 2, this method comprises:
Step 201: the smart card operation request that intelligent card function drives according to upper layer application generates smart card operating instruction;
Wherein, Upper layer application is specially the service managerZ-HU transmit operation request to the smart card service to the operation of smart card; Service managerZ-HU is according to the request call function DeviceIOControl of upper layer application; And the concrete operation of indication in function parameter, behind the smart card Driver Library analytical function, send function to the intelligent card function driving; Intelligent card function drives the data encapsulation that receives is generated the smart card operating instruction that meets the CCID protocol specification, and the 6th this intelligent card function of byte representation in this smart card operating instruction drives the numbering of pairing card reader deck.
For example, upper layer application produces the operation requests of getting random number to smart card device 1, and intelligent card function drives 1 and receives through function (SmartcardExtension->ReaderFunction [RDF_TRANSMIT]=RockeyTransmit; ) the data 0x0084000008 that imports into; Intelligent card function drives 1 and uses 050000000010000000 pair of data that receive of an instruction 0x6f of CCID standard to encapsulate; Obtaining smart card operating instruction is 0x6f 0500000000100000000084000008; Expression is that the random number of getting of No. 1 deck is instructed, and wherein the 6th byte 00 expression is No. 1 deck;
Again for example, intelligent card function drives 2 according to the function that receives
(SmartcardExtension->ReaderFunction [RDF_CARD_POWER]=RockeyCardPower; ) in parameter judge No. 2 decks powered on or electricity operation down, can operation parameter 0x00 represent to power on, 0xFF representes electricity down, perhaps also can represent to power on, 0x55 representes down with parameter 0xaa; Judge will be to the operation that powers on of No. 2 decks if intelligent card function drives 2; Then intelligent card function drives 2 and generates instruction: the 0x62000000000121010000 that powers on that meets the CCID protocol specification; The instruction that powers on of No. 2 decks of expression, wherein the 6th byte 01 expression is No. 2 decks.
Correspondingly, intelligent card function drives the function below utilizing
(SmartcardExtension->ReaderFunction [RDF_CARD_TRACKING]=RockeyCardTracking; ) through the smart card Driver Library to the insertion of smart card service report card or extract;
Moreover intelligent card function drives resolves the ATR information that the back card that powers on returns, the function below utilizing
(SmartcardExtension->ReaderFunction [RDF_SET_PROTOCOL]=RockeySetProtocol; ) communication pattern of serving current card through smart card Driver Library notice smart card follows t0 or t1 agreement.
Step 202: intelligent card function drives judges whether the communication channel between reader device bus driver and the card reader is occupied;
If occupied, then execution in step 203;
If do not have occupiedly, then execution in step 204.
Wherein, Need to prove, be example with 3 decks of the control of the chip timesharing in the present embodiment card reader, can only have a deck to be connected with the reader device bus driver through the bulk transfer pipeline at synchronization; Carry out data interaction; Firmware program in the chip comes switching channel according to the deck number field in the instruction, determines which deck to be connected with the reader device bus driver, carry out data alternately, the transmitting-receiving of instructing etc.
Judge communication channel whether occupied method can for:
After intelligent card function drives and generates smart card operating instruction; Drive deck pairing to this intelligent card function of operating system application sign and can monopolize the mutex that the card reader device bus drives communication port with it; Make intelligent card function drive and establish a communications link, carry out the transmitting-receiving etc. of mutual, the instruction of data through reader device bus driver and corresponding deck.
If obtain the mutex failure, explain that then communication channel is occupied;
If intelligent card function drives and can successfully obtain mutex, explain that then communication channel does not have occupied or is in idle condition.
The beneficial effect of this judgment mode is: when deck is connected with main frame when carrying out data interaction; Through being the corresponding intelligent card function driving distribution mutex of deck; Make in the card reader a deck with main frame carry out answering one answer communicate by letter the time; Can monopolize communication channel, the instruction of other decks can't issue through the reader device bus driver, makes deck and main frame in the card reader can carry out data interaction, instruction transmitting-receiving smoothly, in an orderly manner in this way.
Step 203: the instruction suspends that the reader device bus driver drives this intelligent card function, after the wait mutex was released, this intelligent card function drove and obtains mutex;
After obtaining the mutex success, execution in step 204.
For example, current No. 1 deck state is for powering on, and what the reader device bus driver had issued No. 1 deck gets random number instruction 0x6f 0500000000100000000084000008; Before the reader device bus driver receives this execution result of getting the random number instruction; No. 2 deck has inserted a card; Then No. 2 deck states do not have card not power on by having to block to become, and card reader is sent the signal 0x500c that No. 2 decks of expression have card to insert through interrupting transmission pipeline to the reader device bus driver; Upper layer application learns after No. 2 smart card devices have card to insert and sends powering on request, and intelligent card function drives 2 and receives the request back that powers on and generate No. 2 decks that meet the CCID agreement and power on and instruct 0x62000000000121010000, and sends to the reader device bus driver; Because the instruction of the random number of current No. 1 deck also is not finished; Mutex is driven 1 by intelligent card function and takies, and the reader device bus driver is that the mutex failure is obtained in intelligent card function driving 2, then with this instruction suspends; Wait for that No. 1 deck executes and get random number instruction back and discharge mutex; Again obtain mutex again, after obtaining the mutex success, execution in step 204.
Step 204: the reader device bus driver receives smart card operating instruction and preserves mutex;
After intelligent card function drives and obtains the mutex success; Send the smart card operating instruction that generates to the reader device bus driver; And mutex is saved in the reader device bus driver, discharges mutex receive the execution result of this instruction when the reader device bus driver after.
Step 205: the reader device bus driver issues operational order to card reader;
Wherein, after the reader device bus driver received the smart card operating instruction of intelligent card function driving generation, the reader device bus driver issued this operational order through the deck of the appointment of bulk transfer pipeline in card reader.
Concrete; The instruction that firmware program analysis in the card reader chip receives; Deck in obtaining instructing; The deck of appointment in the instruction is switched to the given transmission pipeline that drives with the reader device function links to each other, make this deck and reader device function drive according to the mode answered of answering carry out data alternately, the transmitting-receiving of instructing.
Step 206: the smart card in the card reader deck is carried out the operational order that receives, and the link order execution result.
Wherein, the smart card in the card reader deck is finished behind the operational order that receives, and through the bulk transfer pipeline execution result of instruction is sent to the reader device bus driver, and deck discharges the hardware resource of card reader.
Step 207: the reader device bus driver receives execution result, and with execution result to the upper strata application report, discharge mutex.
After the reader device bus driver receives instruction execution result; Mutex is released; The reader device bus driver returns to the corresponding intelligent card function with execution result and drives, and is driven by intelligent card function and sends to the smart card service after instruction execution result with the CCID agreement unpacks.
For example; The random number instruction execution result of getting of No. 1 deck is: 0x800a 00000000100000002111ca2b2ebb20059000, intelligent card function drive get the 10th part that byte is later (being 2111ca2b2ebb20059000) as the random number pass of obtaining to the smart card service; It is 0x801500000001210000003bfb1300008131fe4565465307010071c6 806117d4 that No. 2 decks execute the ATR that returns after the operation that powers on, and the intelligent card function driving is got the 10th part that byte is later (being 0x3bfb1300008131fe4565465307010071c6806117d4) and passed to the smart card service.
The d/d while of mutex; The intelligent card function that next bar of being hung up by the reader device bus driver instructs drives and successfully obtains mutex; The reader device bus driver receives this instruction and issues this instruction to card reader; The firmware program switches communication channels of card reader is to specifying deck, and reader device bus driver and this deck carry out mutual, the transmitting-receiving of instructing of data according to the mode answered of answering.
The embodiment of the invention provides the communication means between a kind of main frame and the multiple card-base card reader; Can support to have in the card reader situation of the similar and different deck of a plurality of types; A plurality of decks in the multiple card-base card reader are shared a communication bus, and a plurality of decks in the said multiple card-base card reader can replace, utilize to mutual exclusion communication port to carry out data interaction, transmitting-receiving instruction.
More than be merely preferred embodiment of the present invention, or not all within spirit of the present invention and principle in order to restriction the present invention, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (11)

1. an identification multiple card-base card reader reaches and the multiple card-base card reader method for communicating, it is characterized in that said method comprises:
Multiple card-base card reader and main frame connect, and said main frame loads the reader device bus driver;
Said reader device bus driver is obtained the facility information of said multiple card-base card reader, and creates physical device object according to said facility information;
Said main frame is that the intelligent card function driving is installed and loaded to each said physical device object, and drives the smart card Driver Library of a standard of registration for each intelligent card function;
The smart card Driver Library that smart card service in the said main frame drives and registers according to the intelligent card function that loads; In the explorer of said smart card service, create new smart card device record, said multiple card-base card reader is identified as a plurality of smart card devices;
Said said multiple card-base card reader is identified as after a plurality of smart card devices, said method also comprises:
Said reader device bus driver is sent interrupt request and is given each smart card device, and receives the look-at-me that each smart card device returns;
Said reader device bus driver is resolved said look-at-me, and the interrupt type that parses is passed to the intelligent card function driving of respective smart cards equipment;
The intelligent card function of corresponding each smart card device drives through the state of its smart card Driver Library to its deck of smart card service report, and the state of said deck comprises not to be had card, have card not power on or have card to power on;
When communicating with the multiple card-base card reader that identifies, said method comprises:
Intelligent card function drives the smart card operation request of sending according to upper layer application, generates smart card operating instruction;
Said intelligent card function drives the application mutex;
When the application mutex is unsuccessful, said smart card operating instruction is hung up, wait for success application;
When the success of application mutex, said intelligent card function drives said smart card operating instruction is sent to said reader device bus driver, and said reader device bus driver issues said smart card operating instruction to said multiple card-base card reader; Smart card in the corresponding said multiple card-base card reader deck is carried out the said smart card operating instruction that receives, and the link order execution result; Said reader device bus driver receives said execution result, and with said execution result to the upper strata application report, and discharge said mutex.
2. the method for claim 1 is characterized in that, said reader device bus driver is obtained the facility information of said multiple card-base card reader, and creates physical device object according to said facility information, specifically comprises:
Said reader device bus driver is received the inquiry request of the reader device information of obtaining that main frame issues;
According to said inquiry request, said reader device bus driver is obtained reader device information;
Said reader device bus driver is according to the reader device information creating physical device object of obtaining.
3. method as claimed in claim 2 is characterized in that, said main frame issues the inquiry request through the plug and play manager to said reader device bus driver.
4. method as claimed in claim 2 is characterized in that, said according to said inquiry request, said reader device bus driver is obtained reader device information, specifically comprises:
Said reader device bus driver responds said inquiry request, generates the inquiry instruction, and said inquiry instruction is sent to said multiple card-base card reader;
Said multiple card-base card reader is obtained device descriptor, and said device descriptor is returned to said reader device bus driver.
5. method as claimed in claim 4 is characterized in that, in the said device descriptor with the type of single character representation deck.
6. the method for claim 1 is characterized in that, the number of said physical device object is identical with the deck number of said multiple card-base card reader.
7. the method for claim 1 is characterized in that, can communicate through two communication pipes between said reader device bus driver and the said multiple card-base card reader: bulk transfer pipeline and interruption transmission pipeline;
Accordingly, said interrupt request is sent through said interruption transmission pipeline.
8. the method for claim 1 is characterized in that, the said look-at-me of said parsing, and the interrupt type that parses passed to corresponding to the intelligent card function of smart card device drive, specifically comprise:
Said reader device bus driver is resolved said look-at-me, obtains the corresponding interrupt type of said look-at-me, smart card device and intelligent card function and drives;
Upgrade the subset status list in the said reader device bus driver, said subset status list is used to write down the state of said each deck of multiple card-base card reader;
Through said subset status list each deck state of said multiple card-base card reader being mapped to said intelligent card function drives.
9. the method for claim 1 is characterized in that, the smart card operation request that said intelligent card function drives according to upper layer application generates smart card operating instruction, specifically comprises:
The smart card request call function DeviceIOControl that service managerZ-HU sends according to upper layer application, and the concrete operation of indication in said function parameters;
After the smart card Driver Library is resolved said function, send function to the intelligent card function driving;
Said intelligent card function drives the data encapsulation that receives is generated the smart card operating instruction that meets the CCID agreement, and the 6th the said intelligent card function of byte representation in the said smart card operating instruction drives the numbering of pairing said multiple card-base card reader deck.
10. the method for claim 1; It is characterized in that; Smart card in the said multiple card-base card reader deck is finished behind the operational order that receives; Through the bulk transfer pipeline execution result that instructs is sent to said reader device bus driver, and discharge the hardware resource of said multiple card-base card reader.
11. the method for claim 1 is characterized in that, the d/d while of said mutex, the intelligent card function that next bar of being hung up by the reader device bus driver instructs drives and successfully obtains said mutex.
CN2009102369908A 2009-10-30 2009-10-30 Recognition method of multiple card-base card reader and communication method of host computer and multiple card-base card reader Expired - Fee Related CN101876951B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN2009102369908A CN101876951B (en) 2009-10-30 2009-10-30 Recognition method of multiple card-base card reader and communication method of host computer and multiple card-base card reader
US13/059,538 US8775709B2 (en) 2009-10-30 2010-10-28 Method for recognizing a card reader with multiple card holders and method for communicating between a host and the card reader and system thereof
PCT/CN2010/078215 WO2011050740A1 (en) 2009-10-30 2010-10-28 Method for identifying multi-seat card reader and communication method and system with main computer thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009102369908A CN101876951B (en) 2009-10-30 2009-10-30 Recognition method of multiple card-base card reader and communication method of host computer and multiple card-base card reader

Publications (2)

Publication Number Publication Date
CN101876951A CN101876951A (en) 2010-11-03
CN101876951B true CN101876951B (en) 2012-06-27

Family

ID=43019509

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009102369908A Expired - Fee Related CN101876951B (en) 2009-10-30 2009-10-30 Recognition method of multiple card-base card reader and communication method of host computer and multiple card-base card reader

Country Status (1)

Country Link
CN (1) CN101876951B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102141968B (en) * 2011-03-28 2013-05-15 飞天诚信科技股份有限公司 Method for realizing multi-card slot access
CN102708032B (en) * 2012-01-18 2014-12-10 晨星软件研发(深圳)有限公司 Method and device for detecting hot plug of secure digital card
CN110336592B (en) 2019-06-28 2021-03-16 飞天诚信科技股份有限公司 Data transmission method suitable for Bluetooth card reader, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2424494Y (en) * 2000-03-31 2001-03-21 上海华申智能卡应用系统有限公司 Bus-driving intelligence card reading/writing device
CN101013406A (en) * 2007-02-12 2007-08-08 北京飞天诚信科技有限公司 Automatic-installable information safety equipment and control method thereof
CN200947210Y (en) * 2006-09-18 2007-09-12 深圳市德卡科技有限公司 Integrated read-write equipment of smart card
CN101169819A (en) * 2007-11-30 2008-04-30 北京市门吉利磁电工程研究所 Card reader capable of reading and writing multiple kind information card and its read-write method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2424494Y (en) * 2000-03-31 2001-03-21 上海华申智能卡应用系统有限公司 Bus-driving intelligence card reading/writing device
CN200947210Y (en) * 2006-09-18 2007-09-12 深圳市德卡科技有限公司 Integrated read-write equipment of smart card
CN101013406A (en) * 2007-02-12 2007-08-08 北京飞天诚信科技有限公司 Automatic-installable information safety equipment and control method thereof
CN101169819A (en) * 2007-11-30 2008-04-30 北京市门吉利磁电工程研究所 Card reader capable of reading and writing multiple kind information card and its read-write method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
附图1-2.

Also Published As

Publication number Publication date
CN101876951A (en) 2010-11-03

Similar Documents

Publication Publication Date Title
CN102638397B (en) USB (universal serial bus) device communication transmission method, device and system
CN101699416B (en) Communication method and system between host computer and card reader with multiple card holders
CN100568211C (en) Realize method and the device of a plurality of I2C of visit with programming device from device
RU2530337C1 (en) Usb-switch device and connection method of smart card by means of usb interface
CN102624429A (en) Method and device for managing information exchange between for example a nfc controller and a set of at least two secure elements
CN101097563A (en) System and method for realizing board centralized management and controlling
CN101631345B (en) Method and device for monitoring running state of single plate
CN101876951B (en) Recognition method of multiple card-base card reader and communication method of host computer and multiple card-base card reader
CN101719212B (en) Identification method and device of serial-port card reader
CN106446654A (en) Isolation method based on fingerprint recognition of computer input and output devices
CN107422838A (en) A kind of Wearable, solution lock control system and solution lock control method
CN102393848A (en) Method and system for acquiring identification information of data terminal equipment
CN102968325A (en) USB (Universal Serial Bus) equipment and method and device for automatically initializing same
US8775709B2 (en) Method for recognizing a card reader with multiple card holders and method for communicating between a host and the card reader and system thereof
CN103619053A (en) Method for using user identification cards and communication system
WO2015102131A1 (en) Radio frequency identification tag having input device
CN100429606C (en) PC card and PC card control method
CN112380066A (en) Server maintenance and debugging device based on domestic platform and server
CN107153456A (en) OTG connections control method, OTG connection control devices and electronic equipment
CN100489758C (en) Method and apparatus for contactless ICC connectivity
CN102385566A (en) Hot swapping method based on multiple terminal communication adapter (MTCA) platform and multiple terminal communication adapter (MTCA) platform
CN100403285C (en) Semicondustor storage device having host system operation function
CN100520727C (en) Method and system for identification of erection switching card type
CN201522717U (en) Intelligence card data processing device
CN207249662U (en) Adaptive usb synchronizers

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120627