CN101699416B - Communication method and system between host computer and card reader with multiple card holders - Google Patents

Communication method and system between host computer and card reader with multiple card holders Download PDF

Info

Publication number
CN101699416B
CN101699416B CN2009102369895A CN200910236989A CN101699416B CN 101699416 B CN101699416 B CN 101699416B CN 2009102369895 A CN2009102369895 A CN 2009102369895A CN 200910236989 A CN200910236989 A CN 200910236989A CN 101699416 B CN101699416 B CN 101699416B
Authority
CN
China
Prior art keywords
card
reader
smart card
function
deck
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.)
Active
Application number
CN2009102369895A
Other languages
Chinese (zh)
Other versions
CN101699416A (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
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 CN2009102369895A priority Critical patent/CN101699416B/en
Publication of CN101699416A publication Critical patent/CN101699416A/en
Priority to US13/059,538 priority patent/US8775709B2/en
Priority to PCT/CN2010/078215 priority patent/WO2011050740A1/en
Application granted granted Critical
Publication of CN101699416B publication Critical patent/CN101699416B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a communication method between a host computer and a card reader with multiple card holders, which relates to the field of card readers of smart cards. The method comprises the following steps: the card reader with multiple card holders is identified as a plurality of smart card devices; the function driver of the smart card generates an operation instruction of the smart card according to an operation request of the smart card transmitted by the host computer, and transmits the operation instruction of the smart card to the card reader with multiple card holders by the bus driver of the card reader device; a firmware program of the card reader judges whether the hardware resource of the current card reader is occupied or not; if the hardware resource is occupied, the operation instruction of the smart card is suspended to wait for the release of the hardware resource; if the hardware resource is not occupied, the card reader sends the operation instruction of the smart card to the corresponding card holder; the smart card in the corresponding card holder executes the received operation instruction of the smart card and returns the execution result of the instruction; and the bus driver of the card reader device receives the execution result and reports the execution result to up-level application.

Description

The communication means of main frame and multiple card-base card reader and system
Technical field
IC-card card reader of the present invention field, communication means and system between particularly 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, the embodiment of the invention provides communication means and the system between a kind of main frame and the multiple card-base card reader.Described technical scheme is as follows:
Communication means between a kind of main frame and the 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 received the inquiry request of the reader device information of obtaining that described main frame issues, according to described inquiry acquisition request reader device information, and according to described facility information establishment physical device object;
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 sends interrupt request to described multiple card-base card reader, and receives the look-at-me that described multiple card-base card reader is returned;
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 corresponding deck correspondence;
Described intelligent card function drives the state by the smart card Driver Library corresponding with it deck corresponding with it in the described multiple card-base card reader 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;
Described intelligent card function drives the smart card operation request that sends according to described main frame, generates smart card operating instruction, and by described reader device bus driver described smart card operating instruction is sent to described multiple card-base card reader;
The card reader firmware program judges whether the hardware resource of current card reader is occupied;
If occupied, described smart card operating instruction is hung up, wait for that hardware resource is released;
If unoccupied, described card reader issues described smart card operating instruction to corresponding deck; Smart card in the corresponding 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.
Described main frame issues the inquiry request by the plug and play manager to described reader device bus driver.
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 its 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.
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 and described look-at-me send by described interruption transmission pipeline.
The described look-at-me of described parsing, and the intelligent card function that the interrupt type that parses passes to corresponding deck correspondence driven, 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 each deck state of described 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.
The smart card operation request that described intelligent card function drives according to described main frame generates smart card operating instruction, specifically comprises:
Service managerZ-HU is according to the smart card request call function DeviceIOControl of the upper layer application transmission of described main frame, and the concrete operation of indication in described function parameters;
After the smart card Driver Library is resolved described function, send the function passes data 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 card reader deck.
Smart card in the described 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 hardware resource, the deck that next bar of being hung up by the card reader firmware program instructs obtains described hardware resource.
Communication system between a kind of main frame and the multiple card-base card reader, described system comprises:
Load-on module is used for described multiple card-base card reader and described main frame connects, and loads the reader device bus driver;
Acquisition module is used for receiving by described reader device bus driver the inquiry request of the reader device information of obtaining that described main frame issues, and according to described inquiry acquisition request reader device information;
Creation module is used for creating physical device object by described reader device bus driver according to described facility information;
Installed module is used to each described physical device object to install and load intelligent card function and drives;
Registering modules is used to each intelligent card function to drive the smart card Driver Library of a standard of registration;
Identification module, be used for that smart card service by described main frame drives according to the intelligent card function that loads and the smart card Driver Library of registration, 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;
Sending module is used for sending interrupt request to described multiple card-base card reader by the reader device bus driver;
Receiver module is used for receiving the look-at-me that described multiple card-base card reader is returned by described reader device bus driver;
Interrupt parsing module, be used to resolve described look-at-me, and the interrupt type that parses is passed to the intelligent card function driving of corresponding deck correspondence;
Interrupt reporting modules, be used for being driven by the state of the smart card Driver Library corresponding with it to the described multiple card-base card reader of smart card service report deck corresponding with it by described intelligent card function, the state of described deck comprises not to be had card, have card not power on or has card to power on;
Generate instruction module, be used for driving the smart card operation request that sends according to described main frame by described intelligent card function, generate smart card operating instruction, and by described reader device bus driver described smart card operating instruction is sent to described multiple card-base card reader by described sending module;
Judge module is used for judging by the card reader firmware program of described multiple card-base card reader whether the hardware resource of current card reader is occupied;
Hang up module, be used for when the judged result of described judge module when being occupied described smart card operating instruction being hung up, the wait hardware resource is released;
Transceiver module is used for when the judged result of described judge module when being unoccupied, and described card reader issues described smart card operating instruction to corresponding deck; And receive the execution result that described deck returns, send to described main frame.
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 and described look-at-me send by described interruption transmission pipeline.
Described generation instruction module specifically comprises:
Call unit is used for by the smart card request call function DeviceIOControl of service managerZ-HU according to the upper layer application transmission of described main frame, and the concrete operation of indication in described function parameters;
Dispatch unit after being used for the smart card Driver Library and resolving described function, drives to described intelligent card function and to send the function passes data;
Generation unit, be used for driving the data encapsulation that will receive by intelligent card function and generate the smart card operating instruction that meets the CCID agreement, the 6th the described intelligent card function of byte representation in the described smart card operating instruction drives the numbering of pairing card reader deck.
Described transceiver module also is used for: 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.
The beneficial effect that the technical scheme that the embodiment of the invention provides is brought is:
Can be identified as a plurality of smart card devices by main frame by multiple card-base card reader, 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 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 and carry out data interaction, transmitting-receiving instruction between communication port and the main frame.
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 1 and the communication means process flow diagram between the multiple card-base card reader;
Fig. 3 is the structural representation of a kind of communication system of providing in the embodiment of the invention 2.
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 card reader 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 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 inserts card 0x5003
No. 2 deck inserts card 0x500c
No. 3 deck inserts card 0x5030
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 is upwards made supporting movement to cut off enemy with report has card to insert smart card device, explorer has card with the status modifier of smart card device simultaneously, more the record in the new database.
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 0,x00 84 00 00 08 that imports into, intelligent card function drives 1 and uses 00 00 00 00 10 00 00 00 pairs of data that receive of an instruction 0x6f05 of CCID standard to encapsulate, and what obtain smart card operating instruction and be 0x6f 05 00 00 00 00 10 00 00 00 00 84 00 00 08 expressions 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 0x62 00 00 00 00 01 21 01 0000 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 smart card Driver Library notice smart card service generation card insertion 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 and by the reader device bus driver smart card operating instruction is sent to card reader;
Step 203: the card reader firmware program judges whether the hardware resource of current card reader is occupied;
If occupied, then execution in step 204;
If do not have occupiedly, then execution in step 205;
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 obtains the deck numbering of smart card operating instruction correspondence according to the card reader status command, come switching channel according to the deck number field in the smart card operating instruction, smart card operating instruction is sent to the deck of appointment and the current card reader hardware resource of monopolizing of modified logo information representation.
Wherein, identification information specifically refers to: use a bytes of storage space to preserve the occupied or idle identification information of expression card reader hardware resource in the register of card reader, revise 0xff when identification information being revised as 0x01, free time, perhaps represent that with 0x55 the card reader resource is occupied, 0xaa represents the free time as the card reader resource is occupied;
Also can use two bytes of storage space to preserve expression card reader hardware resource in the register of card reader is taken by a certain deck or idle identification information, taken by No. 2 decks as the card reader resource and then identification information to be revised as 0,x01 00, to be revised as 0,x00 10 when idle, wherein first byte data of identification information is represented the deck numbering, and second byte of identification information is used to represent that deck is occupied or idle.
Step 204: the card reader firmware program is hung up this smart card operating instruction, waits for that hardware resource is released, identification information is modified;
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 05 00 00 00 00 10 00 00 00 00 84 00 00 08; 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 0,x62 00 00 00 00 01 21 01 00 00 that powers on, and send to card reader by the reader device bus driver, because the instruction of the random number of current No. 1 deck also is not finished, the card reader hardware resource is driven 1 by intelligent card function and takies, after the card reader firmware program judges that identification information knows that hardware resource is occupied, then with this operational order instruction suspends, wait for No. 1 deck execute get the random number instruction after, execution in step 205.
Step 205: card reader sends smart card operating instruction to the deck of appointment, and modified logo information;
Wherein, the card reader firmware program judges that current card reader status indicator information is for idle, deck during the instruction that the analysis of card reader firmware program receives obtains instructing, and instruction sent to deck in the instruction, this deck and reader device function are driven according to the mode of answering of answering carry out data interaction, instruction transmitting-receiving, revising card reader status indicator information simultaneously is that hardware resource is occupied.
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, smart card in the card reader deck is finished behind the operational order that receives, by the bulk transfer pipeline execution result that instructs is sent to the reader device bus driver, deck discharges the hardware resource of card reader, and the card reader of card reader firmware program modification simultaneously status indicator information is idle;
After the hardware resource of card reader was released, card reader status indicator information correction is the free time, next bar instruction of being hung up by the card reader firmware program was handed down to corresponding deck and modified logo information.
Step 207: the reader device bus driver receives execution result, and with execution result to the upper strata application report.
After the reader device bus driver receives instruction execution result, execution result is returned to the corresponding intelligent card function drive, drive by intelligent card function and send 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: 0x80 0a 00 00 00 00 10 00 00 002111ca2b2ebb20059000, 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 0,x80 15 00 00 00 01 21 00 00 003bfb1300008131fe4565465307010071c6806117d4 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 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.
Embodiment 2
Referring to Fig. 3, the embodiment of the invention provides a kind of communication system, and the communication means of this communication system can not done detailed description at this referring to the communication means that provides among the embodiment 1.This system comprises: main frame 301 and multiple card-base card reader 302;
Main frame 301 comprises:
Load-on module is used for loading the reader device bus driver when multiple card-base card reader 302 and main frame 301 connect;
Acquisition module is used for obtaining by the reader device bus driver facility information of multiple card-base card reader 302;
Creation module is used for creating physical device object by the reader device bus driver according to facility information;
Installed module is used to each physical device object to install and load intelligent card function and drives;
Registering modules is used to each intelligent card function to drive the smart card Driver Library of a standard of registration;
Identification module, be used for that smart card service by main frame 301 drives according to the intelligent card function that loads and the smart card Driver Library of registration, in the explorer of smart card service, create new smart card device record, multiple card-base card reader 302 is identified as a plurality of smart card devices;
Generate instruction module, be used for driving the smart card operation request that sends according to main frame 301, generate smart card operating instruction by intelligent card function;
Sending module, the smart card operating instruction that is used for generating the instruction module generation sends to multiple card-base card reader 302;
Receiver module is used for receiving by the reader device bus driver execution result of smart card operating instruction, and with execution result to the upper strata application report;
Multiple card-base card reader 302 comprises:
Judge module is used for judging by the card reader firmware program of multiple card-base card reader 302 whether the hardware resource of current card reader 302 is occupied;
Hang up module, be used for when the judged result of judge module when being occupied smart card operating instruction being hung up, the wait hardware resource is released;
Transceiver module is used for when the judged result of judge module when being unoccupied, and card reader 302 issues smart card operating instruction to corresponding deck;
Further, the acquisition module of main frame 301 specifically comprises:
Receiving element is used for receiving the inquiry request of obtaining card reader 302 facility informations that main frame 301 issues by the reader device bus driver;
Acquiring unit is used for obtaining card reader 302 facility informations according to the inquiry request by the reader device bus driver.
Wherein, acquiring unit specifically comprises:
Send subelement, be used for generating the inquiry instruction, and the inquiry instruction being sent to multiple card-base card reader 302 by reader device bus driver response inquiry request;
Return subelement, be used for receiving the device descriptor of multiple card-base card reader 302, and send to creation module after resolving by the reader device bus driver.
Further the sending module of main frame 301 also is used for: send interrupt request to multiple card-base card reader 302 by the reader device bus driver; The receiver module of main frame 301 also is used to receive the look-at-me that multiple card-base card reader 302 is returned;
Accordingly, main frame 301 also comprises:
Interrupt parsing module, be used for look-at-me is resolved, the interrupt type, deck and the intelligent card function that obtain the look-at-me correspondence drive;
Interrupt reporting modules, be used for driving according to the interrupt type, deck and the intelligent card function that interrupt the look-at-me correspondence that parsing module obtains, the state of corresponding deck in smart card service report multiple card-base card reader 302, the state of deck comprise not to be had card, have card not power on or has card to power on.
Can communicate by two communication pipes between reader device bus driver and the multiple card-base card reader 302: bulk transfer pipeline and interruption transmission pipeline;
Accordingly, interrupt request and look-at-me send by interrupting transmission pipeline.
Further, the generation instruction module of main frame 301 specifically comprises:
Call unit, request call function DeviceIOControl under the intelligence that is used for sending according to the upper layer application of main frame 301, and the concrete operation of indication in this function parameters by service managerZ-HU;
Dispatch unit is used for by behind the smart card Driver Library analytical function, drives to intelligent card function and sends function;
Generation unit, be used for driving the data encapsulation that will receive by intelligent card function and generate the smart card operating instruction that meets the CCID agreement, the 6th this intelligent card function of byte representation in this smart card operating instruction drives the numbering of pairing card reader 302 decks.
Wherein, the transceiver module of multiple card-base card reader also is used for by the bulk transfer pipeline execution result that instructs being sent to the reader device bus driver, and discharges the hardware resource of described multiple card-base card reader.
The embodiment of the invention provides a kind of communication system, 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 (14)

1. the communication means between main frame and the 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 received the inquiry request of the reader device information of obtaining that described main frame issues, according to described inquiry acquisition request reader device information, and according to described facility information establishment physical device object;
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 sends interrupt request to described multiple card-base card reader, and receives the look-at-me that described multiple card-base card reader is returned;
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 corresponding deck correspondence;
Described intelligent card function drives the state by the smart card Driver Library corresponding with it deck corresponding with it in the described multiple card-base card reader 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;
Described intelligent card function drives the smart card operation request that sends according to described main frame, generates smart card operating instruction, and by described reader device bus driver described smart card operating instruction is sent to described multiple card-base card reader;
The card reader firmware program judges whether the hardware resource of current card reader is occupied;
If occupied, described smart card operating instruction is hung up, wait for that hardware resource is released;
If unoccupied, described card reader issues described smart card operating instruction to corresponding deck; Smart card in the corresponding 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.
2. the method for claim 1 is characterized in that, described main frame issues the inquiry request by the plug and play manager to described reader device bus driver.
3. the method for claim 1 is characterized in that, 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 its device descriptor, and described device descriptor is returned to described reader device bus driver.
4. method as claimed in claim 3 is characterized in that, in the described device descriptor with the type of single character representation deck.
5. 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.
6. the method for claim 1 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 and described look-at-me send by described interruption transmission pipeline.
7. the method for claim 1 is characterized in that, the described look-at-me of described parsing, and the intelligent card function that the interrupt type that parses passes to corresponding deck correspondence driven, 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 each deck state of described 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.
8. the method for claim 1 is characterized in that, the smart card operation request that described intelligent card function drives according to described main frame generates smart card operating instruction, specifically comprises:
Service managerZ-HU is according to the smart card request call function DeviceIOContro1 of the upper layer application transmission of described main frame, and the concrete operation of indication in described function parameters;
After the smart card Driver Library is resolved described function, send the function passes data 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 card reader deck.
9. the method for claim 1, it is characterized in that, smart card in the described 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.
10. the method for claim 1 is characterized in that, the d/d while of described hardware resource, the deck that next bar of being hung up by the card reader firmware program instructs obtains described hardware resource.
11. the communication system between main frame and the multiple card-base card reader is characterized in that described system comprises:
Load-on module is used for described multiple card-base card reader and described main frame connects, and loads the reader device bus driver;
Acquisition module is used for receiving by described reader device bus driver the inquiry request of the reader device information of obtaining that described main frame issues, and according to described inquiry acquisition request reader device information;
Creation module is used for creating physical device object by described reader device bus driver according to described facility information;
Installed module is used to each described physical device object to install and load intelligent card function and drives;
Registering modules is used to each intelligent card function to drive the smart card Driver Library of a standard of registration;
Identification module, be used for that smart card service by described main frame drives according to the intelligent card function that loads and the smart card Driver Library of registration, 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;
Sending module is used for sending interrupt request to described multiple card-base card reader by the reader device bus driver;
Receiver module is used for receiving the look-at-me that described multiple card-base card reader is returned by described reader device bus driver;
Interrupt parsing module, be used to resolve described look-at-me, and the interrupt type that parses is passed to the intelligent card function driving of corresponding deck correspondence;
Interrupt reporting modules, be used for being driven by the state of the smart card Driver Library corresponding with it to the described multiple card-base card reader of smart card service report deck corresponding with it by described intelligent card function, the state of described deck comprises not to be had card, have card not power on or has card to power on;
Generate instruction module, be used for driving the smart card operation request that sends according to described main frame by described intelligent card function, generate smart card operating instruction, and by described reader device bus driver described smart card operating instruction is sent to described multiple card-base card reader by described sending module;
Judge module is used for judging by the card reader firmware program of described multiple card-base card reader whether the hardware resource of current card reader is occupied;
Hang up module, be used for when the judged result of described judge module when being occupied described smart card operating instruction being hung up, the wait hardware resource is released;
Transceiver module is used for when the judged result of described judge module when being unoccupied, and described card reader issues described smart card operating instruction to corresponding deck; And receive the execution result that described deck returns, send to described main frame.
12. system as claimed in claim 11 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 and described look-at-me send by described interruption transmission pipeline.
13. system as claimed in claim 11 is characterized in that, described generation instruction module specifically comprises:
Call unit is used for by the smart card request call function DeviceIOControl of service managerZ-HU according to the upper layer application transmission of described main frame, and the concrete operation of indication in described function parameters;
Dispatch unit after being used for the smart card Driver Library and resolving described function, drives to described intelligent card function and to send the function passes data;
Generation unit, be used for driving the data encapsulation that will receive by intelligent card function and generate the smart card operating instruction that meets the CCID agreement, the 6th the described intelligent card function of byte representation in the described smart card operating instruction drives the numbering of pairing card reader deck.
14. system as claimed in claim 11 is characterized in that, described transceiver module also is used for: 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.
CN2009102369895A 2009-10-30 2009-10-30 Communication method and system between host computer and card reader with multiple card holders Active CN101699416B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN2009102369895A CN101699416B (en) 2009-10-30 2009-10-30 Communication method and system between host computer and card reader with multiple card holders
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
CN2009102369895A CN101699416B (en) 2009-10-30 2009-10-30 Communication method and system between host computer and card reader with multiple card holders

Publications (2)

Publication Number Publication Date
CN101699416A CN101699416A (en) 2010-04-28
CN101699416B true CN101699416B (en) 2011-05-18

Family

ID=42147876

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009102369895A Active CN101699416B (en) 2009-10-30 2009-10-30 Communication method and system between host computer and card reader with multiple card holders

Country Status (1)

Country Link
CN (1) CN101699416B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011050740A1 (en) 2009-10-30 2011-05-05 北京飞天诚信科技有限公司 Method for identifying multi-seat card reader and communication method and system with main computer thereof
CN103136557A (en) * 2013-03-04 2013-06-05 深圳市易普森科技有限公司 Card writing method and card reading and writing system
CN103885828B (en) * 2014-04-08 2017-07-14 飞天诚信科技股份有限公司 A kind of changing method of hardware resource
CN109635504B (en) * 2019-01-04 2023-04-21 广东智科电子股份有限公司 Heat pump control system software design method
CN110569933A (en) * 2019-09-02 2019-12-13 深圳市优克联新技术有限公司 intelligent card management device and method
CN114548342A (en) * 2022-02-15 2022-05-27 百富计算机技术(深圳)有限公司 Card seat system, detection method, control equipment and payment terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7020090B2 (en) * 2004-06-21 2006-03-28 Cisco Technology, Inc. System and method for loadbalancing in a network environment using feedback information
CN2929828Y (en) * 2006-07-27 2007-08-01 北京飞天诚信科技有限公司 Intelligent card simulating system
CN101013406A (en) * 2007-02-12 2007-08-08 北京飞天诚信科技有限公司 Automatic-installable information safety equipment and control method thereof
CN101018131A (en) * 2007-02-16 2007-08-15 北京飞天诚信科技有限公司 Information security device with the function selection device and its control method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7020090B2 (en) * 2004-06-21 2006-03-28 Cisco Technology, Inc. System and method for loadbalancing in a network environment using feedback information
CN2929828Y (en) * 2006-07-27 2007-08-01 北京飞天诚信科技有限公司 Intelligent card simulating system
CN101013406A (en) * 2007-02-12 2007-08-08 北京飞天诚信科技有限公司 Automatic-installable information safety equipment and control method thereof
CN101018131A (en) * 2007-02-16 2007-08-15 北京飞天诚信科技有限公司 Information security device with the function selection device and its control method

Also Published As

Publication number Publication date
CN101699416A (en) 2010-04-28

Similar Documents

Publication Publication Date Title
CN101699416B (en) Communication method and system between host computer and card reader with multiple card holders
CN102638397B (en) USB (universal serial bus) device communication transmission method, device and system
CN100568211C (en) Realize method and the device of a plurality of I2C of visit with programming device from device
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
CN102331935A (en) Embedded cross-system software development platform
CN101719212B (en) Identification method and device of serial-port card reader
CN102968325A (en) USB (Universal Serial Bus) equipment and method and device for automatically initializing same
CN101876951B (en) Recognition method of multiple card-base card reader and communication method of host computer and multiple card-base card reader
CN103678423A (en) Data file input system, device and method
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
WO2020133134A1 (en) Method and apparatus for establishing optical cable connection
CN105612531A (en) Network access method, RFID tag, electronic device, and control system
JP2015500537A (en) Security information interaction system, apparatus and method based on extended parameter collection
CN202750089U (en) Bluetooth device and integrated peripheral devices
WO2015102131A1 (en) Radio frequency identification tag having input device
CN101477637B (en) Data communication method, system and smart card reader/writer
CN101398884B (en) Smart card reader and its use method
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
CN107168896A (en) The control system and control method of a kind of USB device
CN100495315C (en) Device for electronic equipment synchronous display through USB port and method thereof
CN103632173A (en) Tag access and access processing method and device
CN201886465U (en) Interface equipment and device provided with same
CN104331281B (en) A kind of proxy server and method that remote control function is provided for LXI modules

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
C56 Change in the name or address of the patentee

Owner name: FEITIAN CHENGXIN TECHNOLOGY CO., LTD.

Free format text: FORMER NAME: BEIJING FEITIAN CHENGXIN SCIENCE + TECHNOLOGY CO. LTD.

CP03 Change of name, title or address

Address after: 100085 Beijing city Haidian District Xueqing Road No. 9 Ebizal building B block 17 layer

Patentee after: Feitian Technologies Co., Ltd.

Address before: 100191, Haidian District, Xueyuan Road, Beijing No. 40 research, 7A building, 5 floor

Patentee before: Beijing Feitian Chengxin Science & Technology Co., Ltd.