WO2011050740A1 - 多卡座读卡器的识别方法及其与主机的通信方法和系统 - Google Patents

多卡座读卡器的识别方法及其与主机的通信方法和系统 Download PDF

Info

Publication number
WO2011050740A1
WO2011050740A1 PCT/CN2010/078215 CN2010078215W WO2011050740A1 WO 2011050740 A1 WO2011050740 A1 WO 2011050740A1 CN 2010078215 W CN2010078215 W CN 2010078215W WO 2011050740 A1 WO2011050740 A1 WO 2011050740A1
Authority
WO
WIPO (PCT)
Prior art keywords
card
smart card
card reader
driver
smart
Prior art date
Application number
PCT/CN2010/078215
Other languages
English (en)
French (fr)
Inventor
陆舟
于华章
Original Assignee
北京飞天诚信科技有限公司
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
Priority claimed from CN2009102369895A external-priority patent/CN101699416B/zh
Priority claimed from CN2009102369908A external-priority patent/CN101876951B/zh
Application filed by 北京飞天诚信科技有限公司 filed Critical 北京飞天诚信科技有限公司
Priority to US13/059,538 priority Critical patent/US8775709B2/en
Publication of WO2011050740A1 publication Critical patent/WO2011050740A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/38Universal adapter
    • G06F2213/3804Memory card connected to a computer port directly or by means of a reader/writer

Definitions

  • the present invention relates to the field of an IC card reader, and particularly to a method for recognizing a multi-card reader and a communication method thereof with a host And system. Background technique
  • the IC (Integrated Circuit) card is another new type of information tool that emerged after the magnetic card. It is a card form in which a microelectronic chip is embedded in a card base conforming to the ISO 7816 standard. At present, IC cards have been widely used in many fields such as finance, transportation, social security, etc. For example, the bus card we often use is one of IC cards.
  • the IC card reader is a bridge between the IC card and the application system, and is called in the ISO international standard.
  • the common IC card uses RF technology to communicate with the IFD, that is, the CPU in the IFD is connected to the IC card through an interface circuit and communicates.
  • the IC card interface circuit is a vital part of the IC card reader.
  • different IC card reading and writing chips such as parallel communication, half-duplex serial communication and I2C communication can be selected.
  • the inventors have found that the prior art has at least the following disadvantages: When the IC card reader includes a plurality of card holders, the host cannot recognize the IC card reader, thereby failing to implement the card reading. Data exchange, command transmission and reception, etc.
  • an embodiment of the present invention provides a method for identifying a multi-card reader, a host and a multi-card reader based on the identification method. Communication methods and systems between.
  • a method for identifying a multi-card reader comprising: establishing a connection between a multi-card reader and a host, the host loading a card reader device bus driver; and the card reader device bus driver acquiring the multi-card holder Device information of the card reader, and creating a physical device object according to the device information;
  • the host installs and loads a smart card function driver for each of the physical device objects, and registers a standard smart card driver library for each smart card function driver;
  • the smart card service in the host drives and registers the smart card according to the loaded smart card function Driving the library, creating a new smart card device record in the resource manager of the smart card service, and identifying the multi-card reader as a plurality of smart card devices.
  • a communication method between a host and a multi-card reader based on the identification method of the multi-card reader comprising: the smart card function driving a smart card operation command according to a smart card operation request sent by an upper application;
  • the smart card function drives the application for the mutex; when the application mutex is unsuccessful, the smart card operation instruction is suspended, waiting for the application to succeed; when the application mutex is successful, the smart card function drives the smart card operation instruction Sending to the card reader device bus driver, the card reader device bus driver sends the smart card operation instruction to the multi-card deck reader; corresponding to the multi-card reader card holder
  • the smart card executes the received smart card operation instruction, and returns an instruction execution result;
  • the card reader device bus driver receives the execution result, and applies the execution result to the upper layer, and releases the mutual exclusion
  • the smart card function driver generates a smart card operation instruction according to the smart card operation request sent by the host, and passes the The card reader device bus driver sends the smart card operation instruction to the multi-card deck
  • a communication system between a host and a multi-card reader comprising: a host and a multi-card reader; the host includes: a loading module, configured to: when the multi-card reader and the host When the connection is established, the card reader device bus driver is loaded; the acquiring module is configured to obtain the device information of the multi-card reader by the card reader device bus driver; and the creating module is configured to pass the card reader
  • the device bus driver creates a physical device object according to the device information; a module for installing and loading a smart card function driver for each of the physical device objects; and a registration module for registering a standard smart card driver for each smart card function driver a recognition module, configured to create a new smart card device record in the resource manager of the smart card service by using a smart card service in the host according to a smart card driver library driven and registered according to the loaded smart card function,
  • the card reader is identified as a plurality of smart card devices; and an instruction module is generated for driving by the smart card function according to the a smart card operation request sent by
  • the multi-card reader can be recognized by the host as multiple smart card devices, and the host can monitor each "read card” , the state change of the middle card, so that the multi-card reader can support multiple types of card holders with different types or the same card holder, and share for multiple card holders in the multi-card reader a communication bus, and the plurality of card holders of the multi-card reader can alternately and mutually exclusively use the communication channel to perform data interaction with the host, and send and receive commands to lay a good foundation;
  • the communication method between the host and the multi-card reader can be recognized by the host as multiple smart card devices through the multi-card reader, and the host can monitor the status change of the cards in each "card reader", so that the card is multi-card
  • the card reader can support a plurality of different types or the same card holders in a card reader, and a plurality of card holders in the card deck reader share a communication bus, and the card holders The plurality of card holders in
  • FIG. 1 is a flowchart of a method for identifying a multi-card reader according to Embodiment 1 of the present invention
  • FIG. 2 is a host and a host provided in Embodiment 1 of the present invention
  • FIG. 3 is a schematic structural diagram of a communication system provided in Embodiment 2 of the present invention.
  • FIG. 4 is a multi-card reading provided in Embodiment 3 of the present invention.
  • Embodiment 1 provides a method for identifying a multi-card reader. It should be noted that the IC card reader provided in Embodiment 1 of the present invention includes at least two decks. Referring to FIG.
  • Step 101 The card reader device is connected to the host through a USB bus, the operating system of the host discovers a new USB device, and the operating system loads the card reader device bus driver; after the card reader device establishes a connection with the host device , follow CCID (USB Chip/Smart Card
  • Step 102 The card reader device bus driver receives a request for acquiring the information of the card reader device issued by the operating system of the host; wherein the operating system of the host can read the card through the Plug and Play Manager The device device bus driver sends an inquiry request requesting to obtain the card reader device information.
  • Step 103 The card reader device bus driver obtains the card reader device information; specifically, the step 4 can include the following steps:
  • the card reader device bus driver generates an inquiry command in response to an inquiry request of the operating system, and sends the inquiry command to the card reader to acquire a device descriptor of the device;
  • the device descriptor returned by the card reader indicates the type of the deck with a single character, that is, the device descriptor returned by the card reader contains several characters, which means that the card reader has several decks; for example, reading The device descriptor returned by the card reader is A, indicating that the card reader has only one card holder, and the card type is A type; the device descriptor returned by the card reader is ABAC, indicating that the card reader has four decks, 1
  • the type of deck is type A
  • the type of deck 2 is type B
  • the type of deck 3 is type A
  • the type of deck 4 is type C.
  • the device descriptor returned by the card reader is taken as an example of the CCS, that is, the card reader in the embodiment has three card holders, and the type of the card holder is C type, and the type of the card holder 2 The type is C type, and the type of deck 3 is S type.
  • Step 104 The card reader device bus driver creates a physical device object according to the card reader device information; when the card reader device bus driver obtains the device descriptor returned by the card reader, according to the type of the card holder indicated in the device descriptor The number of decks is created, and the corresponding physical device objects are created, corresponding to the decks of the card reader.
  • the card reader device bus creates three physical device objects, corresponding to the three card holders.
  • Step 105 The operating system of the host installs and loads the smart card function driver for the created physical device object, and each smart card function driver registers a standard smart card driver library; wherein, the operating system installs the card seat corresponding to each physical device object.
  • the function driver of the corresponding type of smart card device referred to as smart card function driver for short
  • each smart card function driver registers a standard smart card driver library.
  • the operating system of the host is installed and loaded with three smart card function drivers corresponding to the three card holders in the card reader, respectively, which are smart card function drivers of the c, C, and S types.
  • the smart card driver library is used to provide a standard framework for the smart card function driver to interact with the service controller of the smart card service.
  • the smart card driver libraries corresponding to the three smart card function drivers are the same.
  • the smart card service may include a service controller, a resource manager, and a database.
  • the service controller is used to manage the smart card service, receive the request from the smart card function driver, manage the resource manager, etc.; the resource manager is used to add a new smart card device record in the database, or delete the existing smart card device record.
  • Step 106 Add a new smart card device record to the smart card service in the host; wherein the smart card service creates a new smart card device record in the resource manager of the smart card service according to the smart card driver library driven and registered by the loaded smart card function.
  • the smart card service creates a new smart card device record in the resource manager of the smart card service according to the smart card driver library driven and registered by the loaded smart card function.
  • three smart card device records are created in the resource manager of the smart card service, respectively corresponding to three card holders in the card reader. In this way, three smart card devices appear in the host, and the host can operate each smart card device separately, and send or receive smart card operation instructions with the smart card device through the card reader device bus driver.
  • the multi-card reader is recognized by the host as a plurality of smart card devices.
  • each card in the card reader includes but is not limited to: no card, Some cards are not powered on and have been powered on.
  • the multi-card reader is recognized by the host as a plurality of smart card devices, if the card holder in the card reader does not have an IC card inserted, the card holder is in a cardless state; if the IC card is inserted into the card holder, but the host is If the power-on command is not issued, or the host sends a power-off command, the card holder is not powered.
  • Step 107 The card reader device bus driver sends an interrupt request to the card reader through the interrupt transmission pipeline; it should be noted that the card reader device bus driver and the card reader can communicate through two communication pipes: And interrupt the transmission pipeline.
  • the bulk transmission pipeline is used for data transmission, such as power and power-off commands and other smart card operation instructions, the host and the card reader exchange data through the bulk transmission pipeline in a one-to-one manner; interrupt the transmission pipeline,
  • the card reader will send a signal to the host through the interrupt transmission pipeline.
  • the interrupt request is suspended.
  • Step 108 The card reader device bus driver receives the interrupt signal returned by the smart card device; when a card is inserted in the card reader deck, the interrupt signal of the card insertion is sent to the card reader device bus driver through the interrupt transmission pipeline, still Taking 3 decks as an example, the specific interrupt signal can be:
  • Step 3 Pull out the card 0x5020
  • Step 109 The card reader device bus driver parses the received interrupt signal and passes the interrupt type to the corresponding smart card function driver; wherein the card reader device bus driver performs the received interrupt signal Parsing, obtaining the interrupt type corresponding to the signal, the smart card device, the smart card function driver, updating the sub-device status list in the card reader device bus driver, and mapping the status change of the card holder in the card reader through the sub-device status list Drive to the smart card function.
  • a sub-device status list for recording the status of the deck in the card reader is established, including the card type and the cardless mode. .
  • Step 110 The smart card function driver reports the state change of the card seat to the smart card service through the smart card driver library; specifically, the smart card function driver 1 provides a function provided by the smart card driver library
  • the multi-card reader can support multiple types of cards or different card holders in a card reader, and share a communication bus for multiple card holders in the multi-card reader.
  • Multiple decks in the multi-card reader can alternately and mutually exclusively use the communication channel to exchange data with the host and send and receive commands.
  • the embodiment of the invention further provides a communication method between the host and the multi-card reader based on the above identification method. That is, after the card reader device bus driver reports to the upper layer application that the card reader has a card, the upper layer application can send a command to the designated card holder in the card reader through the card reader device bus driver as needed, and perform the above power and PPS on the smart card ( Protocol and Parameter Select, protocol and parameter selection), read and write data, etc.
  • the service controller in the smart card service is further configured to receive an application request from an upper layer application, call a function DevicelOControl according to the received application request, and indicate a specific operation in its parameter.
  • the value of the parameter dwIoCotrolCode indicates the operation type, and the operation required by the smart card driver library parsing function DevicelOControl, and then the smart card function drives the result of the smart card driver library to generate a smart card operation instruction conforming to the CCID protocol.
  • the parameter that DevicelOControl provides to call includes the following parameters in addition to dwIoControlCode:
  • the smart card driver library is used to provide a standard framework for the smart card function driver to interact with the service controller of the smart card service; after the smart card driver library parses the DevicelOControl, the following four functions are dispatched to the smart card function driver:
  • SmartcardExtension -> ReaderFunction[RDF_SET_PROTOCOL] Rockey S etProtocol;
  • the smart card function driver generates commands according to these four functions to control the smart card device to perform power-on and power-off, data transmission, tracking card status and setting protocol; accordingly, the smart card function driver also passes The above four functions return information to the smart card driver library, and then the smart card driver library sends the smart card to the smart card and the upper layer application through DevicelOControl. Referring to FIG.
  • the smart card driver library parsing function the function is dispatched to the smart card function driver, and the smart card function driver encapsulates the received data to generate a smart card operation conforming to the CCID protocol specification.
  • the sixth byte in the smart card operation command indicates the number of the card reader deck corresponding to the smart card function driver.
  • the upper application generates a random number to the smart card device 1.
  • Incoming data 0x00 84 00 00 08
  • smart card function driver 1 using CCID standard command header 0x6f 05 00 00 00 00 10 00 00 00
  • Encapsulate the received data and get the smart card operation command as 0x6f 05 00 00 00 00 10 00 00 00 00 00 84 00 00 08 indicates the number 1 deck ⁇
  • the smart card function driver 2 According to the received function
  • Step 202 The smart card function driver sends the smart card operation instruction to the card reader through the card reader device bus driver.
  • the firmware program in the chip obtains the deck number corresponding to the smart card operation instruction according to the card reader status command, switches the channel according to the deck number field in the smart card operation instruction, and sends the smart card operation instruction to the designated card. Block, and modify the identification information to indicate the current exclusive reader hardware resources.
  • the identification information specifically refers to: using a byte storage space in the register of the card reader to store identification information indicating that the hardware resources of the card reader are occupied or idle, such as the card reader resource being occupied, the identification information is changed to 0x01 4 ⁇ is changed to Oxff when idle, or 0x55 indicates that the card reader resource is occupied, Oxaa indicates idle; or two bytes of storage space can be used in the register of the card reader to save the hardware resources of the reader. " ⁇ The occupied or idle identification information, if the card reader resource is occupied by the 2nd card holder, the identification information is changed to 0x01 00, and the idle time is repaired _?
  • Step 204 The card reader firmware program suspends the smart card operation instruction, waits for the hardware resource to be released, and the identification information is tampered with; for example, the current number 1 deck is powered on, and the card reader device bus driver is issued.
  • the status of the deck is changed from no card to no card.
  • the card reader sends a signal 0x500c indicating that the card is inserted into the bus of the card reader through the interrupt transmission pipeline.
  • the upper layer is applied. Knowing that the No. 2 deck has a power-on request after the card is inserted, the smart card function driver 2 generates a power-on command of the No. 2 deck complying with the CCID protocol after receiving the power-on request 0x62 00 00 00 00 01 21 01 00 00 and reads by The card device bus driver sends the card driver to the card reader. Since the random number command of the current card No.
  • Step 205 The card reader sends a smart card operation instruction to the designated card holder, and modifies the identification information. wherein, the card reader firmware program determines that the current card reader status identification information is idle, and the card reader firmware program analyzes the received instruction.
  • Step 206 The smart card in the card reader deck executes the received operation instruction, and returns an instruction execution result.
  • the instruction is processed through the bulk transmission pipeline.
  • the execution result is sent to the card reader device bus driver, the card seat releases the hardware resources of the card reader, and the card reader firmware program modifies the card reader status identification information to be idle; the hardware resources of the card reader are released, and the card reader status is released.
  • Step 207 The card reader device bus driver receives the execution result, and reports the execution result to the upper layer application. After receiving the instruction execution result, the card reader device bus driver returns the execution result to the corresponding smart card function driver, and the smart card function driver unpacks the CCID protocol instruction execution result and sends the result to the smart card service. For example, the random number instruction execution result of the No.
  • 1 deck is: 0x80 0a 00 00 00 00 10 00 00 00 2111 ca2b2ebb20059000
  • the smart card function drives the part after the 10th byte (ie 2111ca2b2ebb20059000) as the obtained random number transmission For the smart card service;
  • the ATR returned by the No. 2 deck after the power-on operation is 0x80 15 00 00 00 01 21 00 00 00 3bf l300008131fe4565465307010071c6806117d4, the part after the 10th byte of the smart card area (ie 3bfbl300008131fe4565465307010071c6806117d4) Passed to the smart card service.
  • the embodiment of the invention provides a communication method between a host and a multi-card reader, which can support multiple card readers of different types or the same card seat, and multiple card readers.
  • the card holders share a communication bus, and the plurality of card holders of the multi-card holder can alternately and mutually exclusively utilize the communication channel for data interaction and transmission and reception of commands.
  • Embodiment 2 Referring to FIG. 3, an embodiment of the present invention provides a communication system.
  • For the communication method of the communication system refer to the communication method provided in Embodiment 1. As shown in FIG.
  • the communication system 300 includes: a host 301 and a multi-card reader 302; the host 301 includes: a loading module, configured to load a card reader device bus driver when the multi-card reader card 302 establishes a connection with the host 301; and an acquisition module, configured to acquire the device of the multi-card reader card 302 through the card reader device bus driver Information; creating a module for creating a physical device object based on device information through a card reader device bus driver; installing a module for installing and loading a smart card function driver for each physical device object; a registration module for each smart card function
  • the driver registers a standard smart card driver library; the identification module is configured to create a new smart card device record in the resource manager of the smart card service by using the smart card service in the host 301 to drive and register the smart card driver library according to the loaded smart card function,
  • the multi-card reader 302 is identified as a plurality of smart card devices; and an instruction module is configured to generate a smart card operation instruction by using a smart card function to generate
  • the suspend module is configured to suspend the smart card operation instruction when the judgment result of the determination module is occupied, and wait for the hardware resource to be released.
  • a transceiver module configured to send a smart card operation instruction to the corresponding card seat when the judgment result of the determination module is unoccupied; and receive an execution result returned by the card seat, and send the result to the host; further, the host
  • the acquiring module of the 301 includes: a receiving unit, configured to drive, by using the card reader device bus, the receiving card sent by the receiving host 301 The request for inquiry of the device information of the device 302;
  • the obtaining unit is configured to acquire the card reader 302 device information through the card reader device bus driver according to the query request.
  • the obtaining unit specifically includes: a sending subunit, configured to generate a query command by using a card reader device bus driver to respond to the query request, and send the query command to the card deck reader 302; return to the subunit,
  • the device descriptor of the multi-card reader 302 is driven by the card reader device bus, and parsed and sent to the creation module.
  • the sending module of the host 301 is further configured to: send a interrupt request to the card deck reader 302 through the card reader device bus; the receiving module of the host 301 is further configured to receive the interrupt returned by the card deck reader 302.
  • the host 301 further includes: an interrupt parsing module, configured to parse the interrupt signal, obtain an interrupt type corresponding to the interrupt signal, a card holder and a smart card function driver; and an interrupt reporting module, configured to interrupt according to the interrupt parsing module
  • the interrupt type, card holder and smart card function corresponding to the signal are used to report the status of the corresponding card holder in the multi-card reader 302 to the smart card service.
  • the status of the card includes no card, no card is powered on, or the card is powered.
  • the card reader device bus driver and the multi-card deck reader 302 can communicate through two communication pipes: a bulk transfer pipe and an interrupt transfer pipe; correspondingly, the interrupt request and the interrupt signal are transmitted through the interrupt transmission pipe.
  • the generating instruction module of the host 301 specifically includes: a calling unit, configured to invoke a function Device1OControl according to a smart card request sent by the upper layer application of the host 301 by the service manager, and indicate a specific operation in a parameter of the function; , after the function is parsed by the smart card driver library, and the function is dispatched to the smart card function driver; a generating unit, configured to drive, by using a smart card function, to package the received data to generate a smart card operation instruction conforming to the CCID protocol, where the sixth byte of the smart card operation instruction indicates that the smart card function driver corresponds to the card reader 302 card seat Numbering.
  • the transceiver module of the multi-card reader is further configured to send the execution result of the instruction to the card reader device bus driver through the bulk transmission pipeline, and release the hardware resources of the multi-card reader.
  • the embodiment of the invention provides a communication system, which can support multiple card readers having different types or the same card holders, and multiple card holders in the multi-card deck reader share a communication bus, and the Multiple decks in a multi-card reader can alternately and mutually exclusively utilize a communication channel for data interaction, transceiving commands.
  • Embodiment 3 The embodiment 3 of the present invention provides a method for identifying a multi-card reader. It should be noted that the IC card reader provided in Embodiment 3 of the present invention includes at least two decks. Referring to FIG.
  • Step 401 The card reader device is connected to the host through a USB bus, the operating system of the host discovers a new USB device, and the operating system loads the card reader device bus driver; after the card reader device establishes a connection with the host device Follow the specifications of the CCID (USB Chip/Smart Card Interface Devices-USB) protocol for data exchange and command transmission and reception via the USB bus.
  • Step 402 The card reader device bus driver receives a request for acquiring the card reader device information sent by the operating system of the host; wherein the host operating system can read the card through the Plug and Play Manager The device device bus driver sends an inquiry request requesting to obtain the card reader device information.
  • Step 403 The card reader device bus driver acquires the card reader device information.
  • the step 4 can include the following steps: (1) the card reader device bus driver responds to the operating system query request to generate an inquiry command. And sent to the card reader to obtain the device descriptor of the device;
  • the type of the card holder is represented by a single character in the device descriptor returned by the card reader, that is, the card is read.
  • the device descriptor returned by the device contains several characters to indicate that the card reader has several decks; for example, the device descriptor returned by the card reader is A, indicating that the card reader has only one deck, and the deck type is Type A;
  • the device descriptor returned by the card reader is ABAC, indicating that the card reader has four decks, the type of deck 1 is type A, the type of deck 2 is type B, and the deck of deck 3 is Type A is type A, and the type of deck 4 is type C.
  • the device descriptor returned by the card reader is taken as an example of the CCS, that is, the card reader in the embodiment has three card holders, and the type of the card holder 1 is C type, and the type of the card holder 2 For the C type, the type of deck 3 is S type.
  • the card reader device bus creates three physical device objects, corresponding to the three card holders.
  • Step 405 The operating system of the host installs and loads the smart card function driver for the created physical device object, and each smart card function driver registers a standard smart card driver library.
  • the operating system installs a function driver of a corresponding type of smart card device for each card seat corresponding to each physical device object (referred to as a smart card function driver), and each smart card function driver registers a standard smart card driver library.
  • the operating system of the host installs and loads three smart card function drivers corresponding to the three card holders in the card reader, which are C, C, and S type smart card function drivers.
  • the smart card driver library is used to provide a standard framework for the smart card function driver to interact with the service controller of the smart card service.
  • the smart card driver libraries corresponding to the three smart card function drivers are the same.
  • the smart card service may include a service controller, a resource manager, and a database.
  • the service controller is used to manage the smart card service, receive the request from the smart card function driver, manage the resource manager, etc.; the resource manager is used to add a new smart card device record in the database, or delete the existing smart card device record.
  • Step 406 Add a new smart card device record to the smart card service among the hosts.
  • the smart card service creates a new smart card device record in the resource manager of the smart card service according to the smart card driver library driven and registered by the loaded smart card function.
  • three smart card device records are created in the resource manager of the smart card service, respectively corresponding to three card holders in the card reader.
  • three smart card devices appear in the host, and the host can operate each smart card device separately, and send or receive smart card operation instructions with the smart card device through the card reader device bus driver.
  • the multi-card reader is recognized by the host as a plurality of smart card devices.
  • each card in the card reader includes but is not limited to: no card, Some cards are not powered on and have been powered on.
  • the multi-card reader is recognized by the host as a plurality of smart card devices, if the card holder in the card reader does not have an IC card inserted, the card holder is in a cardless state; if the IC card is inserted into the card holder, but the host is If the power-on command is not issued, or the host sends a power-off command, the card holder is not powered.
  • Step 407 The card reader device bus driver sends an interrupt request to the card reader through the interrupt transmission pipeline; it should be noted that the card reader device bus driver and the card reader can communicate through two communication pipes: And interrupt the transmission pipeline.
  • the bulk transmission pipeline is used for data transmission, such as power and power-off commands and other smart card operation instructions, the host and the card reader exchange data through the bulk transmission pipeline in a one-to-one manner; interrupt the transmission pipeline,
  • the card reader will send a signal to the host through the interrupt transmission pipeline.
  • the interrupt request is suspended.
  • the card reader device bus driver receives an interrupt signal returned by the card reader device. When a card is inserted in the card reader deck, an interrupt signal with a card insertion is sent to the card reader device bus driver through the interrupt transmission pipeline.
  • the three card holders are still taken as an example.
  • the specific interrupt signal can be:
  • the No. 3 deck is inserted into the card 0x5030.
  • the card interrupt will be sent to the card reader bus driver through the interrupt transmission pipeline.
  • the specific interrupt signal can be: No. 1 deck pull out card 0x5002
  • Step 3 Pull out the card 0x5020
  • Step 409 The card reader device bus driver parses the received interrupt signal and passes the interrupt type to the corresponding smart card function driver; wherein the card reader device bus driver performs the received interrupt signal Parsing, obtaining the interrupt type corresponding to the signal, the smart card device, the smart card function driver, updating the sub-device status list in the card reader device bus driver, and mapping the status change of the card holder in the card reader through the sub-device status list Drive to the smart card function.
  • a sub-device status list for recording the status of the card holder in the card reader is established, including the card-free and card-free states.
  • Step 410 The smart card function driver reports the card deck to the smart card service through the smart card driver library. State change; Specifically, the smart card function driver 1 provides functions provided by the smart card driver library
  • the embodiment provides a method for identifying a multi-card reader. According to the above method, the multi-card reader can be recognized as a plurality of smart card devices by the host, and the host can monitor the state change of the card in each smart card device.
  • the multi-card reader can support a plurality of different types or the same card holder in one card reader, and share a communication bus for a plurality of card holders in the multi-card holder, the multi-card holder Multiple decks in the card reader can alternately and mutually exclusively utilize the communication channel to communicate data with the host and send and receive commands.
  • Embodiment 4 The embodiment of the present invention further provides a communication method between a host and a multi-card reader according to the identification method of Embodiment 3 above.
  • the upper layer application can send a command to the designated card holder in the card reader through the card reader device bus driver as needed, and perform the above power and PPS on the smart card ( Protocol and Parameter Select, protocol and parameter selection), read and write data, etc.
  • the service controller in the smart card service is further configured to receive an application request from an upper layer application, call a function DevicelOControl according to the received application request, and indicate a specific operation in its parameter.
  • the value of the parameter dwIoCotrolCode indicates the operation type, and the operation required by the smart card driver library parsing function DevicelOControl, and then the smart card function drives the result of the smart card driver library to generate a smart card operation instruction conforming to the CCID protocol.
  • the parameter that DevicelOControl provides to call includes the following parameters in addition to dwIoControlCode: BOOL DeviceIoControl(
  • the smart card driver library is used to provide a standard framework for the smart card function driver to interact with the service controller of the smart card service; after the smart card driver library parses the DevicelOControl, the following four functions are dispatched to the smart card function driver:
  • the smart card function driver generates instructions according to these four functions, controls the smart card device to perform power-on and power-off, data transmission, tracking card status and setting protocol; accordingly, the smart card function driver also drives the library through the above four functions to the smart card. After returning the information, the smart card driver library uses DevicelOControl to send the smart card to the upper layer and the upper layer application. Referring to FIG.
  • Step 501 The smart card function driver generates a smart card operation instruction according to the smart card operation request of the upper layer application; wherein, the operation of the upper layer application to the smart card is specifically sending an operation request to the service manager of the smart card service, and the service manager The function DevicelOControl is called according to the request of the upper application, and the specific operation is indicated in the function parameter.
  • the smart card driver library parsing function the function is dispatched to the smart card function driver, and the smart card function driver encapsulates the received data to generate a smart card operation conforming to the CCID protocol specification.
  • the sixth byte in the smart card operation command indicates the number of the card reader deck corresponding to the smart card function driver.
  • the upper layer application generates an operation request for taking a random number to the smart card device 1, and the smart card function driver 1 receives the pass function.
  • SmartcardExtension->ReaderFunction[RX)F_TRANSMIT] Rockey Transmit;
  • Incoming data 0x00 84 00 00 08
  • Smart card function driver 1 uses CCID standard instruction header 0x6f 05 00 00 00 00 10 00 00 00 for received data Encapsulation
  • the smart card operation instruction is 0x6f 05 00 00 00 00 10 00 00 00 00 00 00 84 00 00 08, indicating that it is a random number instruction of the No. 1 deck, wherein the sixth byte 00 represents the No. 1 deck
  • the smart card function driver 2 is based on the received function
  • Step 502 The smart card function driver determines whether the communication channel between the card reader device bus driver and the card reader is occupied. If it is already occupied, step 503 is performed; if not, step 504 is performed. It should be noted that, in the example, the chip in the card reader controls the three card slots in time, for example, only one card holder can be connected to the card reader device bus through the bulk transmission pipeline at the same time.
  • the firmware program in the chip switches the channel according to the card number field in the instruction, determines which card holder is connected to the card reader device bus, performs data interaction, and sends and receives commands.
  • the method for determining whether the communication channel is occupied may be: after the smart card function driver generates the smart card operation instruction, applying to the operating system to mark that the smart card function driver and the corresponding card holder can monopolize the mutual repulsion of the card reader device bus driving communication channel, The smart card function driver is driven to establish a communication connection with the corresponding card holder through the card reader device bus driver, and performs data interaction, command transmission and reception, and the like. If the acquisition of the mutex fails, the communication channel is already occupied.
  • the communication channel is not occupied or is in an idle state.
  • the beneficial effect of this method of judging is: When the card holder is connected to the host for data interaction, by assigning a mutex to the smart card function driver corresponding to the card seat, one card holder in the card reader is in one and the same as the host. When the communication of the answer is made, the communication channel can be monopolized, and the commands of the other card holders cannot be sent and sent by the card reader device bus. In this way, the card holder and the host in the card reader can perform data interaction smoothly and orderly. Command sending and receiving.
  • Step 503 The card reader device bus driver suspends the instruction driven by the smart card function, waiting After the mutex is released, the smart card function drives to acquire the mutex; after the mutex is successfully acquired, step 4 is performed 504.
  • the current No. 1 deck status is powered, and the card reader device bus driver sends the No. 1 deck to take the random number command 0x6f 05 00 00 00 00 10 00 00 00 00 00 84 00 00 08; in the card reader
  • a card is inserted in the No. 2 deck, and the status of the No. 2 deck is changed from no card to no card, and the card reader is interrupted by the transmission pipeline.
  • the card reader device bus driver sends a signal indicating that the card slot has a card insertion 0x500c; the upper layer application knows that the smart card device has a power-on request after the card is inserted, and the smart card function driver 2 generates a CCID-compliant protocol after receiving the power-on request.
  • Step 504 The card reader device bus driver receives the smart card operation instruction and saves the mutex; after the smart card function driver successfully acquires the mutex, sends the generated smart card operation instruction to the card reader device bus driver, and saves the mutex to the The card reader device bus driver releases the mutex when the card reader device bus driver receives the execution result of the instruction.
  • Step 505 The card reader device bus driver sends an operation instruction to the card reader; wherein, after the card reader device bus driver receives the smart card operation instruction generated by the smart card function driver, the card reader device bus driver reads through the bulk transmission pipeline
  • the specified card seat in the card device issues the operation command.
  • the firmware program in the card reader chip analyzes the received command, obtains the card seat in the command, and switches the card seat specified in the command to a designated transmission pipe driven by the function of the card reader device, so that the card seat is
  • the function driver of the card reader device performs data interaction and transmission and reception of commands in a one-to-one manner.
  • Step 506 The smart card in the card reader deck executes the received operation instruction and returns the instruction execution result.
  • Step 507 The card reader device bus driver receives the execution result, and reports the execution result to the upper layer application to release the mutex. After the reader device bus driver receives the instruction execution result, the mutex is released, and the card reader device bus driver returns the execution result to the corresponding smart card function driver, and the smart card function driver unpacks the CCID protocol instruction execution result. Send to smart card service. For example, the random number instruction execution result of the No.
  • 1 deck is: 0x80 0a 00 00 00 00 10 00 00 00 2111 ca2b2ebb20059000
  • the smart card function drives the part after the 10th byte (ie 2111ca2b2ebb20059000) as the obtained random number transmission For the smart card service;
  • the ATR returned by the No. 2 deck after the power-on operation is 0x80 15 00 00 00 01 21 00 00 00 3bf l300008131fe4565465307010071c6806117d4, the part after the 10th byte of the smart card area (ie 0x3bfbl300008131fe4565465307010071c6806117d4) Passed to the smart card service.
  • the embodiment of the invention provides a communication method between a host and a multi-card reader, which can support multiple card readers of different types or the same card seat, and multiple card readers.
  • the card holders share a communication bus, and the plurality of card holders of the multi-card holder can alternately and mutually exclusively utilize the communication channel for data interaction and transmission and reception of commands.

Description

多卡座读卡器的识别方法及其与主机的通信方法和系统 技术领域 本发明涉及 IC 卡读卡器领域, 特别涉及一种多卡座读卡器的识别方法 及其与主机的通信方法和系统。 背景技术
IC ( Integrated Circuit, 集成电路)卡是继磁卡之后出现的又一种新型信 息工具。 它是将一个微电子芯片嵌入符合 ISO 7816标准的卡基中, 做成卡片 形式。 目前, IC卡已经被广泛地应用到金融、 交通、 社保等很多领域, 例如, 我们经常使用的公交车卡就是 IC卡的一种。 IC 卡读写器是 IC 卡与应用系统间的桥梁, 在 ISO 国际标准中称之为
IFD(Interface Device, 接口设备)。 一般常见的 IC卡釆用射频技术与 IFD进 行通讯, 即 IFD内的 CPU通过一个接口电路与 IC卡相连并进行通信。其中, IC卡接口电路是 IC卡读写器中至关重要的部分,根据实际应用系统的不同, 可选择并行通信、 半双工串行通信和 I2C通信等不同的 IC卡读写芯片。 在实现本发明的过程中, 发明人发现现有技术至少存在以下缺点: 当 IC卡读卡器包含多个卡座时, 主机无法识别这种 IC卡读卡器, 从而 无法实现与该读卡器的数据交换、 指令收发等。 发明内容 为了使主机能够识别包含多个卡座的智能卡读卡器, 本发明实施例提供 了一种多卡座读卡器的识别方法、 基于这种识别方法的主机与多卡座读卡器 之间的通信方法以及系统。 一种多卡座读卡器的识别方法, 包括: 多卡座读卡器与主机建立连接, 所述主机加载读卡器设备总线驱动; 所述读卡器设备总线驱动获取所述多卡座读卡器的设备信息, 并根据所 述设备信息创建物理设备对象; 所述主机为每个所述物理设备对象安装并加载智能卡功能驱动, 并为每 个智能卡功能驱动注册一个标准的智能卡驱动库; 所述主机中的智能卡服务根据加载的智能卡功能驱动和注册的智能卡驱 动库, 在所述智能卡服务的资源管理器中创建新的智能卡设备记录, 将所述 多卡座读卡器识别为多个智能卡设备。 一种基于上述多卡座读卡器的识别方法的主机与多卡座读卡器之间的通 信方法, 包括: 所述智能卡功能驱动根据上层应用发送的智能卡操作请求, 生成智能卡 操作指令; 所述智能卡功能驱动申请互斥量; 当申请互斥量不成功时, 将所述智能卡操作指令挂起, 等待申请成功; 当申请互斥量成功时, 所述智能卡功能驱动将所述智能卡操作指令发送 给所述读卡器设备总线驱动, 所述读卡器设备总线驱动向所述多卡座读卡器 下发所述智能卡操作指令; 相应的所述多卡座读卡器卡座中的智能卡执行接 收到的所述智能卡操作指令, 并返回指令执行结果; 所述读卡器设备总线驱 动接收所述执行结果, 并将所述执行结果向上层应用 4艮告, 并释放所述互斥 量; 或 所述智能卡功能驱动根据所述主机发送的智能卡操作请求, 生成智能卡 操作指令, 并通过所述读卡器设备总线驱动将所述智能卡操作指令发送给所 述多卡座读卡器; 读卡器固件程序判断当前读卡器的硬件资源是否被占用; 如果被占用, 将所述智能卡操作指令挂起, 等待硬件资源被释放; 如果未被占用, 所述读卡器向相应的卡座下发所述智能卡操作指令; 相 应的卡座中的智能卡执行接收到的所述智能卡操作指令, 并返回指令执行结 果; 所述读卡器设备总线驱动接收所述执行结果, 并将所述执行结果向上层 应用 4艮告。 一种主机与多卡座读卡器之间的通信系统, 包括: 主机和多卡座读卡器; 所述主机包括: 加载模块, 用于当所述多卡座读卡器与所述主机建立连接时, 加载读卡 器设备总线驱动; 获取模块, 用于通过所述读卡器设备总线驱动获取所述多卡座读卡器的 设备信息; 创建模块, 用于通过所述读卡器设备总线驱动根据所述设备信息创建物 理设备对象; 安装模块, 用于为每个所述物理设备对象安装并加载智能卡功能驱动; 注册模块, 用于为每个智能卡功能驱动注册一个标准的智能卡驱动库; 识别模块, 用于通过所述主机中的智能卡服务根据加载的智能卡功能驱 动和注册的智能卡驱动库, 在所述智能卡服务的资源管理器中创建新的智能 卡设备记录, 将所述多卡座读卡器识别为多个智能卡设备; 生成指令模块, 用于通过所述智能卡功能驱动根据所述主机发送的智能 卡操作请求, 生成智能卡操作指令; 发送模块, 用于将所述智能卡功能驱动生成的智能卡操作指令通过所述 读卡器设备总线驱动发送给所述多卡座读卡器; 接收模块, 用于通过所述读卡器设备总线驱动接收所述多卡座读卡器发 送的执行结果, 并将所述执行结果向上层应用报告; 所述多卡座读卡器包括: 判断模块, 用于通过所述多卡座读卡器的读卡器固件程序判断当前读卡 器的硬件资源是否被占用; 挂起模块, 用于当所述判断模块的判断结果为被占用时, 将所述智能卡 操作指令挂起, 等待硬件资源被释放; 收发模块, 用于当所述判断模块的判断结果为未被占用时, 所述读卡器 向相应的卡座下发所述智能卡操作指令; 并接收所述卡座返回的执行结果, 发送给所述主机。 本发明提供的技术方案带来的有益效果是: 通过一种多卡座读卡器的识别方法, 多卡座读卡器可以被主机识别为多 个智能卡设备, 并且主机可以监控各个"读卡器,,中卡的状态变化, 使得多卡 座读卡器可以支持一个读卡器中有多个类型不同或相同卡座的情况, 并为了 多卡座读卡器中的多个卡座共享一条通信总线, 并且所述多卡座读卡器中的 多个卡座能够交替、 互斥地利用通信通道与主机之间进行数据交互、 收发指 令打下良好的基础; 通过本发明提供的一种主机与多卡座读卡器之间的通信方法, 通过多卡 座读卡器可以被主机识别为多个智能卡设备, 并且主机可以监控各个"读卡 器"中卡的状态变化,使得多卡座读卡器可以支持一个读卡器中有多个类型不 同或相同卡座的情况, 并使多卡座读卡器中的多个卡座共享一条通信总线, 并且所述多卡座读卡器中的多个卡座能够交替、 互斥地利用通信通道与主机 之间进行数据交互、 收发指令; 通过本发明提供的一种通信系统, 可以支持一个读卡器中有多个类型不 同或相同卡座的情况, 多卡座读卡器中的多个卡座共享一条通信总线, 并且 所述多卡座读卡器中的多个卡座能够交替、 互斥地利用通信通道进行数据交 互、 收发指令。 附图说明 图 1 是本发明实施例 1 中提供的一种多卡座读卡器的识别方法的流程 图; 图 2是本发明实施例 1中提供的一种主机与多卡座读卡器之间的通信方 法流程图; 图 3是本发明实施例 2中提供的一种通信系统的结构示意图。 图 4 是本发明实施例 3 中提供的一种多卡座读卡器的识别方法的流程 图; 图 5是本发明实施例 4中提供的一种主机与多卡座读卡器之间的通信方 法。 具体实施方式 为使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图对本发 明实施方式作进一步地详细描述。 实施例 1 本发明实施例 1提供了一种多卡座读卡器的识别方法, 需要说明的是, 本发明实施例 1提供的 IC卡读卡器包含至少两个卡座。 参见图 1 , 该方法包 括: 步骤 101 : 读卡器设备通过 USB总线连接到主机, 主机的操作系统发现 新 USB设备, 操作系统加载读卡器设备总线驱动; 在读卡器设备与主机建立连接后, 遵循 CCID (USB Chip/Smart Card
Interface Devices, USB芯片智能卡接口设备)协议的规范通过 USB总线进行 数据的交互、 指令的收发。 步骤 102: 读卡器设备总线驱动接收到主机的操作系统下发的获取读卡 器设备信息的请求; 其中,主机的操作系统可以通过即插即用管理器( Plug and Play Manager ) 向读卡器设备总线驱动下发询问请求, 请求获得读卡器设备信息。 步骤 103 : 读卡器设备总线驱动获取读卡器设备信息; 具体的, 此步 4聚可以包括如下步 4聚:
( 1 ) 读卡器设备总线驱动响应操作系统的询问请求, 生成问询指令, 并发送给读卡器, 获取设备的设备描述符;
( 2 ) 读卡器返回的设备描述符中用单个字符表示卡座的类型, 即读卡 器返回的设备描述符中包含几个字符就代表该读卡器具有几个卡座; 例如, 读卡器返回的设备描述符为 A, 表示该读卡器只有一个卡座, 卡座类型为 A 型; 读卡器返回的设备描述符为 ABAC, 表示该读卡器有四个卡座, 1 号卡 座的类型为 A型, 2号卡座的类型为 B型, 3号卡座的类型为 A型, 4号卡 座的类型为 C型。 在本实施例中, 以读卡器返回的设备描述符为 CCS为例, 即本实施例中的读卡器有三个卡座, 1号卡座的类型为 C型, 2号卡座的类 型为 C型, 3号卡座的类型为 S型。 步骤 104: 读卡器设备总线驱动根据读卡器设备信息创建物理设备对象; 当读卡器设备总线驱动获取到读卡器返回的设备描述符后, 根据设备描 述符中表示的卡座类型与卡座个数, 创建相应的物理设备对象, 分别与读卡 器的卡座相对应。 以读卡器返回的设备描述符为 CCS为例,读卡器设备总线创建 3个物理 设备对象, 与 3个卡座分别对应。 步骤 105: 主机的操作系统为已创建的物理设备对象安装并加载智能卡 功能驱动, 每个智能卡功能驱动注册一个标准的智能卡驱动库; 其中, 操作系统为每个物理设备对象所对应的卡座安装相应类型的智能 卡设备的功能驱动(简称智能卡功能驱动),每个智能卡功能驱动注册一个标 准的智能卡驱动库。 在本实施例中, 主机的操作系统安装并加载了三个智能卡功能驱动与读 卡器中的三个卡座相对应, 分别是 c、 C、 S类型的智能卡功能驱动。 需要说明的是, 智能卡驱动库用于提供一个标准的框架使智能卡功能驱 动与智能卡服务的服务控制器进行交互, 在本发明实施例当中, 三个智能卡 功能驱动所对应的智能卡驱动库是相同的。 需要说明的是, 智能卡服务可以包括服务控制器、 资源管理器和数据库。 其中, 服务控制器用于管理智能卡服务、 接收来自智能卡功能驱动的请求、 管理资源管理器等; 资源管理器用于在数据库中添加新的智能卡设备记录、 或者删除已有的智能卡设备记录等。 步骤 106: 在主机当中的智能卡服务中添加新的智能卡设备记录; 其中, 智能卡服务根据加载的智能卡功能驱动和注册的智能卡驱动库, 在智能卡服务的资源管理器中创建新的智能卡设备记录。在本发明实施例中, 智能卡服务的资源管理器中创建了三个智能卡设备记录, 分别与读卡器中的 三个卡座相对应。 如此, 在主机中就出现了三个智能卡设备, 主机可以单独 对每个智能卡设备进行操作, 通过读卡器设备总线驱动与智能卡设备发送或 者接收智能卡操作指令。 截止到步骤 106, 多卡座读卡器被主机识别为多个智能卡设备。 下面介绍被识别为多个智能卡设备的多卡座读卡器的各个卡座上卡的状 态监控过程: 这里需要说明的是, 读卡器中各个卡座的状态包括但不限于: 无卡、 有 卡未上电、 已上电。 其中, 当多卡座读卡器被主机识别为多个智能卡设备之 后, 如果读卡器中的卡座没有 IC卡片插入, 卡座就处于无卡状态; 如果 IC 卡片插入卡座, 但主机并未下发上电指令, 或主机下发下电指令, 则卡座处 于有卡未上电状态; 如果 IC 卡卡片插入卡座, 主机下发上电指令, 且智能 卡响应并成功返回 ATR ( Answer To Reset, 复位应答) 后, 卡座处于已上电 大态。 步骤 107: 读卡器设备总线驱动通过中断传输管道发送中断请求给读卡 器; 需要说明的是, 读卡器设备总线驱动与读卡器之间能够通过两条通信管 道进行通信: 批量传输管道和中断传输管道。 其中, 批量传输管道, 用于进行数据的传输, 如上电、 下电指令及其它 智能卡操作指令, 主机与读卡器按照一应一答的方式通过批量传输管道进行 数据交互; 中断传输管道, 用于传输异步事件, 如插卡、 拔卡及卡短路等, 读卡器就会通过中断传输管道向主机发送信号。 其中, 在本发明实施例中, 如果读卡器卡座中没有卡片的插入或者拔出 动作, 则该中断请求被挂起。 步骤 108: 读卡器设备总线驱动接收智能卡设备返回的中断信号; 当读卡器卡座中有卡插入后, 会通过中断传输管道向读卡器设备总线驱 动发送有卡插入的中断信号,仍然以 3个卡座为例,具体的中断信号可以为:
1号卡座插入卡 0x5003 2号卡座插入卡 0x500c
3号卡座插入卡 0x5030 相应的, 在读卡器使用过程中, 如果读卡器卡座中有卡拔出时, 也会通 过中断传输管道向读卡器设备总线驱动发送有卡拔出的中断信号, 具体的中 断信号可以为:
1号卡座拔出卡 0x5002 2号卡座拔出卡 0x5008
3号卡座拔出卡 0x5020 步骤 109: 读卡器设备总线驱动解析接收到的中断信号并将中断类型传 递给相应的智能卡功能驱动; 其中, 读卡器设备总线驱动对接收到的中断信号进行解析, 得到该信号 对应的中断类型及智能卡设备、 智能卡功能驱动, 更新读卡器设备总线驱动 中的子设备状态列表, 并通过该子设备状态列表将读卡器中卡座的状态变化 情况映射到智能卡功能驱动。 其中, 需要说明的是, 读卡器设备总线驱动在创建智能卡设备成功后, 会建立一个用于记录读卡器中卡座状态的子设备状态列表, 包括有卡和无卡 两种^ I 态。 例如, 如果读卡器设备总线驱动中的子设备状态列表中记录的是 1号卡 座为无卡状态, 读卡器设备总线驱动接收到中断信号 0x5003 , 则读卡器设备 总线驱动修改其子设备状态列表中 1号卡座对应的项为有卡状态, 同时将该 状态映射到智能卡功能驱动 1上。 步骤 110: 智能卡功能驱动通过智能卡驱动库向智能卡服务报告卡座的 状态变化; 具体的, 智能卡功能驱动 1通过智能卡驱动库提供的函数
( SmartcardExtension->ReaderFunction[RDF_CARD_TRACKING] = RockeyCardTracking; ) 修改智能卡驱动库 1中智能卡卡座状态跟踪 I/O请求 包中表示智能卡状态的参数为有卡, 并将智能卡卡座状态跟踪 I/O请求包发 送给智能卡服务的服务控制器, 服务控制器向上层应用报告有卡片插入智能 卡设备, 同时资源管理器将智能卡设备的状态修改有有卡, 更新数据库中的 ΐ己录。 本实施例提供了一种多卡座读卡器的识别方法, 通过上述方法, 多卡座 读卡器可以被主机识别为多个智能卡设备, 并且主机可以监控各个"读卡器" 中卡的状态变化, 使得多卡座读卡器可以支持一个读卡器中有多个类型不同 或相同卡座的情况, 并为了多卡座读卡器中的多个卡座共享一条通信总线, 所述多卡座读卡器中的多个卡座能够交替、 互斥地利用通信通道与主机之间 进行数据交互、 收发指令。 本发明实施例还提供了一种基于上述识别方法的主机与多卡座读卡器之 间的通信方法。 即在读卡器设备总线驱动向上层应用报告读卡器有卡后, 上 层应用便可以按需要通过读卡器设备总线驱动发送指令给读卡器中指定卡 座, 对智能卡进行如上电、 PPS ( Protocol and Parameter Select, 协议与参数 选择)、 读写数据等操作。 这里需要说明的是, 智能卡服务中的服务控制器还用于接收来自上层应 用的应用请求,根据接收到的应用请求调用函数 DevicelOControl并在其参数 中指示具体的操作。 例如在函数 DevicelOControl中, 参数 dwIoCotrolCode的值表示操作类 型, 通过智能卡驱动库解析函数 DevicelOControl所要求的操作, 然后智能卡 功能驱动 居智能卡驱动库解析出的结果生成符合 CCID协议的智能卡操作 指令。 其中, DevicelOControl提供调用的参数除 dwIoControlCode外还包括以 下几个参数:
BOOL DeviceIoControl(
HANDLE hDevice, II handle to device
DWORD dwIoControlCode: II operation
LPVOID lpInBuf er, II input data buffer
DWORD nlnBuf erSize, II size of input data buffer
LPVOID lpOutBuf er, II output data buffer
DWORD nOutBuf erSize. // size of output data buffer LPDWORD lpBytesReturned, II byte count LPOVERLAPPED lpOverlapped II overlapped information
); 智能卡驱动库用于提供一个标准的框架使智能卡功能驱动与智能卡服务 的服务控制器进行交互; 智能卡驱动库解析 DevicelOControl后, 向智能卡功 能驱动派遣下面的四个函数:
SmartcardExtension -〉 ReaderFunction [RDF CARD POWER] = RockeyCardPower;
SmartcardExtension->ReaderFunction[RDF_TRANSMIT] = Rockey Transmit;
SmartcardExtension -〉 ReaderFunction [RDF CARD TRACKING] = RockeyCardTracking;
SmartcardExtension -〉 ReaderFunction[RDF_SET_PROTOCOL] = Rockey S etProtocol; 智能卡功能驱动根据这四个函数生成指令,控制智能卡设备进行上下电、 数据传输、 跟踪卡状态和设置协议等操作; 相应地, 智能卡功能驱动也是通 过以上四个函数向智能卡驱动库返回信息, 然后智能卡驱动库通过 DevicelOControl向智能卡月艮务及上层应用汇 4艮。 参见图 2 , 该方法包括: 步骤 201 : 智能卡功能驱动根据上层应用的智能卡操作请求生成智能卡 操作指令; 其中, 上层应用对智能卡的操作具体为向智能卡服务的服务管理器发送 操作请求, 服务管理器根据上层应用的请求调用函数 DevicelOControl, 并在 函数参数中指示具体的操作, 智能卡驱动库解析函数后, 向智能卡功能驱动 派遣函数, 智能卡功能驱动将接收到的数据封装生成符合 CCID协议规范的 智能卡操作指令, 该智能卡操作指令中的第 6个字节表示该智能卡功能驱动 所对应的读卡器卡座的编号。 例如, 上层应用产生向智能卡设备 1取随机数 的 操 作 请 求 , 智 能 卡 功 能 驱 动 1 接 收 到 通 过 函 数 (SmartcardExtension->ReaderFunction[RX)F_TRANSMIT] = Rockey Transmit; ) 传入的数据 0x00 84 00 00 08, 智能卡功能驱动 1使用 CCID标准的指令头 0x6f 05 00 00 00 00 10 00 00 00对接收到的数据进行封装,得到智能卡操作指 令为 0x6f 05 00 00 00 00 10 00 00 00 00 84 00 00 08表示的是 1号卡座 ^ 再例如, 智能卡功能驱动 2根据接收到的函数
( SmartcardExtension->ReaderFunction[RDF_CARD_POWER] = RockeyCardPower; ) 中的参数判断对 2号卡座进行上电或下电操作, 可以使 用参数 0x00表示上电、 OxFF表示下电, 或者也可以用参数 Oxaa表示上电、 0x55表示下电; 若智能卡功能驱动 2判断出要对 2号卡座进行上电操作, 则 智能卡功能驱动 2生成符合 CCID协议规范的上电指令: 0x62 00 00 00 00 01 21 01 00 00, 表示 2号卡座的上电指令, 其中第 6个字节 01表示的是 2号卡 座。 相应地, 智能卡功能驱动利用下面的函数
( SmartcardExtension->ReaderFunction[RDF_CARD_TRACKING] = RockeyCardTracking; )通过智能卡驱动库通知智能卡服务发生卡片的插入或 拔出; 再者, 智能卡功能驱动解析上电后卡片返回的 ATR信息, 利用下面的函 数
( SmartcardExtension->ReaderFunction[RDF_SET_PROTOCOL] = RockeySetProtocol; )通过智能卡驱动库通知智能卡服务当前卡片的通信模式 遵循 t0或 tl协议。 步骤 202: 智能卡功能驱动通过读卡器设备总线驱动将智能卡操作指令 发送给读卡器; 步骤 203: 读卡器固件程序判断当前读卡器的硬件资源是否被占用; 如果已经被占用, 则执行步骤 204; 如果没有被占用, 则执行步骤 205; 其中, 需要说明的是, 以本实施例读卡器中的芯片分时控制 3个卡座为 例, 在同一时刻只能有一个卡座通过批量传输管道与读卡器设备总线驱动连 接, 进行数据交互, 芯片中的固件程序根据读卡器状态指令得到智能卡操作 指令对应的卡座编号, 根据智能卡操作指令中的卡座编号字段来切换通道, 将智能卡操作指令发送给指定的卡座, 并修改标识信息表示当前独占读卡器 硬件资源。 其中, 标识信息具体指的是: 在读卡器的寄存器中使用一个字节存储空 间保存表示读卡器硬件资源被占用或空闲的标识信息, 如读卡器资源被占用 将标识信息爹改为 0x01、 空闲时 4爹改为 Oxff, 或者用 0x55表示读卡器资源 被占用、 Oxaa表示空闲; 也可以在读卡器的寄存器中使用两个字节存储空间保存表示读卡器硬件 资源被某一"" ^座占用或空闲的标识信息, 如读卡器资源被 2号卡座占用则将 标识信息爹改为 0x01 00、 空闲时修_?丈为 0x00 10 , 其中标识信息的第一个字 节数据表示卡座编号, 标识信息的第二个字节用于表示卡座被占用或空闲。 步骤 204: 读卡器固件程序将该智能卡操作指令挂起, 等待硬件资源被 释放、 标识信息被爹改; 例如, 当前 1号卡座状态为已上电, 读卡器设备总线驱动下发了 1号卡 座的取随机数指令 0x6f 05 00 00 00 00 10 00 00 00 00 84 00 00 08; 在读卡器 设备总线驱动接收到该取随机数指令的执行结果之前, 2 号卡座插入了一张 卡片, 则 2号卡座状态由无卡变为有卡未上电, 读卡器通过中断传输管道向 读卡器设备总线驱动发送表示 2号卡座有卡插入的信号 0x500c; 上层应用得 知 2号卡座有卡插入后发出上电请求, 智能卡功能驱动 2接收到上电请求后 生成符合 CCID协议的 2号卡座上电指令 0x62 00 00 00 00 01 21 01 00 00 ,并 通过读卡器设备总线驱动发送给读卡器, 由于当前 1号卡座的随机数指令还 没有执行完毕, 读卡器硬件资源被智能卡功能驱动 1 占用, 读卡器固件程序 判断标识信息获知硬件资源已经被占用后, 则将该操作指令挂起, 等待 1号 卡座执行完取随机数指令后, 执行步骤 205。 步骤 205 : 读卡器向指定的卡座发送智能卡操作指令, 并修改标识信息; 其中, 读卡器固件程序判断当前读卡器状态标识信息为空闲, 读卡器固 件程序分析接收到的指令确定指令中的卡座, 并将该指令发送给该卡座, 使 该卡座与读卡器设备功能驱动按照一应一答的方式进行数据交互、指令收发, 同时修改读卡器状态标识信息为硬件资源已经被占用。 步骤 206: 读卡器卡座中的智能卡执行接收到的操作指令, 并返回指令 执行结果; 其中, 读卡器卡座中的智能卡执行完毕接收到的操作指令后, 通过批量 传输管道将指令的执行结果发送给读卡器设备总线驱动, 卡座释放读卡器的 硬件资源, 同时读卡器固件程序修改读卡器状态标识信息为空闲; 读卡器的硬件资源被释放、 读卡器状态标识信息修改为空闲后, 被读卡 器固件程序挂起的下一条指令被下发给相应的卡座并爹改标识信息。 步骤 207: 读卡器设备总线驱动接收执行结果, 并将执行结果向上层应 用报告。 读卡器设备总线驱动接收到指令执行结果后, 将执行结果返回给相应的 智能卡功能驱动, 由智能卡功能驱动将 CCID协议的指令执行结果解包后发 送给智能卡服务。 例如, 1号卡座的取随机数指令执行结果为: 0x80 0a 00 00 00 00 10 00 00 00 2111 ca2b2ebb20059000 , 智能卡功能驱动取第 10个字节以后的部分(即 2111ca2b2ebb20059000 ) 作为获取的随机数传递给智能卡服务; 2 号卡座执 行完上电操作后返回的 ATR 为 0x80 15 00 00 00 01 21 00 00 00 3bf l300008131fe4565465307010071c6806117d4, 智 卡功 马区动取第 10个 字节以后的部分(即 3bfbl300008131fe4565465307010071c6806117d4 )传递 给智能卡服务。 本发明实施例提供了一种主机与多卡座读卡器之间的通信方法, 可以支 持一个读卡器中有多个类型不同或相同卡座的情况, 多卡座读卡器中的多个 卡座共享一条通信总线, 并且所述多卡座读卡器中的多个卡座能够交替、 互 斥地利用通信通道进行数据交互、 收发指令。 实施例 2 参见图 3 , 本发明实施例提供了一种通信系统, 该通信系统的通信方法 可以参见实施例 1中提供的通信方法。 如图 3所示, 通信系统 300包括: 主 机 301和多卡座读卡器 302 ; 主机 301包括: 加载模块, 用于当多卡座读卡器 302与主机 301建立连接时, 加载读卡 器设备总线驱动; 获取模块, 用于通过读卡器设备总线驱动获取多卡座读卡器 302的设备 信息; 创建模块, 用于通过读卡器设备总线驱动根据设备信息创建物理设备对 象; 安装模块, 用于为每个物理设备对象安装并加载智能卡功能驱动; 注册模块, 用于为每个智能卡功能驱动注册一个标准的智能卡驱动库; 识别模块, 用于通过主机 301中的智能卡服务根据加载的智能卡功能驱 动和注册的智能卡驱动库, 在智能卡服务的资源管理器中创建新的智能卡设 备记录, 将多卡座读卡器 302识别为多个智能卡设备; 生成指令模块, 用于通过智能卡功能驱动根据主机 301发送的智能卡操 作请求, 生成智能卡操作指令; 发送模块, 用于将生成指令模块生成的智能卡操作指令发送给多卡座读 卡器 302 ; 接收模块, 用于通过读卡器设备总线驱动接收智能卡操作指令的执行结 果, 并将执行结果向上层应用报告; 多卡座读卡器 302包括: 判断模块, 用于通过多卡座读卡器 302的读卡器固件程序判断当前读卡 器 302的硬件资源是否被占用; 挂起模块, 用于当判断模块的判断结果为被占用时, 将智能卡操作指令 挂起, 等待硬件资源被释放; 收发模块, 用于当判断模块的判断结果为未被占用时, 向相应的卡座下 发智能卡操作指令; 并接收所述卡座返回的执行结果, 发送给所述主机; 进一步的, 主机 301的获取模块, 具体包括: 接收单元, 用于通过读卡器设备总线驱动接收主机 301下发的获取读卡 器 302设备信息的询问请求;
获取单元,用于根据询问请求,通过读卡器设备总线驱动获取读卡器 302 设备信息。 其中, 获取单元, 具体包括: 发送子单元, 用于通过读卡器设备总线驱动响应询问请求, 生成问询指 令, 并将问询指令发送给多卡座读卡器 302; 返回子单元, 用于通过读卡器设备总线驱动接收多卡座读卡器 302的设 备描述符, 并解析后发送给创建模块。 进一步的, 主机 301的发送模块还用于: 通过读卡器设备总线驱动发送 中断请求给多卡座读卡器 302; 主机 301 的接收模块还用于接收多卡座读卡 器 302返回的中断信号; 相应的, 主机 301还包括: 中断解析模块, 用于对中断信号进行解析, 得到中断信号对应的中断类 型、 卡座和智能卡功能驱动; 中断报告模块,用于根据中断解析模块得到的中断信号对应的中断类型、 卡座和智能卡功能驱动, 向智能卡服务报告多卡座读卡器 302中对应卡座的 状态, 卡座的状态包括无卡、 有卡未上电或有卡已上电。 读卡器设备总线驱动与多卡座读卡器 302之间能够通过两条通信管道进 行通信: 批量传输管道和中断传输管道; 相应的, 中断请求和中断信号通过中断传输管道进行发送。 进一步的, 主机 301的生成指令模块, 具体包括: 调用单元, 用于通过服务管理器根据主机 301的上层应用发送的智能卡 请求调用函数 DevicelOControl, 并在该函数的参数中指示具体的操作; 派遣单元, 用于通过智能卡驱动库解析函数后, 向智能卡功能驱动派遣 函数; 生成单元, 用于通过智能卡功能驱动将接收到的数据封装生成符合 CCID协议的智能卡操作指令, 该智能卡操作指令中的第 6个字节表示该智 能卡功能驱动所对应的读卡器 302卡座的编号。 其中, 多卡座读卡器的收发模块还用于通过批量传输管道将指令的执行 结果发送给读卡器设备总线驱动, 并释放所述多卡座读卡器的硬件资源。 本发明实施例提供了一种通信系统, 可以支持一个读卡器中有多个类型 不同或相同卡座的情况, 多卡座读卡器中的多个卡座共享一条通信总线, 并 且所述多卡座读卡器中的多个卡座能够交替、 互斥地利用通信通道进行数据 交互、 收发指令。 实施例 3 本发明实施例 3提供了一种多卡座读卡器的识别方法, 需要说明的是, 本发明实施例 3提供的 IC卡读卡器包含至少两个卡座。 参见图 4, 该方法包 括: 步骤 401 : 读卡器设备通过 USB总线连接到主机, 主机的操作系统发现 新 USB设备, 操作系统加载读卡器设备总线驱动; 在读卡器设备与主机建立连接后, 遵循 CCID (USB Chip/Smart Card Interface Devices-USB, 芯片智能卡接口设备)协议的规范通过 USB总线进行 数据的交互、 指令的收发。 步骤 402: 读卡器设备总线驱动接收到主机的操作系统下发的获取读卡 器设备信息的请求; 其中,主机的操作系统能够通过即插即用管理器( Plug and Play Manager ) 向读卡器设备总线驱动下发询问请求, 请求获得读卡器设备信息。 步骤 403 : 读卡器设备总线驱动获取读卡器设备信息; 具体的, 此步 4聚可以包括如下步 4聚: ( 1 ) 读卡器设备总线驱动响应操作系统的询问请求, 生成问询指令并 发送给读卡器, 获取设备的设备描述符;
( 2 ) 读卡器返回的设备描述符中用单个字符表示卡座的类型, 即读卡 器返回的设备描述符中包含几个字符就代表该读卡器具有几个卡座; 例如, 读卡器返回的设备描述符为 A, 表示该读卡器只有一个卡座, 卡 座类型为 A型; 读卡器返回的设备描述符为 ABAC, 表示该读卡器有四个卡 座, 1号卡座的类型为 A型, 2号卡座的类型为 B型, 3号卡座的类型为 A 型, 4号卡座的类型为 C型。 在本实施例中, 以读卡器返回的设备描述符为 CCS为例, 即本实施例中的读卡器有三个卡座, 1 号卡座的类型为 C型, 2 号卡座的类型为 C型, 3号卡座的类型为 S型。 步骤 404: 读卡器设备总线驱动根据读卡器设备信息创建物理设备对象; 当读卡器设备总线驱动获取到读卡器返回的设备描述符后, 根据设备描 述符中表示的卡座类型与卡座个数, 创建相应的物理设备对象, 分别与读卡 器的卡座相对应。 以读卡器返回的设备描述符为 CCS为例,读卡器设备总线创建 3个物理 设备对象, 与 3个卡座分别对应。 步骤 405: 主机的操作系统为已创建的物理设备对象安装并加载智能卡 功能驱动, 每个智能卡功能驱动注册一个标准的智能卡驱动库。 其中, 操作系统为每个物理设备对象所对应的卡座安装相应类型的智能 卡设备的功能驱动(简称智能卡功能驱动),每个智能卡功能驱动注册一个标 准的智能卡驱动库。 在本实施例中, 主机的操作系统安装并加载了三个智能卡功能驱动与读 卡器中的三个卡座相对应, 分别是 C、 C、 S类型的智能卡功能驱动。 需要说明的是, 智能卡驱动库用于提供一个标准的框架使智能卡功能驱 动与智能卡服务的服务控制器进行交互, 在本发明实施例当中, 三个智能卡 功能驱动所对应的智能卡驱动库是相同的。 需要说明的是, 智能卡服务可以包括服务控制器、 资源管理器和数据库。 其中, 服务控制器用于管理智能卡服务、 接收来自智能卡功能驱动的请求、 管理资源管理器等; 资源管理器用于在数据库中添加新的智能卡设备记录、 或者删除已有的智能卡设备记录等。 步骤 406: 在主机当中的智能卡服务中添加新的智能卡设备记录。 其中, 智能卡服务根据加载的智能卡功能驱动和注册的智能卡驱动库, 在智能卡服务的资源管理器中创建新的智能卡设备记录。 在本发明实施例中, 智能卡服务的资源管理器中创建了三个智能卡设备 记录, 分别与读卡器中的三个卡座相对应。 如此, 在主机中就出现了三个智 能卡设备, 主机可以单独对每个智能卡设备进行操作, 通过读卡器设备总线 驱动与智能卡设备发送或者接收智能卡操作指令。 截止到步骤 406, 多卡座读卡器被主机识别为多个智能卡设备。 下面介绍被识别为多个智能卡设备的多卡座读卡器的各个卡座上卡的状 态监控过程: 这里需要说明的是, 读卡器中各个卡座的状态包括但不限于: 无卡、 有 卡未上电、 已上电。 其中, 当多卡座读卡器被主机识别为多个智能卡设备之 后, 如果读卡器中的卡座没有 IC卡片插入, 卡座就处于无卡状态; 如果 IC 卡片插入卡座, 但主机并未下发上电指令, 或主机下发下电指令, 则卡座处 于有卡未上电状态; 如果 IC 卡卡片插入卡座, 主机下发上电指令, 且智能 卡响应并成功返回 ATR ( Answer To Reset, 复位应答) 后, 卡座处于已上电 状态。 步骤 407: 读卡器设备总线驱动通过中断传输管道发送中断请求给读卡 器; 需要说明的是, 读卡器设备总线驱动与读卡器之间能够通过两条通信管 道进行通信: 批量传输管道和中断传输管道。 其中, 批量传输管道, 用于进行数据的传输, 如上电、 下电指令及其它 智能卡操作指令, 主机与读卡器按照一应一答的方式通过批量传输管道进行 数据交互; 中断传输管道, 用于传输异步事件, 如插卡、 拔卡及卡短路等, 读卡器就会通过中断传输管道向主机发送信号。 其中, 在本发明实施例中, 如果读卡器卡座中没有卡片的插入或者拔出 动作, 则该中断请求被挂起。 步骤 408: 读卡器设备总线驱动接收读卡器设备返回的中断信号; 当读卡器卡座中有卡插入后, 会通过中断传输管道向读卡器设备总线驱 动发送有卡插入的中断信号,仍然以 3个卡座为例,具体的中断信号可以为:
1号卡座插入卡 0x5003
2号卡座插入卡 0x500c
3号卡座插入卡 0x5030 相应的, 在读卡器使用过程中, 如果读卡器卡座中有卡拔出时, 也会通 过中断传输管道向读卡器设备总线驱动发送有卡拔出的中断信号, 具体的中 断信号可以为: 1号卡座拔出卡 0x5002
2号卡座拔出卡 0x5008
3号卡座拔出卡 0x5020 步骤 409: 读卡器设备总线驱动解析接收到的中断信号并将中断类型传 递给相应的智能卡功能驱动; 其中, 读卡器设备总线驱动对接收到的中断信号进行解析, 得到该信号 对应的中断类型及智能卡设备、 智能卡功能驱动, 更新读卡器设备总线驱动 中的子设备状态列表, 并通过该子设备状态列表将读卡器中卡座的状态变化 情况映射到智能卡功能驱动。 其中, 需要说明的是, 读卡器设备总线驱动在创建智能卡设备成功后, 会建立一个用于记录读卡器中卡座状态的子设备状态列表, 包括有卡和无卡 两种状态。 例如, 如果读卡器设备总线驱动中的子设备状态列表中记录的是 1号卡 座为无卡状态, 读卡器设备总线驱动接收到中断信号 0x5003 , 则读卡器设备 总线驱动修改其子设备状态列表中 1号卡座对应的项为有卡状态, 同时将该 状态映射到智能卡功能驱动 1上。 步骤 410: 智能卡功能驱动通过智能卡驱动库向智能卡服务报告卡座的 状态变化; 具体的, 智能卡功能驱动 1通过智能卡驱动库提供的函数
( SmartcardExtension->ReaderFunction[RDF_CARD_TRACKING] = RockeyCardTracking; ) 修改智能卡驱动库 1中智能卡卡座状态跟踪 I/O请求 包中表示智能卡状态的参数为有卡, 并将智能卡卡座状态跟踪 I/O请求包发 送给智能卡服务的服务控制器, 服务控制器向上层应用报告有卡片插入智能 卡设备, 同时资源管理器将智能卡设备的状态修改为有卡, 更新数据库中的 ΐ己录。 本实施例提供了一种多卡座读卡器的识别方法, 通过上述方法, 多卡座 读卡器可以被主机识别为多个智能卡设备, 并且主机可以监控各个智能卡设 备中卡的状态变化, 使得多卡座读卡器可以支持一个读卡器中有多个类型不 同或相同卡座的情况,并为了多卡座读卡器中的多个卡座共享一条通信总线, 所述多卡座读卡器中的多个卡座能够交替、 互斥地利用通信通道与主机之间 进行数据交互、 收发指令。 实施例 4 本发明实施例还提供了一种基于上述实施例 3识别方法的主机与多卡座 读卡器之间的通信方法。 即在读卡器设备总线驱动向上层应用报告读卡器有 卡后, 上层应用便可以按需要通过读卡器设备总线驱动发送指令给读卡器中 指定卡座, 对智能卡进行如上电、 PPS ( Protocol and Parameter Select, 协议 与参数选择)、 读写数据等操作。 这里需要说明的是, 智能卡服务中的服务控制器还用于接收来自上层应 用的应用请求,根据接收到的应用请求调用函数 DevicelOControl并在其参数 中指示具体的操作。 例如在函数 DevicelOControl中, 参数 dwIoCotrolCode的值表示操作类 型, 通过智能卡驱动库解析函数 DevicelOControl所要求的操作, 然后智能卡 功能驱动 居智能卡驱动库解析出的结果生成符合 CCID协议的智能卡操作 指令。 其中, DevicelOControl提供调用的参数除 dwIoControlCode外还包括以 下几个参数: BOOL DeviceIoControl(
HANDLE hDevice. II handle to device
DWORD dwIoControlCode. II operation
LPVOID lpInBuf er II input data buffer
DWORD nlnBuf erSize, II size of input data buffer
LPVOID lpOutBuf er, II output data buffer
DWORD nOutBuf erSize. II size of output data buffer
LPDWORD lpBytesReturned II byte count
LPOVERLAPPED lpOverlapped II overlapped information
); 智能卡驱动库用于提供一个标准的框架使智能卡功能驱动与智能卡服务 的服务控制器进行交互; 智能卡驱动库解析 DevicelOControl后, 向智能卡功 能驱动派遣下面的四个函数:
SmartcardExtension -〉 ReaderFunction [RDF CARD POWER] = RockeyCardPower;
SmartcardExtension->ReaderFunction[RDF_TRANSMIT] = Rockey Transmit;
SmartcardExtension -〉 ReaderFunction [RDF CARD TRACKING] = RockeyCardTracking; SmartcardExtension->ReaderFunction[RDF_SET_PROTOCOL] =
Rockey S etProtocol; 智能卡功能驱动根据这四个函数生成指令,控制智能卡设备进行上下电、 数据传输、 跟踪卡状态和设置协议等操作; 相应地, 智能卡功能驱动也是通 过以上四个函数向智能卡驱动库返回信息, 然后智能卡驱动库通过 DevicelOControl向智能卡月艮务及上层应用汇 4艮。 参见图 5 , 该方法包括: 步骤 501 : 智能卡功能驱动根据上层应用的智能卡操作请求生成智能卡 操作指令; 其中, 上层应用对智能卡的操作具体为向智能卡服务的服务管理器发送 操作请求, 服务管理器根据上层应用的请求调用函数 DevicelOControl, 并在 函数参数中指示具体的操作, 智能卡驱动库解析函数后, 向智能卡功能驱动 派遣函数, 智能卡功能驱动将接收到的数据封装生成符合 CCID协议规范的 智能卡操作指令, 该智能卡操作指令中的第 6个字节表示该智能卡功能驱动 所对应的读卡器卡座的编号。 例如, 上层应用产生向智能卡设备 1取随机数的操作请求, 智能卡功能 驱 动 1 接 收 到 通 过 函 数
(SmartcardExtension->ReaderFunction[RX)F_TRANSMIT] = Rockey Transmit; ) 传入的数据 0x00 84 00 00 08, 智能卡功能驱动 1使用 CCID标准的指令头 0x6f 05 00 00 00 00 10 00 00 00对接收到的数据进行封装,得到智能卡操作指 令为 0x6f 05 00 00 00 00 10 00 00 00 00 84 00 00 08, 表示是 1号卡座的取随 机数指令, 其中第 6个字节 00表示的是 1号卡座; 再例如, 智能卡功能驱动 2根据接收到的函数
( SmartcardExtension->ReaderFunction[RDF_CARD_POWER] = RockeyCardPower; ) 中的参数判断对 2号卡座进行上电或下电操作, 可以使 用参数 0x00表示上电、 OxFF表示下电, 或者也可以用参数 Oxaa表示上电、 0x55表示下电; 若智能卡功能驱动 2判断出要对 2号卡座进行上电操作, 则 智能卡功能驱动 2生成符合 CCID协议规范的上电指令: 0x62 00 00 00 00 01 21 01 00 00, 表示 2号卡座的上电指令, 其中第 6个字节 01表示的是 2号卡 座。 相应地, 智能卡功能驱动利用下面的函数
( SmartcardExtension->ReaderFunction[RDF_CARD_TRACKING] = RockeyCardTracking; )通过智能卡驱动库向智能卡服务报告卡片的插入或拔 出; 再者, 智能卡功能驱动解析上电后卡片返回的 ATR信息, 利用下面的函 数
( SmartcardExtension->ReaderFunction[RDF_SET_PROTOCOL] = RockeySetProtocol; )通过智能卡驱动库通知智能卡服务当前卡片的通信模式 遵循 t0或 tl协议。 步骤 502: 智能卡功能驱动判断读卡器设备总线驱动与读卡器之间的通 信信道是否被占用; 如果已经被占用, 则执行步骤 503; 如果没有被占用, 则执行步骤 504。 其中, 需要说明的是, 以本实施例读卡器中的芯片分时控制 3个卡座为 例, 在同一时刻只能有一个卡座通过批量传输管道与读卡器设备总线驱动连 接, 进行数据交互, 芯片中的固件程序根据指令中的卡座编号字段来切换通 道, 决定哪一个卡座与读卡器设备总线驱动连接, 进行数据的交互、 指令的 收发等。 判断通信信道是否被占用的方法可以为: 智能卡功能驱动生成智能卡操作指令后, 向操作系统申请标志该智能卡 功能驱动与其所对应的卡座能够独占读卡器设备总线驱动通信通道的互斥 量, 使得智能卡功能驱动通过读卡器设备总线驱动与相应的卡座建立通信连 接, 进行数据的交互、 指令的收发等。 如果获取互斥量失败, 则说明通信信道已经被占用; 如果智能卡功能驱动可以成功获取互斥量, 则说明通信信道没有被占用 或者处于空闲状态。 这种判断方式的有益效果是: 当卡座与主机连接进行数据交互时, 通过 为卡座对应的智能卡功能驱动分配互斥量, 使读卡器中的一个卡座在与主机 进行一应一答的通信时, 能够独占通信信道, 其他卡座的指令无法通过读卡 器设备总线驱动下发, 通过这种方式使读卡器中的卡座与主机能够顺利、 有 序地进行数据交互、 指令收发。 步骤 503: 读卡器设备总线驱动将该智能卡功能驱动的指令挂起, 等待 互斥量被释放后, 该智能卡功能驱动获取互斥量; 当获取互斥量成功后, 执行步 4聚 504。 例如, 当前 1号卡座状态为已上电, 读卡器设备总线驱动下发了 1号卡 座的取随机数指令 0x6f 05 00 00 00 00 10 00 00 00 00 84 00 00 08; 在读卡器 设备总线驱动接收到该取随机数指令的执行结果之前, 2 号卡座插入了一张 卡片, 则 2号卡座状态由无卡变为有卡未上电, 读卡器通过中断传输管道向 读卡器设备总线驱动发送表示 2号卡座有卡插入的信号 0x500c; 上层应用得 知 2号智能卡设备有卡插入后发出上电请求, 智能卡功能驱动 2接收到上电 请求后生成符合 CCID协议的 2号卡座上电指令 0x62 00 00 00 00 01 21 01 00 00, 并发送给读卡器设备总线驱动, 由于当前 1号卡座的随机数指令还没有 执行完毕, 互斥量被智能卡功能驱动 1 占用, 读卡器设备总线驱动为智能卡 功能驱动 2获取互斥量失败, 则将该指令挂起, 等待 1号卡座执行完取随机 数指令后释放互斥量, 再重新获取互斥量, 当获取互斥量成功后, 执行步骤 504。 步骤 504: 读卡器设备总线驱动接收智能卡操作指令并保存互斥量; 智能卡功能驱动获取互斥量成功后, 向读卡器设备总线驱动发送生成的 智能卡操作指令, 并且将互斥量保存到读卡器设备总线驱动, 当读卡器设备 总线驱动接收到该指令的执行结果后释放互斥量。 步骤 505 : 读卡器设备总线驱动向读卡器下发操作指令; 其中, 读卡器设备总线驱动接收到智能卡功能驱动生成的智能卡操作指 令后, 读卡器设备总线驱动通过批量传输管道向读卡器中的指定的卡座下发 该操作指令。 具体的, 读卡器芯片中的固件程序分析接收到的指令, 得到指令中的卡 座,将指令中指定的卡座切换到与读卡器设备功能驱动的指定传输管道相连, 使该卡座与读卡器设备功能驱动按照一应一答的方式进行数据的交互、 指令 的收发。 步骤 506: 读卡器卡座中的智能卡执行接收到的操作指令, 并返回指令 执行结果。 其中, 读卡器卡座中的智能卡执行完毕接收到的操作指令后, 通过批量 传输管道将指令的执行结果发送给读卡器设备总线驱动, 卡座释放读卡器的 硬件资源。 步骤 507: 读卡器设备总线驱动接收执行结果, 并将执行结果向上层应 用报告, 释放互斥量。 读卡器设备总线驱动接收到指令执行结果后, 互斥量被释放, 读卡器设 备总线驱动将执行结果返回给相应的智能卡功能驱动, 由智能卡功能驱动将 CCID协议的指令执行结果解包后发送给智能卡服务。 例如, 1号卡座的取随机数指令执行结果为: 0x80 0a 00 00 00 00 10 00 00 00 2111 ca2b2ebb20059000 , 智能卡功能驱动取第 10个字节以后的部分(即 2111ca2b2ebb20059000 ) 作为获取的随机数传递给智能卡服务; 2 号卡座执 行完上电操作后返回的 ATR 为 0x80 15 00 00 00 01 21 00 00 00 3bf l300008131fe4565465307010071c6806117d4, 智 卡功 马区动取第 10个 字节以后的部分(即 0x3bfbl300008131fe4565465307010071c6806117d4 )传 递给智能卡服务。 互斥量被释放的同时, 被读卡器设备总线驱动挂起的下一条指令的智能 卡功能驱动成功获取互斥量, 读卡器设备总线驱动接收该指令并向读卡器下 发该指令, 读卡器的固件程序切换通信通道到指定卡座, 读卡器设备总线驱 动与该卡座按照一应一答的方式进行数据的交互、 指令的收发。 本发明实施例提供了一种主机与多卡座读卡器之间的通信方法, 可以支 持一个读卡器中有多个类型不同或相同卡座的情况, 多卡座读卡器中的多个 卡座共享一条通信总线, 并且所述多卡座读卡器中的多个卡座能够交替、 互 斥地利用通信通道进行数据交互、 收发指令。 以上仅为本发明的较佳实施例, 并不用以限制本发明, 凡在本发明的精 神和原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的 保护范围之内。

Claims

权 利 要 求 书
1. 一种多卡座读卡器的识别方法, 其特征在于, 所述方法包括:
多卡座读卡器与主机建立连接, 所述主机加载读卡器设备总线驱 动;
所述读卡器设备总线驱动获取所述多卡座读卡器的设备信息, 并 根据所述设备信息创建物理设备对象;
所述主机为每个所述物理设备对象安装并加载智能卡功能驱动, 并为每个智能卡功能驱动注册一个标准的智能卡驱动库;
所述主机中的智能卡服务根据加载的智能卡功能驱动和注册的智 能卡驱动库, 在所述智能卡服务的资源管理器中创建新的智能卡设备 记录, 将所述多卡座读卡器识别为多个智能卡设备。
2. 如权利要求 1 所述的方法, 其特征在于, 所述读卡器设备总线驱动获 取所述多卡座读卡器的设备信息, 并根据所述设备信息创建物理设备 对象, 具体包括:
所述读卡器设备总线驱动收到主机下发的获取读卡器设备信息的 询问请求;
根据所述询问请求, 所述读卡器设备总线驱动获取读卡器设备信 息;
所述读卡器设备总线驱动根据获取的读卡器设备信息创建物理设 备对象。
3. 如权利要求 2所述的方法, 其特征在于, 所述询问请求由所述主机通 过即插即用管理器向所述读卡器设备总线驱动下发。
4. 如权利要求 2所述的方法, 其特征在于, 所述根据所述询问请求, 所 述读卡器设备总线驱动获取读卡器设备信息, 具体包括:
所述读卡器设备总线驱动响应所述询问请求, 生成问询指令, 并 将所述问询指令发送给所述多卡座读卡器;
所述多卡座读卡器获取设备描述符, 并将所述设备描述符返回给 所述读卡器设备总线驱动。 如权利要求 4所述的方法, 其特征在于, 所述设备描述符中用单个字 符表示卡座的类型。
6. 如权利要求 1 所述的方法, 其特征在于, 所述物理设备对象的个数与 所述多卡座读卡器的卡座数目相同。
7. 如权利要求 1 所述的方法, 其特征在于, 所述将所述多卡座读卡器识 别为多个智能卡设备之后, 所述方法还包括:
所述读卡器设备总线驱动发送中断请求给各个智能卡设备, 并接 收各个智能卡设备返回的中断信号;
所述读卡器设备总线驱动解析所述中断信号, 并将解析出的中断 类型传递给相应智能卡设备的智能卡功能驱动;
相应的各个智能卡设备的智能卡功能驱动通过其智能卡驱动库向 智能卡服务报告其卡座的状态, 所述卡座的状态包括无卡、 有卡未上 电或有卡已上电。
8. 如权利要求 7所述的方法, 其特征在于, 所述读卡器设备总线驱动与 所述多卡座读卡器之间能够通过两条通信管道进行通信: 批量传输管 道和中断传输管道;
相应的, 所述中断请求通过所述中断传输管道进行发送。
9. 如权利要求 7所述的方法, 其特征在于, 所述解析所述中断信号, 并 将解析出的中断类型传递给相应于智能卡设备的智能卡功能驱动, 具 体包括:
所述读卡器设备总线驱动对所述中断信号进行解析, 得到所述中 断信号对应的中断类型、 智能卡设备和智能卡功能驱动;
更新所述读卡器设备总线驱动中的子设备状态列表, 所述子设备 状态列表用于记录所述多卡座读卡器各个卡座的状态;
通过所述子设备状态列表将所述多卡座读卡器各个卡座状态映射 到所述智能卡功能驱动。
10. —种基于权利要求 1 所述方法的主机与多卡座读卡器之间的通信方 法, 其特征在于, 所述方法包括: 所述智能卡功能驱动根据上层应用发送的智能卡操作请求, 生成 智能卡操作指令;
所述智能卡功能驱动申请互斥量;
当申请互斥量不成功时, 将所述智能卡操作指令挂起, 等待申请 成功;
当申请互斥量成功时, 所述智能卡功能驱动将所述智能卡操作指 令发送给所述读卡器设备总线驱动, 所述读卡器设备总线驱动向所述 多卡座读卡器下发所述智能卡操作指令; 相应的所述多卡座读卡器卡 座中的智能卡执行接收到的所述智能卡操作指令, 并返回指令执行结 果; 所述读卡器设备总线驱动接收所述执行结果, 并将所述执行结果 向上层应用 4艮告, 并释放所述互斥量; 或, 所述智能卡功能驱动 居 所述主机发送的智能卡操作请求, 生成智能卡操作指令, 并通过所述 读卡器设备总线驱动将所述智能卡操作指令发送给所述多卡座读卡 器;
读卡器固件程序判断当前读卡器的硬件资源是否被占用; 如果被占用, 将所述智能卡操作指令挂起, 等待硬件资源被释放; 如果未被占用, 所述读卡器向相应的卡座下发所述智能卡操作指 令; 相应的卡座中的智能卡执行接收到的所述智能卡操作指令, 并返 回指令执行结果; 所述读卡器设备总线驱动接收所述执行结果, 并将 所述执行结果向上层应用报告。
11. 如权利要求 10所述的方法, 其特征在于, 所述智能卡功能驱动根据上 层应用的智能卡操作请求生成智能卡操作指令, 具体包括:
服务管理器根据所述主机的上层应用发送的智能卡请求调用函数
DevicelOControl , 并在所述函数的参数中指示具体的操作;
智能卡驱动库解析所述函数后, 向智能卡功能驱动派遣函数; 所述智能卡功能驱动将接收到的数据封装生成符合芯片智能卡接 口设备( CCID )协议的智能卡操作指令, 所述智能卡操作指令中的第 6 个字节表示所述智能卡功能驱动所对应的所述多卡座读卡器卡座的 编号。
12. 如权利要求 10所述的方法, 其特征在于, 所述多卡座读卡器卡座中的 智能卡执行完毕接收到的操作指令后, 通过批量传输管道将所述指令 执行结果发送给所述读卡器设备总线驱动, 并释放所述多卡座读卡器 的硬件资源。
13. 如权利要求 10所述的方法, 其特征在于, 所述互斥量被释放的同时, 被读卡器设备总线驱动挂起的下一条指令的智能卡功能驱动成功获取 所述互斥量。
14. 一种通信系统, 其特征在于, 所述系统包括: 主机和多卡座读卡器; 所述主机包括:
加载模块, 用于当所述多卡座读卡器与所述主机建立连接时, 加 载读卡器设备总线驱动;
获取模块, 用于通过所述读卡器设备总线驱动获取所述多卡座读 卡器的设备信息;
创建模块, 用于通过所述读卡器设备总线驱动根据所述设备信息 创建物理设备对象;
安装模块, 用于为每个所述物理设备对象安装并加载智能卡功能 马区动;
注册模块, 用于为每个智能卡功能驱动注册一个标准的智能卡驱 动库;
识别模块, 用于通过所述主机中的智能卡服务根据加载的智能卡 功能驱动和注册的智能卡驱动库, 在所述智能卡服务的资源管理器中 创建新的智能卡设备记录, 将所述多卡座读卡器识别为多个智能卡设 备;
生成指令模块, 用于通过所述智能卡功能驱动根据所述主机发送 的智能卡操作请求, 生成智能卡操作指令;
发送模块, 用于将所述智能卡操作指令通过所述读卡器设备总线 驱动发送给所述多卡座读卡器;
接收模块, 用于通过所述读卡器设备总线驱动接收所述多卡座读 卡器发送的执行结果, 并将所述执行结果向上层应用报告;
所述多卡座读卡器包括:
判断模块, 用于通过所述多卡座读卡器的读卡器固件程序判断当 前读卡器的硬件资源是否被占用;
挂起模块, 用于当所述判断模块的判断结果为被占用时, 将所述 智能卡操作指令挂起, 等待硬件资源被释放;
收发模块, 用于当所述判断模块的判断结果为未被占用时, 向所 述智能卡操作指令中的卡座下发所述智能卡操作指令; 并接收所述卡 座返回的执行结果, 发送给所述主机。
15. 如权利要求 14所述的系统, 其特征在于, 所述主机的获取模块, 具体 包括:
接收单元, 用于通过所述读卡器设备总线驱动接收主机下发的获 取读卡器设备信息的询问请求;
获取单元, 用于根据所述询问请求, 通过所述读卡器设备总线驱 动获取读卡器设备信息。
16. 如权利要求 14所述的系统 ,其特征在于,所述主机的发送模块还用于: 通过读卡器设备总线驱动发送中断请求给所述多卡座读卡器; 所 述主机的接收模块还用于接收所述多卡座读卡器返回的中断信号; 相应的, 所述主机还包括:
中断解析模块, 用于解析所述中断信号, 得到所述中断信号对应 的中断类型、 卡座和智能卡功能驱动;
中断报告模块, 用于根据所述中断解析模块得到的所述中断信号 对应的中断类型、 卡座和智能卡功能驱动, 向所述智能卡服务报告对 应卡座的状态, 所述卡座的状态包括无卡、 有卡未上电或有卡已上电。
17. 如权利要求 16所述的系统, 其特征在于, 所述读卡器设备总线驱动与 所述多卡座读卡器之间能够通过两条通信管道进行通信: 批量传输管 道和中断传输管道; 相应的 ,所述中断请求和所述中断信号通过所述中断传输管道进行发送。
18. 如权利要求 14所述的系统, 其特征在于, 所述主机的生成指令模块, 具体包括:
调用单元, 用于通过月艮务管理器 居所述主机的上层应用发送的 智能卡请求调用函数 DevicelOControl, 并在所述函数的参数中指示具 体的操作;
派遣单元, 用于智能卡驱动库解析所述函数后, 向所述智能卡功 能驱动派遣函数;
生成单元, 用于通过智能卡功能驱动将接收到的数据封装生成符 合芯片智能卡接口设备(CCID )协议的智能卡操作指令, 所述智能卡 操作指令中的第 6个字节表示所述智能卡功能驱动所对应的读卡器卡 座的编号。 如权利要求 14所述的系统, 其特征在于, 所述多卡座读卡器的收发模 块还用于: 通过批量传输管道将指令的执行结果发送给所述读卡器设 备总线驱动, 并释放所述多卡座读卡器的硬件资源。
PCT/CN2010/078215 2009-10-30 2010-10-28 多卡座读卡器的识别方法及其与主机的通信方法和系统 WO2011050740A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
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 (4)

Application Number Priority Date Filing Date Title
CN2009102369895A CN101699416B (zh) 2009-10-30 2009-10-30 主机与多卡座读卡器的通信方法和系统
CN200910236989.5 2009-10-30
CN2009102369908A CN101876951B (zh) 2009-10-30 2009-10-30 识别多卡座读卡器及与多卡座读卡器通信的方法
CN200910236990.8 2009-10-30

Publications (1)

Publication Number Publication Date
WO2011050740A1 true WO2011050740A1 (zh) 2011-05-05

Family

ID=43921352

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/078215 WO2011050740A1 (zh) 2009-10-30 2010-10-28 多卡座读卡器的识别方法及其与主机的通信方法和系统

Country Status (2)

Country Link
US (1) US8775709B2 (zh)
WO (1) WO2011050740A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104750630A (zh) * 2015-04-14 2015-07-01 飞天诚信科技股份有限公司 一种pc/sc驱动库在ios设备中的工作方法

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120208454A1 (en) * 2011-02-10 2012-08-16 Cassis International Pte Ltd. System and method for detecting and communicating with diverse near field communications adaptors
CN103092802B (zh) * 2013-02-07 2015-07-22 飞天诚信科技股份有限公司 一种读卡器与上位机通信的方法
CN103295439A (zh) * 2013-06-19 2013-09-11 福州市蝴蝶妈妈教育信息咨询有限公司 学生情商财商综合素质智能测评装置及其测评方法
US10262174B1 (en) 2017-10-12 2019-04-16 Red Hat, Inc. Testing controllable cards

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101013406A (zh) * 2007-02-12 2007-08-08 北京飞天诚信科技有限公司 一种可自动安装的信息安全设备及其控制方法
CN101018131A (zh) * 2007-02-16 2007-08-15 北京飞天诚信科技有限公司 一种具有功能选择装置的信息安全设备及其控制方法
US20090259772A1 (en) * 2008-04-11 2009-10-15 Nokia Corporation Apparatus for a user removable memory or a device for communication with a user removable memory, and associated methods

Family Cites Families (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5887145A (en) * 1993-09-01 1999-03-23 Sandisk Corporation Removable mother/daughter peripheral card
US5875339A (en) * 1993-10-21 1999-02-23 Sun Microsystems, Inc. Asynchronous arbiter using multiple arbiter elements to enhance speed
JPH10171957A (ja) * 1996-12-04 1998-06-26 Murata Mfg Co Ltd Pcカードのcis切り替え機構
US6134615A (en) * 1997-05-13 2000-10-17 Micron Electronics, Inc. System for facilitating the replacement or insertion of devices in a computer system through the use of a graphical user interface
JP4025429B2 (ja) * 1998-08-21 2007-12-19 富士通株式会社 接続制御装置及び接続制御方法
JP4649009B2 (ja) * 2000-03-08 2011-03-09 株式会社東芝 カードインタフェースを備えた情報処理装置、同装置に装着可能なカード型電子機器、及び同装置におけ動作モード設定方法
CN2424494Y (zh) 2000-03-31 2001-03-21 上海华申智能卡应用系统有限公司 总线驱动的智能卡读写器
US7278051B2 (en) * 2000-07-06 2007-10-02 Onspec Electronic, Inc. Field-operable, stand-alone apparatus for media recovery and regeneration
US6438638B1 (en) * 2000-07-06 2002-08-20 Onspec Electronic, Inc. Flashtoaster for reading several types of flash-memory cards with or without a PC
US7114157B2 (en) * 2001-11-27 2006-09-26 Kuka Roboter Gmbh System controlling exclusive access by control programs to system resources
EP1434128A1 (en) * 2002-12-27 2004-06-30 Neodio Technologies Corporation Plug-and-play interconnection architecture and method with in-device storage module in peripheral device
JP2004326434A (ja) * 2003-04-24 2004-11-18 Softbank Bb Corp Pcカード及びpcカードの制御方法
CN1542689A (zh) 2003-11-05 2004-11-03 深圳矽感科技有限公司 具有多种存储格式的信息卡及其读写设备和方法
US8046508B2 (en) * 2004-04-21 2011-10-25 Stmicroelectronics, Inc. Smart card with self-detachment features and related methods
US7191275B2 (en) * 2004-09-28 2007-03-13 Hewlett-Packard Development Company, L.P. System and method for the management of hardware triggered hotplug operations of input/output cards
CN200947210Y (zh) 2006-09-18 2007-09-12 深圳市德卡科技有限公司 智能卡的集成读写器
US7899970B2 (en) * 2006-12-05 2011-03-01 Belkin International, Inc. Connectivity hub with a stationary base station and a removable second hub
US7578446B2 (en) 2007-05-01 2009-08-25 Yen Shin Identification card holder with flash memory card reader
CN100583122C (zh) 2007-11-30 2010-01-20 北京市门吉利磁电工程研究所 可读写多种类型信息卡的读卡器及其读写方法
US8086778B2 (en) * 2008-06-27 2011-12-27 Microsoft Corporation Filter driver to enumerate smartcard nodes for plug and play
US8209528B2 (en) * 2009-04-28 2012-06-26 Qualcomm Incorporated Method and system for certifying a circuit card lacking any non-volatile memory as being compatible with a computer
CN101699416B (zh) 2009-10-30 2011-05-18 北京飞天诚信科技有限公司 主机与多卡座读卡器的通信方法和系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101013406A (zh) * 2007-02-12 2007-08-08 北京飞天诚信科技有限公司 一种可自动安装的信息安全设备及其控制方法
CN101018131A (zh) * 2007-02-16 2007-08-15 北京飞天诚信科技有限公司 一种具有功能选择装置的信息安全设备及其控制方法
US20090259772A1 (en) * 2008-04-11 2009-10-15 Nokia Corporation Apparatus for a user removable memory or a device for communication with a user removable memory, and associated methods

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104750630A (zh) * 2015-04-14 2015-07-01 飞天诚信科技股份有限公司 一种pc/sc驱动库在ios设备中的工作方法
CN104750630B (zh) * 2015-04-14 2017-09-22 飞天诚信科技股份有限公司 一种pc/sc驱动库在ios设备中的工作方法

Also Published As

Publication number Publication date
US20110197007A1 (en) 2011-08-11
US8775709B2 (en) 2014-07-08

Similar Documents

Publication Publication Date Title
US8312189B2 (en) Processing of data to monitor input/output operations
US8725909B2 (en) Method for identifying host operating system by universal serial bus (USB) device
JP3497834B2 (ja) ルートリピータ、usb通信システム、usb通信制御方法
US20200366135A1 (en) Near field communication and wireless power
US8042743B2 (en) IC card comprising a main device and an additional device
KR101281966B1 (ko) 교통 요금의 자동 요금 징수 시스템에 사용되는 교통 요금 단말기 및 이를 이용한 교통 요금 처리 방법
WO2011050740A1 (zh) 多卡座读卡器的识别方法及其与主机的通信方法和系统
WO2023284699A1 (zh) 基于Linux系统的协议栈数据传输方法、计算机设备和存储介质
EP2861037B1 (en) Radio frequency communication method, device and terminal device for near field communication
CN101937406B (zh) 一种VxWorks操作系统中实现驱动1394设备的方法和系统
US8443120B2 (en) Method for accessing multiple card slots and apparatus for the same
KR20080059277A (ko) 엔에프씨 호스트 콘트롤러 인터페이스
TW200522583A (en) IP-based method and apparatus for booting computers remotely in wide-area-network environment
CN105468548B (zh) 串行外围接口的通信
JP5470462B2 (ja) 通信オブジェクトと処理装置との間でデータを交換するためのマッチング方法、システム及び装置
TW514786B (en) Processing method and computer system for driver in intelligent peripherals
CN101699416B (zh) 主机与多卡座读卡器的通信方法和系统
CN102567268A (zh) 一种usb转虚拟串口/modem的检测方法
WO2017117396A1 (en) Modular communication framework
CN101719212B (zh) 串口读卡器的识别方法和装置
US7996524B2 (en) Controlling external communication of embedded device using proxy server
US8250275B2 (en) Secure MMC standard smartcard with multi-application operation capability, process of operation
CN107172139B (zh) 一种无线协议栈及其实现方法
CN110971621B (zh) 基于sdio接口的嵌入式多cpu互联电路、互联方法及驱动方法
CN105159852B (zh) 双接口nfc标签电路及其数据传输方法

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 13059538

Country of ref document: US

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10826103

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10826103

Country of ref document: EP

Kind code of ref document: A1