A method, system and related devices for NFC processing
By implementing compatibility of multiple NFC protocols in NFC devices, the inconvenience of card swiping caused by incompatibility of different NFC protocols is solved, improving user experience and success rate.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2024-12-17
- Publication Date
- 2026-06-19
AI Technical Summary
Incompatibility between different NFC protocols can cause inconvenience when NFC card readers and electronic devices swipe cards.
When an electronic device does not support the NFC protocol at the access layer, it executes the access layer signaling interaction process through the supported NFC protocol, and performs card swiping services at the application layer based on the target NFC protocol, thus achieving compatibility with multiple NFC protocols.
It improves the success rate of NFC emulation card swiping and user experience, and is compatible with NFC emulation cards of various NFC protocols in different application scenarios.
Smart Images

Figure CN122242539A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of wireless communication technology, and in particular to an NFC processing method, system and related device. Background Technology
[0002] With the development of wireless communication technology, near field communication (NFC) technology has been widely used. NFC technology evolved from contactless radio frequency identification (RFID) and interconnection technology. In NFC technology, NFC-enabled devices can operate in three modes when communicating via NFC: proximity coupling device (PCD) mode (also known as reader mode), proximity integrated circuit card (PICC) mode (also known as card emulation mode), and point-to-point (P2P) mode.
[0003] Currently, some NFC-enabled electronic devices (such as mobile phones, tablets, and wearable devices) support both PICC and PCD modes. Users can activate one or more NFC emulator cards in their electronic devices. When the electronic device is in PICC mode, it can simulate itself as a PICC device conforming to NFC standards based on the data from the NFC emulator card and interact with NFC devices in PCD mode.
[0004] When an electronic device has an NFC emulator activated, it interacts with the NFC reader using the NFC emulator based on supported NFC protocols when the device is near it. However, since multiple NFC protocols exist, the NFC reader and the electronic device may support different protocols, and multiple NFC emulators activated on the electronic device may follow different protocols. Therefore, one or more NFC emulators activated on the electronic device may use different NFC protocols when interacting with the NFC reader. Incompatibility between different NFC protocols can cause inconvenience when NFC readers swipe cards. Summary of the Invention
[0005] This application provides an NFC processing method, system, and related device, which achieves compatibility with multiple NFC protocols and is applicable to more card-swiping scenarios.
[0006] Firstly, this application provides an NFC processing method applied to an electronic device. In one possible implementation, the method includes: upon entering the radio frequency field of an NFC card reader, receiving a first card search request and a second card search request from the NFC card reader. The first card search request indicates that the NFC card reader supports a first NFC protocol, and the second card search request indicates that the NFC card reader supports a second NFC protocol. If the electronic device does not support the first NFC protocol at the access layer but supports the second NFC protocol at the access layer, it sends a second card search response to the NFC card reader. The second card search response indicates that the electronic device supports the second NFC protocol. Based on the second NFC protocol, it performs an access layer signaling interaction process with the NFC card reader. If the electronic device has activated a first NFC analog card matching the first NFC protocol of the NFC card reader, it performs a card swiping service for the first NFC analog card at the application layer based on the first NFC protocol. Thus, when the electronic device does not support the first NFC protocol at the access layer, it can implement the access layer signaling interaction process through the second NFC protocol, and then perform a card swiping service for the first NFC analog card at the application layer based on the first NFC protocol, thus being compatible with multiple NFC protocols and enabling card swiping services for NFC analog cards with multiple NFC protocols.
[0007] In one possible implementation, after receiving the first card search request and the second card search request from the NFC card reader, the method further includes: if the electronic device supports the first NFC protocol at the access layer, sending a first card search response of the first NFC protocol to the NFC card reader, the first card search response indicating that the electronic device supports the first NFC protocol; performing an access layer signaling interaction process with the NFC card reader based on the first NFC protocol; and if the electronic device has activated the first NFC emulator card, performing a card swiping service for the first NFC emulator card with the NFC card reader at the application layer based on the first NFC protocol. Thus, when the electronic device supports the first NFC protocol at the access layer, it prioritizes performing the card swiping interaction process based on the first NFC protocol, facilitating the electronic device to implement the card swiping service for the NFC emulator card using the first NFC protocol.
[0008] In some examples, NFC reader devices are configured to prioritize the execution of access layer signaling interaction procedures based on a first NFC protocol. This allows for better adaptation to different application scenarios by configuring the NFC reader device to prioritize the NFC protocol used.
[0009] In one possible implementation, after the access layer signaling interaction process with the NFC reader based on the second NFC protocol, the method further includes: if the electronic device has not activated the first NFC emulator card but has activated a second NFC emulator card with the second NFC protocol matched with the NFC reader, after the application layer fails to execute the card swiping service of the first NFC emulator card with the NFC reader based on the first NFC protocol, the method then executes the card swiping service of the second NFC emulator card with the NFC reader based on the second NFC protocol. In this way, even when the electronic device has not activated the first NFC emulator card, it can still execute the card swiping service of the second NFC emulator card based on the second NFC protocol after the application layer fails to execute the card swiping service based on the first NFC protocol, thus being compatible with multiple NFC protocols and providing users with a better card swiping experience.
[0010] In one possible implementation, after receiving the first and second card search requests from the NFC reader, the method further includes: receiving a third card search request from the NFC reader, the third card search request indicating that the NFC reader supports a third NFC protocol; if the electronic device does not support the first NFC protocol at the access layer but supports the third NFC protocol at the access layer, sending a third card search response in the third NFC protocol to the NFC reader, the third card search response indicating that the electronic device supports the third NFC protocol; performing access layer signaling interaction with the NFC reader based on the third NFC protocol; if the electronic device has activated a first NFC emulator card, performing a card swiping service for the first NFC emulator card at the application layer based on the first NFC protocol with the NFC reader. Thus, when the NFC reader supports three NFC protocols, it can realize card swiping services for NFC emulator cards with multiple NFC protocols through the above process.
[0011] In one possible implementation, after the access layer signaling interaction process with the NFC reader based on the third NFC protocol, the method further includes: if the electronic device has not activated the first NFC emulator card but has activated a third NFC emulator card using the third NFC protocol compatible with the NFC reader, after the application layer fails to execute the card swiping service of the first NFC emulator card using the first NFC protocol, the method then executes the card swiping service of the third NFC emulator card using the third NFC protocol. In this way, even when the electronic device has not activated the first NFC emulator card, it can still execute the card swiping service of the third NFC emulator card using the third NFC protocol after the application layer fails to execute the card swiping service using the first NFC protocol, thus being compatible with multiple NFC protocols and providing users with a better card swiping experience.
[0012] In one possible implementation, after receiving a third card-finding request from an NFC reader, the method further includes: if the electronic device does not support the first NFC protocol at the access layer, does not support the third NFC protocol at the access layer, but supports the second NFC protocol at the access layer, sending a second card-finding response to the NFC reader; performing an access layer signaling interaction process with the NFC reader based on the second NFC protocol; and if the electronic device has activated a first NFC emulator card, performing a card-swiping service for the first NFC emulator card with the NFC reader at the application layer based on the first NFC protocol. Thus, when the NFC reader supports multiple NFC protocols, it sends card-finding requests for multiple NFC protocols in turn. After receiving card-finding requests for multiple NFC protocols, the electronic device sends a card-finding response for the supported NFC protocol to the NFC reader, enabling the electronic device to complete the access layer signaling interaction process with the NFC reader. The NFC reader performs a card-swiping process for the first NFC emulator card with the electronic device at the application layer based on the first NFC protocol, enabling the electronic device to perform a card-swiping service for the first NFC emulator card even when the access layer does not support the first NFC protocol.
[0013] In one possible implementation, after the access layer signaling interaction process with the NFC reader based on the second NFC protocol, the method further includes: if the electronic device has not activated the first NFC emulator card but has activated a third NFC emulator card using the third NFC protocol matched with the NFC reader, after the application layer fails to execute the card-swiping service of the NFC emulator card using the first NFC protocol with the NFC reader, the method then executes the access layer signaling interaction process with the NFC reader based on the second NFC protocol; and then executes the card-swiping service of the third NFC emulator card using the third NFC protocol with the NFC reader. In this way, the NFC reader executes the card-swiping process of the third NFC emulator card with the electronic device at the application layer based on the third NFC protocol, enabling the electronic device to perform card-swiping services using the third NFC emulator card even when the access layer does not support the third NFC protocol.
[0014] In one possible implementation, after the access layer signaling interaction process with the NFC reader based on the second NFC protocol, the method further includes: if the electronic device has not activated the first NFC emulator card or the third NFC emulator card, but has activated a second NFC emulator card with the second NFC protocol matched with the NFC reader card, after the application layer fails to execute the card swiping service of the first NFC emulator card with the NFC reader card based on the first NFC protocol, the method then executes the access layer signaling interaction process with the NFC reader card based on the second NFC protocol; after the application layer fails to execute the card swiping service of the third NFC emulator card with the NFC reader card based on the third NFC protocol, the method then executes the card swiping service of the second NFC emulator card based on the second NFC protocol. In this way, when the electronic device has not activated the first NFC emulator card or the third NFC emulator card, it can still execute the card swiping service of the second NFC emulator card based on the second NFC protocol after the application layer fails to execute the card swiping service of the first NFC emulator card and the third NFC emulator card, thus being compatible with multiple NFC protocols and providing users with a better card swiping experience.
[0015] In one possible implementation, the application layer performs a card-swiping service for the first NFC simulated card with the NFC card reader based on the first NFC protocol. Specifically, this includes sending card information of the first NFC simulated card to the NFC card reader at the application layer. The card information is used by the NFC card reader to perform the card-swiping service for the NFC simulated card using the first NFC protocol.
[0016] The card-swiping service can include any one of the following: opening access control, unlocking doors, unlocking vehicles, making transactions, verifying electronic tickets, verifying digital documents, and swiping transportation cards to get on and off vehicles.
[0017] The card information of the first NFC simulated card may include one or more of the following: access control information, key information, transaction account information, and electronic ticket information. Access control information may include one or more of the following: card number, card validity period, etc. Key information may include one or more of the following: key code, key code validity period, etc. Transaction account information may include one or more of the following: transaction account identifier, remaining balance in the transaction account, etc. Electronic ticket information may include one or more of the following: electronic ticket code, electronic ticket verification time, electronic ticket validity period, etc.
[0018] In one possible implementation, sending card information of a first NFC simulated card to an NFC reader at the application layer specifically includes: receiving a mini-program selection command from the NFC reader, the mini-program selection command carrying the identifier of a first applet; determining, based on the identifier of the first applet, that the first applet corresponds to a first NFC simulated card; and sending the card information of the first NFC simulated card to the NFC reader via the first applet. This allows the first applet on the electronic device to be selected, enabling the first applet to perform subsequent transmission processes related to the card information of the first NFC simulated card.
[0019] In one possible implementation, after sending the card information of the first NFC simulated card to the NFC card reader via the first applet, the method further includes receiving the card swiping result of the first NFC simulated card sent by the NFC card reader. This allows the electronic device to determine the card swiping result, facilitating the execution of other NFC protocol card swiping procedures when a card swiping failure is detected.
[0020] In one possible implementation, determining the first NFC emulator card corresponding to the first applet based on its identifier specifically includes: identifying the first applet from one or more applets based on its identifier; and determining the first DF corresponding to the first NFC emulator card from the first applet's MF (Mean Function), wherein the first applet's MF includes one or more DFs, the one or more DFs include the first DF, and the first DF includes the card information of the first NFC emulator card. In this way, after identifying the first applet, the electronic device can obtain the first DF through the first applet, improving the NFC card-swiping speed.
[0021] In one possible implementation, the first DF further includes a first external authentication key; sending the card information of the first NFC simulated card to the NFC reader via a first applet specifically includes: encrypting the card information of the first NFC simulated card stored in the first DF using the first external authentication key and a first random number via the first applet to obtain encrypted data; sending the encrypted data to the NFC reader, whereby the encrypted data is used by the NFC reader to decrypt the card information of the first NFC simulated card. This improves the security of the card information of the first NFC simulated card during transmission.
[0022] In one possible implementation, before encrypting the card information of the first NFC analog card using a first external authentication key and a first random number to obtain encrypted data, the method further includes: receiving a card information acquisition command sent by an NFC card reader, the card information acquisition command being used to request the acquisition of the card information of the first NFC analog card; and encrypting the card information of the first NFC analog card using a first Applet using the first external authentication key and a first random number to obtain encrypted data, specifically including: in response to the card information acquisition command, encrypting the card information of the first NFC analog card stored in a first DF using the first external authentication key and a first random number to obtain encrypted data.
[0023] In one possible implementation, before receiving the card information retrieval command sent by the NFC card reader, the method further includes: receiving a random number retrieval Get Challenge command sent by the NFC card reader; generating a first random number via a first Applet in response to the GetChallenge command; sending a first response to the NFC card reader, the first response carrying the first random number; receiving an external authentication command sent by the NFC card reader, the external authentication command carrying authentication ciphertext; decrypting the first random number from the authentication ciphertext using a first external authentication key in a first DF via the first Applet; and sending a second response to the NFC card reader, the second response carrying a first authentication result, the first authentication result indicating that the electronic device has successfully decrypted the first random number from the authentication ciphertext.
[0024] In one possible implementation, after receiving the swipe result of the first NFC simulated card from the NFC card reader, the method further includes: outputting a prompt corresponding to the swipe result of the first NFC simulated card. This allows the user to know the swipe result immediately.
[0025] In one possible implementation, the method further includes sending a third response to the NFC card reader 200, the third response indicating that the electronic device has successfully received the swipe result of the first NFC analog card. This allows the NFC card reader to immediately know that the electronic device has successfully received the swipe result.
[0026] Secondly, this application provides an NFC processing method applied to an NFC card reader. The method includes: sending a first card search request and a second card search request, wherein the first card search request indicates that the NFC card reader supports a first NFC protocol, and the second card search request indicates that the NFC card reader supports a second NFC protocol; if a second card search response is received from an electronic device, the second card search response indicates that the electronic device supports the second NFC protocol; performing an access layer signaling interaction process with the NFC card reader based on the second NFC protocol; and performing a card swiping service for a first NFC simulated card with the electronic device at the application layer based on the first NFC protocol. Thus, when the NFC card reader supports multiple NFC protocols, it can send card search requests for multiple NFC protocols. As long as the electronic device supports any one of the multiple NFC protocols, it can perform an access layer signaling interaction process with the NFC card reader, thus being compatible with multiple NFC protocols. The NFC card reader interacts with the electronic device at the application layer based on the first NFC protocol, enabling the electronic device to perform a card swiping service for a first NFC simulated card even when the access layer does not support the first NFC protocol.
[0027] In one possible implementation, after sending the first card search request and the second card search request, the method further includes: if a first card search response is received from an electronic device, the first card search response indicating that the electronic device supports the first NFC protocol; performing an access layer signaling interaction process with an NFC card reader based on the first NFC protocol; and performing a card swiping service for the first NFC simulated card with the NFC card reader at the application layer based on the first NFC protocol. In this way, the NFC card reader prioritizes completing the access layer signaling interaction process based on the first NFC protocol, improving the card swiping experience of the NFC simulated card using the first NFC protocol.
[0028] In one possible implementation, the method further includes: if the card-swiping transaction of the first NFC simulated card with the electronic device fails at the application layer based on the first NFC protocol, then the card-swiping transaction of the second NFC simulated card is executed with the NFC reader based on the second NFC protocol, where the second NFC simulated card is an NFC simulated card activated by the electronic device using the second NFC protocol. In this way, when the NFC reader fails to execute the card-swiping transaction of the first NFC simulated card, it tends to assume that the NFC simulated card activated by the electronic device and matched with the NFC reader is an NFC simulated card using the second NFC protocol, and executes the card-swiping transaction of the second NFC simulated card with the electronic device based on the second NFC protocol, thereby increasing the probability of successful card swiping by the electronic device.
[0029] In one possible implementation, after sending the first card search request and the second card search request, the method further includes: sending a third card search request, which indicates that the NFC card reader supports a third NFC protocol; if a third card search response is received from the electronic device, which indicates that the electronic device supports the third NFC protocol; performing an access layer signaling interaction process with the NFC card reader based on the third NFC protocol; and performing a card swiping service for the first NFC simulated card with the electronic device at the application layer based on the first NFC protocol. In this way, even when the electronic device only supports the third NFC protocol at the access layer, it can still perform a card swiping service for the first NFC simulated card.
[0030] In one possible implementation, the method further includes: if the card-swiping transaction of the first NFC simulated card with the electronic device fails at the application layer based on the first NFC protocol, then the card-swiping transaction of the third NFC simulated card is executed with the NFC reader based on the third NFC protocol, where the third NFC simulated card is an NFC simulated card activated by the electronic device using the third NFC protocol. In this way, when the NFC reader fails to execute the card-swiping transaction of the first NFC simulated card, it tends to assume that the NFC simulated card activated by the electronic device and matched with the NFC reader is an NFC simulated card using the third NFC protocol, and executes the card-swiping transaction of the third NFC simulated card with the electronic device based on the third NFC protocol, thereby increasing the probability of successful card swiping by the electronic device.
[0031] In one possible implementation, after sending the third card search request, the method further includes: if a second card search response is received from the electronic device, the second card search response indicating that the electronic device supports the second NFC protocol; performing an access layer signaling interaction process with the NFC card reader based on the second NFC protocol; and performing a card swiping service for the first NFC simulated card with the electronic device at the application layer based on the first NFC protocol. In this way, the NFC card reader supports multiple NFC protocols, and the electronic device can still perform a card swiping service for the first NFC simulated card even when the access layer only supports the third NFC protocol.
[0032] In one possible implementation, the method further includes: if the card-swiping transaction of the first NFC simulated card with the electronic device fails at the application layer based on the first NFC protocol, then the card-swiping transaction of the third NFC simulated card is executed with the NFC reader based on the third NFC protocol. In this way, when the NFC reader fails to execute the card-swiping transaction of the first NFC simulated card, it tends to assume that the NFC simulated card activated by the electronic device and matched with the NFC reader is an NFC simulated card using the third NFC protocol, and executes the card-swiping transaction of the third NFC simulated card with the electronic device based on the third NFC protocol, thereby increasing the probability of successful card swiping by the electronic device.
[0033] In one possible implementation, the method further includes: if the card swiping operation of the third NFC simulated card with the NFC card reader fails based on the third NFC protocol, then the card swiping operation of the second NFC simulated card with the NFC card reader is performed based on the second NFC protocol. In this way, when both the card swiping operation of the first and third NFC simulated cards fails, the NFC card reader tends to assume that the NFC simulated card activated by the electronic device and matched with the NFC card reader is an NFC simulated card using the second NFC protocol, and performs the card swiping operation of the second NFC simulated card with the electronic device based on the second NFC protocol, thereby increasing the probability of successful card swiping by the electronic device.
[0034] In one possible implementation, the application layer performs a card-swiping service for the first NFC simulated card with an electronic device based on the first NFC protocol. Specifically, this includes: receiving card information of the first NFC simulated card sent by the electronic device at the application layer; and implementing the card-swiping service for the first NFC simulated card based on the card information of the first NFC simulated card.
[0035] In one possible implementation, receiving card information of the first NFC simulated card sent by the electronic device at the application layer specifically includes: sending a mini-program selection command to the electronic device, the mini-program selection command carrying the identifier of the first Applet, the mini-program selection command being used to request the electronic device to select the first Applet; and receiving card information of the first NFC simulated card sent by the electronic device through the first Applet.
[0036] In one possible implementation, after receiving card information of a first NFC analog card sent by an electronic device via a first Applet, the method further includes sending the swipe result of the first NFC analog card to the electronic device.
[0037] In one possible implementation, receiving card information of a first NFC analog card sent by an electronic device via a first applet specifically includes: receiving encrypted data sent by the electronic device via the first applet; and decrypting the card information of the first NFC analog card from the encrypted data using a first external authentication key and a first random number.
[0038] In one possible implementation, before decrypting the card information of the first NFC emulator from the encrypted data using a first external authentication key and a first random number, the method further includes: sending a card information acquisition command to an electronic device, the card information acquisition command being used to request the acquisition of the card information of the first NFC emulator.
[0039] In one possible implementation, before sending the card information retrieval command to the electronic device, the method further includes: sending a random number retrieval Get Challenge command to the electronic device, the Get Challenge command being used to request a first Applet of the electronic device to generate a first random number; sending a first response to an NFC card reader, the first response carrying the first random number; encrypting the first random number using a first external authentication key to obtain authentication ciphertext; sending an external authentication command to the electronic device, the external authentication command carrying the authentication ciphertext; and receiving a second response from the electronic device, the second response carrying a first authentication result, the first authentication result being used to indicate that the electronic device has successfully decrypted the first random number from the authentication ciphertext.
[0040] In one possible implementation, after receiving the swipe result of the first NFC simulated card sent by the NFC card reader, the method further includes: receiving a third response sent by the electronic device, the third response indicating that the electronic device has successfully received the swipe result of the first NFC simulated card.
[0041] Thirdly, this application provides an NFC system, including: an electronic device and an NFC card reader; the electronic device is used to execute any possible implementation of the first aspect; the NFC card reader is used to execute any possible implementation of the second aspect. Thus, when the NFC card reader supports multiple NFC protocols, as long as the electronic device supports any one of the multiple NFC protocols at the access layer, it can achieve access layer signaling interaction with the NFC card reader. Furthermore, regardless of whether the NFC protocol of the NFC analog card activated by the electronic device and matched with the NFC card reader is any one of the multiple NFC protocols supported by the NFC card reader, the card-swiping service of the NFC analog card can be realized, ensuring compatibility with multiple NFC protocols and providing users with a more convenient card-swiping experience.
[0042] Fourthly, this application provides an electronic device including one or more processors, one or more memories, and a transceiver. The transceiver, the one or more memories, and the one or more memories are coupled to the one or more processors. The one or more memories are used to store a computer program, and when the one or more processors execute the computer program, they perform the NFC processing method described in the first aspect and any possible implementation thereof.
[0043] Fifthly, this application provides an NFC card reader device, including one or more processors, one or more memories, and a transceiver. The transceiver, the one or more memories, and the one or more memories are coupled to the one or more processors. The one or more memories are used to store a computer program, and when the one or more processors execute the computer program, they perform the NFC processing method described in the second aspect above and any possible implementation of the second aspect.
[0044] Sixthly, this application provides an NFC device including one or more processors, one or more memories, and a transceiver. The transceiver, the one or more memories, and the one or more memories are coupled to the one or more processors. The one or more memories are used to store a computer program, which, when executed by the one or more processors, performs the NFC processing method described in the first aspect and any possible implementation thereof.
[0045] The NFC device can be an electronic device or an NFC tag card.
[0046] In a seventh aspect, this application provides a computer storage medium storing a computer program that, when executed by a processor, implements the NFC processing method described in the first aspect and any possible implementation thereof.
[0047] Eighthly, this application provides a computer storage medium storing a computer program that, when executed by a processor, implements the NFC processing method in the second aspect and any possible implementation thereof.
[0048] Ninthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the NFC processing method in the first aspect and any possible implementation thereof.
[0049] In a tenth aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the NFC processing method in the second aspect and any possible implementation thereof.
[0050] In one aspect, this application provides a chip system including a processing circuit and an interface circuit. The interface circuit is used to receive code instructions and transmit them to the processing circuit. The processing circuit is used to execute the code instructions to perform the NFC processing method in the first aspect and any possible implementation thereof.
[0051] In a twelfth aspect, this application provides a chip system including a processing circuit and an interface circuit. The interface circuit is used to receive code instructions and transmit them to the processing circuit, which is used to execute the code instructions to perform the NFC processing method in the second aspect and any possible implementation thereof.
[0052] The beneficial effects of the second to twelfth aspects and any possible implementation of the second to twelfth aspects can be referred to the beneficial effects of the first aspect and any possible implementation of the first aspect, and will not be repeated here. Attached Figure Description
[0053] Figure 1 A schematic diagram illustrating the working principle of NFC provided in an embodiment of this application;
[0054] Figure 2 This application provides a schematic diagram of the architecture of an NFC system.
[0055] Figure 3 A schematic diagram of an NFC protocol stack provided in an embodiment of this application;
[0056] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0057] Figure 5 This application provides a schematic diagram of an NFC signaling interaction process.
[0058] Figure 6 This is a schematic diagram of another NFC signaling interaction process provided in an embodiment of this application;
[0059] Figure 7 A flowchart illustrating an NFC processing method provided in an embodiment of this application;
[0060] Figure 8 A flowchart illustrating another NFC signaling interaction process provided in an embodiment of this application;
[0061] Figure 9 A schematic diagram of a file structure provided for an embodiment of this application;
[0062] Figures 10A-10E A set of interface schematic diagrams provided for embodiments of this application;
[0063] Figure 11A and Figure 11B A flowchart illustrating another NFC processing method provided in an embodiment of this application;
[0064] Figure 12 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0065] Figure 13 This is a schematic diagram of the structure of a communication device provided in an embodiment of this application;
[0066] Figure 14 This is a schematic diagram of another communication device provided in an embodiment of this application;
[0067] Figure 15 This is a schematic diagram of another communication device provided in an embodiment of this application;
[0068] Figure 16This is a schematic diagram of another communication device provided in an embodiment of this application. Detailed Implementation
[0069] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0070] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0071] The working principle of NFC in the embodiments of this application is described below.
[0072] Figure 1 A schematic diagram illustrating the working principle of NFC provided in an embodiment of this application is shown.
[0073] like Figure 1 The two parties communicating using NFC technology can include a proximity coupling device (PCD) (also known as an NFC reader) and a proximity smart card (PICC). The PCD can achieve contactless communication with the PICC in close proximity. The PCD and PICC can allow near-field communication at specific data rates (e.g., 106kbps, 212kbps, 424kbps, or 848kbps) and specific frequencies (e.g., 13.56MHz). Communication between the PCD and PICC can occur at close range, for example, within a range of approximately 2 to 4 centimeters.
[0074] The PCD (Polymer Capacitor) can generate high-frequency alternating current to produce a radio frequency (RF) field of a specified frequency (e.g., 13.56 MHz), and transmit data to the PICC (Peripherally Input Cell) via this RF field. When the PICC is near the PCD, it can sense the RF field emitted by the PCD. Upon entering the RF field, the PICC can obtain energy from the PCD's RF field through electromagnetic induction, and use this energy to generate electricity to drive the internal circuitry of the PICC, thus enabling data transmission from the PCD to the PICC. Alternatively, the PICC can also transmit data to the PCD by modulating the RF field with a load, achieving data transmission from the PICC to the PCD.
[0075] In the embodiments of this application, PICC can be a physical NFC tag card. Some NFC devices (e.g., mobile phones, tablets, smartwatches, and other electronic devices) can also simulate themselves as PICCs that conform to NFC-related standards through data from NFC emulation cards to realize the functions of PICCs and interact with PCD via NFC.
[0076] The following describes an NFC system provided in an embodiment of this application.
[0077] Figure 2 A schematic diagram of the architecture of an NFC system 10 provided in an embodiment of this application is shown.
[0078] like Figure 2 As shown, the NFC system 10 may include an electronic device 100 and an NFC card reader 200. The electronic device 100 can simulate itself as a PICC conforming to NFC standards by using data information from an NFC emulation card to achieve PICC functionality. The NFC card reader 200 can act as a PCD to interact with the electronic device 100 in PICC mode via NFC.
[0079] In one possible implementation, the electronic device 100 can support both PICC mode and PCD mode. In PCD mode, the electronic device 100 can act as a PCD transmitter to communicate with the PICC. In PICC mode, the electronic device 100 can act as a PICC to passively receive the radio frequency field transmitted by the PCD and perform NFC interaction with the PCD through load modulation technology.
[0080] In this embodiment, after the electronic device 100 enables the NFC function, the electronic device 100 can be in PICC mode. If the electronic device 100 supports both PCD mode and PICC mode, after enabling the NFC function, the electronic device 100 can switch between PICC mode and PCD mode in a time-sharing manner.
[0081] In this embodiment of the application, the device type of electronic device 100 can be any of the following: mobile phone, tablet computer, handheld computer, desktop computer, laptop computer, ultra-mobile personal computer (UMPC), netbook, cellular phone, personal digital assistant (PDA), as well as smart home devices such as smart screens and smart speakers, wearable devices such as smart bracelets, smartwatches, and smart glasses, extended reality (XR) devices such as augmented reality (AR), virtual reality (VR), and mixed reality (MR), in-vehicle devices, or smart city devices.
[0082] The NFC card reader device 200 can be any of the following: mobile phone, tablet computer, handheld computer, desktop computer, laptop computer, super mobile personal computer, netbook, cellular phone, personal digital assistant, as well as smart home devices such as smart screens and smart speakers, wearable devices such as smart bracelets, smartwatches, and smart glasses, extended reality devices such as augmented reality, virtual reality, and mixed reality, vehicles, gates, smart locks, card readers, payment terminals, ticket purchase and / or ticket verification terminals, bank service terminals, and document card reading devices.
[0083] The following describes an NFC protocol stack provided in an embodiment of this application.
[0084] Figure 3 A schematic diagram of an NFC protocol stack provided in an embodiment of this application is shown.
[0085] like Figure 3 As shown, the NFC protocol stack can include a physical layer, a radio frequency layer, an access layer, a transport layer, and an application layer.
[0086] The physical layer can be used to implement the physical characteristics of NFC technology communication.
[0087] The radio frequency (RF) layer can be used to implement RF specifications for NFC technology communication, such as data rate and RF signal frequency.
[0088] The access layer can be used to implement functions such as polling and device discovery, service result notification, card conflict management, transmission protocol negotiation, timeout and retransmission mechanism, PICC / PCD mode switching, and converged card selection.
[0089] The transport layer includes a high-speed data transmission protocol, which enables data transmission between the PCD and PICC at the application layer.
[0090] The application layer can be used to implement one or more NFC services and one or more service management policies. The one or more NFC services may include codeless payment, electronic tickets, access control, digital ID cards, all-scenario contactless payment, and short-range data transmission. The one or more service management policies may include any one or more of the following: file management, card long-term activation, security management, and service routing management. The processing logic of the NFC services can be executed by Applets. In one possible implementation, the processing logic of the service management policies can be executed by the NFC basic service module.
[0091] The following is a schematic diagram of the structure of an electronic device 100 provided in the embodiments of this application.
[0092] Figure 4 A schematic diagram of the structure of an electronic device 100 provided in an embodiment of this application is shown.
[0093] like Figure 4 As shown, the electronic device 100 may include a processor 101 and an NFC module 102. The processor 101 may run one or more applications. These applications may include one or more of the following: a wallet application, one or more host-based card emulation (HCE) applications, etc. Optionally, the electronic device 100 may also include a secure element (SE) 103 and / or a subscriber identity module (SIM) card 104. The processor 101 may be connected to the NFC module 102, the SE 103, and the SIM card 104, respectively. The NFC module 102 may also be connected to the SE 103 and the SIM card 104.
[0094] NFC module 102 may include an NFC controller ( Figure 4 (not shown in the image), NFC transceiver ( Figure 4 (not shown in the image) and NFC memory ( Figure 4 (Not shown in the image). The NFC controller can be connected to the processor 101, and can also be connected to the NFC transceiver and the NFC memory respectively.
[0095] The NFC controller is primarily used for modulation and demodulation of contactless communication signals, controlling the input and output of data in the NFC memory, and interacting with the processor 101. The NFC transceiver is used to transmit and receive NFC signals (e.g., 13.56MHz radio frequency signals), and may include an electromagnetic compatibility (EMC) filter circuit, a matching circuit, a receiving circuit, and an NFC antenna, where the NFC antenna may be a loop antenna, used to enable proximity-based contactless communication capabilities of the NFC module 102. The NFC memory can be used to store data sent by the NFC module 102 to the NFC reader device 200, as well as data received from the NFC reader device 200. In some embodiments, the NFC memory can be a shared memory that can be used by the various components in the NFC module 102; for example, some data in the NFC memory can be accessed by the NFC controller, while other data can be accessed by the SE 103.
[0096] In other embodiments, the NFC memory may be a collection of multiple memories. For example, the NFC controller may include a first memory among these multiple memories. The first memory may include instructions or data that the NFC controller has used or reused. If the NFC controller needs to use the instruction or data again, it can directly retrieve it from the first memory, thus reducing the waiting time of the NFC controller. SE103 may include a second memory among these multiple memories. The second memory may include card information such as that of the NFC emulator based on the secure element. Thus, if SE103 needs to read the card information of the NFC emulator, it can read the card information of the NFC emulator from the second memory in SE103. SIM card 104 may include a third memory among these multiple memories. The third memory may include card information such as that of the NFC emulator based on the SIM card. Thus, if SIM card 104 needs to read the card information of the NFC emulator, it can read the card information of the NFC emulator from the third memory in SIM card 104.
[0097] In some embodiments, the NFC memory described above can also store routing information. In some embodiments, this routing information can be controlled or managed by the NFC controller, and can include a routing table consisting of a list of routing rules. Each routing rule contains an applet identifier (AID) and a destination; the destination is the location where the applet used to implement the business logic of the NFC emulator card runs. The destination can include an HCE application running in the processor 101 of the electronic device 100, or an SE 103 or SIM card 104 connected to the NFC controller.
[0098] The SE103 and NFC module 102 can be two separate chips. Alternatively, the SE103 and NFC module 102 can be packaged into a single chip.
[0099] Electronic device 100 can activate one or more NFC emulator cards in an application based on user input, thereby enabling electronic device 100 to support one or more NFC services. The service processing logic for the NFC emulator card within electronic device 100 is specifically implemented by an applet. The applet can be stored and run in the corresponding hardware device or software module (e.g., HCE application, SIM card, SE, etc.) of the NFC emulator card.
[0100] The card emulation modes of electronic device 100 can be divided into hardware-based virtual card mode and software-based HCE mode. Among them:
[0101] 1. In hardware-based virtual card mode, electronic device 100 can provide the operating environment for the Applet corresponding to the NFC emulator card, as well as the storage and processing of the NFC emulator card's business data, through SE103 or SIM card 104. NFC module 102, as the front end of contactless communication, receives commands from the external PCD and forwards them to SE103 or SIM card 104. The Applet in SE103 or SIM card 104 then processes the commands and sends response data to the external PCD via NFC module 102. Users can activate one or more NFC emulator cards in a wallet application, which can write the Applets and card data of one or more NFC emulator cards into SE103. Alternatively, users can activate one or more NFC emulator cards in a SIM card application, which can write the Applets and card data of one or more NFC emulator cards into SIM card 104 for storage.
[0102] 2. In software-based HCE mode, the HCE application running in processor 101 can provide the operating environment for the Applet corresponding to the NFC emulator card, as well as the storage and processing of the NFC emulator card's business data. After receiving a command from an external PCD, NFC module 102 can send the command to the HCE application. The HCE application can process the command received by the NFC module through the Applet running in the HCE application or a cloud server, and generate response data for the PCD. The HCE application can then send the response data to NFC module 102. NFC module 102 can then send the response data to the external PCD. Users can activate one or more NFC emulator cards in the HCE application. The HCE application can run one or more NFC emulator card Applets and store the NFC emulator card data on the local memory of electronic device 100 or on a cloud server.
[0103] Optionally, the processor 101 can also run an NFC basic service module. The NFC basic service module can be used to provide common management functions for one or more NFC services. These common management functions may include file management, card activation, security management, service routing management, and other functions.
[0104] For example, in the card emulation scenario described above, the electronic device 100 has a native NFC-related application installed, and users can also download and install third-party applications from app stores. Generally, the native application can use a hardware-based virtual card solution, while the third-party application can use an HCE solution. The native application can be a wallet application, etc., and the third-party application can be, for example, Alipay, PayPal, WeChat, etc. The above examples are merely for explaining this application and should not be construed as limiting it.
[0105] It should be noted that, in combination Figure 3 As shown in the NFC protocol stack, when the wallet application of electronic device 100 activates an NFC emulator card, it can write the NFC emulator card's applet (including the card information and application layer instructions) into the second or third memory. The memory that writes the card data of the NFC emulator card can send the access layer parameters of the NFC emulator card to the NFC controller. The NFC controller can store the access layer parameters. These access layer parameters may include the unique identifier (UID) of the NFC emulator card. The NFC controller of electronic device 100 has pre-set (fixed) access layer protocol data. Electronic device 100 can implement the access layer interaction process through the NFC controller. Electronic device 100 can implement the application layer interaction process through the applet in the second or third memory.
[0106] Thus, since different NFC modules 102 have their access layer protocol signaling written into them at the factory, the NFC protocols supported by different NFC modules 102 at the access layer may be different. For example, if the electronic device 100 activates an NFC analog card designed based on the first NFC protocol at the application layer, and the NFC module 102 of the electronic device 100 only supports the second NFC protocol at the access layer and does not support the first NFC protocol, a situation may arise where the card swiping process cannot be implemented due to NFC protocol incompatibility.
[0107] In one possible implementation, the electronic device 100 and the NFC card reader 200 support a first NFC protocol. The electronic device 100 and the NFC card reader 200 can execute a card-swiping process for an NFC-enabled simulated card based on the first NFC protocol. Thus, when the electronic device 100 supports the first NFC protocol, it can execute a card-swiping process for an NFC-enabled simulated card using the first NFC protocol on the NFC card reader 200, thereby realizing the card-swiping service for an NFC-enabled simulated card using the first NFC protocol.
[0108] In some examples, when electronic device 100 enters the radio frequency field emitted by NFC reader 200, electronic device 100 can receive a first NFC protocol probe frame emitted by NFC reader 200. After receiving the probe frame, electronic device 100 can send a first NFC protocol probe acknowledgement (Probe ACK) frame to NFC reader 200, which indicates that electronic device 100 has received the probe frame. After receiving the probe frame, NFC reader 200 can send a notification frame to electronic device 100, which carries device characteristic information of NFC reader 200. After receiving the notification frame, electronic device 100 performs application layer data transmission.
[0109] In this way, through the signaling interaction process at the access layer in the NFC processing method, the device characteristic information of the NFC reader 200 is sent to the electronic device 100 using a Notify frame. This allows the electronic device 100 to determine the target NFC service based on the device characteristic information of the NFC reader 200 before data transmission at the application layer. This enables the electronic device 100 to prepare the data required for the target NFC service or output a prompt for the target NFC service before data transmission at the application layer. Thus, the electronic device 100 and the NFC reader 200 can complete different types of NFC services at the application layer after the same signaling interaction process at the access layer, saving resources and costs for the electronic device.
[0110] For example, such as Figure 5 As shown, the NFC card reader 200 can operate in PCD mode. The electronic device 100, after enabling NFC, defaults to PICC mode. The electronic device 100 and the NFC card reader 200 can implement the NFC analog card swiping process based on the first NFC protocol, including the following steps:
[0111] S501. Electronic device 100 enters the radio frequency field of NFC card reader 200.
[0112] S502.NFC card reader 200 sends a probe frame.
[0113] The Probe frame can be used to indicate that the NFC reader 200 supports the first NFC protocol. The NFC reader 200 can periodically send Probe frames.
[0114] The first NFC protocol includes several NFC transmission frames, such as Data frames, Probe frames, Probe ACK frames, Conflict frames, Conflict ACK frames, Pick frames, Pick ACK frames, Notify frames, Notify ACK frames, Reset frames, Reset ACK frames, Command frames, and Response frames. Each NFC transmission frame includes a frame control header and a checksum field. The frame control header can be 3 bytes long, and the checksum field can be 2 bytes long. The frame control header may include a protocol identifier field, a frame type field, and a protocol version field. The NFC protocol can use Cyclic Redundancy Check (CRC) to verify NFC transmission frames. Therefore, the checksum field of the NFC transmission frame can carry a CRC code.
[0115] The frame type field indicates the frame type of the NFC transmission frame. For example, the frame type field value can be "0x00" in a data frame, "0x01" in a Probe frame, "0x02" in a Probe ACK frame, "0x03" in a Conflict frame, "0x04" in a Conflict ACK frame, "0x07" in a Notify frame, "0x08" in a Notify ACK frame, "0x09" in a Reset frame, "0x0A" in a Reset ACK frame, "0x0B" in a Command frame, and "0x0C" in a Response frame. Values "0x0D" to "0x88" in the frame type field are reserved for future expansion of NFC transmission frame types in the first NFC protocol. The value of the frame type field, "0x09~0xFF", can be a vendor-defined value. The above example is only for explaining this application and should not be construed as limiting it.
[0116] The protocol identifier field can have a data length of 1 byte. In the first NFC protocol, the protocol identifier field of the NFC transmission frame indicates that the NFC transmission frame is transmitted using the first NFC protocol. Specifically, the protocol identifier field in the Probe frame can be used to indicate the first NFC protocol used by the NFC reader device 200 when sending the Probe frame. The value of the protocol identifier field can be an identifier of the first NFC protocol, for example, "0x7C".
[0117] The protocol version field can be used to indicate the version of the first NFC protocol.
[0118] S503. After receiving the probe frame, the electronic device 100 sends a probe ACK frame to the NFC reader device 200.
[0119] The Probe ACK frame can be used to indicate that the electronic device 100 has received the Probe frame. The Probe ACK frame can also be used to indicate that the electronic device 100 supports the first NFC protocol indicated by the Probe frame.
[0120] If the electronic device 100 does not support the first NFC protocol indicated by the Probe frame, the electronic device 100 may not send a Probe ACK frame.
[0121] S504. After receiving the Probe ACK frame, the NFC card reader 200 sends a Notify frame to the electronic device 100. The Notify frame carries the device feature information of the NFC card reader 200.
[0122] The device characteristic information may include, but is not limited to, the service identifier (SID) and the device organization identifier (also known as the NFC device organization unique identifier (ND_OUI)).
[0123] Optionally, device characteristic information may include one or more of the following: Service Identifier (SID), Device Organization Identifier (ND_OUI), and Device Group Identifier (also known as NFC Device Group Identifier (ND_GID)).
[0124] 1. The Service Identifier (SID) can be used to indicate the type of NFC service supported by the NFC reader device 200 on the basis of NFC functionality.
[0125] In one possible implementation, the NFC service type can include a primary service type and a sub-service type. Therefore, the service identifier can include a primary service identifier and a sub-service identifier. The primary service identifier can be used to indicate the primary service type supported by the NFC reader 200, and the sub-service identifier can be used to indicate the sub-service types supported by the NFC reader 200 under a certain primary service type. The primary service type can include one or more of the following: access control, keys, transportation, banking, digital currency, digital certificates, codeless payment, electronic tickets, wireless charging, contactless payment, multi-function cards, etc. The sub-service types corresponding to access control can include one or more of the following: community access control, enterprise access control, government access control, campus access control, etc. The sub-service types corresponding to keys can include one or more of the following: smart locks, Intelligent Car Connectivity Industry Ecosystem Alliance (ICCE) car keys, Car Connectivity Consortium (CCC) car keys, Intelligent Car Connectivity Open Alliance (ICCOA) car keys, hotel room cards, etc. The sub-service types for transportation cards can include one or more of the following: transportation cards within China and transportation cards outside China. The sub-service types for banks can include one or more of the following: UnionPay, UnionPay International, Visa, and Mastercard. The sub-service types for digital currencies can include digital currencies as defined by the People's Bank of China. The sub-service types for digital certificates can include one or more of the following: ID cards, Hong Kong and Macau travel permits, driver's licenses, social security cards, and passports. The sub-service types for code-free payment can include one or more of the following: general services, membership card discount services, and payment institution discount services. The sub-service types for electronic tickets can include electronic ticketing for park entry. The sub-service types for wireless charging can include wireless charging. The sub-service types for tap-to-pay can include one or more of the following: tap-to-pair, tap-to-multi-screen collaboration, tap-to-transfer audio, tap-to-transfer image, tap-to-add friends, and tap-to-transfer. The sub-service types for multi-functional cards can include one or more of the following: multi-functional all-in-one cards.
[0126] The main service identifier can occupy 1 byte, and the sub-service identifier can occupy 1 byte. For example, when the main service identifier is "0x01", the main service type is access control. If the sub-service identifier is "0x01", the sub-service type is community access control. If the sub-service identifier is "0x02", the sub-service type is enterprise access control. If the sub-service identifier is "0x03", the sub-service type is government access control. If the sub-service identifier is "0x04", the sub-service type is campus access control. When the main service type is access control, the sub-service identifier values "0x00" and "0x05~0xFF" can be reserved for protocol extensions.
[0127] For example, if the primary service identifier is "0x02", the primary service type is a key. If the sub-service identifier is "0x01", the sub-service type is a smart lock. If the sub-service identifier is "0x02", the sub-service type is an ICCE car key. If the sub-service identifier is "0x03", the sub-service type is a CCC car key. If the sub-service identifier is "0x04", the sub-service type is an ICCOA car key. If the sub-service identifier is "0x05", the sub-service type is a hotel room key. When the primary service type is a key, the sub-service identifier values "0x00" and "0x06~0xFF" can be reserved for protocol extensions, and so on. It is understood that the above examples are merely for explaining this application and should not be construed as limiting this application.
[0128] 2. The Device Organization Identifier (ND_OUI) can be used to indicate the manufacturer providing NFC services using the NFC card reader device 200. The NFC protocol standards organization's registration management agency can assign different Device Organization Identifiers to different manufacturers. For example, manufacturers providing NFC services may include one or more smart lock manufacturers, one or more property management companies, one or more automotive parts manufacturers, one or more transportation card management departments, etc.
[0129] For example, if the NFC service of the NFC card reader 200 is for community access control, the device organization identifier of the NFC card reader 200 can be the organization identifier applied for by the property management company to which the NFC card reader 200 belongs to the NFC standards organization. For example, the device organization identifier applied for by Vanke Property Management Company to the registration management agency of the NFC standards organization can be "0x1A3B27".
[0130] If the NFC service provided by the NFC reader 200 is for smart locks, the device organization identifier of the NFC reader 200 can be the organization identifier applied for by the smart lock manufacturer to which the NFC reader 200 belongs from the NFC standards organization.
[0131] If the NFC service provided by the NFC reader 200 is a car key, the device organization identifier of the NFC reader 200 can be the organization identifier applied for by the vehicle manufacturer to which the NFC reader 200 belongs to the NFC standards organization.
[0132] If the NFC service provided by the NFC card reader 200 is a multi-functional all-in-one card, the device organization identifier of the NFC card reader 200 can be the organization identifier applied for by the all-in-one card issuing organization to the NFC standards organization. The PICC corresponding to the multi-functional all-in-one card can include campus cards, employee cards, and other cards with multiple functions such as access control, stored value, and consumption. The all-in-one card issuing organization to which the NFC card reader 200 belongs can include organizations such as companies and schools.
[0133] The above examples are merely for explaining this application and should not be construed as limiting this application.
[0134] 3. The Device Group Identifier (ND_GID) can be used to indicate the group to which the NFC services provided by the NFC reader 200 belong. The Device Group Identifier can be assigned based on the purpose and location of the NFC reader 200. Different NFC services can be assigned to different groups.
[0135] For example, if the NFC service provided by the NFC reader 200 is community access control, the device group identifier of the NFC reader 200 may include a hash value obtained by hashing the city name and the community name together, and a random number. For instance, the data length of the device group identifier of the NFC reader 200 can be 6 bytes, the hash value obtained by hashing the city name and the community name together can be located in the first 4 bytes of the device group identifier, and the random number can be located in the last 2 bytes of the device group identifier.
[0136] If the NFC service provided by the NFC reader 200 is a smart lock, the device group identifier of the NFC reader 200 may include the hash value obtained by hashing the serial number (SN) of the NFC reader 200, and a random number. For example, the data length of the device group identifier of the NFC reader 200 can be 6 bytes, the hash value obtained by hashing the serial number (SN) of the NFC reader 200 can be located in the first 4 bytes of the device group identifier, and the random number can be located in the last 2 bytes of the device group identifier.
[0137] If the NFC service provided by the NFC reader 200 is a car key, the device group identifier of the NFC reader 200 may include the hash value obtained by hashing the vehicle identification number (VIN) of the NFC reader 200, and a random number. For example, the data length of the device group identifier of the NFC reader 200 can be 6 bytes, the hash value obtained by hashing the vehicle identification number of the NFC reader 200 can be located in the first 4 bytes of the device group identifier, and the random number can be located in the last 2 bytes of the group identifier.
[0138] If the NFC service provided by the NFC card reader 200 is a multi-functional all-in-one card, the device group identifier of the NFC card reader 200 can be a preset value.
[0139] The above examples are merely for explaining this application and should not be construed as limiting this application.
[0140] Optionally, the Notify frame may also include an element code, an identifier mask, a device type identifier, and a device individual identifier.
[0141] Element codes are used to identify control elements. These control elements can include one or more of the following: device identification elements, card identification elements, transmission capability elements, and security algorithm elements. Control elements can be flexibly combined and carried in the NFC control frame. Since the Notify frame carries the device identification element, the element code in the Notify frame is used to indicate the identification of this element. The element code can be 1 byte long; for example, the element code for the device identification element can be "0x00", the element code for the card identification element can be "0x01", the element code for the transmission capability element can be "0x02", and the element code for the security algorithm element can be "0x03". The values of the element code "0x04~0xFF" can be reserved for protocol extensions or manufacturer-defined uses.
[0142] The identifier mask in the device identifier element can be used to indicate the type of device identifier carried in the device identifier element. The data length of the identifier mask can be 1 byte.
[0143] Device identifiers may include one or more of the following: device type identifier (also known as NFC device type identifier (ND_TID)), service identifier (SID), device organization identifier (ND_OUI), device group identifier (ND_GID), and device private identifier (also known as NFC device private identifier (ND_PID)).
[0144] The device type identifier can be used to indicate the device type of the NFC card reader 200. The device type indicated in the device type identifier can include any of the following: mobile phone, wearable device, card reader that does not require interaction with electronic devices, card reader that requires interaction with electronic devices, etc.
[0145] The Device Individual Identifier (ND_PID) can be used to indicate the individual identifier of the NFC card reader 200 within a class of card readers under the same device organization identifier and the same device group identifier. The manufacturer of the NFC card reader 200 needs to ensure that the device individual identifiers of card readers within a class of card readers with the same device organization identifier and the same device group identifier are different.
[0146] In one possible implementation, after the electronic device 100 obtains the device feature information of the NFC card reader 200 from the Notify ACK frame, it can execute the action corresponding to the device feature information of the NFC card reader 200. The action corresponding to the device feature information of the NFC card reader 200 may include outputting an NFC service prompt. For example, the NFC service prompt may be any one or more of the following: a swipe prompt for an NFC analog card (e.g., access card, key card, transportation card, bank card), a wireless charging prompt, a codeless payment prompt, an electronic ticket prompt, a tap-to-pay function prompt, or a multi-function card prompt.
[0147] In some examples, after receiving device feature information from the NFC card reader 200, the electronic device 100 can determine the first NFC simulated card of the first NFC protocol at the application layer based on the device feature information of the NFC card reader 200. After determining the first NFC simulated card, the electronic device 100 outputs a card swipe prompt for the first NFC simulated card.
[0148] After activating one or more NFC emulator cards, the electronic device 100 can store the device feature information corresponding to each of the one or more NFC emulator cards. Different NFC emulator cards correspond to different device feature information. Based on the device feature information of the NFC reader 200, the electronic device 100 can determine the first NFC emulator card corresponding to the first NFC protocol from among the one or more NFC emulator cards on the electronic device 100. For example, the correspondence between device feature information and NFC emulator cards can be shown in Table 1 below:
[0149] Table 1
[0150]
[0151] As shown in Table 1 above, device feature information 1 corresponds to the access card of Community A. The main service identifier of device feature information 1 can be "0x01", the sub-service identifier can be "0x01", the device organization identifier can be "0x1A3B27", and the device group identifier can be "0x18ed29d7c6d5". Device feature information 2 corresponds to the access card of Community B. The main service identifier of device feature information 2 can be "0x01", the sub-service identifier can be "0x01", the device organization identifier can be "0x1A3B27", and the device group identifier can be "0x89b6337b0006". Device feature information 3 corresponds to the access card of Community C. The main service identifier of device feature information 3 can be "0x01", the sub-service identifier can be "0x01", the device organization identifier can be "0x1A3B29", and the device group identifier can be "0x7b04481a15c0". Device characteristic information 4 corresponds to the Shenzhen Tong transportation card. The main service identifier for device characteristic information 4 can be "0x03", the sub-service identifier can be "0x01", and the device organization identifier can be "0x2C3D11". Device characteristic information 5 corresponds to the home door lock key card. The main service identifier for device characteristic information 5 can be "0x02", the sub-service identifier can be "0x01", the device organization identifier can be "0x332A99", and the device group identifier can be "0x5ea970d54450". Device characteristic information 6 corresponds to the vehicle M9 key card. The main service identifier for device characteristic information 6 can be "0x02", the sub-service identifier can be "0x02", the device organization identifier can be "0x37BCA1", and the device group identifier can be "0x38d112bd15d3".
[0152] For example, the device feature information of the NFC card reader 200 is the device feature information 1 shown in Table 1 above. After receiving the Notify frame carrying the NFC card reader 200, the electronic device 100 determines that the first NFC analog card matching the device feature information of the NFC card reader 200 is the access card of community A.
[0153] The examples shown in Table 1 above are merely for explaining this application and should not be construed as limiting the embodiments of this application.
[0154] The wallet application of electronic device 100 can manage and store the mapping relationship between device feature information and NFC emulator cards. For example, the mapping relationship between device feature information and NFC emulator cards can be stored in the wallet application or in the trusted execution environment (TEE) of processor 101. The wallet application can determine the first NFC emulator card of the first NFC protocol from one or more NFC emulator cards of electronic device 100 based on the device feature information of NFC card reader 200 and the mapping relationship between the device feature information and NFC emulator cards. The wallet application running in processor 101 can display a swipe prompt for the first NFC emulator card. It should be noted that the wallet application is only an example; electronic device 100 can also store this mapping relationship through other applications used to manage NFC emulator cards.
[0155] The swipe notification of the first NFC simulated card can be used to indicate that an electronic device is using the first NFC simulated card for swiping. The swipe notification of the first NFC simulated card can include one or more of the following: image notification, text notification, audio notification, and vibration notification. Image notifications include one or more of the following: static image notification, dynamic image notification, and video notification.
[0156] For example, after identifying the first NFC emulated card, the wallet application can display a swiping interface for the first NFC emulated card. This interface can include information about the first NFC emulated card. For instance, the information could be a card-shaped icon displaying the name of the first NFC emulated card. The swiping interface can be used to notify the user's electronic device 100 that it is using the first NFC emulated card for swiping.
[0157] In another possible implementation, the correspondence between device feature information and NFC emulator cards can be managed and stored by the NFC module 102 (e.g., stored internally in the NFC module 102 or in the SE). Upon receiving a Notify frame, the NFC module 102 in the electronic device 100 can determine the first NFC emulator card from one or more NFC emulator cards in the electronic device 100 based on the device feature information of the NFC card reader 200. Then, the NFC module 102 can send the identifier of the first NFC emulator card to an application running in the processor 101 (e.g., a wallet application), causing the application to display a swipe notification for the first NFC emulator card.
[0158] S505. Electronic device 100 sends a Notify ACK frame to NFC card reader 200.
[0159] After receiving a Notify frame, electronic device 100 can send a Notify ACK frame to NFC reader device 200. The Notify ACK frame can be used to notify NFC reader device 200 that electronic device 100 has successfully received the Notify frame.
[0160] After receiving a Notify ACK frame, the S506.NFC card reader 200 can send a parameter negotiation command to the electronic device 100.
[0161] S507. After receiving the parameter negotiation command, the electronic device 100 can send a parameter negotiation response to the NFC card reader 200.
[0162] The parameter negotiation command can be a command frame, and the parameter negotiation response can be a response frame. These parameter negotiation commands and responses can be used by the NFC reader 200 and the electronic device 100 to negotiate data transmission parameters at the application layer. These data transmission parameters may include one or more of the following: maximum transmission rate and maximum data transmission length during application layer data transmission.
[0163] After completing the access layer signaling interaction process, the NFC card reader 200 and the electronic device 100 can perform application layer data transmission. Specifically, the NFC card reader 200 and the electronic device 100 can perform application layer data transmission according to the data transmission parameters negotiated through parameter negotiation commands and responses.
[0164] In one possible implementation, steps S506 and S507 are optional. If the NFC card reader 200 does not need to send a parameter negotiation command to the electronic device 100 after receiving the Notify ACK frame, the NFC card reader 200 and the electronic device 100 can perform application layer data transmission using the default data transmission parameters.
[0165] After receiving the parameter negotiation response, the S508.NFC card reader 200 sends a Select AID command to the electronic device 100, wherein the Select AID command carries the identifier of the first Applet.
[0166] In the electronic device 100, the service processing logic of the NFC emulator card is specifically implemented by an Applet. The Applet can be stored and run in the corresponding hardware device or software module (e.g., HCE application, SIM card, SE, etc.) of the NFC emulator card. Since one or more NFC emulator cards are activated on the electronic device 100, there can be one or more Applets on the electronic device 100. One NFC emulator card corresponds to one Applet. The Applets corresponding to different NFC emulator cards may be different or the same. The first NFC emulator card corresponds to the first Applet. The NFC card reader 200 can send a command instructing the first Applet to the electronic device 100 at the application layer. After receiving the command, the electronic device 100 can send the card information of the first NFC emulator card to the NFC card reader 200 through the first Applet.
[0167] S509. Electronic device 100 determines the first NFC analog card corresponding to the first Applet based on the identifier of the first Applet.
[0168] In some embodiments of this application, the electronic device 100 can obtain the identifier of the first Applet carried in the select AID command and determine whether there is an NFC simulation card corresponding to the first Applet among one or more NFC simulation cards included in the electronic device 100. When the electronic device 100 has the first NFC simulation card corresponding to the first Applet activated, the electronic device 100 can send the card information of the first NFC simulation card of the first NFC protocol corresponding to the first Applet to the NFC card reader 200.
[0169] S510. After determining the first NFC analog card corresponding to the first Applet, the electronic device 100 sends the card information of the first NFC analog card to the NFC card reader 200 through the first Applet.
[0170] In some examples, the card information of the first NFC analog card may include one or more of the following: access control information, key information, transaction account information, and electronic ticket information. Access control information may include one or more of the following: card number, card validity period, etc. Key information may include one or more of the following: key code, key code validity period, etc. Transaction account information may include one or more of the following: transaction account identifier, remaining balance in the transaction account, etc. Electronic ticket information may include one or more of the following: electronic ticket code, electronic ticket verification time, electronic ticket validity period, etc.
[0171] After obtaining the card information of the first NFC simulated card, the NFC card reader 200 can perform card swiping services based on the card information of the first NFC simulated card. These card swiping services can include, but are not limited to, any of the following: opening access control systems, unlocking doors, unlocking vehicles, making payments, verifying electronic tickets, verifying digital documents, and using transportation cards to board and alight.
[0172] Specifically, electronic device 100 can send the card information of the first NFC simulated card to NFC card reader 200 via NFC data interaction. NFC card reader 200 can then perform a card swiping transaction based on the card information of the first NFC simulated card. NFC card reader 200 can also send the card swiping result of the first NFC simulated card to electronic device 100 via NFC command interaction.
[0173] It should be noted that steps S502 to S507 are implemented by the NFC card reader 200 and the electronic device 100 at the access layer, belonging to the signaling interaction process of the access layer in the first NFC protocol. Steps S508 to S510 are implemented by the NFC card reader 200 and the electronic device 100 at the application layer, belonging to the signaling interaction process of the application layer in the first NFC protocol.
[0174] In one possible implementation, both the electronic device 100 and the NFC card reader 200 support a second NFC protocol. The electronic device 100 and the NFC card reader 200 can implement the NFC analog card swiping process based on the second NFC protocol. Thus, when the electronic device 100 supports the second NFC protocol, it can implement the NFC analog card swiping process using the second NFC protocol on the NFC card reader 200.
[0175] In some examples, the second NFC protocol can be the ISO14443 protocol or the IEC14443 protocol. The following section uses the ISO14443 protocol as an example to describe the interaction process between the electronic device 100 and the NFC reader 200.
[0176] Specifically, when electronic device 100 enters the radio frequency field emitted by NFC card reader 200, electronic device 100 can receive a Type A request command (REQA) of the second NFC protocol emitted by NFC card reader 200. Upon receiving the REQA, electronic device 100 can send a Type A response (ATQA) of the second NFC protocol to NFC card reader 200. Upon receiving the ATQA, NFC card reader 200 can send a select command to electronic device 100. Upon receiving the select command, electronic device 100 can send the unique identifier (UID) of the NFC emulator card of the second NFC protocol to NFC card reader 200. NFC card reader 200 can verify the card swiping result of the NFC emulator card of the second NFC protocol based on the UID. The NFC emulator card of the second NFC protocol can be an NFC emulator card selected by the user, or a default NFC emulator card set by electronic device 100. In this way, the electronic device 100 can use the second NFC protocol to communicate with the NFC card reader 200 to implement the NFC analog card swiping process of the second NFC protocol.
[0177] For example, such as Figure 6 As shown, this NFC processing method can be applied to an NFC system 10 including an electronic device 100 and an NFC card reader 200. The NFC card reader 200 can operate in PCD mode. The electronic device 100, after enabling the NFC function, is in PICC mode by default. The card-swiping process executed by the electronic device 100 and the NFC card reader 200 based on the second NFC protocol may include the following steps:
[0178] S601. Electronic device 100 enters the radio frequency energy field of NFC card reader 200.
[0179] S602. NFC card reader 200 sends a Class A request command (REQA).
[0180] The REQA can be used to indicate that the NFC reader 200 supports a second NFC protocol. The NFC reader 200 can send the REQA periodically. For example, the REQA can be encoded as 0x26.
[0181] S603. After receiving the REQA, the electronic device 100 sends an A-type request response (ATQA) to the NFC card reader 200.
[0182] ATQA can be used to indicate that electronic device 100 supports the second NFC protocol indicated by REQA. It is understood that if electronic device 100 does not support the second NFC protocol, it may not send ATQA. For example, the ATQA encoding could be 0x0800.
[0183] S604. After sending ATQA to NFC card reader 200, electronic device 100 receives a first select command.
[0184] After receiving the ATQA, the NFC card reader 200 sends a first selection command to the electronic device 100. This first selection command can instruct the electronic device 100 to send the unique identifier of the NFC analog card. For example, the encoding of the first selection command can be 0x9320.
[0185] S605. After receiving the first selection command, the electronic device 100 sends a selection response to the NFC card reader 200, including the UID of the second NFC analog card.
[0186] The second NFC emulator is an NFC emulator using the second NFC protocol. When activating the second NFC emulator, the electronic device 100 can write the access layer parameters (including the UID) of the second NFC emulator into the NFC module 102. After receiving the first selection command, the NFC module 102 of the electronic device 100 can send a selection response carrying the UID of the second NFC emulator to the NFC reader 200.
[0187] In some examples, after receiving input from the user to select a second NFC simulated card, the electronic device 100 can simulate the second NFC simulated card and, upon entering the NFC card reader 200, implement the card swiping process of the second NFC simulated card.
[0188] In some examples, the second NFC emulator card is the default NFC emulator card. If the second NFC emulator card is not an NFC emulator card supported by the NFC card reader 200, the electronic device 100 will fail to swipe the card. Afterwards, the user needs to manually switch to the emulator card and re-execute the swipe process with the NFC card reader 200 to successfully swipe the card, which is cumbersome and time-consuming.
[0189] It should be noted that when the second NFC simulation card is not activated, the NFC module 102 of the electronic device 100 that supports the second NFC protocol can randomly generate a UID after receiving the first selection command, and send the selection response carrying the randomly generated UID to the NFC card reader 200.
[0190] It should also be noted that after the NFC card reader 200 receives an ATQA from an NFC device, it sends a first selection command without carrying a UID. Upon receiving the first selection command, the electronic device 100 can send a selection response to the NFC card reader 200, the selection response including the UID of the NFC analog card using the second NFC protocol. Upon receiving the selection response, the NFC card reader 200 can send a second selection command to the electronic device 100 carrying the UID of the electronic device 100.
[0191] After receiving ATQA signals from multiple NFC devices, the NFC reader 200 sends an anti-collision command. The NFC reader 200 can perform an anti-collision procedure with the multiple NFC devices. In this procedure, the multiple NFC devices send X bytes of their UIDs to the NFC reader 200. Upon receiving these X bytes, the NFC reader 200 selects one X byte from the selected X bytes and sends an anti-collision command carrying the selected X bytes to the multiple NFC devices until the NFC reader 200 selects the UID sent by one of the NFC devices (e.g., electronic device 100). Afterward, the NFC reader 200 can send a second selection command carrying the UID of electronic device 100 to electronic device 100. In other words, when the NFC card reader 200 receives ATQA from multiple NFC devices, the first selection command in step S604 that does not carry the UID of the electronic device 100 can be regarded as an anti-collision command, and the selection response in step S605 that carries the UID of the electronic device 100 can be regarded as an anti-collision response of the UID of the electronic device 100.
[0192] S606. After receiving the UID of the second NFC emulated card, the NFC card reader 200 sends a second selection command to the electronic device 100, including the UID of the second NFC emulated card.
[0193] For example, the encoding of the second selection command may include 0x9370. The second selection command may carry the UID of the second NFC emulation card.
[0194] S607. After receiving the second selection command, the electronic device 100 sends a select acknowledgment (SAK) command to the NFC card reader 200.
[0195] S608. When the SAK command indicates that the second NFC analog card does not support the application layer protocol, the card swipe result is determined based on the UID sent by the electronic device 100.
[0196] The selection confirmation command can be used to indicate whether the second NFC-enabled NFC analog card supports application layer protocols (such as ISO14443-4 or IEC14443-4). If the SAK received by the NFC reader 200 indicates that the second NFC-enabled NFC analog card does not support application layer protocols, the NFC reader 200 can perform a card swipe verification process, that is, the NFC reader 200 can determine the card swipe result of the second NFC-enabled NFC analog card based on the UID of the second NFC-enabled NFC analog card. If the SAK received by the NFC reader 200 indicates that the second NFC-enabled NFC analog card supports application layer protocols, the NFC reader 200 and the electronic device 100 can perform an application layer signaling interaction process (also known as an application layer interaction process) based on the second NFC protocol. Specifically, the electronic device 100 can send the card information of the second NFC-enabled NFC analog card to the NFC reader 200 at the application layer based on the second NFC protocol. The NFC reader 200 can then perform the card swipe service of the second NFC-enabled NFC analog card at the application layer based on the card information of the second NFC-enabled NFC analog card. In some examples, the Select Confirmation command can be 0x08 when the Select Confirmation command indicates that the NFC emulator card of the second NFC protocol does not support the application layer protocol.
[0197] For example, when electronic device 100 sends an SAK command indicating that the NFC simulation card of the second NFC protocol supports the application layer protocol, NFC card reader 200 can send a Request for Answer to Select (RATS) command to electronic device 100. Electronic device 100 can also send an Answer to Select (ATS) command to NFC card reader 200. The ATS command can be used by electronic device 100 and NFC card reader 200 to negotiate the communication parameters used in the communication process of the application layer protocol. NFC card reader 200 can obtain the communication parameters used to implement the communication process of the application layer protocol from electronic device 100 according to the ATS command. Furthermore, NFC card reader 200 can determine whether the communication parameters meet its preset requirements, such as whether the communication parameters are the same as the communication parameters required by NFC card reader 200 for implementing the application layer protocol. If the result is yes, the verification passes; otherwise, the verification fails. When the NFC card reader 200 passes the ATS command verification, the NFC card reader 200 and the electronic device 100 can transmit the application protocol data unit (APDU) in the application layer protocol to realize the card swiping service of the NFC simulated card of the second NFC protocol.
[0198] In some examples, when the NFC-enabled NFC card using the second NFC protocol is an access card, the SAK command sent by the electronic device 100 indicates that the NFC-enabled NFC card using the second NFC protocol does not support the application layer protocol. The NFC card reader 200 can determine the card swiping result of the NFC-enabled NFC card based on its UID. When the NFC card reader 200 determines that the card swiping was successful based on the UID of the NFC-enabled NFC card, it can also open the access control, allowing the user holding the electronic device 100 to pass through. When the NFC card reader 200 determines that the card swiping failed based on the UID of the NFC-enabled NFC card, it can keep the access control closed, preventing the user holding the electronic device 100 from passing through. Optionally, the NFC card reader 200 can also send the card swiping result of the NFC-enabled NFC card using the second NFC protocol to the electronic device 100 via NFC command interaction. After receiving the card swiping result, the electronic device 100 can also display a prompt message to inform the user of the card swiping result.
[0199] As can be seen from the above card-swiping process, when electronic device 100 only supports the second NFC protocol, if a user wants to use electronic device 100 in PICC mode to perform a target NFC service, they need to open the application, manually select the target NFC simulation card corresponding to the target NFC service, and then bring electronic device 100 close to the NFC card reader to complete the target NFC service. This means that every time a user wants to use the NFC service, they need to open the application and reselect the target NFC simulation card, which is very inconvenient for the user.
[0200] In some examples, users can set a frequently used NFC emulator as the default NFC emulator within the application. This way, when the electronic device 100 is near the NFC reader, it can use the data from the default NFC emulator to interact with the NFC reader. However, if the default NFC emulator is incompatible with the NFC reader, the user still needs to open the application on the electronic device 100 and reselect the target NFC emulator to interact with the NFC reader. This prevents the electronic device 100 from automatically and accurately selecting the appropriate NFC emulator.
[0201] When electronic device 100 only supports the first NFC protocol, electronic device 100 can determine the NFC analog card corresponding to NFC card reader 200 through the device feature information of NFC card reader 200, which allows electronic device 100 to automatically and accurately select the appropriate NFC analog card, thereby improving the speed and efficiency of NFC card swiping.
[0202] In one possible implementation, the electronic device 100 supports both a first NFC protocol and a second NFC protocol at the access layer. If the NFC card reader 200 also supports both the first and second NFC protocols, the electronic device 100 and the NFC card reader 200 can implement the card-swiping process based on the first NFC protocol, improving card-swiping efficiency. If the NFC card reader 200 only supports the second NFC protocol, the electronic device 100 and the NFC card reader 200 can implement the card-swiping process based on the second NFC protocol, enabling the electronic device 100 to successfully swipe its card on the NFC card reader 200.
[0203] Thus, when electronic device 100 supports both the first and second NFC protocols, it can interact with NFC card reader 200 using either the first or second NFC protocol based on NFC-enabled NFC analog cards with different communication protocols, thereby implementing the NFC analog card swiping process. However, when electronic device 100 only supports the second NFC protocol at the access layer, it cannot achieve the same card swiping effect as the first NFC protocol, resulting in low swiping efficiency and cumbersome card selection. Therefore, how to achieve compatibility with multiple NFC protocols and realize better card swiping performance is an urgent problem to be solved.
[0204] This application provides an NFC processing method. Electronic device 100 supports a second NFC protocol at the access layer but does not support a first NFC protocol. Electronic device 100 activates an NFC simulation card using the first NFC protocol. NFC card reader 200 supports both the first and second NFC protocols; that is, NFC card reader 200 supports both the first and second NFC protocols at both the access layer and the application layer.
[0205] The NFC card reader 200 can poll and send card search requests using both the first and second NFC protocols. Upon entering the radio frequency field of the NFC card reader 200 and receiving both requests, the electronic device 100 sends a card search response using the second NFC protocol to the NFC card reader 200. After receiving the response, the NFC card reader 200 can then perform access layer signaling interaction procedures with the electronic device 100 based on the second NFC protocol.
[0206] After completing the access layer signaling interaction process with the electronic device 100 based on the first NFC protocol, the NFC card reader 200 executes the application layer signaling interaction process with the electronic device 100 based on the first NFC protocol. The electronic device 100 can send card information of the NFC simulated card (based on the first NFC protocol) to the NFC card reader 200 at the application layer based on the first NFC protocol. The NFC card reader 200 can then perform card swiping services using the NFC simulated card (based on the first NFC protocol) at the application layer.
[0207] In this way, even when the access layer does not support the first NFC protocol, the electronic device 100 can still perform the card swiping operation of the NFC simulated card of the first NFC protocol through the NFC processing method provided in the embodiments of this application, so that the electronic device 100 and the NFC card reader 200 can be compatible with multiple NFC protocols and achieve better card swiping effect.
[0208] The following describes an NFC processing method provided in an embodiment of this application.
[0209] Figure 7 An exemplary flowchart of an NFC processing method provided in an embodiment of this application is shown.
[0210] like Figure 7 As shown, this NFC processing method can be applied to a communication system including an electronic device 100 and an NFC card reader 200. The NFC card reader 200 can operate in PCD mode. The electronic device 100, after enabling the NFC function, is in PICC mode by default. The NFC processing method may include the following steps:
[0211] S701. Electronic device 100 enters the radio frequency energy field of NFC card reader 200.
[0212] S702. The NFC card reader 200 sends a card search request using the first NFC protocol to the electronic device 100.
[0213] S703. NFC card reader 200 sends a card search request using the second NFC protocol to electronic device 100.
[0214] In some embodiments of this application, the PCD mode NFC card reader 200 can broadcast a card search request via a radio frequency field. When the PICC mode electronic device 100 enters the radio frequency field of the NFC card reader 200, the electronic device 100 can receive the card search request broadcast by the NFC card reader 200. The NFC card reader 200 can periodically send card search requests using a first NFC protocol and a second NFC protocol.
[0215] In some embodiments of this application, the first NFC protocol can be Figure 5 The NFC protocol shown can be a second NFC protocol. Figure 6 The NFC protocol is shown. The first NFC protocol's card search request can be... Figure 5 The Probe frame shown. The second NFC protocol's card search request can be... Figure 6 REQA shown.
[0216] S704. After receiving the card search request of the first NFC protocol and the card search request of the second NFC protocol, the electronic device 100 sends the card search response of the second NFC protocol to the NFC card reader 200.
[0217] The first NFC protocol card search request is used to indicate that the NFC card reader 200 supports the first NFC protocol. The second NFC protocol card search request is used to indicate that the NFC card reader 200 supports the second NFC protocol.
[0218] After receiving both the card search request using the first NFC protocol and the card search request using the second NFC protocol, the electronic device 100, since it supports the second NFC protocol but not the first NFC protocol at the access layer, can recognize the card search request using the second NFC protocol and send a card search response using the second NFC protocol to the NFC card reader 200. Upon receiving the card search response using the second NFC protocol, the NFC card reader 200 determines that the electronic device 100 supports the second NFC protocol.
[0219] Understandably, because the NFC module 102 of the electronic device 100 does not store the access layer signaling of the first NFC protocol, the electronic device 100 cannot recognize the card search request of the first NFC protocol after receiving it, until it receives the card search request of the second NFC protocol and sends a card search response of the second NFC protocol to the NFC card reader 200. The card search response of the second NFC protocol is used to indicate that the electronic device 100 supports the second NFC protocol.
[0220] S705. Electronic device 100 and NFC card reader 200 implement access layer interaction process based on the second NFC protocol.
[0221] After receiving a card search response from the second NFC protocol, the NFC card reader 200 determines that the electronic device 100 supports the second NFC protocol. The NFC card reader 200 can then perform access layer signaling interaction procedures with the electronic device 100 based on the second NFC protocol.
[0222] S706. The NFC card reader 200, based on the first NFC protocol, performs card swiping services of the first NFC analog card with the electronic device 100 at the application layer.
[0223] After the NFC card reader 200 and the electronic device 100 complete the access layer signaling interaction process, the NFC card reader 200 can perform the application layer signaling interaction process with the electronic device 100 based on the first NFC protocol at the application layer.
[0224] When the electronic device 100 activates an NFC-enabled NFC simulation card using the first NFC protocol, it can send the card information of the NFC simulation card to the NFC card reader 200 at the application layer based on the first NFC protocol. The NFC card reader 200 can then perform card-swiping operations on the NFC simulation card using the first NFC protocol at the application layer based on the card information. For details, please refer to... Figure 5 The description of steps S508 to S510 is shown.
[0225] Thus, when the electronic device 100 does not support the first NFC protocol at the access layer but has activated an NFC simulation card using the first NFC protocol, the NFC processing method provided in this application embodiment can be used to implement the card-swiping service of the NFC simulation card using the first NFC protocol, ensuring compatibility with different NFC protocols. In some application scenarios, when the NFC simulation card using the first NFC protocol activated by the electronic device 100 is an access control card, since the NFC card reader 200 can obtain the card information of the access control card at the application layer based on the first NFC protocol, it can also select the access control card through the first NFC protocol, eliminating the need for the user to manually select the card, making card swiping more convenient.
[0226] It should be noted that when the NFC simulated card of the first NFC protocol activated by the electronic device 100 is matched with the NFC card reader 200, the NFC card reader 200 successfully performs the card swiping service of the NFC simulated card of the first NFC protocol with the electronic device 100 at the application layer.
[0227] When the NFC simulation card of the first NFC protocol activated by the electronic device 100 does not match the NFC card reader 200, the electronic device 100 fails to select the NFC simulation card applet, or the NFC card reader 200 fails to verify the card information, and the NFC card reader 200 fails to perform the card swiping service of the NFC simulation card of the first NFC protocol with the electronic device 100 at the application layer.
[0228] It should also be noted that when the electronic device 100 has not activated the NFC simulation card of the first NFC protocol, the electronic device 100 fails to select the Applet of the NFC simulation card of the first NFC protocol at the application layer, the electronic device 100 fails to send card information to the NFC card reader 200 at the application layer, and the NFC card reader 200 fails to perform the card swiping business of the NFC simulation card of the first NFC protocol with the electronic device 100 at the application layer.
[0229] In some examples, electronic device 100 activates an NFC emulator card with the first NFC protocol. Electronic device 100 can identify the signaling of the first NFC communication protocol through the applet of the NFC emulator card with the first NFC protocol, and send the signaling of the first NFC communication protocol to NFC card reader 200 through the applet.
[0230] The S707 NFC card reader 200 failed to execute a card swiping transaction for the first NFC analog card at the application layer.
[0231] When the electronic device 100 does not activate the NFC simulation card of the first NFC protocol matched with the NFC card reader 200 (including the electronic device 100 not activating the simulation card of the first NFC protocol), the electronic device 100 and the NFC card reader 200 fail to execute the application layer signaling interaction process based on the first NFC protocol, and the NFC card reader 200 can execute step S708.
[0232] The S708 NFC card reader 200 performs a card-swiping interaction process with the electronic device 100 based on the second NFC protocol.
[0233] After the NFC card reader 200 fails to perform a card swiping transaction with the electronic device 100 at the application layer, it can realize the card swiping interaction process with the electronic device 100 based on the second NFC protocol.
[0234] It should be noted that, in this embodiment of the application, if the NFC simulation card of the second NFC protocol simulated by the electronic device 100 does not support the application layer signaling interaction process, the NFC card reader 200 performs a card swiping interaction process with the electronic device 100 based on the second NFC protocol, which includes performing an access layer signaling interaction process and performing a card swiping verification process based on the second NFC protocol. Specifically, the NFC card reader 200 can obtain the UID of the NFC simulation card of the second NFC protocol from the electronic device 100 at the access layer. The NFC card reader 200 performs a card swiping verification process, which includes verifying the obtained UID to determine the card swiping result and performing the card swiping service upon successful swiping.
[0235] If the NFC-enabled card simulating the second NFC protocol simulated by electronic device 100 supports application layer signaling interaction, the NFC card reader 200 performs a card-swiping interaction process with electronic device 100 based on the second NFC protocol. This includes performing access layer signaling interaction and performing access layer signaling interaction based on the second NFC protocol. Specifically, the NFC card reader 200 can obtain the card information of the NFC-enabled card simulating the second NFC protocol from electronic device 100 at the application layer, and can perform card-swiping services for the NFC-enabled card simulating the second NFC protocol based on the card information.
[0236] The following describes an NFC analog card selection method provided in the embodiments of this application, using NFC signaling interaction as an example.
[0237] Figure 8 An exemplary flowchart of an NFC signaling interaction process provided in an embodiment of this application is shown.
[0238] like Figure 8 As shown, the first NFC protocol can be Figure 5 The NFC protocol shown can be a second NFC protocol. Figure 6 The NFC protocol is shown. This NFC processing method can be applied to a communication system including electronic device 100 and NFC card reader 200. The NFC card reader 200 can operate in PCD mode. Electronic device 100, after enabling NFC, is in PICC mode by default. The NFC processing method may include the following steps:
[0239] S801. Electronic device 100 enters the radio frequency energy field of NFC card reader 200.
[0240] S802. NFC card reader 200 sends a probe frame to electronic device 100.
[0241] S803. NFC card reader 200 sends a Class A request command (REQA) to electronic device 100.
[0242] The NFC card reader 200 supports both the first NFC protocol and the second NFC protocol. The NFC card reader 200 can periodically send card search requests using these two communication protocols, namely, sending Probe frames and REQA.
[0243] S804. After receiving the probe frame and the Class A Request Command (REQA), the electronic device 100 sends a Class A Request Response (ATQA) to the NFC reader device 200.
[0244] When the NFC module 102 of electronic device 100 only supports the second NFC protocol, after receiving the probe frame and REQA, electronic device 100 can only recognize the REQA. Electronic device 100 can then send ATQA to NFC card reader 200 based on the REQA via NFC module 102.
[0245] S805.NFC card reader 200 sends a first select command to electronic device 100.
[0246] After receiving the ATQA, the NFC card reader 200 determines that the electronic device 100 supports the second NFC protocol and can complete the subsequent access layer signaling interaction process with the electronic device 100 based on the second NFC protocol (steps S806 to S808).
[0247] S806. Electronic device 100 sends a selection response to NFC card reader 200, including the UID of a second NFC analog card of the second NFC protocol.
[0248] S807. NFC card reader 200 sends a second selection command to electronic device 100, including the UID of the second NFC emulation card.
[0249] S808. After receiving the second selection command, the electronic device 100 sends a selection confirmation (SAK) command to the NFC card reader 200.
[0250] After receiving the SAK command, the S809 NFC card reader 200 sends a Select AID command to the electronic device 100, wherein the Select AID command carries the identifier of the first Applet.
[0251] After receiving the SAK command, the NFC reader 200 determines that it has completed the access layer signaling interaction process with the electronic device 100 based on the second NFC protocol. The NFC reader 200 can then perform the application layer signaling interaction process with the electronic device 100 based on the first NFC protocol. Here, since the NFC reader 200 stores the identifier of the first Applet, it can send a small program selection command carrying the identifier of the first Applet to the electronic device 100.
[0252] It should be noted that even if the SAK command indicates that the electronic device 100 does not support the application layer protocol, the NFC card reader 200 will still perform application layer signaling interaction with the electronic device 100 based on the first NFC protocol before the NFC card reader 200 has engaged in application layer signaling interaction with the electronic device 100 based on the first NFC protocol. Thus, successful card swiping is only possible when the electronic device 100 has activated an NFC simulation card corresponding to the first NFC protocol of the NFC card reader 200.
[0253] S810. Electronic device 100 determines and operates the first applet from one or more applets based on the identifier of the first applet.
[0254] The electronic device 100 may have one or more applets. One NFC emulator card corresponds to one applet. Different NFC emulator cards may correspond to different or the same applet. For example, the correspondence between NFC emulator cards and applets can be shown in Table 2 below:
[0255] Table 2
[0256] Card Name Mini Program Identifier (AID) Jiangsu Transportation Smart Card A00000063201010530013000FFFFFFFF Shenzhen Tong Transportation Card 535A542E57414C4C45542E454E56 Lingnan Pass Transportation Card 5943542E55534552 Wuhan Tong Transportation Card A00000534257485448 Chongqing One-Card 4351515041592E5359533331 Shanghai Public Transportation Card A0000003330101020063485750415902 UnionPay A0000003330053440121561126241000 Bank of China Card A00000000353504200080822 China Construction Bank Card A00000000353504200080807 China Merchants Bank Card A0000003330101010003080000030801 BMW car key card A00000000353504200080836 Huawei door lock key card F0000000485750415906000002029703 Vanke Property's access control card B00000007819392019283
[0257] As shown in Table 2 above, the Applet identifier (AID) for Jiangsu Transportation Smart Card is “A00000063201010530013000FFFFFFFF”. The Applet identifier (AID) for Shenzhen Tong Transportation Card is “535A542E57414C4C45542E454E56”, the Applet identifier (AID) for Lingnan Transportation Card is “5943542E55534552”, and the Applet identifier (AID) for Wuhan Tong Transportation Card is “A00000534257485448”. The Applet's identifier (AID) for Chongqing Transportation Card is "4351515041592E5359533331", the Applet's identifier (AID) for Shanghai Public Transportation Card is "A0000003330101020063485750415902", the Applet's identifier (AID) for UnionPay is "A0000003330053440121561126241000", and the Applet's identifier (AID) for Bank of China Card is "A00000000353504200080822". China Construction Bank... Let the Applet's identifier (AID) be "A00000000353504200080807", the Applet's identifier (AID) be "A0000003330101010003080000030801", the Applet's identifier (AID) be "A00000000353504200080836", and the Applet's identifier (AID) be "F0000000485750415906000002029703". The Applet's identifier (AID) for Vanke Property's access control card is "B00000007819392019283".
[0258] The examples shown in Table 2 above are only for explaining this application and should not be construed as limiting this application.
[0259] S811. After determining the first applet, the electronic device 100 sends a response 1 to the NFC reader 200, wherein the response 1 is used to indicate that the electronic device 100 has successfully selected the first applet.
[0260] In the electronic device 100, the service processing logic of the NFC emulator card is specifically implemented by an applet. The applet can be stored and run in the corresponding hardware device or software module (e.g., NFC module 102, HCE application, SIM card, SE, etc.) of the NFC emulator card. Since one or more NFC emulator cards are activated on the electronic device 100, there can be one or more applets on the electronic device 100. Each applet corresponds to a master file (MF), and different applets correspond to different MFs. Therefore, upon identifying the first applet, the NFC module 102 can obtain the MF of the first applet.
[0261] When an electronic device 100 activates an NFC simulation card that matches the first NFC protocol of the NFC reader 200, it can determine the first Applet based on a selection command in a mini-program.
[0262] It should be noted that when electronic device 100 has not activated an NFC simulation card matching the first NFC protocol with NFC card reader 200, if electronic device 100 includes an identifier for a second applet that is identical to the identifier of the first applet, electronic device 100 can identify the second applet and, through subsequent steps, send the card information of the NFC simulation card corresponding to the second applet to NFC card reader 200. If NFC card reader 200 fails to perform a card swipe transaction based on this card information, NFC card reader 200 can perform a card swipe interaction process with electronic device 100 based on the second NFC protocol, as detailed in step S711. If electronic device 100 does not include the identifier of the first applet, electronic device 100 can send a response to NFC card reader 200 indicating that electronic device 100 has not successfully selected an applet. Upon receiving this response, NFC card reader 200 determines that the signaling interaction process based on the first NFC protocol at the application layer has failed and can perform a card swipe interaction process with electronic device 100 based on the second NFC protocol.
[0263] S812. Electronic device 100 determines the first DF corresponding to the first NFC analog card of the first NFC protocol from the MF of the first Applet via the first Applet.
[0264] If the MF of the first Applet includes a DF, then that DF is the first DF corresponding to the first NFC emulator card.
[0265] If the MF of the first Applet includes multiple DFs, the MF of the first Applet may also include a first mapping list, wherein the first mapping list is used to indicate the mapping relationship between device feature information and the identifier of the dedicated file (DF) in the MF of the first Applet. The first Applet can determine the first DF corresponding to the first NFC emulated card based on the device feature information of the NFC card reader 200 and the first mapping list.
[0266] The electronic device 100 can store data from one or more NFC emulator cards via a file tree. The data from the NFC emulator card can include device characteristic information, keys, and permission information associated with the NFC emulator card. The file tree can include a master file (MF), a dedicated file (DF), and an elementary file (EF). The MF directory can contain one or more EFs and one or more DFs, and each DF directory can contain one or more EFs. One NFC emulator card corresponds to one DF, and different NFC emulator cards correspond to different DFs. Since one NFC emulator card can correspond to one or more card information entries, a DF can store one or more card information entries (EF) for storing card information (e.g., a DF can support storing up to 8 card information entries, each with a data length of 4 bytes) and one or more external authentication keys corresponding to card information entries (EF). The external authentication keys corresponding to different card information entries (EF) within the same DF can be the same or different.
[0267] For example, the NFC-enabled analog cards activated on electronic device 100 can include access cards for community A, community B, community C, a Shenzhen Tong transit card, and a home door lock key card. Since all access cards can correspond to the same Applet, the card information for the community access cards, community B access cards, and community C access cards can all be stored under different DFs in MF1. The Shenzhen Tong transit card corresponds to another Applet; therefore, its card information can be stored in a DF in MF2. The home door lock key card corresponds to a separate Applet; therefore, its card information can be stored in a DF in MF3.
[0268] For example, such as Figure 9 As shown, MF1 may include key EF1, Applet identity public key EF, Applet identity private key EF, mapping list EF, DF1, DF2 and DF3.
[0269] 1. Key EF1 may include a master key and a maintenance key. The master key in key EF1 can be used for encryption and decryption when data in key EF1 is updated. The maintenance key in key EF1 can be used for encryption and decryption when data in the Applet identity public key EF, Applet identity private key EF, and mapping list EF is updated.
[0270] 2. The Applet Identity Private Key (EF) can be used to store the identity private key used by one or more Applets.
[0271] 3. The Applet identity public key EF can be used to store the identity public key used by one or more Applets.
[0272] 4. The mapping list EF can be used to store the first mapping list mentioned above. The first mapping list indicates the mapping relationship between device feature information and the identifier of DF. For example, device feature information 1 corresponds to DF1, and DF1 can be used to store the access card data of community A. Device feature information 2 corresponds to DF2, and DF2 can be used to store the access card data of community B. Device feature information 3 corresponds to DF3, and DF3 can be used to store the access card data of community C.
[0273] 5. DF1 stores key EF11, device feature information EF12, file permission list EF13, and X card information EFs. X is a positive integer. Key EF11 may include a master control key, a maintenance key, and X external authentication keys. The master control key in key EF11 can be used for encryption and decryption when the data in key EF11 is updated. The maintenance key in key EF11 can be used for encryption and decryption when the device feature information EF12, file permission list EF13, and X card information EFs in DF1 are updated. The X external authentication keys in DF1 correspond to the X card information EFs in DF1, with one external authentication key corresponding to one card information EF. Different card information EFs in DF1 may correspond to the same or different external authentication keys. For example, DF1 may include card information EF storing card information 1 and card information EF storing card information 2. Card information 1 can be used to open the access control system of building 1 in community A, and card information 2 can be used to open the access control system of building 2 in community A. Device feature information EF12 can be used to store the device feature information corresponding to DF1. File permission list EF13 can be used to indicate the read and write permissions for X card information EF in DF1.
[0274] 6. DF2 stores key EF21, device characteristic information EF22, file permission list EF23, and Y card information EFs. Y is a positive integer. Key EF21 may include a master control key, a maintenance key, and Y external authentication keys. The master control key in key EF21 can be used for encryption and decryption during data updates. The maintenance key in key EF21 can be used for encryption and decryption during data updates to device characteristic information EF22, file permission list EF23, and the Y card information EFs in DF2. The Y external authentication keys in DF2 correspond to the Y card information EFs in DF2, with one external authentication key corresponding to one card information EF. Different card information EFs in DF2 may have the same or different external authentication keys. For example, DF2 may include card information EF storing card information 3, which can be used to open all access control systems within cell B. Device characteristic information EF22 can be used to store device characteristic information corresponding to DF2. File permission list EF23 can be used to indicate read and write permissions for the Y card information EFs in DF2.
[0275] 7. DF3 stores key EF31, device feature information EF32, file permission list EF33, and Z card information EFs. Z is a positive integer. Key EF31 may include a master control key, a maintenance key, and Z external authentication keys. The master control key in key EF31 can be used for encryption and decryption during data updates. The maintenance key in key EF31 can be used for encryption and decryption during data updates to device feature information EF32, file permission list EF33, and the Z card information EFs in DF3. The Z external authentication keys in DF3 correspond to the Z card information EFs in DF3, with one external authentication key corresponding to one card information EF. Different card information EFs in DF3 may have the same or different external authentication keys. For example, DF3 may include card information EF storing card information 4, which can be used to open all access control systems within cell C. Device feature information EF32 can be used to store device feature information corresponding to DF3. File permission list EF33 can be used to indicate read and write permissions for the Z card information EFs in DF3.
[0276] The above Figure 9 The examples shown are for illustrative purposes only and should not be construed as limiting the scope of this application.
[0277] If the MF corresponding to the first Applet is MF1, the first Applet can obtain the device feature information of the NFC reader 200 from the NFC module 102 or the wallet application, and then... Figure 9The first mapping list is obtained from the mapping list EF of MF1 shown. Then, the first applet can determine the first DF corresponding to the first NFC emulator card based on the device feature information of the NFC card reader 200 and the first mapping list.
[0278] After receiving response 1, the S813.NFC card reader 200 sends a random number acquisition (GetChallenge) command to the NFC module 102.
[0279] If the NFC card reader 200 does not receive a response (1) within a preset response time after sending a mini-program selection command to the electronic device 100, the NFC card reader 200 determines that the electronic device 100 does not support the application layer signaling of the first NFC protocol. The NFC card reader 200 can then implement a card-swiping interaction process with the electronic device 100 based on the second NFC protocol.
[0280] Specifically, if the NFC card reader 200 does not receive a response 1 within a preset response time, it can send a REQA to the electronic device 100. Upon receiving the REQA, the electronic device 100 can send an ATQA to the NFC card reader 200. Upon receiving the ATQA, the NFC card reader 200 can send a first selection command to the electronic device 100. Upon receiving the first selection command, the electronic device 100 can send a selection response to the NFC card reader 200, including the UID of the NFC analog card with the second NFC protocol. Upon receiving the selection response, the NFC card reader 200 can send a second selection command to the electronic device 100, including the UID of the NFC analog card with the second NFC protocol. The electronic device 100 can send an SAK command to the NFC card reader 200.
[0281] When the SAK command indicates that the NFC emulator card using the second NFC protocol does not support the application layer protocol, the NFC reader 200 can, upon receiving the SAK command, perform a card-swiping operation on the NFC emulator card using the second NFC protocol based on the NFC emulator card's UID. When the SAK command indicates that the NFC emulator card using the second NFC protocol supports the application layer protocol, the NFC reader 200 can, upon receiving the SAK command, implement a card-swiping operation on the NFC emulator card using the second NFC protocol at the application layer with the electronic device 100, based on the second NFC protocol.
[0282] S814. After receiving a random number acquisition command, the electronic device 100 can generate a first random number through the first Applet.
[0283] S815. Electronic device 100 sends response 2 to NFC card reader 200, wherein response 2 carries a first random number.
[0284] After receiving response 2, the S816.NFC card reader 200 encrypts a first random number using a first external authentication key to obtain the authentication ciphertext.
[0285] S817. NFC card reader 200 sends an external authentication command to electronic device 100, wherein the external authentication command carries authentication ciphertext.
[0286] S818. After receiving an external authentication command, the electronic device 100 decrypts the first random number from the authentication ciphertext using the first external authentication key in the first DF through the first Applet.
[0287] Since the first DF can include one or more card information EFs, where each card information EF corresponds to an external authentication key, the first DF can also include one or more external authentication keys. The electronic device 100 can use the first applet to sequentially decrypt the authentication ciphertext using one or more external authentication keys in the first DF. When the first random number is successfully decrypted using one of the external authentication keys in the first DF, it indicates that the external authentication key is the first external authentication key, and the electronic device 100 has successfully authenticated the NFC card reader 200.
[0288] S819. After electronic device 100 decrypts the first random number from the authentication ciphertext using the first external authentication key in the first DF via the first Applet, it sends a response (Response) 3, wherein the response 3 carries the first authentication result. The first authentication result is used to indicate that electronic device 100 has successfully decrypted the first random number from the authentication ciphertext.
[0289] After receiving the response 3 carrying the first authentication result, the S820 NFC card reader 200 sends a card information retrieval command to the electronic device 100.
[0290] The card information acquisition command is used to retrieve the card information of the first NFC analog card stored in the first DF.
[0291] S821. After receiving the card information acquisition command, the electronic device 100 uses the first Applet to encrypt the card information of the first NFC analog card stored in the first DF using the first external authentication key and the first random number to obtain encrypted data.
[0292] S822. Electronic device 100 sends encrypted data to NFC card reader 200.
[0293] After receiving encrypted data, the S823.NFC card reader 200 decrypts the card information of the first NFC simulated card from the encrypted data using a first external authentication key and a first random number, and performs a card swiping service for the first NFC simulated card based on the card information of the first NFC simulated card.
[0294] In one possible implementation, the first NFC analog card may have one or more card information entries. If one or more external authentication keys stored in the first DF are identical and all refer to the aforementioned first external authentication key, then the electronic device 100 can use the first Applet to encrypt one or more card information entries of the first NFC analog card stored in the first DF using the first external authentication key, obtaining encrypted data. After receiving the encrypted data, the NFC card reader 200 can use the first external authentication key to decrypt one or more card information entries of the first NFC analog card from the first DF. The NFC card reader 200 can perform a card-swiping transaction based on one or more card information entries of the first NFC analog card. If the NFC card reader 200 successfully swipes the card based on any one of the one or more card information entries of the first NFC analog card, it indicates that the first NFC analog card swipe was successful. If the NFC card reader 200 fails to swipe the card based on any one or more card information entries of the first NFC analog card, it indicates that the first NFC analog card swipe failed.
[0295] In one possible implementation, the first NFC emulator card may have multiple card information entries, and the multiple external authentication keys stored in the first DF are not all the same. After determining the first external authentication key from the multiple external authentication keys, the electronic device 100 can determine one or more card information entries EF corresponding to the first external authentication key, and obtain one or more target card information entries of the first NFC emulator card from these entries. The electronic device 100 can use the first external authentication key to encrypt one or more target card information entries of the first NFC emulator card via a first applet, obtaining encrypted data. After receiving the encrypted data, the NFC card reader 200 can use the first external authentication key to decrypt one or more target card information entries from the first DF. The NFC card reader 200 can perform a card swiping operation based on one or more target card information entries of the first NFC emulator card. If the NFC card reader 200 successfully swipes a card based on any one of the one or more target card information entries of the first NFC emulator card, it indicates that the first NFC emulator card swipe is successful. If the NFC card reader 200 fails to swipe a card based on any one or more target card information entries of the first NFC emulator card, it indicates that the first NFC emulator card swipe has failed.
[0296] S824.NFC card reader 200 sends the card swipe result to electronic device 100.
[0297] The card swipe result includes either a first card swipe result or a second card swipe result. The first card swipe result indicates that the first NFC simulated card was swiped successfully, while the second card swipe result indicates that the first NFC simulated card was swiped unsuccessfully. If the NFC card reader 200 successfully performs the card swipe transaction based on the card information of the first NFC simulated card, the NFC card reader 200 can send the first card swipe result. If the NFC card reader 200 fails to perform the card swipe transaction based on the card information of the first NFC simulated card, the NFC card reader 200 can send the second card swipe result.
[0298] Once the electronic device 100 receives the card swipe result via the NFC module 102, it can output the corresponding prompt information through the wallet application.
[0299] S825. After receiving the card swipe result, the electronic device 100 can send a response 4 to the NFC card reader 200, wherein the response 4 is used to indicate that the electronic device 100 has successfully received the card swipe result.
[0300] In one possible implementation, steps S812 to S821 are optional. The NFC card reader 200 can directly execute step S820 after receiving response 1. After receiving the card information acquisition command, the electronic device 100 can send the card information of the first NFC simulated card directly to the NFC card reader 200 without encrypting it. Upon receiving the card information of the first NFC simulated card, the NFC card reader 200 can perform a card swiping transaction based on that information.
[0301] This application provides an NFC processing method. When an electronic device 100 enters the radio frequency field emitted by an NFC card reader 200, the electronic device 100 and the NFC card reader 200 can implement an access layer signaling interaction process based on a second NFC protocol. The NFC card reader 200 can obtain the card information of the NFC simulated card with the first NFC protocol stored in the first DF from the electronic device 100 at the application layer, thereby completing the card swiping service of the first NFC simulated card. In this way, the electronic device 100 can activate the NFC simulated card with the first NFC protocol even when the NFC module 102 does not support the first NFC protocol, and can complete the card swiping service of the NFC simulated card with the first NFC protocol on the NFC card reader 200. It is compatible with multiple NFC protocols, applicable to more card swiping scenarios, and achieves better card swiping performance.
[0302] The following describes the process of a user swiping a card on an electronic device 100 in an embodiment of this application.
[0303] For example, such as Figure 10AAs shown, the electronic device 100 can display a desktop 1001. The desktop 1001 can include icons for one or more applications. For example, these icons may include icons for a wallet application 1004, a clock application, a settings application, a voice recorder application, a dialer application, a messaging application, a contacts application, and a camera application. A status bar 1002 can be displayed at the top of the desktop 1001. The status bar 1002 can include one or more status indicators, which may include, but are not limited to, indicators for communication signal strength (e.g., cellular network signal, WLAN signal), time indicators, battery level indicators, and an NFC function indicator 1003. When the electronic device 100 displays the NFC function indicator 1003 in the status bar 1002, it indicates that the electronic device 100 has enabled the NFC function.
[0304] The electronic device 100 can receive user input (e.g., a click) on the icon 1004 of the wallet application, and in response to the input, the electronic device 100 can display, as shown below. Figure 10B The wallet application interface shown is 1010.
[0305] like Figure 10B As shown, the wallet application interface 1010 may include one or more functional controls. These functional controls may include a card holder control 1011, a payment control, a ride control, and a door opening control, etc.
[0306] The electronic device 100 can receive user input (e.g., a click) to the wallet control 1011, and in response to the input, the electronic device 100 can display, as shown below. Figure 10C The card pack interface shown is 1020.
[0307] like Figure 10C As shown, the card wallet interface 1020 can include options for one or more types of NFC simulated cards activated by the user. These options may include options for transportation cards, access control cards, smart lock key cards, and car key cards. For example, the transportation card option may include the Shenzhen Tong transportation card option. The access control card options may include options 1021 for access control cards in Community A, 1022 for access control cards in Community B, 1023 for access control cards in Community C, and 1024 for access control cards in Community D. The smart lock key card option may include options for home lock key cards. The car key card option may include options for key cards for vehicle M9. The access control card for Community D is an NFC simulated card using the second NFC protocol. NFC simulated cards other than the access control card for Community D are NFC simulated cards using the first NFC protocol.
[0308] In some examples, electronic device 100 supports a second NFC protocol at the access layer but does not support the first NFC protocol. NFC card reader 200 supports both the first and second NFC protocols. NFC card reader 200 is an access control device for community A. Electronic device 100 has activated an access control card for community A that is matched with NFC card reader 200.
[0309] After enabling NFC, the electronic device 100, upon entering the radio frequency energy field of the NFC reader 200, can perform an access layer signaling interaction process with the NFC reader 200 based on the second NFC protocol using the NFC processing method provided in this embodiment. Subsequently, the electronic device 100 can perform an application layer signaling interaction process with the NFC reader 200 based on the first NFC protocol. The steps for the electronic device 100 to perform the signaling interaction process with the NFC reader 200 can be found in [link to relevant documentation]. Figure 7 or Figure 8 The embodiments shown are not described in detail here.
[0310] The electronic device can send the access card information of Community A to the NFC card reader 200 for verification. If the NFC card reader 200 successfully verifies the access card information of Community A, it sends a card swipe result 1 to the electronic device 100 and opens the gate of the NFC card reader 200. Card swipe result 1 indicates that the NFC simulated card was swiped successfully. After receiving card swipe result 1, the electronic device 100 can display the following: Figure 10D The interface shown is 1030.
[0311] like Figure 10D As shown, interface 1030 includes a card icon 1031 and a notification message 1032. The card icon 1031 corresponds to the access card for Community A, and it indicates to the user that the electronic device 100 is using the access card for Community A. The notification message 1032 indicates to the user that the NFC card reader 200 has been successfully opened. The notification message 1032 can be one or more of the following: text notification, image notification, audio notification, vibration notification, etc. For example, the notification message 1032 may include the text "Door opened successfully" and an image notification with a checkmark pattern.
[0312] Optionally, when electronic device 100 identifies the access card simulating community A during application layer signaling interaction, it can display something like this: Figure 10D The card icon 1031 is shown. In this way, the electronic device 100 can display the NFC simulated card simulated by the electronic device 100 more quickly, providing users with a better card swiping experience.
[0313] It should be noted that if the electronic device 100 and the NFC card reader 200 do not implement the NFC processing method provided in this application embodiment, the NFC card reader 200 and the electronic device 100 implement the entire card-swiping interaction process based on the second NFC protocol, which can be found in [reference needed]. Figure 6 The illustrated embodiment. Because only access cards for cell D using the second NFC protocol are enabled on electronic device 100, the NFC card reader 200 is incompatible with the access cards for cell D, and the electronic device 100 fails to swipe the access card based on cell D. After completing the card swiping process, electronic device 100 displays the following... Figure 10E The interface shown is 1040. (As shown) Figure 10E As shown, interface 1040 displays a card icon 1041 corresponding to the access card for Community D and a prompt message 1042. The card icon 1041 indicates to the user that the electronic device 100 is simulating the access card for Community D, and the prompt message 1042 indicates to the user that opening the gate of the NFC card reader 200 has failed. For example, the prompt message 1042 may include the text "Door opening failed" and an image prompt with a geometric pattern. It is understood that the file structure of the file storing the card information of the access card for Community D in the electronic device 100 is... Figure 9 The file structures shown are different.
[0314] In one possible implementation, the NFC card reader 200 supports multiple NFC protocols. These protocols include a first NFC protocol, a second NFC protocol, and a third NFC protocol. The NFC card reader 200 and the electronic device 100 can be configured to prioritize executing the access layer interaction process via the first NFC protocol, then via the third NFC protocol, and finally via the second NFC protocol. Furthermore, after completing the access layer interaction process, the NFC card reader 200 and the electronic device 100 can be configured to prioritize executing the application layer interaction process via the first NFC protocol, then via the third NFC protocol, and finally via the second NFC protocol.
[0315] Specifically, the NFC card reader 200 can send card search requests using the first NFC protocol, the second NFC protocol, and the third NFC protocol in turn. When the electronic device 100 supports the first NFC protocol at the access layer, it can send a card search response using the first NFC protocol to the NFC card reader 200. After receiving the card search response using the first NFC protocol from the electronic device 100 located within the NFC card reader 200's radio frequency field, the NFC card reader 200 can complete the access layer signaling interaction process and the application layer interaction process with the electronic device 100 based on the first NFC protocol.
[0316] When electronic device 100 does not support the first NFC protocol at the access layer but supports the third NFC protocol, it can send a card search response using the third NFC protocol to NFC card reader 200. After receiving the card search response using the third NFC protocol from electronic device 100 located within NFC card reader 200's radio frequency field, NFC card reader 200 can complete the access layer interaction process with electronic device 100 based on the third NFC protocol. Subsequently, NFC card reader 200 can perform application layer signaling interaction with electronic device 100 based on the first NFC protocol. If the application layer signaling interaction with electronic device 100 based on the first NFC protocol fails, NFC card reader 200 can perform both access layer signaling interaction and application layer signaling interaction processes based on the third NFC protocol.
[0317] When electronic device 100 does not support the first NFC protocol or the third NFC protocol at the access layer, but supports the second NFC protocol, it can send a card search response using the second NFC protocol to NFC card reader 200. After receiving the card search response using the second NFC protocol from electronic device 100 within its radio frequency field, NFC card reader 200 can complete the access layer interaction process with electronic device 100 based on the second NFC protocol. After receiving a card search response using the third NFC protocol from electronic device 100 within its radio frequency field, NFC card reader 200 can complete the access layer interaction process with electronic device 100 based on the third NFC protocol. Afterwards, NFC card reader 200 can perform application layer signaling interaction with electronic device 100 based on the first NFC protocol. If the application layer signaling interaction process based on the first NFC protocol fails, NFC card reader 200 can complete the access layer interaction process with electronic device 100 based on the second NFC protocol and perform application layer signaling interaction with electronic device 100 based on the third NFC protocol. When the NFC card reader 200 fails to perform the application layer signaling interaction process with the electronic device 100 based on the third NFC protocol, it can perform the card swiping interaction process with the electronic device 100 based on the second NFC protocol.
[0318] In this way, even if the NFC communication protocol supported by the access layer is different, the electronic device 100 and the NFC card reader 200 can still perform NFC analog card swiping services through the NFC processing method provided in this application embodiment.
[0319] For example, such as Figure 11A and Figure 11B As shown, an NFC processing method provided in this application includes the following steps:
[0320] S1101. Electronic device 100 enters the radio frequency energy field of NFC card reader 200.
[0321] S1102. The NFC card reader 200 sends a card search request using the first NFC protocol to the electronic device 100.
[0322] S1103. The NFC card reader 200 sends a card search request using the second NFC protocol to the electronic device 100.
[0323] S1104. The NFC card reader 200 sends a card search request using the third NFC protocol to the electronic device 100.
[0324] The NFC card reader 200 can periodically send card search requests using a first NFC protocol, a second NFC protocol, and a third NFC protocol. In some examples, the first NFC protocol can be... Figure 5 The communication protocol shown. The second NFC protocol can be... Figure 6 The communication protocol shown.
[0325] S1105. Electronic device 100 sends a first NFC protocol card search response to NFC card reader 200.
[0326] The electronic device 100 supports a first NFC protocol at the access layer. After receiving a card search request using the first NFC protocol, the electronic device 100 can send a card search response using the first NFC protocol to the NFC card reader 200. Optionally, the electronic device 100 may also support a second NFC protocol and / or a third NFC protocol at the access layer.
[0327] It should be noted that, in this embodiment of the application, when the electronic device 100 supports the first NFC protocol, as well as the second NFC protocol and / or the third NFC protocol at the access layer, when the electronic device 100 receives a card search request for multiple NFC protocols, it will prioritize sending a card search response for the first NFC protocol to the NFC card reader 200.
[0328] S1106. Electronic device 100 and NFC card reader 200 perform access layer interaction process based on the first NFC protocol.
[0329] After receiving a card search response from the first NFC protocol, the NFC card reader 200 can perform an access layer signaling interaction process with the electronic device 100 based on the first NFC protocol. In some examples, a description of the access layer interaction process performed by the electronic device 100 and the NFC card reader 200 based on the first NFC protocol can be found in [reference needed]. Figure 5 The embodiments shown are not described in detail here.
[0330] S1107. Electronic device 100 and NFC card reader 200 perform card swiping transactions at the application layer based on the first NFC protocol.
[0331] After completing the access layer signaling interaction process with the electronic device 100 based on the first NFC protocol, the NFC card reader 200 can perform card swiping services at the application layer based on the first NFC protocol (also known as performing application layer signaling interaction process based on the first NFC protocol).
[0332] Specifically, when electronic device 100 activates an NFC-enabled NFC analog card compatible with the NFC reader 200 using the first NFC protocol, electronic device 100 can send the card information of the NFC-enabled NFC analog card to the NFC reader 200 at the application layer based on the first NFC protocol. The NFC reader 200 can then perform a card-swiping transaction using the NFC analog card at the application layer based on the card information of the NFC-enabled NFC analog card using the first NFC protocol. For a description of how electronic device 100 and NFC reader 200 perform card-swiping transactions at the application layer based on the first NFC protocol in some examples, please refer to [link to relevant documentation]. Figure 8 Steps S809 to S825 shown are not repeated here.
[0333] When the electronic device 100 has not activated an NFC simulation card that matches the first NFC protocol of the NFC card reader 200, the card swiping service based on the first NFC protocol at the application layer fails.
[0334] When the electronic device 100 does not have an NFC simulation card with the first NFC protocol enabled, the card swiping service performed at the application layer based on the first NFC protocol fails. Specifically, the electronic device 100 can send a signaling message to the NFC reader 200 at the application layer indicating that the electronic device 100 does not have an NFC simulation card with the first NFC protocol enabled (e.g., a signaling message indicating that the electronic device 100 failed to select an Applet). Upon receiving this signaling message, the NFC reader 200 can determine that the card swiping service performed based on the first NFC protocol has failed, and then perform an access layer signaling interaction process based on the first NFC protocol and perform the card swiping service at the application layer based on the third NFC protocol. The description of the electronic device 100 and the NFC reader 200 performing the card swiping service at the application layer based on the third NFC protocol can be found in the description of performing the card swiping service at the application layer based on the first protocol, and will not be repeated here.
[0335] When the NFC simulation card of the first NFC protocol activated by the electronic device 100 does not match the NFC card reader 200, the electronic device 100 fails to perform the card swiping service with the NFC card reader 200 at the application layer based on the first NFC protocol (for example, the electronic device 100 fails to select the Applet, or the NFC card reader 200 fails to verify the card information). When the card swiping service based on the first NFC protocol fails, the NFC card reader 200 can perform the access layer signaling interaction process based on the first NFC protocol and perform the card swiping service at the application layer based on the third NFC protocol.
[0336] Optionally, when the card swiping service fails to be executed based on the first NFC protocol, the electronic device 100 may execute the card swiping service at the access layer and application layer based on the third NFC protocol, that is, execute the access layer signaling interaction process based on the third NFC protocol and execute the application layer signaling interaction process based on the third NFC protocol.
[0337] In some examples, after the NFC card reader 200 sends a small program selection command for the first NFC protocol to the electronic device 100 at the application layer, if it does not receive a response 1 from the first NFC protocol within a preset response time, it determines that the card swiping transaction based on the first NFC protocol has failed. Thus, in some application scenarios, the NFC card reader 200 can determine whether the card swiping transaction has failed based on whether it receives a response 1 within the preset response time.
[0338] Similarly, when electronic device 100 fails to perform a card swipe transaction based on the third NFC protocol (electronic device 100 has not activated an NFC simulation card matching the third NFC protocol with NFC card reader 200), NFC card reader 200 can, if electronic device 100 has activated an NFC simulation card supporting the second NFC protocol (which supports application layer protocols), perform access layer signaling interaction procedures based on the first NFC protocol and perform card swipe transactions at the application layer based on the second NFC protocol. Alternatively, if electronic device 100 has activated an NFC simulation card that does not support the second NFC protocol (which supports application layer protocols), NFC card reader 200 can perform a card swipe interaction procedure based on the second NFC protocol. For details, please refer to [link to relevant documentation]. Figure 6 The illustrated embodiment.
[0339] It should be noted that, since the electronic device 100 does not support the application layer protocol for the NFC simulation card using the second NFC protocol, it verifies the UID of the NFC simulation card obtained at the access layer by executing a card swipe verification process to determine the card swipe result. When the electronic device 100 can obtain the UID of the NFC simulation card using the second NFC protocol at the access layer based on the first or third NFC protocol, the electronic device 100 and the NFC card reader 200 can perform a signaling interaction process at the access layer based on the higher-priority NFC protocol. After the access layer signaling interaction process is completed, the card swipe verification process is executed based on the second NFC protocol. When the electronic device 100 cannot obtain the UID of the NFC simulation card using the second NFC protocol at the access layer based on the first or third NFC protocol, the electronic device 100 and the NFC card reader 200 execute a card swipe interaction process based on the second NFC protocol. This card swipe interaction process includes performing a signaling interaction process at the access layer based on the second NFC protocol and executing a card swipe verification process.
[0340] In some examples, when electronic device 100 activates both an NFC emulator card supporting the second NFC protocol (which supports the application layer protocol) and an NFC emulator card that does not support the application layer protocol, electronic device 100 may prioritize performing a card-swiping interaction with NFC card reader 200 using the NFC emulator card supporting the application layer protocol, and then perform the card-swiping interaction with NFC card reader 200 using the NFC emulator card that does not support the application layer protocol. Alternatively, electronic device 100 may prioritize performing a card-swiping interaction with NFC card reader 200 using the NFC emulator card that does not support the application layer protocol, and then perform the card-swiping interaction with NFC card reader 200 using the NFC emulator card that supports the application layer protocol.
[0341] In other examples, when electronic device 100 supports the third NFC protocol at the access layer and has activated an NFC emulated card using the third NFC protocol, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction based on the first NFC protocol. If the card swiping service fails to execute at the application layer based on the third NFC protocol, they can then perform access layer signaling interaction based on the third NFC protocol and execute the card swiping service at the application layer based on the third NFC protocol. This method of executing the entire card swiping interaction process based on the third NFC protocol is more suitable for NFC emulated cards using the third NFC protocol.
[0342] Similarly, when electronic device 100 supports the second NFC protocol at the access layer and has activated an NFC emulation card using the second NFC protocol, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction based on the first NFC protocol. If the card swiping service fails at the application layer based on the second NFC protocol, they can then perform access layer signaling interaction based on the second NFC protocol and perform the card swiping service at the application layer based on the second NFC protocol. This method of performing the entire card swiping interaction process based on the second NFC protocol is more suitable for NFC emulation cards using the second NFC protocol.
[0343] S1108. After receiving a card search request in the third NFC protocol, the electronic device 100 can send a card search response in the third NFC protocol to the NFC card reader 200.
[0344] The electronic device 100 supports the third NFC protocol at the access layer but does not support the first NFC protocol. After receiving a card search request in the third NFC protocol, it can send a card search response in the third NFC protocol to the NFC card reader 200.
[0345] S1109. Electronic device 100 and NFC card reader 200 perform access layer interaction process based on the third NFC protocol.
[0346] After receiving the card search response of the third NFC protocol, the NFC card reader 200 determines that the electronic device 100 supports the third NFC protocol at the access layer, and can perform access layer signaling interaction procedures with the electronic device 100 based on the third NFC protocol.
[0347] It should be noted that when the electronic device 100 supports both the second NFC protocol and the third NFC protocol at the access layer, when the electronic device 100 receives a card search request using the third NFC protocol and a card search request using the second NFC protocol, it will prioritize sending a card search response using the third NFC protocol to the NFC card reader 200.
[0348] S1110. Electronic device 100 and NFC card reader 200 perform card swiping transactions at the application layer based on the first NFC protocol.
[0349] S1111. If the electronic device 100 and the NFC card reader 200 fail to perform a card swiping service based on the first NFC protocol.
[0350] If the electronic device 100 and the NFC card reader 200 fail to execute the card swiping service based on the first NFC protocol, that is, the electronic device 100 has not activated an NFC simulated card matching the first NFC protocol with the NFC card reader 200, the electronic device 100 and the NFC card reader 200 proceed to step S1112. Specifically, the descriptions of steps S1110 and S1111 can be found in the description of step S1107, and will not be repeated here.
[0351] S1112. Electronic device 100 and NFC card reader 200 perform access layer interaction process based on the third NFC protocol.
[0352] When the electronic device 100 and the NFC card reader 200 fail to perform a card swiping transaction based on the first NFC protocol, the electronic device 100 and the NFC card reader 200 perform an access layer interaction process based on the third NFC protocol.
[0353] S1113. If the electronic device 100 has activated the NFC simulation card of the third NFC protocol, the electronic device 100 and the NFC card reader 200 perform card swiping business at the application layer based on the third NFC protocol.
[0354] After executing step S1112, electronic device 100 and NFC card reader 200 perform card swiping transactions at the application layer based on the third NFC protocol. Specifically, when an NFC-enabled NFC-enabled card matching the third NFC protocol is activated, electronic device 100 can send the card information of the NFC-enabled NFC-enabled card to NFC card reader 200 at the application layer based on the third NFC protocol. NFC card reader 200 can then perform card swiping transactions for the NFC-enabled NFC-enabled card at the application layer based on the card information of the NFC-enabled NFC-enabled card using the third NFC protocol.
[0355] When electronic device 100 has not activated an NFC simulation card using the third NFC protocol, electronic device 100 can send a signaling message at the application layer to NFC card reader 200 indicating that electronic device 100 has not activated an NFC simulation card using the third NFC protocol. Upon receiving this signaling message, NFC card reader 200 can determine that the card swiping transaction based on the third NFC protocol has failed. When electronic device 100 has activated an NFC simulation card using the second NFC protocol, NFC card reader 200 and electronic device 100 can perform a card swiping interaction process based on the second NFC protocol.
[0356] When the NFC simulation card of the third NFC protocol activated by electronic device 100 is incompatible with the NFC card reader 200, the card swiping transaction between electronic device 100 and NFC card reader 200 based on the third NFC protocol fails. If the card swiping transaction based on the third NFC protocol fails, and electronic device 100 has activated the NFC simulation card of the second NFC protocol, then the NFC card reader 200 can perform a card swiping interaction process with electronic device 100 based on the second NFC protocol. Specifically, the description of the card swiping interaction process between NFC card reader 200 and electronic device 100 based on the second NFC protocol can be found in the description of step S1107, and will not be repeated here.
[0357] S1114. After receiving a card search request using the second NFC protocol, the electronic device 100 can send a card search response using the second NFC protocol to the NFC card reader 200.
[0358] The electronic device 100 supports the second NFC protocol at the access layer but does not support the first NFC protocol or the third NFC protocol. After receiving a card search request using the second NFC protocol, it can send a card search response using the second NFC protocol to the NFC card reader 200.
[0359] S1115. Electronic device 100 and NFC card reader 200 perform access layer interaction process based on the second NFC protocol.
[0360] After receiving a card search response using the second NFC protocol, the NFC card reader 200 determines that the electronic device 100 supports the second NFC protocol at the access layer and can then perform access layer interaction procedures with the electronic device 100 based on the second NFC protocol. In some examples, descriptions of the access layer interaction procedures between the electronic device 100 and the NFC card reader 200 based on the second NFC protocol can be found in [reference needed]. Figure 8 The embodiments shown are not described in detail here.
[0361] S1116. Electronic device 100 and NFC card reader 200 perform card swiping transactions at the application layer based on the first NFC protocol.
[0362] S1117. If the electronic device 100 and the NFC card reader 200 fail to perform a card swiping service based on the first NFC protocol.
[0363] If the electronic device 100 and the NFC card reader 200 fail to execute the card swiping service based on the first NFC protocol, that is, the electronic device 100 has not activated an NFC simulated card with the first NFC protocol matched with the NFC card reader 200, the electronic device 100 and the NFC card reader 200 proceed to step S1119. Specifically, the descriptions of steps S1116 and S1117 can be found in the description of step S1107, and will not be repeated here.
[0364] S1118. Electronic device 100 and NFC card reader 200 perform access layer interaction process based on the second NFC protocol.
[0365] If the electronic device 100 and the NFC card reader 200 fail to perform a card swiping service based on the first NFC protocol, the electronic device 100 and the NFC card reader 200 will perform an access layer interaction process based on the second NFC protocol.
[0366] S1119. Electronic device 100 and NFC card reader 200 perform card swiping transactions at the application layer based on the third NFC protocol.
[0367] If electronic device 100 activates an NFC analog card using the third NFC protocol compatible with NFC card reader 200, electronic device 100 and NFC card reader 200 successfully perform a card swiping transaction at the application layer based on the third NFC protocol. Specifically, after electronic device 100 and NFC card reader 200 complete the access layer interaction process based on the second NFC protocol, they then perform a card swiping transaction at the application layer based on the third NFC protocol.
[0368] If the electronic device 100 has not activated the NFC simulation card with the third NFC protocol that matches the NFC card reader 200, the electronic device 100 and the NFC card reader 200 will fail to perform the card swiping service at the application layer based on the third NFC protocol.
[0369] S1120. If the electronic device 100 and the NFC card reader 200 fail to perform a card swiping transaction based on the third NFC protocol.
[0370] If the electronic device 100 and the NFC card reader 200 fail to perform a card swiping transaction based on the third NFC protocol, the electronic device 100 and the NFC card reader 200 proceed to step S1118. Specifically, the descriptions of steps S1119 and S1120 can be found in the description of step S1107, and will not be repeated here.
[0371] S1121. Electronic device 100 and NFC card reader 200 execute a card swiping interaction process based on the second NFC protocol.
[0372] If the electronic device 100 and the NFC card reader 200 fail to execute a card swiping transaction based on the third NFC protocol, they will instead execute the card swiping interaction process based on the second NFC protocol. For details, please refer to [link / reference needed]. Figure 6 The embodiments shown are not described in detail here.
[0373] It should be noted that when electronic device 100 activates an access card using the second NFC protocol, the NFC card reader 200 obtains the access card's UID at the access layer. Therefore, NFC card reader 200 and electronic device 100 do not need to perform application layer signaling interaction procedures. They can perform the card swipe verification process. For details, please refer to [link to relevant documentation]. Figure 6 The embodiments shown are not described in detail here.
[0374] It is understood that, in this embodiment of the application, if the electronic device 100 and the NFC card reader 200 do not support the execution of the access layer signaling interaction process based on the second NFC protocol, and the NFC card reader 200 only supports obtaining the card information of the electronic device at the access layer, the electronic device 100 will fail to swipe the card based on the second NFC protocol.
[0375] It is understood that in this embodiment of the application, if the electronic device 100 and the NFC card reader 200 do not support the execution of access layer signaling interaction process based on the third NFC protocol, and the NFC card reader 200 only supports obtaining the card information of the electronic device at the access layer, the electronic device 100 will fail to swipe the card based on the third NFC protocol.
[0376] In summary, in the NFC processing method provided in this application embodiment, the NFC card reader 200 and electronic device 100 perform card swiping services in the following ways:
[0377] 1. When the NFC card reader 200 supports the first NFC protocol and the electronic device 100 supports the first NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform the card swiping process based on the first NFC protocol.
[0378] 2. When the NFC card reader 200 supports the second NFC protocol and the electronic device 100 supports the second NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform the card swiping process based on the second NFC protocol.
[0379] 3. When the NFC card reader 200 supports the third NFC protocol and the electronic device 100 supports the third NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform the card swiping process based on the third NFC protocol.
[0380] 4. When the NFC card reader 200 supports the first NFC protocol and the second NFC protocol, and the electronic device 100 supports the second NFC protocol at the access layer but does not support the first NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform the access layer signaling interaction process based on the second NFC protocol.
[0381] After completing the access layer signaling interaction process with the electronic device 100 based on the second NFC protocol, the NFC card reader 200 executes the application layer signaling interaction process with the electronic device 100 based on the first NFC protocol.
[0382] When electronic device 100 activates an NFC simulated card with the first NFC protocol that matches NFC card reader 200, electronic device 100 can send the card information of the NFC simulated card with the first NFC protocol to NFC card reader 200 at the application layer based on the first NFC protocol. NFC card reader 200 can then perform card swiping service of the NFC simulated card with the first NFC protocol at the application layer based on the card information of the NFC simulated card with the first NFC protocol.
[0383] When electronic device 100 has not activated an NFC analog card that matches the first NFC protocol with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and NFC card reader 200 based on the first NFC protocol fails. Electronic device 100 and NFC card reader 200 can then perform a card swiping interaction process based on the second NFC protocol.
[0384] Specifically, when the NFC-enabled NFC simulation card of the second NFC protocol activated by electronic device 100 supports the application layer protocol simulation card, the card swiping interaction process performed by electronic device 100 and NFC card reader 200 based on the second NFC protocol includes an access layer interaction process and an application layer interaction process. In the application layer interaction process, electronic device 100 can send the card information of the NFC simulation card of the second NFC protocol to electronic device 100, and NFC card reader 200 can perform the card swiping service of the NFC simulation card of the second NFC protocol based on the card information of the NFC simulation card of the second NFC protocol at the application layer.
[0385] When the NFC simulation card of the electronic device 100 that enables the second NFC protocol does not support the simulation card of the application layer protocol, the electronic device 100 and the NFC card reader 200 perform a card swiping interaction process based on the second NFC protocol, including an access layer interaction process and a card swiping verification process based on the second NFC protocol. The card swiping verification process includes the NFC card reader 200 determining the card swiping result based on the UID and implementing the card swiping service corresponding to the result.
[0386] In other examples, when the electronic device 100 fails to swipe an NFC-enabled simulated card based on the first NFC protocol or the second NFC protocol, the electronic device 100 can prompt the user to select an NFC-enabled simulated card. The electronic device 100 can then perform a card swiping transaction with the NFC card reader 200 based on the user-selected NFC-enabled simulated card. Specifically, the electronic device 100 and the NFC card reader 200 use the second NFC protocol at the access layer and the NFC protocol corresponding to the NFC-enabled simulated card at the application layer.
[0387] 5. When the NFC card reader 200 supports the first NFC protocol and the third NFC protocol, and the electronic device 100 supports the third NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform access layer signaling interaction procedures based on the third NFC protocol.
[0388] After completing the access layer signaling interaction process with the electronic device 100 based on the third NFC protocol, the NFC card reader 200 can perform the application layer interaction process with the electronic device 100 based on the first NFC protocol. For details, please refer to the description of situation 4 above.
[0389] When electronic device 100 fails to activate an NFC simulation card that does not match the first NFC protocol of NFC card reader 200, electronic device 100 and NFC card reader 200 fail to execute the application layer signaling interaction process based on the first NFC protocol. Electronic device 100 and NFC card reader 200 can then execute the card swiping interaction process based on the third NFC protocol, that is, execute the access layer signaling interaction process and the application layer signaling interaction process.
[0390] In other examples, when electronic device 100 fails to perform a card swipe transaction using an NFC-enabled emulator card based on the first NFC protocol (i.e., the application layer interaction process fails) or fails to perform a card swipe transaction using an NFC-enabled emulator card based on the third NFC protocol, electronic device 100 can prompt the user to select an NFC-enabled emulator card. Electronic device 100 can then perform a card swipe transaction with NFC reader 200 based on the user-selected NFC-enabled emulator card. Specifically, electronic device 100 and NFC reader 200 use the third NFC protocol at the access layer and the NFC protocol corresponding to the NFC-enabled emulator card at the application layer.
[0391] 6. When the NFC card reader 200 supports the second NFC protocol and the third NFC protocol, and the electronic device 10 supports the second NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform access layer signaling interaction procedures based on the second NFC protocol.
[0392] After completing the access layer signaling interaction process with the electronic device 100 based on the second NFC protocol, the NFC card reader 200 executes the application layer interaction process with the electronic device 100 based on the third NFC protocol.
[0393] When electronic device 100 activates an NFC simulation card that matches the third NFC protocol with NFC card reader 200, electronic device 100 successfully executes the application layer interaction process with NFC card reader 200 based on the third NFC protocol.
[0394] When electronic device 100 has not activated an NFC simulation card that matches the third NFC protocol of NFC card reader 200, electronic device 100 and NFC card reader 200 fail to execute the application layer signaling interaction process based on the third NFC protocol. Electronic device 100 and NFC card reader 200 can execute the card swiping interaction process based on the second NFC protocol. For details, please refer to the description in step 4.
[0395] In other examples, when the electronic device 100 fails to swipe an NFC-enabled simulated card based on the third NFC protocol or the second NFC protocol, the electronic device 100 can prompt the user to select an NFC-enabled simulated card. The electronic device 100 can then perform a card swipe transaction with the NFC reader 200 based on the user-selected NFC-enabled simulated card. Specifically, the electronic device 100 and the NFC reader 200 use the second NFC protocol at the access layer and the NFC protocol corresponding to the NFC-enabled simulated card at the application layer.
[0396] Understandably, because the NFC card reader 200 does not support the first NFC protocol, the electronic device 100 cannot activate an NFC analog card that matches the first NFC protocol of the NFC card reader 200.
[0397] 7. When the NFC card reader 200 supports the third NFC protocol and the second NFC protocol, and the electronic device 100 supports the third NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform access layer signaling interaction procedures based on the third NFC protocol.
[0398] After completing the access layer signaling interaction process with the electronic device 100 based on the third NFC protocol, the NFC card reader 200 executes the application layer interaction process with the electronic device 100 based on the third NFC protocol.
[0399] When electronic device 100 activates an NFC simulation card that matches the third NFC protocol of NFC card reader 200, electronic device 100 and NFC card reader 200 successfully execute the application layer signaling interaction process based on the third NFC protocol.
[0400] When electronic device 100 has not activated an NFC simulation card using the third NFC protocol compatible with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and NFC card reader 200 based on the third NFC protocol fails. When the NFC simulation card activated by electronic device 100 using the second NFC protocol supports application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the third NFC protocol and application layer signaling interaction processes based on the second NFC protocol. When the NFC simulation card activated by electronic device 100 using the second NFC protocol does not support application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the third NFC protocol and card swipe verification interaction processes based on the second NFC protocol.
[0401] In other examples, if the electronic device 100 and the NFC card reader 200 fail to execute the application layer signaling interaction process based on the third NFC protocol, the electronic device 100 and the NFC card reader 200 can execute the card swiping interaction process based on the second NFC protocol. For details, please refer to the description in case 4.
[0402] In other examples, when the electronic device 100 fails to swipe an NFC simulated card based on the third NFC protocol or the second NFC protocol, the electronic device 100 can prompt the user to select an NFC simulated card. The electronic device 100 can then perform a card swipe transaction with the NFC card reader 200 based on the user-selected NFC simulated card. Specifically, the electronic device 100 and the NFC card reader 200 use the third NFC protocol at the access layer and the NFC protocol corresponding to the NFC simulated card at the application layer.
[0403] 8. When the NFC card reader 200 supports the first NFC protocol and the second NFC protocol, and the electronic device 100 supports the first NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform access layer signaling interaction procedures based on the first NFC protocol.
[0404] After completing the access layer signaling interaction process with the electronic device 100 based on the first NFC protocol, the NFC card reader 200 executes the application layer signaling interaction process based on the first NFC protocol and the electronic device 100.
[0405] When electronic device 100 activates an NFC simulated card using the first NFC protocol matched with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the first NFC protocol is successfully executed. Specifically, electronic device 100 can send card information of the NFC simulated card using the first NFC protocol to NFC card reader 200 at the application layer based on the first NFC protocol, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the first NFC protocol at the application layer based on the card information of the NFC simulated card using the first NFC protocol.
[0406] When electronic device 100 has not activated an NFC simulation card using the first NFC protocol matched with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and NFC card reader 200 based on the first NFC protocol fails. When electronic device 100 activates an NFC simulation card using the second NFC protocol that supports application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the first NFC protocol and application layer signaling interaction processes based on the second NFC protocol. When electronic device 100 activates an NFC simulation card using the second NFC protocol that does not support application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the first NFC protocol and card swipe verification interaction processes based on the second NFC protocol.
[0407] In some examples, if the NFC analog card swipe by electronic device 100 based on the first NFC protocol fails, electronic device 100 can perform a card swipe interaction process with NFC card reader 200 based on the second NFC protocol.
[0408] In other examples, when the electronic device 100 fails to swipe an NFC simulated card based on the first NFC protocol or the second NFC protocol, the electronic device 100 can prompt the user to select an NFC simulated card. The electronic device 100 can then perform a card swiping transaction with the NFC card reader 200 based on the user-selected NFC simulated card. Specifically, the electronic device 100 and the NFC card reader 200 use the first NFC protocol at the access layer and the NFC protocol corresponding to the NFC simulated card at the application layer.
[0409] 9. When the NFC card reader 200 supports the first NFC protocol and the third NFC protocol, and the electronic device 100 supports the first NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform access layer signaling interaction procedures based on the first NFC protocol.
[0410] The electronic device 100 and the NFC card reader 200 can execute the application layer signaling interaction process based on the first NFC protocol after executing the access layer signaling interaction process based on the first NFC protocol.
[0411] When electronic device 100 activates an NFC simulated card using the first NFC protocol matched with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the first NFC protocol is successfully executed. Specifically, electronic device 100 can send card information of the NFC simulated card using the first NFC protocol to NFC card reader 200 at the application layer based on the first NFC protocol, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the first NFC protocol at the application layer based on the card information of the NFC simulated card using the first NFC protocol.
[0412] When electronic device 100 fails to activate an NFC simulation card that matches the first NFC protocol of NFC card reader 200, electronic device 100 and NFC card reader 200 fail to execute the application layer signaling interaction process based on the first NFC protocol. Electronic device 100 and NFC card reader 200 can execute the access layer signaling interaction process based on the first NFC protocol and the application layer signaling interaction process based on the third NFC protocol.
[0413] In other examples, if the NFC simulated card swipe by electronic device 100 based on the first NFC protocol fails, electronic device 100 can perform a card swipe interaction process (including access layer interaction process and application layer interaction process) with NFC card reader 200 based on the third NFC protocol.
[0414] In other examples, when the electronic device 100 fails to swipe an NFC simulated card based on the first NFC protocol or the third NFC protocol, the electronic device 100 can prompt the user to select an NFC simulated card. The electronic device 100 can then perform a card swiping transaction with the NFC card reader 200 based on the user-selected NFC simulated card. Specifically, the electronic device 100 and the NFC card reader 200 use the first NFC protocol at the access layer and the NFC protocol corresponding to the NFC simulated card at the application layer.
[0415] 10. When the NFC card reader 200 supports the first NFC protocol, the second NFC protocol and the third NFC protocol, and the electronic device 100 supports the first NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform access layer signaling interaction procedures based on the first NFC protocol.
[0416] The electronic device 100 and the NFC card reader 200 can execute the application layer signaling interaction process based on the first NFC protocol after executing the access layer signaling interaction process based on the first NFC protocol.
[0417] When electronic device 100 activates an NFC simulated card using the first NFC protocol matched with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the first NFC protocol is successfully executed. Specifically, electronic device 100 can send card information of the NFC simulated card using the first NFC protocol to NFC card reader 200 at the application layer based on the first NFC protocol, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the first NFC protocol at the application layer based on the card information of the NFC simulated card using the first NFC protocol.
[0418] When electronic device 100 fails to activate an NFC simulation card that matches the first NFC protocol of NFC card reader 200, electronic device 100 and NFC card reader 200 fail to execute the application layer signaling interaction process based on the first NFC protocol. Electronic device 100 and NFC card reader 200 can execute the access layer signaling interaction process based on the first NFC protocol and the application layer signaling interaction process based on the third NFC protocol.
[0419] When electronic device 100 activates an NFC simulated card using the third NFC protocol compatible with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the third NFC protocol is successfully executed. Specifically, electronic device 100 can send the card information of the NFC simulated card using the third NFC protocol to NFC card reader 200 at the application layer, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the third NFC protocol at the application layer.
[0420] When electronic device 100 has not activated an NFC simulation card using the third NFC protocol compatible with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and NFC card reader 200 based on the third NFC protocol fails. When the NFC simulation card activated by electronic device 100 using the second NFC protocol supports application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the first NFC protocol and application layer signaling interaction processes based on the second NFC protocol. When the NFC simulation card activated by electronic device 100 using the second NFC protocol does not support application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the first NFC protocol and card swipe verification interaction processes based on the second NFC protocol.
[0421] In other examples, when the electronic device 100 fails to swipe an NFC simulated card based on the first NFC protocol or the second NFC protocol, the electronic device 100 can prompt the user to select an NFC simulated card. The electronic device 100 can then perform a card swiping transaction with the NFC card reader 200 based on the user-selected NFC simulated card. Specifically, the electronic device 100 and the NFC card reader 200 use the first NFC protocol at the access layer and the NFC protocol corresponding to the NFC simulated card at the application layer.
[0422] 11. When the NFC card reader 200 supports the first NFC protocol, the second NFC protocol and the third NFC protocol, and the electronic device 100 supports the second NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform access layer signaling interaction procedures based on the second NFC protocol.
[0423] The electronic device 100 and the NFC card reader 200 can execute the application layer signaling interaction process based on the first NFC protocol after executing the access layer signaling interaction process based on the first NFC protocol.
[0424] When electronic device 100 activates an NFC simulated card using the first NFC protocol matched with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the first NFC protocol is successfully executed. Specifically, electronic device 100 can send card information of the NFC simulated card using the first NFC protocol to NFC card reader 200 at the application layer based on the first NFC protocol, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the first NFC protocol at the application layer based on the card information of the NFC simulated card using the first NFC protocol.
[0425] When electronic device 100 fails to activate an NFC simulation card that matches the first NFC protocol of NFC card reader 200, electronic device 100 and NFC card reader 200 fail to execute the application layer signaling interaction process based on the first NFC protocol. Electronic device 100 and NFC card reader 200 can execute the access layer signaling interaction process based on the second NFC protocol and the application layer signaling interaction process based on the third NFC protocol.
[0426] When electronic device 100 activates an NFC simulated card using the third NFC protocol compatible with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the third NFC protocol is successfully executed. Specifically, electronic device 100 can send the card information of the NFC simulated card using the third NFC protocol to NFC card reader 200 at the application layer, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the third NFC protocol at the application layer.
[0427] When electronic device 100 has not activated an NFC simulation card that matches the third NFC protocol of NFC card reader 200, electronic device 100 and NFC card reader 200 fail to execute the application layer signaling interaction process based on the third NFC protocol. Electronic device 100 and NFC card reader 200 can execute the card swiping interaction process based on the second NFC protocol. For details, please refer to the example shown in case 4.
[0428] In other examples, when the electronic device 100 fails to swipe an NFC simulated card based on the first NFC protocol or the second NFC protocol, the electronic device 100 can prompt the user to select an NFC simulated card. The electronic device 100 can then perform a card swiping transaction with the NFC card reader 200 based on the user-selected NFC simulated card. Specifically, the electronic device 100 and the NFC card reader 200 use the first NFC protocol at the access layer and the NFC protocol corresponding to the NFC simulated card at the application layer.
[0429] 12. When the NFC card reader 200 supports the first NFC protocol, the second NFC protocol and the third NFC protocol, and the electronic device 100 supports the third NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform access layer signaling interaction procedures based on the third NFC protocol.
[0430] The electronic device 100 and the NFC card reader 200 can execute the application layer signaling interaction process based on the third NFC protocol after executing the access layer signaling interaction process based on the first NFC protocol.
[0431] When electronic device 100 activates an NFC simulated card using the first NFC protocol matched with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the first NFC protocol is successfully executed. Specifically, electronic device 100 can send card information of the NFC simulated card using the first NFC protocol to NFC card reader 200 at the application layer based on the first NFC protocol, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the first NFC protocol at the application layer based on the card information of the NFC simulated card using the first NFC protocol.
[0432] When electronic device 100 fails to activate an NFC simulation card that matches the first NFC protocol of NFC card reader 200, electronic device 100 and NFC card reader 200 fail to execute the application layer signaling interaction process based on the first NFC protocol. Electronic device 100 and NFC card reader 200 can then execute the access layer signaling interaction process based on the third NFC protocol and the application layer signaling interaction process based on the third NFC protocol.
[0433] When electronic device 100 activates an NFC simulated card using the third NFC protocol compatible with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the third NFC protocol is successfully executed. Specifically, electronic device 100 can send the card information of the NFC simulated card using the third NFC protocol to NFC card reader 200 at the application layer, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the third NFC protocol at the application layer.
[0434] When electronic device 100 has not activated an NFC simulation card using the third NFC protocol matched with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and NFC card reader 200 based on the third NFC protocol fails. When the NFC simulation card activated by electronic device 100 using the second NFC protocol supports application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the third NFC protocol and application layer signaling interaction processes based on the second NFC protocol. When the NFC simulation card activated by electronic device 100 using the second NFC protocol does not support application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the third NFC protocol and card swipe verification interaction processes based on the second NFC protocol. For details, please refer to the example shown in Case 7.
[0435] In other examples, when the electronic device 100 fails to swipe an NFC simulated card based on the first NFC protocol or the second NFC protocol, the electronic device 100 can prompt the user to select an NFC simulated card. The electronic device 100 can then perform a card swiping transaction with the NFC card reader 200 based on the user-selected NFC simulated card. Specifically, the electronic device 100 and the NFC card reader 200 use the first NFC protocol at the access layer and the NFC protocol corresponding to the NFC simulated card at the application layer.
[0436] 13. When the NFC card reader 200 supports the first NFC protocol, the second NFC protocol and the third NFC protocol, and the electronic device 100 supports the first NFC protocol and the second NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform the access layer signaling interaction process based on the first NFC protocol.
[0437] The electronic device 100 and the NFC card reader 200 can execute the application layer signaling interaction process based on the first NFC protocol after executing the access layer signaling interaction process based on the first NFC protocol.
[0438] When electronic device 100 activates an NFC simulated card using the first NFC protocol matched with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the first NFC protocol is successfully executed. Specifically, electronic device 100 can send card information of the NFC simulated card using the first NFC protocol to NFC card reader 200 at the application layer based on the first NFC protocol, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the first NFC protocol at the application layer based on the card information of the NFC simulated card using the first NFC protocol.
[0439] When electronic device 100 fails to activate an NFC simulation card that matches the first NFC protocol of NFC card reader 200, electronic device 100 and NFC card reader 200 fail to execute the application layer signaling interaction process based on the first NFC protocol. Electronic device 100 and NFC card reader 200 can execute the access layer signaling interaction process based on the first NFC protocol and the application layer signaling interaction process based on the third NFC protocol.
[0440] When electronic device 100 activates an NFC simulated card using the third NFC protocol compatible with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the third NFC protocol is successfully executed. Specifically, electronic device 100 can send the card information of the NFC simulated card using the third NFC protocol to NFC card reader 200 at the application layer, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the third NFC protocol at the application layer.
[0441] When electronic device 100 has not activated an NFC simulation card using the third NFC protocol compatible with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and NFC card reader 200 based on the third NFC protocol fails. When the NFC simulation card activated by electronic device 100 using the second NFC protocol supports application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the first NFC protocol and application layer signaling interaction processes based on the second NFC protocol. When the NFC simulation card activated by electronic device 100 using the second NFC protocol does not support application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the first NFC protocol and card swipe verification interaction processes based on the second NFC protocol.
[0442] In other examples, when the electronic device 100 fails to swipe an NFC simulated card based on the first NFC protocol or the second NFC protocol, the electronic device 100 can prompt the user to select an NFC simulated card. The electronic device 100 can then perform a card swiping transaction with the NFC card reader 200 based on the user-selected NFC simulated card. Specifically, the electronic device 100 and the NFC card reader 200 use the first NFC protocol at the access layer and the NFC protocol corresponding to the NFC simulated card at the application layer.
[0443] Optionally, when the electronic device 100 and the NFC card reader 200 fail to execute the access layer signaling interaction process based on the first NFC protocol and the application layer signaling interaction process based on the third NFC protocol, respectively, the electronic device 100 and the NFC card reader 200 may execute the access layer signaling interaction process based on the second NFC protocol and the application layer signaling interaction process based on the third NFC protocol.
[0444] Optionally, when the electronic device 100 and the NFC card reader 200 fail to execute the access layer signaling interaction process based on the first NFC protocol and the application layer signaling interaction process based on the second NFC protocol, they may execute the access layer signaling interaction process and the application layer signaling interaction process based on the second NFC protocol.
[0445] Optionally, when the electronic device 100 and the NFC card reader 200 fail to execute the access layer signaling interaction process based on the first NFC protocol and the card swipe verification process based on the second NFC protocol, the electronic device 100 and the NFC card reader 200 may execute the access layer signaling interaction process and the card swipe verification process based on the second NFC protocol.
[0446] 14. When the NFC card reader 200 supports one or more of the first NFC protocol, the second NFC protocol, and the third NFC protocol, and the electronic device 100 supports the first NFC protocol and the third NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform the access layer signaling interaction process based on the first NFC protocol.
[0447] The electronic device 100 and the NFC card reader 200 can execute the application layer signaling interaction process based on the first NFC protocol after executing the access layer signaling interaction process based on the first NFC protocol.
[0448] When electronic device 100 activates an NFC simulated card using the first NFC protocol matched with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the first NFC protocol is successfully executed. Specifically, electronic device 100 can send card information of the NFC simulated card using the first NFC protocol to NFC card reader 200 at the application layer based on the first NFC protocol, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the first NFC protocol at the application layer based on the card information of the NFC simulated card using the first NFC protocol.
[0449] When electronic device 100 fails to activate an NFC simulation card that matches the first NFC protocol of NFC card reader 200, electronic device 100 and NFC card reader 200 fail to execute the application layer signaling interaction process based on the first NFC protocol. Electronic device 100 and NFC card reader 200 can execute the access layer signaling interaction process based on the first NFC protocol and the application layer signaling interaction process based on the third NFC protocol.
[0450] When electronic device 100 activates an NFC simulated card using the third NFC protocol compatible with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the third NFC protocol is successfully executed. Specifically, electronic device 100 can send the card information of the NFC simulated card using the third NFC protocol to NFC card reader 200 at the application layer, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the third NFC protocol at the application layer.
[0451] When electronic device 100 has not activated an NFC simulation card using the third NFC protocol compatible with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and NFC card reader 200 based on the third NFC protocol fails. When the NFC simulation card activated by electronic device 100 using the second NFC protocol supports application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the first NFC protocol and application layer signaling interaction processes based on the second NFC protocol. When the NFC simulation card activated by electronic device 100 using the second NFC protocol does not support application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the first NFC protocol and card swipe verification interaction processes based on the second NFC protocol.
[0452] In other examples, when the electronic device 100 fails to swipe an NFC simulated card based on the first NFC protocol or the second NFC protocol, the electronic device 100 can prompt the user to select an NFC simulated card. The electronic device 100 can then perform a card swiping transaction with the NFC card reader 200 based on the user-selected NFC simulated card. Specifically, the electronic device 100 and the NFC card reader 200 use the first NFC protocol at the access layer and the NFC protocol corresponding to the NFC simulated card at the application layer.
[0453] Optionally, when the access layer signaling interaction process based on the first NFC protocol fails to be executed and the application layer signaling interaction process based on the third NFC protocol fails to be executed, the electronic device 100 and the NFC card reader 200 may execute the access layer signaling interaction process based on the third NFC protocol and the application layer signaling interaction process based on the third NFC protocol.
[0454] Optionally, when the electronic device 100 and the NFC card reader 200 fail to execute the access layer signaling interaction process based on the first NFC protocol and the application layer signaling interaction process based on the second NFC protocol, they may execute the access layer signaling interaction process based on the third NFC protocol and the application layer signaling interaction process based on the second NFC protocol.
[0455] Optionally, when the electronic device 100 and the NFC card reader 200 fail to execute the access layer signaling interaction process based on the first NFC protocol and the card swipe verification process based on the second NFC protocol, they may execute the access layer signaling interaction process based on the third NFC protocol and the card swipe verification process based on the second NFC protocol.
[0456] 15. When the NFC card reader 200 supports one or more of the first NFC protocol, the second NFC protocol, and the third NFC protocol, and the electronic device 100 supports the second NFC protocol and the third NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform the access layer signaling interaction process based on the third NFC protocol.
[0457] Electronic device 100 and NFC card reader 200 can execute application layer signaling interaction procedures based on the third NFC protocol after executing access layer signaling interaction procedures based on the third NFC protocol.
[0458] When electronic device 100 activates an NFC simulated card using the first NFC protocol matched with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the first NFC protocol is successfully executed. Specifically, electronic device 100 can send card information of the NFC simulated card using the first NFC protocol to NFC card reader 200 at the application layer based on the first NFC protocol, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the first NFC protocol at the application layer based on the card information of the NFC simulated card using the first NFC protocol.
[0459] When electronic device 100 fails to activate an NFC simulation card that matches the first NFC protocol of NFC card reader 200, electronic device 100 and NFC card reader 200 fail to execute the application layer signaling interaction process based on the first NFC protocol. Electronic device 100 and NFC card reader 200 can then execute the access layer signaling interaction process based on the third NFC protocol and the application layer signaling interaction process based on the third NFC protocol.
[0460] When electronic device 100 activates an NFC simulated card using the third NFC protocol compatible with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the third NFC protocol is successfully executed. Specifically, electronic device 100 can send the card information of the NFC simulated card using the third NFC protocol to NFC card reader 200 at the application layer, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the third NFC protocol at the application layer.
[0461] When electronic device 100 has not activated an NFC simulation card using the third NFC protocol compatible with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and NFC card reader 200 based on the third NFC protocol fails. When the NFC simulation card activated by electronic device 100 using the second NFC protocol supports application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the third NFC protocol and application layer signaling interaction processes based on the second NFC protocol. When the NFC simulation card activated by electronic device 100 using the second NFC protocol does not support application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the third NFC protocol and card swipe verification interaction processes based on the second NFC protocol.
[0462] In other examples, when the electronic device 100 fails to swipe an NFC simulated card based on the first NFC protocol or the second NFC protocol, the electronic device 100 can prompt the user to select an NFC simulated card. The electronic device 100 can then perform a card swiping transaction with the NFC card reader 200 based on the user-selected NFC simulated card. Specifically, the electronic device 100 and the NFC card reader 200 use the first NFC protocol at the access layer and the NFC protocol corresponding to the NFC simulated card at the application layer.
[0463] Optionally, when the electronic device 100 and the NFC card reader 200 fail to execute the access layer signaling interaction process based on the third NFC protocol and the application layer signaling interaction process based on the first NFC protocol, they may execute the access layer signaling interaction process based on the second NFC protocol and the application layer signaling interaction process based on the first NFC protocol.
[0464] Optionally, when the electronic device 100 and the NFC card reader 200 fail to execute the access layer signaling interaction process based on the third NFC protocol and the application layer signaling interaction process based on the second NFC protocol, they may execute the access layer signaling interaction process and the application layer signaling interaction process based on the second NFC protocol.
[0465] Optionally, when the electronic device 100 and the NFC card reader 200 fail to execute the access layer signaling interaction process based on the third NFC protocol and the card swipe verification process based on the second NFC protocol, the electronic device 100 and the NFC card reader 200 may execute the access layer signaling interaction process and the card swipe verification process based on the second NFC protocol.
[0466] 16. When the NFC card reader 200 supports one or more of the first NFC protocol, the second NFC protocol, and the third NFC protocol, and the electronic device 100 supports the first NFC protocol, the second NFC protocol, and the third NFC protocol at the access layer, the electronic device 100 and the NFC card reader 200 can perform the access layer signaling interaction process based on the first NFC protocol.
[0467] The electronic device 100 and the NFC card reader 200 can execute the application layer signaling interaction process based on the first NFC protocol after executing the access layer signaling interaction process based on the first NFC protocol.
[0468] When electronic device 100 activates an NFC simulated card using the first NFC protocol matched with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the first NFC protocol is successfully executed. Specifically, electronic device 100 can send card information of the NFC simulated card using the first NFC protocol to NFC card reader 200 at the application layer based on the first NFC protocol, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the first NFC protocol at the application layer based on the card information of the NFC simulated card using the first NFC protocol.
[0469] When electronic device 100 fails to activate an NFC simulation card that matches the first NFC protocol of NFC card reader 200, electronic device 100 and NFC card reader 200 fail to execute the application layer signaling interaction process based on the first NFC protocol. Electronic device 100 and NFC card reader 200 can execute the access layer signaling interaction process based on the first NFC protocol and the application layer signaling interaction process based on the third NFC protocol.
[0470] When electronic device 100 activates an NFC simulated card using the third NFC protocol compatible with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and the third NFC protocol is successfully executed. Specifically, electronic device 100 can send the card information of the NFC simulated card using the third NFC protocol to NFC card reader 200 at the application layer, and NFC card reader 200 can successfully perform a card swiping transaction using the NFC simulated card using the third NFC protocol at the application layer.
[0471] When electronic device 100 has not activated an NFC simulation card using the third NFC protocol compatible with NFC card reader 200, the application layer signaling interaction process between electronic device 100 and NFC card reader 200 based on the third NFC protocol fails. When the NFC simulation card activated by electronic device 100 using the second NFC protocol supports application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the first NFC protocol and application layer signaling interaction processes based on the second NFC protocol. When the NFC simulation card activated by electronic device 100 using the second NFC protocol does not support application layer protocol simulation cards, electronic device 100 and NFC card reader 200 can perform access layer signaling interaction processes based on the first NFC protocol and card swipe verification interaction processes based on the second NFC protocol.
[0472] In other examples, when the electronic device 100 fails to swipe an NFC simulated card based on the first NFC protocol or the second NFC protocol, the electronic device 100 can prompt the user to select an NFC simulated card. The electronic device 100 can then perform a card swiping transaction with the NFC card reader 200 based on the user-selected NFC simulated card. Specifically, the electronic device 100 and the NFC card reader 200 use the first NFC protocol at the access layer and the NFC protocol corresponding to the NFC simulated card at the application layer.
[0473] Optionally, when the access layer signaling interaction process based on the first NFC protocol fails to be executed and the application layer signaling interaction process based on the third NFC protocol fails to be executed, the electronic device 100 and the NFC card reader 200 may execute the access layer signaling interaction process based on the third NFC protocol and the application layer signaling interaction process based on the third NFC protocol.
[0474] Optionally, when the electronic device 100 and the NFC card reader 200 fail to execute the access layer signaling interaction process based on the first NFC protocol and the application layer signaling interaction process based on the second NFC protocol, they may execute the access layer signaling interaction process and the application layer signaling interaction process based on the second NFC protocol.
[0475] Optionally, when the electronic device 100 and the NFC card reader 200 fail to execute the access layer signaling interaction process based on the first NFC protocol and the card swipe verification process based on the second NFC protocol, the electronic device 100 and the NFC card reader 200 may execute the access layer signaling interaction process and the card swipe verification process based on the second NFC protocol.
[0476] It is understandable that when the NFC card reader 200 and the electronic device 100 do not support the same NFC protocol, the NFC card reader 200 and the electronic device 100 cannot perform card swiping transactions.
[0477] It is also understandable that when the NFC card reader 200 and the electronic device 100 support more than three NFC protocols, the order in which the NFC card reader 200 and the electronic device 100 use the NFC protocols can be deduced from the above embodiments. In this way, more protocols can be compatible, better NFC protocols can be used, and better card-swiping performance can be achieved.
[0478] In one possible implementation, when the NFC reader 200 supports three or more NFC communication protocols (including the first NFC protocol), the NFC reader 200 and the electronic device 100 can set the priority of the NFC protocols. The first NFC protocol has the highest priority. The NFC reader 200 can preferentially use the first NFC protocol to interact with the electronic device 100 for access layer signaling. When the electronic device 100 does not support the access layer signaling interaction process of the first NFC protocol, the NFC reader 200 can use the second-highest priority NFC protocol among the supported NFC protocols to interact with the electronic device 100 for access layer signaling, and so on. After the NFC reader 200 and the electronic device 100 complete the access layer signaling interaction process, the NFC reader 200 can preferentially use the first NFC protocol to interact with the electronic device 100 for application layer signaling. When the electronic device 100 does not support the application layer signaling interaction process of the first NFC protocol, the NFC reader 200 can use the second-highest priority NFC protocol among the supported NFC protocols to interact with the electronic device 100 for application layer signaling, and so on. In this way, electronic device 100 can be compatible with multiple NFC protocols and ensure the card swiping service of NFC analog cards using the first NFC protocol.
[0479] In some examples, if the NFC card reader 200 and electronic device 100 fail to execute the application layer signaling interaction process based on the first NFC protocol or the third NFC protocol, and if electronic device 100 supports the access layer signaling interaction process of the second NFC protocol, electronic device 100 can send a card search response using the second NFC protocol to NFC card reader 200. NFC card reader 200 and electronic device 100 can then execute the card swiping interaction process based on the second NFC protocol. Thus, when the access layer of electronic device 100 supports the second NFC protocol, executing the card swiping interaction process based on the second NFC protocol is more adaptable to different NFC protocols.
[0480] Similarly, in some examples, if the NFC card reader 200 and the electronic device 100 fail to execute the application layer signaling interaction process based on the first NFC protocol, and if the electronic device 100 supports the access layer signaling interaction process of the third NFC protocol, the electronic device 100 can send a card search response using the third NFC protocol to the NFC card reader 200. The NFC card reader 200 and the electronic device 100 can then execute both the access layer signaling interaction process and the application layer signaling interaction process based on the third NFC protocol.
[0481] It should be noted that the NFC card reader 200 supports multiple NFC communication protocols, including a first NFC protocol and a second NFC protocol. It is not limited to prioritizing the first NFC protocol for signaling interaction. When the electronic device 100 enters the radio frequency field of the NFC card reader 200, the NFC card reader 200 may prioritize the second NFC protocol for signaling interaction. Specifically, the NFC card reader 200 may prioritize the second NFC protocol for access layer signaling interaction with the electronic device 100. If the NFC card reader 200 and the electronic device 100 fail to execute the access layer signaling interaction based on the second NFC protocol, the NFC card reader 200 may execute the access layer signaling interaction based on the first NFC protocol. After successfully executing the access layer signaling interaction based on the first NFC protocol, the NFC card reader 200 may execute the application layer signaling interaction based on the second NFC protocol. If the NFC card reader 200 fails to execute the application layer signaling interaction process with the electronic device 100 based on the second NFC protocol, it can execute the application layer signaling interaction process with the electronic device 100 based on the first NFC protocol. In this way, the NFC card reader 200 and the electronic device 100 can also be compatible with multiple NFC protocols and are applicable to more card-swiping scenarios.
[0482] The following describes another hardware structure of an electronic device 100 provided in the embodiments of this application.
[0483] Figure 12 This illustration shows a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of this application.
[0484] The following description uses electronic device 100 as an example to illustrate the embodiment. It should be understood that... Figure 12 The electronic device 100 shown is merely an example, and the electronic device 100 may have more than Figure 12 The more or fewer components shown can be combined into two or more components, or they can have different component configurations. Figure 12 The various components shown can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0485] Electronic device 100 may include: processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include one or more of the following: pressure sensor 180A, gyroscope sensor 180B, barometric pressure sensor 180C, magnetic sensor 180D, accelerometer sensor 180E, distance sensor 180F, proximity sensor 180G, fingerprint sensor 180H, temperature sensor 180J, touch sensor 180K, ambient light sensor 180L, bone conduction sensor 180M, etc.
[0486] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0487] Processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. Processor 110 may also include memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that processor 110 has just used or is recurring. If processor 110 needs to reuse the instruction or data, it can directly retrieve it from the memory. This avoids repeated access, reduces the waiting time of processor 110, and thus improves system efficiency.
[0488] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0489] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0490] The charging management module 140 receives charging input from the charger. The power management module 141 connects to the battery 142, and the charging management module 140 connects to the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc.
[0491] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0492] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0493] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0494] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0495] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0496] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display panel can also be manufactured using organic light-emitting diodes (OLEDs), active-matrix organic light-emitting diodes (AMOLEDs), flexible light-emitting diodes (FLEDs), miniled, microled, micro-OLEDs, quantum dot light-emitting diodes (QLEDs), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0497] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0498] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The internal memory 121 can be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.). Furthermore, the internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0499] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0500] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. Gyroscope sensor 180B can be used to determine the motion posture of electronic device 100. Barometric pressure sensor 180C is used to measure air pressure. Magnetic sensor 180D includes a Hall sensor. Accelerometer sensor 180E can detect the magnitude of acceleration of electronic device 100 in various directions (generally three axes). Distance sensor 180F is used to measure distance. Proximity sensor 180G may include, for example, a light-emitting diode (LED) and a photodetector, such as a photodiode. Ambient light sensor 180L is used to sense ambient light intensity. Fingerprint sensor 180H is used to collect fingerprints. Temperature sensor 180J is used to detect temperature. Touch sensor 180K, also called a "touch panel". Touch sensor 180K can be set on display screen 194, and touch sensor 180K and display screen 194 form a touch screen, also called a "touch screen". Touch sensor 180K is used to detect touch operations applied to or near it. A touch sensor can transmit detected touch operations to an application processor to determine the type of touch event. Visual output related to the touch operation can be provided via display screen 194. In some embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194. Bone conduction sensor 180M can acquire vibration signals. Buttons 190 include a power button, volume buttons, etc. Motor 191 can generate vibration cues. Indicator 192 may be an indicator light, used to indicate charging status, battery level changes, or to indicate messages, missed calls, notifications, etc.
[0501] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0502] In some embodiments, the wireless communication module 160 can specifically be used to establish a short-range wireless communication link with the NFC card reader 200, so that the two can perform short-range wireless data transmission with each other. Exemplarily, the aforementioned short-range wireless communication link can be a Bluetooth link, a Wi-Fi link, an NFC link, etc. Therefore, the wireless communication module 160 can specifically include a Bluetooth communication module, a Wi-Fi communication module, or an NFC module. The NFC module can include any suitable components for enabling proximity-based contactless communication between the electronic device 100 and the NFC card reader 200, thereby providing NFC functionality to the electronic device 100. A description of the NFC module can be found above. Figure 4 The embodiments shown are not described in detail here.
[0503] The foregoing details the method provided in this application. In order to facilitate better implementation of the above-described solutions in the embodiments of this application, the embodiments of this application also provide corresponding devices or equipment.
[0504] This application embodiment can divide the electronic device 100 and NFC card reader 200 into functional modules according to the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0505] The following will combine Figures 13 to 16 The communication device of the embodiments of this application is described in detail.
[0506] In the case of using integrated units, see Figure 13 , Figure 13 This is a schematic diagram of the structure of the communication device 1300 provided in an embodiment of this application. The communication device 1300 can be the electronic device 100 in the above embodiments or an NFC tag card. Optionally, the communication device 1300 can be a chip / chip system, such as an NFC chip. Figure 13 As shown, the communication device 1300 may include a transceiver unit 1310 and a processing unit 1320.
[0507] The transceiver unit 1310 can also be used to perform NFC sending and NFC receiving functions performed by the electronic device 100 in the above embodiments of this application.
[0508] Optionally, the processing unit 1320 can also be used to perform functional steps related to NFC protocol parsing and encapsulation, NFC service processing flow, and display, which are performed by the electronic device 100 in the above embodiments of this application.
[0509] It should be understood that the communication device 1300 in this design can perform the method steps executed by the electronic device 100 in the aforementioned embodiments, and for the sake of brevity, it will not be described again here.
[0510] In the case of using integrated units, see Figure 14 , Figure 14 This is a schematic diagram of the communication device 1400 provided in an embodiment of this application. The communication device 1400 can be the NFC card reader 200 in the above embodiments. Figure 14 As shown, the communication device 1400 may include a transceiver unit 1410 and a processing unit 1420.
[0511] Optionally, the transceiver unit 1410 can also be used to perform the NFC sending and NFC receiving functions performed by the NFC card reader 200 in the above embodiments of this application.
[0512] Optionally, the processing unit 1420 can also be used to execute the functional steps related to NFC protocol parsing and encapsulation and NFC service processing flow executed by the NFC card reader 200 in the above embodiments of this application.
[0513] It should be understood that the communication device 1400 in this design can perform the method steps executed by the NFC card reader 200 in the aforementioned embodiment, and for the sake of brevity, it will not be described again here.
[0514] The above describes the electronic device 100 and the NFC card reader 200 according to embodiments of this application. It should be understood that any device possessing the above-described features... Figure 13 Any product of the aforementioned electronic device 100, regardless of its form, that possesses the above-mentioned functions. Figure 14 Any form of product that incorporates the functionality of the NFC card reader 200 falls within the protection scope of this application's embodiments.
[0515] As one possible product form, the electronic device 100 described in this application embodiment can be implemented using a general bus architecture.
[0516] See Figure 15 , Figure 15 This is a schematic diagram of the structure of the communication device 1500 provided in an embodiment of this application. The communication device 1500 can be an electronic device 100 or an NFC tag card, or a device within the electronic device 100 or an NFC tag card. For example... Figure 15As shown, the communication device 1500 includes a processor 1501 and a transceiver 1502 internally connected and communicating with the processor 1501. The processor 1501 can be a general-purpose processor or a dedicated processor, such as a central processing unit and / or an NFC controller. The transceiver 1502, also known as a transceiver unit, transceiver, or transceiver circuit, is used to implement transceiver functions. The transceiver 1502 may include a receiver and a transmitter. The receiver, also known as a receiver circuit, is used to implement a receiving function, such as an NFC receiving function; the transmitter, also known as a transmitter or transmitting circuit, is used to implement a transmitting function, such as an NFC transmitting function. Optionally, the communication device 1500 may also include an antenna 1503 and / or a radio frequency unit (RF unit). Figure 15 (Not shown in the image), for example, an NFC antenna, where the NFC antenna can be a coil-type antenna. The antenna 1503 and / or the radio frequency unit can be located inside the communication device 1500 or separate from the communication device 1500, that is, the antenna 1503 and / or the radio frequency unit can be remotely or distributedly deployed.
[0517] Optionally, the communication device 1500 may include one or more memories 1504, which may store instructions, which may be computer programs, that can be executed on the communication device 1500 to cause the communication device 1500 to perform the method steps described in the above embodiments of this application. Optionally, the memory 1504 may also store data. The communication device 1500 and the memory 1504 may be provided separately or integrated together.
[0518] The processor 1501, transceiver 1502, and memory 1504 can be connected via a communication bus.
[0519] In one design, the communication device 1500 can be used to perform the functions of the electronic device 100 in the foregoing embodiments: the processor 1501 can be used to perform the functional steps related to NFC protocol parsing and encapsulation, NFC service processing flow and display performed by the electronic device 100 in the foregoing embodiments of this application and / or other processes used in the technology described herein; the transceiver 1502 can be used to perform the functional steps related to NFC sending and NFC receiving performed by the electronic device 100 in the foregoing embodiments of this application and / or other processes used in the technology described herein.
[0520] In any of the above designs, the processor 1501 may include a transceiver for implementing receive and transmit functions. For example, the transceiver may be a transceiver circuit, an interface, or an interface circuit. The transceiver circuit, interface, or interface circuit for implementing receive and transmit functions may be separate or integrated. The aforementioned transceiver circuit, interface, or interface circuit may be used for reading and writing code / data, or it may be used for transmitting or relaying signals.
[0521] In any of the above designs, the processor 1501 may store instructions, which may be computer programs. These computer programs, running on the processor 1501, cause the communication device 1500 to execute the method steps performed by the electronic device 100 in the above embodiments of this application. The computer program may be embedded in the processor 1501; in this case, the processor 1501 may be implemented in hardware.
[0522] In one implementation, the communication device 1500 may include circuitry capable of performing the functions of transmitting, receiving, or communicating as described in the foregoing method embodiments. The processor and transceiver described in this application can be implemented on integrated circuits (ICs), analog ICs, radio frequency integrated circuits (RFICs), mixed-signal ICs, application-specific integrated circuits (ASICs), printed circuit boards (PCBs), electronic devices, etc. The processor and transceiver can also be manufactured using various IC process technologies, such as complementary metal-oxide-semiconductor (CMOS), n-metal-oxide-semiconductor (NMOS), positive-channel metal-oxide-semiconductor (PMOS), bipolar junction transistors (BJTs), bipolar CMOS (BiCMOS), silicon-germanium (SiGe), gallium arsenide (GaAs), etc.
[0523] The scope of the communication device described in this application is not limited thereto, and the structure of the communication device may vary. Figure 15 The communication device 1500 may be a standalone device or part of a larger device. For example, the communication device 1500 may be:
[0524] (1) A standalone integrated circuit IC, or chip, or chip system or subsystem; (2) A collection of one or more ICs, optionally including storage components for storing data or computer programs; (3) An ASIC, such as an NFC chip; (4) A module that can be embedded in other devices; (5) A receiver, terminal, smart terminal, cellular phone, wireless device, handheld device, mobile unit, vehicle device, network device, cloud device, artificial intelligence device, etc.; (6) Others, etc.
[0525] As a possible product form, the NFC card reader 200 described in this application embodiment can be implemented using a general bus architecture.
[0526] See Figure 16 , Figure 16 This is a schematic diagram of the communication device 1600 provided in an embodiment of this application. The communication device 1600 may be an NFC card reader 200, or a device thereof. Figure 16 As shown, the communication device 1600 includes a processor 1601 and a transceiver 1602 internally connected and communicating with the processor 1601. The processor 1601 can be a general-purpose processor or a dedicated processor, such as an NFC controller. The transceiver 1602, also known as a transceiver unit, transceiver, or transceiver circuit, is used to implement transceiver functions. The transceiver 1602 may include a receiver and a transmitter. The receiver, also known as a receiver circuit, is used to implement a receiving function; the transmitter, also known as a transmitter or transmitting circuit, is used to implement a transmitting function. Optionally, the communication device 1600 may also include an antenna 1603 and / or a radio frequency unit (not shown in the figure). The antenna 1603 and / or the radio frequency unit may be located inside the communication device 1600 or separate from it; that is, the antenna 1603 and / or the radio frequency unit may be remotely or distributedly deployed.
[0527] Optionally, the communication device 1600 may include one or more memories 1604, which may store instructions, which may be computer programs, that can be executed on the communication device 1600 to cause the communication device 1600 to perform the method steps described in the above embodiments of this application. Optionally, the memory 1604 may also store data. The communication device 1600 and the memory 1604 may be provided separately or integrated together.
[0528] The processor 1601, transceiver 1602, and memory 1604 can be connected via a communication bus.
[0529] In one design, the communication device 1600 can be used to perform the functions of the NFC card reader 200 in the foregoing embodiments: the processor 1601 can be used to perform the above-mentioned functions. Figure 16 The NFC card reader 200 in the illustrated embodiment performs functional steps related to NFC protocol parsing and encapsulation, NFC service processing flow, and / or other processes used in the technology described herein; the transceiver 1602 can be used to perform the above. Figure 16 The NFC card reader 200 in the illustrated embodiment performs functional steps related to NFC sending and NFC receiving, and / or other processes used in the technology described herein.
[0530] In any of the above designs, the processor 1601 may include a transceiver for implementing receive and transmit functions. For example, the transceiver may be a transceiver circuit, an interface, or an interface circuit. The transceiver circuit, interface, or interface circuit for implementing receive and transmit functions may be separate or integrated. The aforementioned transceiver circuit, interface, or interface circuit may be used for reading and writing code / data, or it may be used for transmitting or relaying signals.
[0531] In any of the above designs, the processor 1601 may store instructions, which may be computer programs. These computer programs, running on the processor 1601, cause the communication device 1600 to execute the method steps performed by the NFC card reader 200 in the above method embodiments. The computer program may be embedded in the processor 1601; in this case, the processor 1601 may be implemented in hardware.
[0532] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps performed by the electronic device 100 in the above-described method embodiments.
[0533] This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the steps performed by the NFC card reader 200 in the above-described method embodiments.
[0534] This application also provides a computer program product, including a computing program, which, when run on a computer, enables the computer to perform the steps executed by the electronic device 100 in the above-described method embodiments.
[0535] This application also provides a computer program product, including a computing program, which, when run on a computer, enables the computer to perform the steps executed by the NFC card reader 200 in the above-described method embodiments.
[0536] This application also provides a chip system, which includes a processing circuit interface circuit. The interface circuit receives code instructions and transmits them to the processing circuit. The processing circuit executes the code instructions to enable the chip system to perform the steps executed by the electronic device 100 in any method embodiment of this application. The chip system can be a single chip or a chip module composed of multiple chips.
[0537] This application also provides a chip system, which includes a processing circuit interface circuit. The interface circuit receives code instructions and transmits them to the processing circuit. The processing circuit executes the code instructions to enable the chip system to perform the steps executed by the NFC card reader 200 in any method embodiment of this application. The chip system can be a single chip or a chip module composed of multiple chips.
[0538] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A near-field communication (NFC) processing method, applied to electronic devices, characterized in that, The method includes: After entering the radio frequency field of the NFC card reader, the device receives a first card search request and a second card search request from the NFC card reader. The first card search request is used to indicate that the NFC card reader supports the first NFC protocol, and the second card search request is used to indicate that the NFC card reader supports the second NFC protocol. If the electronic device does not support the first NFC protocol at the access layer but supports the second NFC protocol at the access layer, it sends a second card search response to the NFC card reader. The second card search response is used to indicate that the electronic device supports the second NFC protocol. Based on the second NFC protocol, the access layer signaling interaction process is executed with the NFC card reader device; If the electronic device activates a first NFC simulated card that matches the first NFC protocol of the NFC card reader, the card swiping service of the first NFC simulated card is performed at the application layer based on the first NFC protocol and the NFC card reader.
2. The method according to claim 1, characterized in that, After receiving the first card search request and the second card search request sent by the NFC card reader, the method further includes: If the electronic device supports the first NFC protocol at the access layer, it sends a first card search response of the first NFC protocol to the NFC card reader. The first card search response is used to indicate that the electronic device supports the first NFC protocol. Based on the first NFC protocol, an access layer signaling interaction process is executed with the NFC card reader device; If the electronic device has activated the first NFC emulated card, it performs the card swiping service of the first NFC emulated card with the NFC card reader device at the application layer based on the first NFC protocol.
3. The method according to claim 1, characterized in that, After the access layer signaling interaction process is performed with the NFC reader device based on the second NFC protocol, the method further includes: If the electronic device has not activated the first NFC emulator card but has activated the second NFC emulator card with the second NFC protocol that matches the NFC card reader, after the application layer fails to execute the card swiping service of the first NFC emulator card with the NFC card reader based on the first NFC protocol, it will execute the card swiping service of the second NFC emulator card with the NFC card reader based on the second NFC protocol.
4. The method according to claim 1, characterized in that, After receiving the first card search request and the second card search request sent by the NFC card reader, the method further includes: The third card search request sent by the NFC card reader is received, and the third card search request is used to indicate that the NFC card reader supports the third NFC protocol; If the electronic device does not support the first NFC protocol at the access layer but supports the third NFC protocol at the access layer, it sends a third card search response of the third NFC protocol to the NFC card reader. The third card search response is used to indicate that the electronic device supports the third NFC protocol. Based on the third NFC protocol, the access layer signaling interaction process is executed with the NFC card reader; If the electronic device has activated the first NFC emulated card, it performs the card swiping service of the first NFC emulated card with the NFC card reader device at the application layer based on the first NFC protocol.
5. The method according to claim 4, characterized in that, After the access layer signaling interaction process is performed with the NFC reader device based on the third NFC protocol, the method further includes: If the electronic device has not activated the first NFC emulator card but has activated the third NFC emulator card with the third NFC protocol that matches the NFC card reader, after the application layer fails to execute the card swiping service of the first NFC emulator card with the NFC card reader based on the first NFC protocol, it will execute the card swiping service of the third NFC emulator card with the NFC card reader based on the third NFC protocol.
6. The method according to claim 4, characterized in that, After receiving the third card search request sent by the NFC card reader, the method further includes: If the electronic device does not support the first NFC protocol at the access layer, does not support the third NFC protocol at the access layer, but supports the second NFC protocol at the access layer, it sends the second card search response to the NFC card reader. Based on the second NFC protocol, the access layer signaling interaction process is executed with the NFC card reader device; If the electronic device has activated the first NFC emulated card, it performs the card swiping service of the first NFC emulated card with the NFC card reader device at the application layer based on the first NFC protocol.
7. The method according to claim 6, characterized in that, After the access layer signaling interaction process is performed with the NFC reader device based on the second NFC protocol, the method further includes: If the electronic device has not activated the first NFC emulated card but has activated the third NFC emulated card of the third NFC protocol that matches the NFC card reader, after the application layer fails to execute the card swiping service of the NFC emulated card of the first NFC protocol with the NFC card reader based on the first NFC protocol, the access layer signaling interaction process is executed with the NFC card reader based on the second NFC protocol. The card swiping service of the third NFC simulated card is performed based on the third NFC protocol and the NFC card reader device.
8. The method according to claim 7, characterized in that, After the access layer signaling interaction process is performed with the NFC reader device based on the second NFC protocol, the method further includes: If the electronic device has not activated the first NFC emulator card, has not activated the third NFC emulator card, but has activated the second NFC emulator card that matches the second NFC protocol of the NFC card reader, after the application layer fails to execute the card swiping service of the first NFC emulator card with the NFC card reader based on the first NFC protocol, it will execute the access layer signaling interaction process with the NFC card reader based on the second NFC protocol. At the application layer, the card swiping service of the third NFC simulated card is executed with the NFC card reader based on the third NFC protocol; After the application layer fails to execute the card swiping service of the third NFC simulated card with the NFC card reader based on the third NFC protocol, the card swiping service is executed based on the second NFC protocol with the second NFC simulated card.
9. The method according to any one of claims 1-8, characterized in that, The step of performing the card-swiping service of the first NFC simulated card with the NFC card reader at the application layer based on the first NFC protocol specifically includes: The application layer sends the card information of the first NFC simulated card to the NFC card reader device. The card information is used by the NFC card reader device to perform the swipe card service of the NFC simulated card of the first NFC protocol.
10. The method according to claim 9, characterized in that, The step of sending the card information of the first NFC simulated card to the NFC card reader at the application layer specifically includes: The system receives a mini-program selection command sent by the NFC card reader, the mini-program selection command carrying the identifier of the first Applet; Based on the identifier of the first Applet, it is determined that the first Applet corresponds to the first NFC emulation card; The first applet sends the card information of the first NFC emulated card to the NFC card reader.
11. The method according to claim 10, characterized in that, After sending the card information of the first NFC simulated card to the NFC card reader via the first applet, the method further includes: Receive the swipe result of the first NFC simulated card sent by the NFC card reader device.
12. The method according to claim 10 or 11, characterized in that, The step of determining the first NFC emulator card corresponding to the first Applet based on the identifier of the first Applet specifically includes: Based on the identifier of the first applet, the first applet is determined from one or more applets; Using the first applet, the first DF corresponding to the first NFC emulator is determined from the MF of the first applet. The MF of the first applet includes one or more DFs, and the one or more DFs include the first DF. The first DF includes the card information of the first NFC emulator.
13. The method according to claim 12, characterized in that, The first DF also includes a first external authentication key; The step of sending the card information of the first NFC simulated card to the NFC card reader via the first Applet specifically includes: The first Applet uses a first external authentication key and a first random number to encrypt the card information of the first NFC analog card stored in the first DF to obtain encrypted data; The encrypted data is sent to the NFC card reader, and the encrypted data is used by the NFC card reader to decrypt the card information of the first NFC simulated card.
14. The method according to claim 13, characterized in that, Before encrypting the card information of the first NFC analog card using the first external authentication key and the first random number to obtain encrypted data, the method further includes: The NFC card reader receives a card information acquisition command, which is used to request the acquisition of the card information of the first NFC simulated card. The step of encrypting the card information of the first NFC simulated card using the first Applet with the first external authentication key and the first random number to obtain encrypted data specifically includes: In response to the card information acquisition command, the card information of the first NFC analog card stored in the first DF is encrypted using the first external authentication key and the first random number to obtain encrypted data.
15. The method according to claim 14, characterized in that, Before receiving the card information retrieval command sent by the NFC card reader, the method further includes: Receives a Get Challenge command sent by the NFC card reader to obtain a random number; In response to the Get Challenge command, the first random number is generated through the first Applet; Send a first response to the NFC card reader, the first response carrying the first random number; The device receives an external authentication command sent by the NFC card reader, the external authentication command carrying authentication ciphertext; The first random number is decrypted from the authentication ciphertext using the first external authentication key in the first DF through the first Applet; A second response is sent to the NFC card reader, the second response carrying a first authentication result, the first authentication result being used to indicate that the electronic device has successfully decrypted the first random number from the authentication ciphertext.
16. The method according to claim 11, characterized in that, After receiving the swipe result of the first NFC simulated card sent by the NFC card reader, the method further includes: Output the prompt corresponding to the swipe result of the first NFC simulated card.
17. The method according to claim 16, characterized in that, The method further includes: A third response is sent to the NFC card reader, the third response indicating that the electronic device has successfully received the swipe result of the first NFC simulated card.
18. A near-field communication (NFC) processing method, applied to an NFC card reader device, characterized in that, The method includes: Send a first card search request and a second card search request. The first card search request is used to indicate that the NFC card reader supports the first NFC protocol, and the second card search request is used to indicate that the NFC card reader supports the second NFC protocol. If a second card search response is received from an electronic device, the second card search response is used to indicate that the electronic device supports the second NFC protocol; Based on the second NFC protocol, the access layer signaling interaction process is executed with the NFC card reader device; At the application layer, the electronic device performs a card-swiping service using the first NFC simulated card based on the first NFC protocol. The first NFC simulated card is an NFC simulated card activated by the electronic device using the first NFC protocol.
19. The method according to claim 18, characterized in that, After sending the first card search request and the second card search request, the method further includes: If a first card search response is received from an electronic device, the first card search response is used to indicate that the electronic device supports the first NFC protocol; Based on the first NFC protocol, an access layer signaling interaction process is executed with the NFC card reader device; At the application layer, the card swiping service of the first NFC simulated card is executed with the NFC card reader device based on the first NFC protocol.
20. The method according to claim 18, characterized in that, The method further includes: If the card swiping service of the first NFC simulated card fails to be executed with the electronic device based on the first NFC protocol at the application layer, the card swiping service of the second NFC simulated card is executed with the NFC card reader based on the second NFC protocol. The second NFC simulated card is an NFC simulated card of the second NFC protocol activated by the electronic device.
21. The method according to claim 18, characterized in that, After sending the first card search request and the second card search request, the method further includes: Send a third card search request, the third card search request being used to indicate that the NFC card reader device supports the third NFC protocol; If a third card search response is received from an electronic device, the third card search response is used to indicate that the electronic device supports the third NFC protocol; Based on the third NFC protocol, the access layer signaling interaction process is executed with the NFC card reader; At the application layer, the electronic device performs a card swiping transaction for the first NFC simulated card based on the first NFC protocol.
22. The method according to claim 21, characterized in that, The method further includes: If the card swiping service of the first NFC simulated card with the electronic device fails at the application layer based on the first NFC protocol, the card swiping service of the third NFC simulated card with the NFC card reader is executed based on the third NFC protocol. The third NFC simulated card is an NFC simulated card of the third NFC protocol activated by the electronic device.
23. The method according to claim 21, characterized in that, After sending the third card search request, the method further includes: If a second card search response is received from an electronic device, the second card search response is used to indicate that the electronic device supports the second NFC protocol; Based on the second NFC protocol, the access layer signaling interaction process is executed with the NFC card reader device; At the application layer, the electronic device performs a card swiping service for the first NFC simulated card based on the first NFC protocol.
24. The method according to claim 23, characterized in that, The method further includes: If the card swiping service of the first NFC simulated card fails to be executed at the application layer with the electronic device based on the first NFC protocol, the card swiping service of the third NFC simulated card is executed with the NFC card reader based on the third NFC protocol.
25. The method according to claim 24, characterized in that, The method further includes: If the card swiping service of the third NFC simulated card fails to be executed with the NFC card reader based on the third NFC protocol, the card swiping service of the second NFC simulated card is executed with the NFC card reader based on the second NFC protocol.
26. The method according to any one of claims 18-25, characterized in that, The step of performing a card-swiping service for the first NFC simulated card with the electronic device at the application layer based on the first NFC protocol specifically includes: The application layer receives the card information of the first NFC simulated card sent by the electronic device; Based on the card information of the first NFC simulated card, the card swiping service of the first NFC simulated card is realized.
27. The method according to claim 26, characterized in that, The step of receiving the card information of the first NFC simulated card sent by the electronic device at the application layer specifically includes: Send a mini-program selection command to the electronic device. The mini-program selection command carries the identifier of the first applet and is used to request the electronic device to select the first applet. The electronic device receives card information of the first NFC simulated card sent via the first Applet.
28. The method according to claim 27, characterized in that, After receiving the card information of the first NFC simulated card sent via the first Applet through the electronic device, the method further includes: The swipe result of the first NFC simulated card is sent to the electronic device.
29. The method according to claim 27 or 28, characterized in that, The receipt of card information of the first NFC simulated card sent by the electronic device through the first Applet specifically includes: Receive encrypted data sent by the electronic device through the first applet; The card information of the first NFC emulator card is decrypted from the encrypted data using a first external authentication key and a first random number.
30. The method according to claim 29, characterized in that, Before decrypting the card information of the first NFC emulated card from the encrypted data using the first external authentication key and the first random number, the method further includes: A card information acquisition command is sent to the electronic device, the card information acquisition command being used to request the acquisition of the card information of the first NFC simulated card.
31. The method according to claim 30, characterized in that, Before sending the card information retrieval command to the electronic device, the method further includes: Send a random number to the electronic device and a Get Challenge command, wherein the Get Challenge command is used to request the first Applet of the electronic device to generate the first random number; Send a first response to the NFC card reader, the first response carrying the first random number; The first random number is encrypted using the first external authentication key to obtain the authentication ciphertext; Send an external authentication command to the electronic device, the external authentication command carrying the authentication ciphertext; The electronic device receives a second response, which carries a first authentication result. The first authentication result indicates that the electronic device has successfully decrypted the first random number from the authentication ciphertext.
32. The method according to claim 28, characterized in that, After receiving the swipe result of the first NFC simulated card sent by the NFC card reader, the method further includes: The electronic device receives a third response, which indicates that it has successfully received the swipe result of the first NFC analog card.
33. An NFC system, characterized in that, This includes electronic devices and NFC card readers; among them, The electronic device is configured to perform the near-field communication method as described in any one of claims 1-17; The NFC card reader is used to perform the near-field communication method as described in any one of claims 18-32.
34. An electronic device, characterized in that, include: One or more processors, one or more memories, and a transceiver, wherein the transceiver, the one or more memories, and the one or more processors are coupled together, the one or more memories being used to store a computer program that, when the one or more processors execute the computer program, performs the NFC processing method as described in any one of claims 1-17.
35. An NFC card reader device, characterized in that, include: One or more processors, one or more memories, and a transceiver, wherein the transceiver, the one or more memories, and the one or more processors are coupled together, the one or more memories being used to store a computer program that, when the one or more processors execute the computer program, performs the NFC processing method as described in any one of claims 18-32.
36. A computer-readable storage medium, characterized in that, The device stores a computer program that, when executed by a processor, implements the NFC processing method as described in any one of claims 1-17.
37. A computer-readable storage medium, characterized in that, The device stores a computer program that, when executed by a processor, implements the NFC processing method as described in any one of claims 18-32.
38. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the NFC processing method as described in any one of claims 1-17.
39. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the NFC processing method as described in any one of claims 18-32.
40. A chip system, characterized in that, It includes a processing circuit and an interface circuit, wherein the interface circuit is used to receive code instructions and transmit them to the processing circuit, and the processing circuit is used to execute the code instructions to perform the NFC processing method as described in any one of claims 1-17.
41. A chip system, characterized in that, It includes a processing circuit and an interface circuit, wherein the interface circuit is used to receive code instructions and transmit them to the processing circuit, and the processing circuit is used to execute the code instructions to perform the NFC processing method as described in any one of claims 18-32.