CN105184337B - A kind of NFC device carries out application of IC cards detection method and system - Google Patents

A kind of NFC device carries out application of IC cards detection method and system Download PDF

Info

Publication number
CN105184337B
CN105184337B CN201510527295.2A CN201510527295A CN105184337B CN 105184337 B CN105184337 B CN 105184337B CN 201510527295 A CN201510527295 A CN 201510527295A CN 105184337 B CN105184337 B CN 105184337B
Authority
CN
China
Prior art keywords
smart card
apdu
nfc
mobile terminal
response
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
CN201510527295.2A
Other languages
Chinese (zh)
Other versions
CN105184337A (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.)
Datang Microelectronics Technology Co Ltd
Datang Semiconductor Design Co Ltd
Original Assignee
Datang Microelectronics Technology Co Ltd
Datang Semiconductor Design 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 Datang Microelectronics Technology Co Ltd, Datang Semiconductor Design Co Ltd filed Critical Datang Microelectronics Technology Co Ltd
Priority to CN201510527295.2A priority Critical patent/CN105184337B/en
Publication of CN105184337A publication Critical patent/CN105184337A/en
Application granted granted Critical
Publication of CN105184337B publication Critical patent/CN105184337B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Telephonic Communication Services (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a kind of NFC devices to carry out application of IC cards detection method and system, including:NFC device receives the Apdu instructions from PC, and the Apdu is instructed and is sent to smart card by NFC modes;NFC device judges whether that receiving the Apdu responses that smart card returns responds Apdu if received and be sent to PC;If be not received by, it is determined that NFC device and smart card are incompatible;PC judges whether Apdu responses are correct, if correctly, it is determined that NFC device and smart card compatibility;If incorrect, it is determined that NFC device and smart card are incompatible.By means of the invention it is possible to test compatibility issue in NFC device and smart card interactive process.

Description

Method and system for detecting smart card application by NFC equipment
Technical Field
The invention relates to the technical Field of detection, in particular to a method and a system for detecting smart card application by Near Field Communication (NFC) equipment.
Background
NFC is integrated and evolved by non-contact radio frequency identification and interconnection technology, combines functions of an induction card reader, an induction card and point-to-point on a single chip, and can perform identification and data exchange with compatible equipment in a short distance.
With the popularization of the mobile phone NFC, an NFC device and a smart card are required to interact in more and more application scenes, and although both the NFC device and the smart card conform to ISO14443 specifications, compatibility of a card reader and a card is always a great problem which plagues card and card reader manufacturers. At present, no tool special for testing the compatibility of the mobile phone NFC and the smart card exists in the market, mobile phone manufacturers do not pay much attention to the compatibility problem of the mobile phone NFC and the smart card, so that the interactivity between the mobile phone NFC and the card in the market is poor, and the situation that the interaction between the mobile phone NFC and the card fails frequently occurs. In order to solve the compatibility problem of the mobile phone NFC and the card, a method and a tool capable of testing the compatibility problem in the interaction process of the NFC device and the smart card are urgently needed to be developed.
Disclosure of Invention
In order to solve the technical problem, the invention provides a method and a system for detecting the application of the smart card by the NFC equipment, which can test the compatibility problem in the interaction process of the NFC equipment and the smart card.
In order to achieve the purpose of the present invention, the present invention provides a method for detecting an application of a smart card by an NFC device, comprising: the NFC equipment receives an Apdu instruction from an application instruction processing unit (Apdu) of a Personal Computer (PC), and sends the Apdu instruction to the smart card in an NFC mode; the NFC equipment judges whether Apdu response returned by the smart card is received or not, and if the Apdu response is received, the Apdu response is sent to the PC; if the Apdu response is not received, determining that the NFC equipment and the smart card are incompatible; the PC judges whether Apdu response is correct or not, and if yes, the NFC equipment is determined to be compatible with the smart card; if not, the NFC device and the smart card are determined to be incompatible.
Further, the method further comprises: the PC compiles a script and sends an Apdu instruction in the script to the NFC equipment through the testing tool.
Further, the Apdu instruction is sent to the smart card in an NFC manner, specifically: and sending the Apdu instruction to the smart card through an Application Programming Interface (API) of an NFC module in the read-write NFC equipment.
Further, the PC determines whether the Apdu response is correct, specifically: judging whether Apdu response is correct according to whether the state word sw of Apdu response is a set value or not, and if yes, judging that Apdu response is correct; if not, Apdu responds with an error.
The invention also provides a system for detecting the application of the smart card by the NFC equipment, which comprises the following steps: the NFC equipment comprises Near Field Communication (NFC) equipment, a Personal Computer (PC) connected with the NFC equipment and a smart card installed in the NFC equipment, wherein the PC is used for sending an Apdu instruction to the NFC equipment; the NFC equipment is used for receiving the Apdu instruction from the PC and sending the Apdu instruction to the smart card in an NFC mode; judging whether Apdu response returned by the smart card is received or not, and if the Apdu response is received, sending the Apdu response to the PC; if the Apdu response is not received, determining that the NFC equipment and the smart card are incompatible; the PC is also used for judging whether the Apdu response is correct or not, and if so, the compatibility of the NFC equipment and the smart card is determined; if not, the NFC device and the smart card are determined to be incompatible.
Compared with the prior art, the method and the device can test the compatibility problem in the interaction process of the NFC equipment and the smart card, and solve the problems that the interaction between the NFC mobile phone and the smart card is poor in the existing market and the interaction between the NFC mobile phone and the smart card fails frequently.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and not to limit the invention.
Fig. 1 is a schematic structural diagram of a system for detecting a smart card application by an NFC device in an embodiment of the present invention.
Fig. 2 is a flowchart illustrating a method for detecting a smart card application by an NFC device in an embodiment of the present invention.
Fig. 3 is a schematic specific flowchart of a method for detecting a smart card application based on the NFC device in fig. 2.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
Fig. 1 is a schematic structural diagram of a system for detecting a smart card application by an NFC device in an embodiment of the present invention. As shown in fig. 1, the NFC device is connected to a Personal Computer (PC), and the smart card is installed in the NFC device and performs information interaction with the NFC device. The NFC equipment is connected with the PC through the USB, and can also be connected with the PC through WIFI and Bluetooth.
Fig. 2 is a flowchart illustrating a method for detecting a smart card application by an NFC device in an embodiment of the present invention. Based on the system of fig. 1, as shown in fig. 2, the method of the present invention includes:
in step 201, the NFC device receives an Application protocol data Unit (Apdu) command from the PC, and sends the Apdu command to the smart card in an NFC manner.
Before the step, a network port mapping is established through an Android Debug Bridge (ADB) in an Android Software Development Kit (SDK), wherein the ADB is a client-server program, the client is a PC, and the server is an Android device. Therefore, the NFC equipment can be connected with the PC through the USB and carry out network communication, so that the mutual sending of Apdu instructions between the NFC equipment and the PC is realized, wherein the Apdu instructions are numerous and basically included in the PBOC specification, and common read-write files, various transaction instructions and card authentication instructions are available.
In this step, the PC writes a script, and sends an Apdu instruction in the script to the NFC device through the test tool. The NFC equipment sends the received Apdu instruction to a smart card in an NFC mode, for example, an Android mobile phone with an NFC module calls an Application Programming Interface (API) which is provided by Android and used for reading and writing the NFC module in a mode of compiling Android mobile phone Application to send the Apdu instruction.
Step 202, the NFC device determines whether to receive an Apdu response returned by the smart card, and if so, the process goes to step 203; and if not, determining that the NFC equipment and the smart card are not compatible.
In step 203, the NFC device sends an Apdu response to the PC.
In this step, an Apdu response is sent to the PC through the API of the read-write NFC module, where the Apdu response is related to an Apdu instruction type, for example, if the Apdu response is an Apdu instruction of a read file class, the Apdu response is corresponding to a file content; if the Apdu instruction is of the authentication class, the Apdu response is authentication success or authentication failure correspondingly.
Step 204, the PC judges whether the Apdu response is correct, and if the Apdu response is correct, the compatibility of the NFC equipment and the smart card is determined; if not, the NFC device and the smart card are determined to be incompatible.
In this step, according to the ISO7816 standard, it is generally assumed that the status word (sw) of the Apdu response is successful if it is a set value, for example, 9000, and is failed otherwise.
Fig. 3 is a schematic specific flowchart of a method for detecting a smart card application based on the NFC device in fig. 2. As shown in fig. 3, the method is applied to an NFC device, the NFC device is connected to a PC, and a smart card is installed in the NFC device, and the method of the present invention includes:
step 301, initializing a system, initializing an NFC device, for example, checking whether the NFC device includes an NFC module, whether an NFC function is turned on, whether a card has been connected to the NFC device, and the like;
step 302, judging whether a network connection request from a PC exists, if so, entering step 303; if not, continue with step 302;
step 303, judging whether the connection with the PC is successful, if so, entering step 304; if not, returning to the step 302;
step 304, connecting the NFC equipment with the smart card;
step 305, judging whether the connection with the smart card is successful, if so, entering step 306; if not, go to step 307;
step 306, sending back and displaying an Answer To Select (ATS) history byte, and performing step 308, where the ATS is a string of data sent back by the card in the process of connecting the card with the NFC device, and the data includes configuration information of the card;
step 307, displaying the connection failure, and returning to step 302;
step 308, judging whether an Apdu instruction from the PC is received, if so, entering step 309; if not, continue with step 308;
step 309, displaying the received Apdu instruction;
step 310, transmitting the Apdu instruction to the smart card in an NFC mode;
311, judging whether the transmission is successful, if so, entering 312; if not, continue with step 314;
step 312, receiving an Apdu response returned by the smart card;
step 313, sending Apdu response to the PC for display, and returning to step 308;
step 314, display transmission failure and return an empty Apdu response to the PC, returning to step 308.
Referring to fig. 1, the system for detecting the smart card application by the NFC device includes: the NFC equipment, a Personal Computer (PC) connected with the NFC equipment, and a smart card installed on the NFC equipment and performing information interaction with the NFC equipment, wherein,
and the PC is used for sending the Apdu instruction to the NFC equipment.
Specifically, the PC writes a script and sends an Apdu instruction in the script to the NFC device through the test tool.
The NFC equipment is used for receiving the Apdu instruction and sending the Apdu instruction to the smart card in an NFC mode; judging whether Apdu response returned by the smart card is received or not, and if the Apdu response is received, sending the Apdu response to the PC; if no Apdu response is received, the NFC device and the smart card are determined to be incompatible.
Specifically, the Apdu instruction is sent to the smart card through an Application Programming Interface (API) that reads and writes an NFC module in the NFC device.
The PC is also used for judging whether the Apdu response is correct or not according to the Apdu response, and if the Apdu response is correct, the compatibility of the NFC equipment and the smart card is determined; if not, the NFC device and the smart card are determined to be incompatible.
Specifically, whether the Apdu response is correct is judged according to whether the status word (sw) of the Apdu response is a set value. If the response value is the set value, Apdu responds correctly, and the NFC equipment is determined to be compatible with the smart card; and if the current value is not the set value, the Apdu responds to an error, and the NFC equipment and the smart card are determined to be incompatible.
The invention can test the compatibility problem in the interaction process of the NFC equipment and the smart card, and solves the problems that the interaction between the NFC mobile phone and the smart card is poor in the existing market and the interaction between the NFC mobile phone and the smart card fails frequently.
Although the embodiments of the present invention have been described above, the above description is only for the convenience of understanding the present invention, and is not intended to limit the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (8)

1. A method for detecting smart card application by using mobile terminal NFC equipment based on an Android system is characterized by comprising the following steps:
establishing network port mapping through an Android Debug Bridge (ADB) in an Android Software Development Kit (SDK), wherein a client of the ADB is a Personal Computer (PC), and a server is an Android mobile terminal containing Near Field Communication (NFC) equipment;
the Android mobile terminal receives an Apdu instruction from an application instruction processing unit (PC) and sends the Apdu instruction to the smart card in an NFC mode;
the Android mobile terminal judges whether Apdu response returned by the smart card is received or not, and if the Apdu response is received, the Apdu response is sent to the PC; if no Apdu response is received, determining that the NFC device and the smart card are incompatible;
the PC judges whether Apdu response is correct or not, and if yes, the NFC equipment is determined to be compatible with the smart card; and if not, determining that the NFC equipment and the smart card are not compatible.
2. The method for smart card application detection by an NFC device of claim 1, further comprising: and the PC compiles a script and sends an Apdu instruction in the script to the Android mobile terminal through a test tool.
3. The method for detecting the smart card application by the NFC device according to claim 1, wherein the Apdu instruction is sent to the smart card by an NFC method, specifically:
and the Android mobile terminal sends the Apdu instruction to the smart card through reading and writing an Application Programming Interface (API) of an NFC module in the NFC equipment.
4. The method for detecting the smart card application by the NFC device according to any one of claims 1 to 3, wherein the PC determines whether the Apdu response is correct, specifically:
judging whether Apdu response is correct according to whether the state word sw of Apdu response is a set value or not, and if yes, judging that Apdu response is correct; if not, Apdu responds with an error.
5. The utility model provides a mobile terminal NFC equipment carries out smart card application detecting system based on Android system which characterized in that includes: the method comprises the steps that an Android mobile terminal comprising Near Field Communication (NFC) equipment, a Personal Computer (PC) connected with the Android mobile terminal, and a smart card installed in the NFC equipment establish network port mapping through an Android Debug Bridge (ADB) in an Android Software Development Kit (SDK), wherein a client of the ADB is the PC, and a server is the Android mobile terminal comprising the Near Field Communication (NFC) equipment; wherein,
the PC is used for sending an Apdu instruction to the Android mobile terminal;
the Android mobile terminal is used for receiving the Apdu instruction from the PC and sending the Apdu instruction to the smart card in an NFC mode; judging whether Apdu response returned by the smart card is received or not, and if the Apdu response is received, sending the Apdu response to the PC; if no Apdu response is received, determining that the NFC device and the smart card are incompatible;
the PC is further used for judging whether Apdu response is correct or not, and if yes, the NFC equipment is determined to be compatible with the smart card; and if not, determining that the NFC equipment and the smart card are not compatible.
6. The system for detecting smart card application by an NFC device according to claim 5, wherein the PC sends an Apdu instruction to the Android mobile terminal, specifically:
and the PC compiles a script and sends an Apdu instruction in the script to the Android mobile terminal through a test tool.
7. The system for detecting smart card application by the NFC device according to claim 5, wherein the Android mobile terminal sends the Apdu command to the smart card in an NFC manner, specifically:
and sending the Apdu instruction to the smart card through an Application Programming Interface (API) of an NFC module in the read-write NFC equipment.
8. The system for detecting smart card application by an NFC device according to any of claims 5 to 7, wherein the PC determines whether the Apdu response is correct, specifically:
the PC judges whether Apdu response is correct according to whether the status word sw of the Apdu response is a set value, and if the status word sw of the Apdu response is the set value, the Apdu response is correct; if not, Apdu responds with an error.
CN201510527295.2A 2015-08-25 2015-08-25 A kind of NFC device carries out application of IC cards detection method and system Active CN105184337B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510527295.2A CN105184337B (en) 2015-08-25 2015-08-25 A kind of NFC device carries out application of IC cards detection method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510527295.2A CN105184337B (en) 2015-08-25 2015-08-25 A kind of NFC device carries out application of IC cards detection method and system

Publications (2)

Publication Number Publication Date
CN105184337A CN105184337A (en) 2015-12-23
CN105184337B true CN105184337B (en) 2018-08-10

Family

ID=54906401

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510527295.2A Active CN105184337B (en) 2015-08-25 2015-08-25 A kind of NFC device carries out application of IC cards detection method and system

Country Status (1)

Country Link
CN (1) CN105184337B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106817276A (en) * 2016-12-26 2017-06-09 东信和平科技股份有限公司 Intelligent card test method, mobile terminal and test system
CN107180251A (en) * 2017-05-10 2017-09-19 成都优威骐翼教育科技有限公司 The system that robot program is write using nfc card
CN107491706B (en) * 2017-08-16 2020-11-13 惠州Tcl移动通信有限公司 NFC pressure testing method and system based on mobile terminal and storage device
CN110995913A (en) * 2019-11-14 2020-04-10 北京中电华大电子设计有限责任公司 Non-contact smart card testing method based on NFC smart phone
CN111115398B (en) * 2019-12-12 2022-03-22 日立楼宇技术(广州)有限公司 Debugging method and device of elevator, debugging terminal and storage medium
CN112100082B (en) * 2020-11-10 2021-02-19 深圳市深圳通有限公司 IC card test method, apparatus, system, and computer-readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101505545A (en) * 2008-02-05 2009-08-12 佳能株式会社 Communication apparatus, communication system, and network establishing method
CN101964673A (en) * 2009-07-24 2011-02-02 索尼公司 Communication device, communication scheme determination method, and program

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6600418B2 (en) * 2000-12-12 2003-07-29 3M Innovative Properties Company Object tracking and management system and method using radio-frequency identification tags
DE102004013156B4 (en) * 2004-03-17 2009-07-23 Atmel Germany Gmbh Method for data transmission in RFID or remote sensor systems
FR2935510B1 (en) * 2008-08-28 2010-12-10 Oberthur Technologies METHOD OF EXCHANGING DATA BETWEEN TWO ELECTRONIC ENTITIES

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101505545A (en) * 2008-02-05 2009-08-12 佳能株式会社 Communication apparatus, communication system, and network establishing method
CN101964673A (en) * 2009-07-24 2011-02-02 索尼公司 Communication device, communication scheme determination method, and program

Also Published As

Publication number Publication date
CN105184337A (en) 2015-12-23

Similar Documents

Publication Publication Date Title
CN105184337B (en) A kind of NFC device carries out application of IC cards detection method and system
US6769622B1 (en) System and method for simulating universal serial bus smart card device connected to USB host
US8060673B2 (en) Smart card read/write control method based on USB interface and reader/writer thereof
US20150296330A1 (en) Near field communication device
US20040178276A1 (en) Smart card that can be configured for debugging and software development using secondary communication port
CN113361293A (en) Card swiping method, card controller, electronic device and storage medium
EP3208723A1 (en) Usb wireless network card configuration method, host, usb wireless network card and communication system
CN101853351A (en) Automatically the method and apparatus of the selection application that can realize by equipment
TWI449356B (en) Detachable wireless communication module and method for using the same
CN107491706B (en) NFC pressure testing method and system based on mobile terminal and storage device
US20130179499A1 (en) Method, apparatus and system for displaying radio frequency identification application information
US7823133B2 (en) Smart card device and method for debug and software development
CN100468440C (en) Method and device for information interaction between host and smart card
CN106067049A (en) A kind of Android client card reading method based on NFC technique
CN101799861A (en) Software upgrading method and device of card reader and card reader
CN110069952B (en) Terminal test method, device and system
US20170206520A1 (en) Control of applications in a mobile terminal
CN107195081B (en) The test method and device of financial transaction terminal, test card, computer-readable medium
CN110119646B (en) Device parameter setting method and system based on radio frequency card
CN110995913A (en) Non-contact smart card testing method based on NFC smart phone
KR101072438B1 (en) Apparatus and method of testing interface between usim card module and mobile phone
CN104935710A (en) Mobile device and method for testing communication user card
CN116170794B (en) Online idle issuing system and method for smart card
KR101346905B1 (en) Method for Providing Control Interface of SD Memory, SD Memory
KR101485157B1 (en) Radio Frequency identification tag comprising an input unit

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant