CN101876951A - 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
CN101876951A
CN101876951A CN2009102369908A CN200910236990A CN101876951A CN 101876951 A CN101876951 A CN 101876951A CN 2009102369908 A CN2009102369908 A CN 2009102369908A CN 200910236990 A CN200910236990 A CN 200910236990A CN 101876951 A CN101876951 A CN 101876951A
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.)
Granted
Application number
CN2009102369908A
Other languages
Chinese (zh)
Other versions
CN101876951B (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.)
Beijing Feitian Technologies Co Ltd
Original Assignee
Beijing 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 Beijing Feitian Technologies Co Ltd filed Critical Beijing Feitian Technologies Co Ltd
Priority to CN2009102369908A priority Critical patent/CN101876951B/en
Priority to PCT/CN2010/078215 priority patent/WO2011050740A1/en
Priority to US13/059,538 priority patent/US8775709B2/en
Publication of CN101876951A publication Critical patent/CN101876951A/en
Application granted granted Critical
Publication of CN101876951B publication Critical patent/CN101876951B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

The communication means of multiple card-base card reader recognition methods, main frame and multiple card-base card reader
Technical field
IC-card card reader of the present invention field, the particularly communication means between a kind of recognition methods of multiple card-base card reader and a kind of main frame and the multiple card-base card reader.
Background technology
IC (Integrated Circuit, integrated circuit) card is another the novel information instrument that occurs after magnetic card.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, is referred to as IFD (Interface Device, interfacing equipment) in the ISO international standard.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 by 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.Described technical scheme is as follows:
A kind of recognition methods of multiple card-base card reader, described method comprises:
Multiple card-base card reader and main frame connect, and described main frame loads the reader device bus driver;
Described reader device bus driver is obtained the facility information of described multiple card-base card reader, and creates physical device object according to described facility information;
Described main frame is that the intelligent card function driving is installed and loaded to each described 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 described main frame drives and registers according to the intelligent card function that loads, in the explorer of described smart card service, create new smart card device record, described multiple card-base card reader is identified as a plurality of smart card devices.
Described reader device bus driver is obtained the facility information of described multiple card-base card reader, and creates physical device object according to described facility information, specifically comprises:
Described reader device bus driver is received the inquiry request of the reader device information of obtaining that main frame issues;
According to described inquiry request, described reader device bus driver is obtained reader device information;
Described reader device bus driver is according to the reader device information creating physical device object of obtaining.
Described main frame issues the inquiry request by the plug and play manager to described reader device bus driver.
Described according to described inquiry request, described reader device bus driver is obtained reader device information, specifically comprises:
Described reader device bus driver responds described inquiry request, generates the inquiry instruction, and described inquiry instruction is sent to described multiple card-base card reader;
Described multiple card-base card reader is obtained device descriptor, and described device descriptor is returned to described reader device bus driver.
In the described device descriptor with the type of single character representation deck.
The number of described physical device object is identical with the deck number of described multiple card-base card reader.
Described described multiple card-base card reader is identified as after a plurality of smart card devices, described method also comprises:
Described reader device bus driver sends interrupt request to each smart card device, and receives the look-at-me that each smart card device returns;
Described reader device bus driver is resolved described 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 by the state of its smart card Driver Library to its deck of smart card service report, and the state of described deck comprises not to be had card, have card not power on or have card to power on.
Can communicate by two communication pipes between described reader device bus driver and the described multiple card-base card reader: bulk transfer pipeline and interruption transmission pipeline;
Accordingly, described interrupt request sends by described interruption transmission pipeline.
The described look-at-me of described parsing, and the interrupt type that parses passed to corresponding to the intelligent card function of smart card device drive, specifically comprise:
Described reader device bus driver is resolved described look-at-me, and the interrupt type, smart card device and the intelligent card function that obtain described look-at-me correspondence drive;
Upgrade the subset status list in the described reader device bus driver, described subset status list is used to write down the state of described each deck of multiple card-base card reader;
By described subset status list each deck state of described multiple card-base card reader being mapped to described intelligent card function drives.
A kind of main frame of the recognition methods based on the described multiple card-base card reader of claim 1 and the communication means between the multiple card-base card reader, described method comprises:
Intelligent card function drives the smart card operation request that sends according to upper layer application, generates smart card operating instruction;
Described intelligent card function drives the application mutex;
When the application mutex is unsuccessful, described smart card operating instruction is hung up, wait for and applying for successfully;
When the success of application mutex, described intelligent card function drives described smart card operating instruction is sent to described reader device bus driver, and described reader device bus driver issues described smart card operating instruction to described multiple card-base card reader; Smart card in the corresponding described multiple card-base card reader deck is carried out the described smart card operating instruction that receives, and the link order execution result; Described reader device bus driver receives described execution result, and with described execution result to the upper strata application report, and discharge described mutex.
The smart card operation request that described 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 described function parameters;
After the smart card Driver Library is resolved described function, send function to the intelligent card function driving;
Described intelligent card function drives the data encapsulation that will receive and generates the smart card operating instruction that meets the CCID agreement, and the 6th the described intelligent card function of byte representation in the described smart card operating instruction drives the numbering of pairing described multiple card-base card reader deck.
Smart card in the described multiple card-base card reader deck is finished behind the operational order that receives, and by the bulk transfer pipeline execution result of instruction is sent to described reader device bus driver, and discharges the hardware resource of described multiple card-base card reader.
The d/d while of described mutex, the intelligent card function that next bar of being hung up by the reader device bus driver instructs drives and successfully obtains described mutex.
The beneficial effect that technical scheme provided by the invention is brought is:
Recognition methods by 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 described 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;
By 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 described 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 purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
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 by 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 InterfaceDevices-USB, chip intelligent card equipment) agreement was carried out the transmitting-receiving of mutual, the instruction of data by 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 by 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, promptly comprise several characters in the device descriptor that 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, represents 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, represents 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 has also loaded three intelligent card functions and has driven correspondingly with three decks in the card reader, is 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 record or deleting existing smart card device record etc. at database.
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, corresponding with three decks in the card reader respectively.So, three smart card devices just occurred in main frame, main frame can be operated each smart card device separately, sends or receive smart card operating instruction by 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 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 sends interrupt request to card reader by interrupting transmission pipeline;
Need to prove, can communicate by 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 powers on, descends electricity instruction and other smart card operating instruction, and main frame and card reader are carried out data interaction according to the mode of answering of answering by the bulk transfer pipeline; Interrupt transmission pipeline, be used to transmit asynchronous event, as plug-in card, pull out card and card short circuit etc., card reader will send signal to main frame by 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 suspended.
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 by 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 by 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 the interrupt type of this signal correspondence and smart card device, intelligent card function drives, upgrade the subset status list in the reader device bus driver, and by 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 the Xiang Weiyou card state of No. 1 deck correspondence in its subset status list, simultaneously this state is mapped to intelligent card function and drives on 1.
Step 110: intelligent card function drives by the state variation of smart card Driver Library to smart card service report deck;
Concrete, the function that intelligent card function driving 1 provides by the smart card Driver Library
(SmartcardExtension->ReaderFunction[RDF_CARD_TRACKING]=RockeyCardTracking; ) revise in the smart card Driver Library 1 and represent that the parameter of intelligent card state is for there being card in the intelligent card state tracking I/O request package, and smart card deck status tracking I/O request package is 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 is arranged, the record in the new database more.
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 for the shared communication bus of a plurality of decks in the multiple card-base card reader, a plurality of decks in the described multiple card-base card reader can replace, utilize to mutual exclusion and carry out data interaction between communication port and the main frame, the transmitting-receiving instruction 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 send instruction to specifying deck in the card reader by the reader device bus driver on demand, 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, by 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 also to comprise following parameter except that dwIoControlCode:
BOOL?DeviceIoControl(
HANDLE?hDevice, //handle?to?device
DWORD?dwIoControlCode,?//operation
LPVOID?lpInBuffer, //input?data?buffer
DWORD?nInBufferSize, //size?of?input?data?buffer
LPVOID?lpOutBuffer, //output?data?buffer
DWORD?nOutBufferSize, //size?of?output?data?buffer
LPDWORD?lpBytesReturned,//byte?count
LPOVERLAPPED?lpOverlapped //overlapped?information
);
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, four functions below the intelligent card function driving is sent:
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 by 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 by 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 of serving to smart card 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 will receive and generates 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, intelligent card function drive 1 receive by function (SmartcardExtension->ReaderFunction[RDF_TRANSMIT]=RockeyTransmit; ) the data 0x0084000008 that imports into, intelligent card function drives 1 and uses an instruction 0x6f050000000010000000 of CCID standard that the data that receive are encapsulated, obtaining smart card operating instruction is 0x6f0500000000100000000084000008, 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 represents electricity down, perhaps also can represent to power on, 0x55 represents 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; ) by 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 by 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, with 3 decks of the control of the chip timesharing in the present embodiment card reader is example, can only there be a deck to be connected with the reader device bus driver at synchronization by the bulk transfer pipeline, 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 by reader device bus driver and corresponding deck.
If obtain the mutex failure, illustrate that then communication channel is occupied;
If intelligent card function drives and can successfully obtain mutex, illustrate 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, by being the intelligent card function driving distribution mutex of deck correspondence, 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 by 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 0x6f0500000000100000000084000008; 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 sends the signal 0x500c that No. 2 decks of expression have card to insert by interrupting transmission pipeline to the reader device bus driver; Upper layer application is learnt after No. 2 smart card devices have card to insert and is sent the request of powering on, intelligent card function drives 2 and receives the request back that powers on and generate No. 2 decks that meet the CCID agreement instruction 0x62000000000121010000 that powers on, and send 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, 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 by 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 of answering 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 by 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: 0x800a00000000100000002111ca2b2ebb20059000, 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 of answering 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 described multiple card-base card reader can replace, utilize to mutual exclusion communication port to carry out data interaction, transmitting-receiving instruction.
Below only be preferred embodiment of the present invention, or not within the spirit and principles in the present invention not all 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 (13)

1. the recognition methods of a multiple card-base card reader is characterized in that, described method comprises:
Multiple card-base card reader and main frame connect, and described main frame loads the reader device bus driver;
Described reader device bus driver is obtained the facility information of described multiple card-base card reader, and creates physical device object according to described facility information;
Described main frame is that the intelligent card function driving is installed and loaded to each described 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 described main frame drives and registers according to the intelligent card function that loads, in the explorer of described smart card service, create new smart card device record, described multiple card-base card reader is identified as a plurality of smart card devices.
2. the method for claim 1 is characterized in that, described reader device bus driver is obtained the facility information of described multiple card-base card reader, and creates physical device object according to described facility information, specifically comprises:
Described reader device bus driver is received the inquiry request of the reader device information of obtaining that main frame issues;
According to described inquiry request, described reader device bus driver is obtained reader device information;
Described 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, described main frame issues the inquiry request by the plug and play manager to described reader device bus driver.
4. method as claimed in claim 2 is characterized in that, described according to described inquiry request, described reader device bus driver is obtained reader device information, specifically comprises:
Described reader device bus driver responds described inquiry request, generates the inquiry instruction, and described inquiry instruction is sent to described multiple card-base card reader;
Described multiple card-base card reader is obtained device descriptor, and described device descriptor is returned to described reader device bus driver.
5. method as claimed in claim 4 is characterized in that, in the described device descriptor with the type of single character representation deck.
6. the method for claim 1 is characterized in that, the number of described physical device object is identical with the deck number of described multiple card-base card reader.
7. the method for claim 1 is characterized in that, described described multiple card-base card reader is identified as after a plurality of smart card devices, and described method also comprises:
Described reader device bus driver sends interrupt request to each smart card device, and receives the look-at-me that each smart card device returns;
Described reader device bus driver is resolved described 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 by the state of its smart card Driver Library to its deck of smart card service report, and the state of described deck comprises not to be had card, have card not power on or have card to power on.
8. method as claimed in claim 7 is characterized in that, can communicate by two communication pipes between described reader device bus driver and the described multiple card-base card reader: bulk transfer pipeline and interruption transmission pipeline;
Accordingly, described interrupt request sends by described interruption transmission pipeline.
9. method as claimed in claim 7 is characterized in that, the described look-at-me of described parsing, and the interrupt type that parses passed to corresponding to the intelligent card function of smart card device drive, specifically comprise:
Described reader device bus driver is resolved described look-at-me, and the interrupt type, smart card device and the intelligent card function that obtain described look-at-me correspondence drive;
Upgrade the subset status list in the described reader device bus driver, described subset status list is used to write down the state of described each deck of multiple card-base card reader;
By described subset status list each deck state of described multiple card-base card reader being mapped to described intelligent card function drives.
10. one kind based on the main frame of the recognition methods of the described multiple card-base card reader of claim 1 and the communication means between the multiple card-base card reader, it is characterized in that described method comprises:
Intelligent card function drives the smart card operation request that sends according to upper layer application, generates smart card operating instruction;
Described intelligent card function drives the application mutex;
When the application mutex is unsuccessful, described smart card operating instruction is hung up, wait for and applying for successfully;
When the success of application mutex, described intelligent card function drives described smart card operating instruction is sent to described reader device bus driver, and described reader device bus driver issues described smart card operating instruction to described multiple card-base card reader; Smart card in the corresponding described multiple card-base card reader deck is carried out the described smart card operating instruction that receives, and the link order execution result; Described reader device bus driver receives described execution result, and with described execution result to the upper strata application report, and discharge described mutex.
11. method as claimed in claim 10 is characterized in that, the smart card operation request that described 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 described function parameters;
After the smart card Driver Library is resolved described function, send function to the intelligent card function driving;
Described intelligent card function drives the data encapsulation that will receive and generates the smart card operating instruction that meets the CCID agreement, and the 6th the described intelligent card function of byte representation in the described smart card operating instruction drives the numbering of pairing described multiple card-base card reader deck.
12. method as claimed in claim 10, it is characterized in that, smart card in the described multiple card-base card reader deck is finished behind the operational order that receives, by the bulk transfer pipeline execution result that instructs is sent to described reader device bus driver, and discharge the hardware resource of described multiple card-base card reader.
13. method as claimed in claim 10 is characterized in that, the d/d while of described mutex, the intelligent card function that next bar of being hung up by the reader device bus driver instructs drives and successfully obtains described 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 Active 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
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
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

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 true CN101876951A (en) 2010-11-03
CN101876951B CN101876951B (en) 2012-06-27

Family

ID=43019509

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009102369908A Active 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102141968A (en) * 2011-03-28 2011-08-03 北京飞天诚信科技有限公司 Method for realizing multi-card slot access
TWI467367B (en) * 2012-01-18 2015-01-01 Mstar Semiconductor Inc Detecting method and apparatus for hot swapped sd card
CN110336592A (en) * 2019-06-28 2019-10-15 飞天诚信科技股份有限公司 It is applicable in the data transmission method and electronic equipment of Bluetooth card reader

Family Cites Families (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
CN100462949C (en) * 2007-02-12 2009-02-18 北京飞天诚信科技有限公司 Automatic-installable information safety equipment and control method thereof
CN100583122C (en) * 2007-11-30 2010-01-20 北京市门吉利磁电工程研究所 Card reader capable of reading and writing multiple kind information card and its read-write method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102141968A (en) * 2011-03-28 2011-08-03 北京飞天诚信科技有限公司 Method for realizing multi-card slot access
CN102141968B (en) * 2011-03-28 2013-05-15 飞天诚信科技股份有限公司 Method for realizing multi-card slot access
TWI467367B (en) * 2012-01-18 2015-01-01 Mstar Semiconductor Inc Detecting method and apparatus for hot swapped sd card
CN110336592A (en) * 2019-06-28 2019-10-15 飞天诚信科技股份有限公司 It is applicable in the data transmission method and electronic equipment of Bluetooth card reader
CN110336592B (en) * 2019-06-28 2021-03-16 飞天诚信科技股份有限公司 Data transmission method suitable for Bluetooth card reader, electronic equipment and storage medium
US11736149B2 (en) 2019-06-28 2023-08-22 Feitian Technologies Co., Ltd. Data transmission method for Bluetooth card reader and electronic device

Also Published As

Publication number Publication date
CN101876951B (en) 2012-06-27

Similar Documents

Publication Publication Date Title
CN101699416B (en) Communication method and system between host computer and card reader with multiple card holders
CN101198943B (en) Point-to-point link negotiation method and apparatus
CN102638397B (en) USB (universal serial bus) device communication transmission method, device and system
CN101494602B (en) Energy-saving method and apparatus for communication equipment
CN101097563A (en) System and method for realizing board centralized management and controlling
CN101719212B (en) Identification method and device of serial-port card reader
CN102567268A (en) Detection method for USB to virtual serial port/MODEM
CN101876951B (en) Recognition method of multiple card-base card reader and communication method of host computer and multiple card-base card reader
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
CN105612531A (en) Network access method, RFID tag, electronic device, and control system
CN106358179A (en) SIM (Subscriber Identification Module) card switching circuit and SIM card switching method
CN103619053A (en) Method for using user identification cards and communication system
CN103514074A (en) MVB network card development method and platform
CN107153456A (en) OTG connections control method, OTG connection control devices and electronic equipment
CN112380066A (en) Server maintenance and debugging device based on domestic platform and server
CN109977050A (en) A kind of USB equipment complex and its working method
CN108307286B (en) Method and system for realizing communication between android devices based on NFC
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
CN207249662U (en) Adaptive usb synchronizers
CN101694641A (en) Method and system for initializing universal serial bus (USB) devices
CN103813207B (en) A kind of information processing method, update device and upgrade card

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