NFC data interaction method and application thereof in POS machine
By using the POS machine terminal as the card reader terminal and the mobile phone terminal as the card simulation terminal for NFC data interaction, the problem that the POS machine does not support the card simulation function without connecting the chip, and the NFC function coverage of the existing POS machine and the flexibility of the mobile phone NFC function is improved.
Patent Information
- Application Number
- CN202411938438.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-22
Smart Images

Figure CN119862900A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of NFC communication technology and POS machine data interaction technology, and in particular to an NFC data interaction method and an application thereof in a POS machine. Background Art
[0002] NFC communication comes from near field communication technology, and its basic principle is to exchange data between devices through short-range radio waves. With the iteration of mobile phone technology, the NFC function on mobile phones has gradually become popular. In recent years, POS manufacturers have also begun to use the NFC communication characteristics of mobile phones for development. As a substitute for QR code communication, NFC is used for transactions or transmission of transaction receipt links, avoiding the need to scan code and making it easier for users to use.
[0003] Combination Figure 1 As shown in the figure, in traditional cases, when POS exchanges data with a mobile phone, the POS terminal simulates a card and the mobile phone terminal acts as a card reader. The mobile phone terminal uses fixed logic to read the content of the POS terminal and parses it on the mobile phone terminal. However, the traditional solution has its limitations, requiring the contactless chip on the POS terminal to have a card emulation function (capable of capturing external APDU at high speed and making timely responses such as ATQA and UID), and not all RFID chips meet this requirement. There are a large number of POS terminals on the market whose contactless chips do not support card emulation. In the case where such hardware does not support card emulation, it will be impossible to uniformly meet the NFC needs of customers.
[0004] Therefore, how to optimize the NFC data interaction mechanism between POS machines and mobile phones so that existing POS machines can also be compatible with diverse data interaction needs is a research topic with very positive and practical significance. Summary of the invention
[0005] In view of this, the object of the present invention is to propose an NFC data interaction method with reliable implementation, flexible application and effective data interaction, and its application in a POS machine.
[0006] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:
[0007] An NFC data interaction method is applied to NFC data interaction between a mobile phone and a POS machine, and includes:
[0008] Use the POS terminal as the card reader terminal and let it actively send card search signals according to the preset specifications;
[0009] Use the mobile phone as a card emulation terminal, call its NFC permissions, and make it simulate an NFC card according to the preset specifications to respond to the card search signal sent by the POS terminal;
[0010] The mobile phone responds to the card search signal sent by the POS terminal and returns a communication success response message;
[0011] The POS terminal receives the communication success response information returned by the mobile terminal and sends a write data instruction to the mobile terminal;
[0012] The mobile phone receives the write data instruction, writes data according to the write data instruction, and then parses the data and returns a status word to the POS machine.
[0013] As a possible implementation mode, further, the POS terminal described in this solution actively sends a card search signal according to the 14443A card communication protocol specification; correspondingly, the POS terminal communicates using the 14443A card communication protocol specification by calling the Android native NFC interface.
[0014] As a possible implementation mode, further, the NFC simulated card simulated by the mobile phone in this solution is a T4T standard card supporting RATS.
[0015] As a preferred implementation option, preferably, after the mobile phone in this solution responds to the card search signal sent by the POS terminal and returns a communication success response message, the simulated NFC card is in an activated state, and the format of the write data instruction sent by the POS terminal to the mobile phone is a T4T instruction;
[0016] The write data instruction is organized according to the NDEF data format.
[0017] As a preferred implementation option, preferably, after the mobile phone of this solution parses the data, it executes preset instructions based on the parsed data.
[0018] As a preferred implementation option, preferably, the preset instructions described in this solution include: accessing a web link, jumping to a specified application, and calling a specified application to perform an encrypted transaction.
[0019] In this solution, the POS terminal acts as a card reader and the Android phone acts as a card emulator. Data interaction is performed through the common NFC interactive data method, which generally includes the following:
[0020] The mobile phone simulates an NFC card (T4T) according to the 14443A communication specification, parses data according to the NDEF specification, and designs a response mode based on customer needs.
[0021] The POS terminal is a card reader. According to the same protocol, it activates the mobile phone to simulate the card and transmit the corresponding data. This solution gets rid of the traditional solution's hard requirement that the POS contactless chip must support the card simulation function, improves the coverage of the NFC function on the POS, and enhances the flexibility of the mobile phone for the NFC function, making it more convenient for users to use.
[0022] Based on the above, this solution also provides a POS machine data interaction method, which applies the above-mentioned NFC data interaction method.
[0023] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art: the present solution ingeniously proposes a universal NFC data interaction method with the POS terminal as a card reader and the Android mobile phone terminal as a card simulation device, which effectively avoids the diversified functional requirements for the POS terminal. It is only necessary to deploy and develop merchant software on the mobile phone terminal, so that it can call the NFC interface of the Android system and obtain the data transmitted by the POS terminal to interact with the application data. In the application, the transmitted data can be parsed according to the 7816-4 instruction format and the NDEF general specification, and the functions such as pop-up web links, browsers, text messages, mailboxes, and mobile phone numbers can be realized according to customer needs. Compared with the traditional solution, the present solution can make better use of the POS that has been circulated on the market and improve the coverage of the NFC function. For the mobile phone terminal, the use of the software is more flexible than the native NFC function of the mobile phone. The application developer can customize the response method after the NDEF data is parsed, which can not only fully support basic functions such as pop-up links and applications, but also, on this basis, the solution can also be used as another way of NFC transactions to realize mobile payment. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 This is a brief illustration of the communication data interaction between a traditional mobile phone and a POS machine in the prior art;
[0026] Figure 2 This is a brief logical diagram of the communication and interaction between the POS terminal and the mobile phone in this solution;
[0027] Figure 3 This is the system block diagram of NFC communication interaction between POS machine and Android phone in this solution;
[0028] Figure 4 This is the flow chart of the mobile phone processing received data in this solution;
[0029] Figure 5 This is a brief flow chart of the communication between the POS machine and the mobile phone in this solution. DETAILED DESCRIPTION
[0030] The present invention will be further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present invention, but are not intended to limit the scope of the present invention. Similarly, the following examples are only partial embodiments of the present invention rather than all embodiments, and all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0031] Combination Figures 2 to 5 As shown in FIG. 1 , this embodiment provides an NFC data interaction method, which is applied to NFC data interaction between a mobile phone and a POS machine, and includes:
[0032] Use the POS terminal as the card reader terminal and let it actively send card search signals according to the preset specifications;
[0033] Use the mobile phone as a card emulation terminal, call its NFC permissions, and make it simulate an NFC card according to the preset specifications to respond to the card search signal sent by the POS terminal;
[0034] The mobile phone responds to the card search signal sent by the POS terminal and returns a communication success response message;
[0035] The POS terminal receives the communication success response information returned by the mobile terminal and sends a write data instruction to the mobile terminal;
[0036] The mobile phone receives the write data instruction, writes data according to the write data instruction, and then parses the data and returns a status word to the POS machine.
[0037] In terms of communication specifications, as a possible implementation method, further, the POS terminal described in this solution actively sends a card search signal in accordance with the 14443A card communication protocol specification; correspondingly, the POS terminal communicates using the 14443A card communication protocol specification by calling the Android native NFC interface.
[0038] Among them, as a possible implementation method, further, the NFC simulation card simulated by the mobile phone in this solution is a T4T standard card that supports RATS.
[0039] In addition, as a preferred implementation option, preferably, after the mobile phone described in this scheme responds to the card-seeking signal sent by the POS machine and returns a communication success response message, the simulated NFC card it simulates is in an activated state, and the format used by the POS machine to send a write data instruction to the mobile phone is a T4T instruction; the write data instruction is organized in accordance with the NDEF data format.
[0040] In this solution, after the mobile phone parses the data, it executes preset instructions according to the parsed data; preferably, the preset instructions in this solution include: accessing a web link, jumping to a specified application, and calling a specified application to perform an encrypted transaction.
[0041] This solution provides a universal NFC data interaction method with the POS terminal as a card reader and the mobile phone as a card emulation. Compared with the traditional solution, this solution effectively avoids the diversified functional requirements for the POS terminal, that is, the POS terminal is no longer required to support the card emulation function, as long as it supports the card reader function.
[0042] In traditional cases, the mobile phone can use the built-in mobile wallet of the system to realize the mode card function, which is used for the POS to obtain data. For example, the mobile phone can simulate a bus card for swiping. Figure 1 This solution can be achieved by deploying relevant software applications on the Android phone, calling the NFC interface of the Android system, and using the phone to simulate the card to obtain data from the POS terminal. In the application, the transmitted data can be parsed according to the NDEF general specification to meet customer needs and realize functions such as pop-up web links, pop-up browsers, pop-up texts, emails, and mobile phone calls.
[0043] Furthermore, in this solution, the relevant software applications deployed on the mobile phone can use customized NFC software, which can realize encrypted data transmission as needed and realize NFC payment (encrypted payment). In terms of functional effect, it is similar to Alipay's touch-and-pay based on POS card simulation.
[0044] As a specific implementation example, this solution may include the following when it is put into practice:
[0045] 1. Card simulation communication development
[0046] During the communication between the POS terminal and the mobile phone, the Android phone will act as the simulated card terminal.
[0047] Android phones can simulate Apk applications through the development card. Using the Android native card simulation interface, the phone can simulate a card. The phone will simulate an A card that supports RATS according to the 14443A specification, corresponding to the T4T specification in the NFC communication specification. Then the POS and mobile phones need to develop instructions to be compatible with T4T cards. The system block diagram can be seen Figure 3 The mobile phone obtains the data from the POS terminal by calling the Android interface, and parses the obtained data to enter the corresponding application state. In the correct state, the mobile phone parses the write data instruction UpdateBinary transmitted by the POS terminal and responds accordingly.
[0048] 2. Card simulation data communication development
[0049] The data field of the UpdateBinary instruction can be NDEF format data, and the parsed data is parsed according to the NFC forum specification. Conventional Android phones have the functions of popping up web page tags and jumping to specified applications. Call the parsing interface to analyze the specific function type of transmitting NDEF data, which can be web page instructions, opening specified applications, using specified applications to parse the input URL data, or other custom instruction formats (the data content / format can be defined and configured by the customer. In the case of customization, the POS end only needs to specify the merchant and transmit it in the corresponding format). The acquired data type and function are transmitted to the Android response module.
[0050] 3. Data corresponding to the response from the Android phone
[0051] Steps to implement the mobile phone function. Figure 4 As shown, the application is called according to the acquired data type and content. When the parsed data is a pop-up web page, the application pops up a notification bar event, and the owner clicks the notification bar to enter the specified website. When the parsed data is to open a mobile application (such as opening a browser), the card simulation application jumps to the corresponding application. When the parsed data is a custom format, the mobile end can choose different implementation methods, such as using Google Wallet's PIX payment.
[0052] 4. Download the corresponding application on your mobile phone
[0053] Merchants provide applications for customers to download. After customers download the mobile application, they can set the application as the default NFC startup application to achieve default background communication. At the same time, according to the effects that the application needs to achieve, corresponding permissions are provided (for example, allowing sidebar notifications, allowing automatic background jump applications).
[0054] 5. POS Apdu communication
[0055] As the card reader, POS actively initiates communication according to 14443A specification. Figure 5 . At the beginning of communication, POS always sends a card search signal until a card is detected. After successful detection, activation is performed and a RATS command is sent. If the response fails, it is not the expected simulated card. After successful activation, the application is selected according to the T4T specification. After successful selection, data is sent in accordance with the UpdateBinary command format of 7816-4. The data domain part complies with the NFC forum specification. According to the function and merchant, web link command data is sent, corresponding application commands are popped up, or merchant-specific commands are sent. Success is achieved when the expected response data returned by the mobile phone is received.
[0056] In this solution, the mobile phone uses the 14443A card protocol to communicate (respond to ATQA / UID and other Class A contactless card communication data) by calling the Android native NFC interface. The card simulated by the mobile phone enters the ACTIVE state from the IDLE state, and receives the RATS command to enter the 14443-4 protocol layer (T4T supported / T2T not supported). After the card is successfully activated, the subsequent command format is the T4T command (7816-4 layer command). After selecting the application (ISOSelect), write data to the card (ISOUpdateBinary), and the card returns the corresponding command code, and the communication is completed.
[0057] When the communication is completed, the card needs to obtain the data field from the write command (ISOUpdateBinary). This part of the data is the required content, which can be parsed using the NDEF format. By parsing the class name set (Type Name Format), data element (payload) and specific type (type) of the NDEF data.
[0058] For the mobile phone, the mobile phone responds accordingly based on the parsed data. This step is relatively flexible and can be customized according to customer needs. For example, when parsed as a URL type in the general data type, the mobile phone calls the pop-up tool to pop up the URL, or when parsed as a custom class name, it can determine whether it is an Android application pop-up, or a custom function (such as encrypted data transactions, etc.).
[0059] Under normal circumstances, if the mobile phone is used as a card reader, it is used to read the card simulation data of the POS end. In this solution, the mobile phone is used as a simulated card, and the POS end is used to obtain data from the mobile phone. This solution improves the original mode of the mobile phone as a card simulation, so that it can be used to obtain external data. The usage scenario of this new mode is as follows: the POS end cannot perform card simulation, but still provides data to the mobile phone in the form of a card reader (the basic function of the POS device). This new mode is beneficial to the current POS market (many models of contactless chips do not support the card simulation function).
[0060] In summary, the following technical effects can be achieved:
[0061] (1) Improve the versatility of existing POS terminals;
[0062] (2) Avoid frequent use of the card simulation function on the POS terminal to extend the life of the POS terminal;
[0063] (3) The mobile phone has strong compatibility. The developer can customize the parsing of NDEF data and the corresponding response method, and can realize functions such as popping up corresponding links, corresponding applications, and encrypted communication.
[0064] Based on the above, this solution also provides a POS machine data interaction method, which applies the above-mentioned NFC data interaction method.
[0065] The above descriptions are only some embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent device or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. An NFC data interaction method, applied to NFC data interaction between a mobile phone and a POS machine, characterized in that: It includes: Use the POS terminal as the card reader terminal and let it actively send card search signals according to the preset specifications; Use the mobile phone as a card emulation terminal, call its NFC permissions, and make it simulate an NFC card according to the preset specifications to respond to the card search signal sent by the POS terminal; The mobile phone responds to the card search signal sent by the POS terminal and returns a communication success response message; The POS terminal receives the communication success response information returned by the mobile terminal and sends a write data instruction to the mobile terminal; The mobile phone receives the write data instruction, writes data according to the write data instruction, and then parses the data and returns a status word to the POS machine.
2. The NFC data interaction method according to claim 1, characterized in that: The POS terminal actively sends a card search signal according to the 14443A card communication protocol specification; The POS machine communicates by calling the Android native NFC interface and using the 14443A card communication protocol specification.
3. The NFC data interaction method according to claim 1, characterized in that: The NFC card simulated by the mobile phone is a T4T standard card that supports RATS.
4. The NFC data interaction method according to claim 3, characterized in that: After the mobile phone responds to the card search signal sent by the POS terminal and returns a communication success response message, the simulated NFC card is in an activated state, and the format of the write data instruction sent by the POS terminal to the mobile phone is a T4T instruction; The write data instruction is organized according to the NDEF data format.
5. The NFC data interaction method according to any one of claims 1 to 4, characterized in that: After the mobile phone parses the data, it executes preset instructions based on the parsed data.
6. The NFC data interaction method according to claim 5, characterized in that: The preset instruction includes: accessing a web link, jumping to a specified application, and calling a specified application to perform an encrypted transaction.
7. A POS machine data interaction method, characterized in that: The invention is applied with the NFC data interaction method as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
NFC payment method and apparatus
CN106920090A
Method for expanding simulation function of NFC card, NFC expansion equipment and NFC terminal
CN113965228A
Device and method for supporting IC card reader to read NFC
CN115983296A
Electronic equipment and communication method and system based on NFC (Near Field Communication)
CN118095331A
Method for extending simulation function of NFC card, NFC extension device and NFC terminal
WO2023056775A1