Card management method and related device
By dynamically selecting commands between NFC card readers and electronic devices, multiple NFC analog cards can be activated and coexist simultaneously, solving the problem of multi-card coexistence failure in existing technologies and improving the success rate and speed of card swiping.
Patent Information
- Application Number
- CN202410875130.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-29
- Publication Date
- 2025-12-30
AI Technical Summary
In existing electronic devices using NFC technology, multiple NFC emulator cards cannot be activated and coexist simultaneously, causing NFC service execution failures. Furthermore, switching between emulator cards in the default active state requires multiple communications, resulting in slow card-swiping speeds.
By sending selection commands, selection confirmation (SAK) commands, and selection (AID) commands between NFC card readers and electronic devices, the appropriate NFC emulation card is dynamically selected for communication, ensuring that multiple emulation cards are activated simultaneously and meet the card swiping requirements of the current scenario.
It improves the success rate and speed of NFC card swiping, and avoids card swiping failures and multiple communication delays caused by the default activation state of the simulated card.
Smart Images

Figure CN121234960A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of wireless communication technology, and in particular to a card management method and related apparatus. Background Technology
[0002] With the development of wireless communication technology, Near Field Communication (NFC) technology has been widely used. NFC technology evolved from the integration of contactless radio frequency identification (RFID) and interconnection technologies. 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 emulators in their electronic devices, allowing the devices to include the NFC parameters of these emulators. 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, and interact with NFC devices (also known as NFC readers) in PCD mode. However, if multiple NFC emulators are activated, when the electronic device approaches an NFC reader, it will use the NFC parameters of the active NFC emulator to attempt to perform NFC services. However, only one NFC emulator is active at a time, preventing multiple emulators from coexisting. The NFC reader cannot recognize NFC signaling containing NFC parameters from multiple emulators, causing the NFC service to fail. Summary of the Invention
[0004] This application discloses a card management method and related apparatus, which can ensure that electronic devices and near-field communication (NFC) card readers communicate through application layer protocols, thereby enabling electronic devices to select a suitable NFC emulator card from multiple NFC emulator cards and complete NFC card swiping transactions with the NFC card reader, thus achieving simultaneous activation and coexistence of these multiple NFC emulator cards.
[0005] In a first aspect, this application provides a card management method applied to an NFC card reader device. For example, the target proximity smart card PICC of the NFC card reader device is a PICC that supports access layer protocols (such as ISO14443-3 protocol or IEC14443-3 protocol) and application layer protocols (such as ISO14443-4 protocol or IEC14443-4 protocol). The method includes: sending a select command in the access layer protocol to an electronic device, the select command being used to select the electronic device to interact with an NFC card reader via NFC; receiving a first Select Confirmation (SAK) command in the access layer protocol sent by the electronic device in response to the select command, the first SAK command indicating that the application layer protocol is not supported; after receiving the first SAK command, sending a Select App ID (AID) command in the application layer protocol to the electronic device, for example, the NFC card reader does not verify the first SAK command, so after receiving the first SAK command, it will continue the communication process of the application layer protocol (including sending the Select AID command); the Select AID command is used to identify a first NFC emulator card, for example, to identify the first NFC emulator card from one or more NFC emulator cards (supporting both access layer and application layer protocols) in the electronic device; then interacting with the electronic device via NFC and completing the card swiping transaction of the first NFC emulator card.
[0006] In the above method, even if the first SAK command sent by the electronic device to the NFC reader indicates that the application layer protocol is not supported, the NFC reader will still send a Select AID command to the electronic device. For example, the NFC reader does not verify the SAK command. The Select AID command allows the electronic device to determine the corresponding first NFC emulator from one or more NFC emulators, instead of only using the NFC emulator in the default active state and the NFC reader for NFC card swiping. This can be understood as one or more NFC emulators in the electronic device "participating" in each NFC communication, thus enabling the simultaneous activation and coexistence of multiple NFC emulators in the electronic device. Furthermore, the first NFC emulator selected by the electronic device according to the Select AID command matches the card swiping requirements of the current scenario, which is more accurate. This avoids the situation where only the NFC emulator in the default active state is used for NFC interaction with the NFC reader, but the NFC emulator in the default active state is not the target PICC of the NFC reader, resulting in card swiping failure. It also avoids the situation where the electronic device needs to perform multiple NFC communications when randomly switching to the NFC emulator in the default active state, resulting in slow card swiping. Therefore, the success rate and speed of NFC card swiping are improved.
[0007] In one possible implementation, the first NFC emulator supports both access layer and application layer protocols. The electronic device also includes a second NFC emulator (e.g., an NFC emulator in a default active state). The second NFC emulator supports the access layer protocol but does not support the application layer protocol. The first SAK command is obtained based on the NFC parameters of the second NFC emulator, such as the first SAK command. The method further includes: sending a request command (e.g., a Type A request command REQA or a Type B request command REQB) in the access layer protocol to the electronic device before sending a selection command; receiving a request response command (e.g., a Type A request reply command ATQA or a Type B request reply command ATQB) in the access layer protocol sent by the electronic device in response to the request command, the request response command being obtained based on the NFC parameters of the second NFC emulator, such as the request response command; and sending an anti-collision command in the access layer protocol to the electronic device in response to the request response command. For example, the NFC reader does not verify the request-response command, so after receiving the request-response command sent by the electronic device, it will continue the access layer protocol communication process with the electronic device (including sending the anti-collision command); it receives the unique identifier UID of the second NFC emulator card sent by the electronic device in response to the anti-collision command (for example, the NFC parameters of the second NFC emulator card include the UID of the second NFC emulator card); the above selection command is sent by the NFC reader in response to the UID of the second NFC emulator card sent by the electronic device. For example, the NFC reader does not verify the UID of the second NFC emulator card sent by the electronic device, so after receiving the UID of the second NFC emulator card sent by the electronic device, it will continue the access layer protocol communication process with the electronic device (including sending the selection command).
[0008] In the above method, the target PICC of the NFC card reader can be the first NFC emulator card, not the second NFC emulator card. Even if the request-response command, UID, and first SAK command sent by the electronic device to the NFC card reader are all obtained based on the NFC parameters of the second NFC emulator card, the NFC card reader will still continue to communicate with the electronic device. For example, the NFC card reader does not verify the request-response command, UID, and SAK command. This ensures that the electronic device and the NFC card reader communicate using the application layer protocol. This allows the electronic device to select the first NFC emulator card required by the NFC card reader during the application layer protocol communication process and perform the card swiping service with the first NFC emulator card, further improving the success rate and speed of NFC card swiping.
[0009] In one possible implementation, the method further includes: after receiving the first SAK command sent by the electronic device, sending a Select Response Request (RATS) command in the application layer protocol to the electronic device; receiving a Select Response (ATS) command in the application layer protocol sent by the electronic device in response to the RATS command, wherein the content of the ATS command does not conform to the preset requirements of the NFC card reader, for example, the content of the ATS command is empty, or the content of the ATS command is communication parameters used to implement the communication process of the application layer protocol (e.g., including length bytes indicating frame length, interface bytes indicating rate, interface bytes indicating frame wait time (FWT) and start frame protection time (SFGT), interface bytes indicating whether logical channel number (CID) is supported, and history bytes), but the communication parameters in the ATS command do not conform to the preset requirements of the NFC card reader; the aforementioned Select AID command is sent by the NFC card reader in response to the ATS command, for example, the NFC card reader determines that the format of the ATS command is correct (without verifying the content of the ATS command), or the NFC card reader does not verify the format and content of the ATS command, therefore, after receiving the ATS command, it will continue to send a Select AID command to the electronic device.
[0010] In the above method, even if the content of the ATS command sent by the electronic device to the NFC card reader does not meet the preset requirements of the NFC card reader, the NFC card reader will still continue to communicate with the electronic device through subsequent application layer protocol processes (including sending the Select AID command). For example, the NFC card reader may only verify the format of the ATS command or may not verify the ATS command at all. This ensures that the NFC card reader sends the Select AID command to the electronic device, allowing the electronic device to select the first NFC analog card required by the NFC card reader based on the Select AID command, and then perform the card swiping service with the electronic device using the first NFC analog card, further improving the success rate and speed of NFC card swiping.
[0011] Secondly, this application provides a card management method applied to an electronic device. The method includes: receiving a first selection command in an access layer protocol (e.g., ISO14443-3 or IEC14443-3 protocol) sent by an NFC card reader, the first selection command being used to select the electronic device to perform NFC interaction with the NFC card reader; responding to the first selection command, sending a first selection confirmation (SAK) command in the access layer protocol to the NFC card reader, the first SAK command indicating that an application layer protocol (e.g., ISO14443-4 or IEC14443-4 protocol) is not supported; receiving a select AID command in the application layer protocol sent by the NFC card reader, for example, the NFC card reader does not verify the first SAK command, therefore, after receiving the first SAK command, it will continue the communication process of the application layer protocol (including sending the select AID command); determining a first NFC emulator card from one or more NFC emulator cards (supporting access layer and application layer protocols) of the electronic device according to the select AID command; performing NFC interaction with the NFC card reader and completing the card swiping transaction of the first NFC emulator card.
[0012] In some examples, the target proximity smart card PICC of the NFC reader is a PICC that supports both access layer protocols and application layer protocols.
[0013] In the above method, even if the first SAK command sent by the electronic device to the NFC reader indicates that the application layer protocol is not supported, the NFC reader will still send a Select AID command to the electronic device. For example, the NFC reader does not verify the SAK command. The Select AID command allows the electronic device to determine the corresponding first NFC emulator from one or more NFC emulators, instead of only using the NFC emulator in the default active state and the NFC reader for NFC card swiping. This can be understood as one or more NFC emulators in the electronic device "participating" in each NFC communication, thus enabling the simultaneous activation and coexistence of multiple NFC emulators in the electronic device. Furthermore, the first NFC emulator selected by the electronic device according to the Select AID command matches the card swiping requirements of the current scenario, which is more accurate. This avoids the situation where only the NFC emulator in the default active state is used for NFC interaction with the NFC reader, but the NFC emulator in the default active state is not the target PICC of the NFC reader, resulting in card swiping failure. It also avoids the situation where the electronic device needs to perform multiple NFC communications when randomly switching to the NFC emulator in the default active state, resulting in slow card swiping. Therefore, the success rate and speed of NFC card swiping are improved.
[0014] In one possible implementation, the first NFC emulator supports both access layer and application layer protocols. The electronic device also includes a second NFC emulator (e.g., an NFC emulator in a default active state). The second NFC emulator supports the access layer protocol but does not support the application layer protocol. The first SAK command is obtained based on the NFC parameters of the second NFC emulator, such as the first SAK command. The method further includes: before receiving the first selection command sent by the NFC reader, after entering the radio frequency field of the NFC reader, receiving a request command (e.g., a Type A request command REQA or a Type B request command REQB) in the access layer protocol sent by the NFC reader; in response to the request command, sending a request response command (e.g., a Type A request reply command ATQA or a Type B request reply command ATQB) in the access layer protocol to the NFC reader, the request response command being obtained based on the NFC parameters of the second NFC emulator, such as the request response command; and receiving an anti-collision command in the access layer protocol sent by the NFC reader in response to the request response command. For example, the NFC reader does not verify the request-response command, so after receiving the request-response command sent by the electronic device, it will continue the access layer protocol communication process with the electronic device (including sending the anti-collision command); in response to the anti-collision command, the unique identifier (UID) of the second NFC emulator card is sent to the NFC reader (for example, the NFC parameters of the second NFC emulator card include the UID of the second NFC emulator card); the above-mentioned first selection command is sent by the NFC reader in response to the UID of the second NFC emulator card sent by the electronic device. For example, the NFC reader does not verify the UID of the second NFC emulator card sent by the electronic device, so after receiving the UID of the second NFC emulator card sent by the electronic device, it will continue the access layer protocol communication process with the electronic device (including sending the selection command).
[0015] In some examples, the NFC parameters of one or more NFC emulator cards (supporting access layer protocols and application layer protocols) in an electronic device are obtained by bitwise ANDing the corresponding configuration parameters and configuration mask. The NFC parameters of the one or more NFC emulator cards include at least one of the following: SAK command, request-response command and UID used to implement the communication process of the access layer protocol. The configuration mask corresponding to the NFC parameters of the one or more NFC emulator cards is zero. Therefore, the NFC parameters of the one or more NFC emulator cards are zero.
[0016] In the above method, the target PICC of the NFC card reader can be the first NFC emulator card, not the second NFC emulator card. Even if the request-response command, UID, and first SAK command sent by the electronic device to the NFC card reader are all obtained based on the NFC parameters of the second NFC emulator card, the NFC card reader will still continue to communicate with the electronic device. For example, the NFC card reader does not verify the request-response command, UID, and SAK command. This ensures that the electronic device and the NFC card reader communicate using the application layer protocol. This allows the electronic device to select the first NFC emulator card required by the NFC card reader during the application layer protocol communication process and perform the card swiping service with the first NFC emulator card, further improving the success rate and speed of NFC card swiping.
[0017] In one possible implementation, the method further includes: after sending a first SAK command to the NFC reader, receiving a Select Response Request (RATS) command in the application layer protocol sent by the NFC reader in response to the first SAK command; in response to the RATS command, sending an Select Response (ATS) command in the application layer protocol to the NFC reader, wherein the content of the ATS command does not conform to the preset requirements of the NFC reader, for example, the content of the ATS command is empty, or the content of the ATS command is communication parameters used to implement the communication process of the application layer protocol (e.g., including length bytes indicating frame length, interface bytes indicating rate, interface bytes indicating frame wait time (FWT) and start frame protection time (SFGT), interface bytes indicating whether logical channel number (CID) is supported, and history bytes), but the communication parameters in the ATS command do not conform to the preset requirements of the NFC reader; the Select AID command is sent by the NFC reader in response to the ATS command, for example, the NFC reader determines that the format of the ATS command is correct (without verifying the content of the ATS command), or the NFC reader does not verify the format and content of the ATS command, therefore, after receiving the ATS command, it will continue to send a Select AID command to the electronic device.
[0018] In the above method, even if the content of the ATS command sent by the electronic device to the NFC card reader does not meet the preset requirements of the NFC card reader, the NFC card reader will still continue to communicate with the electronic device through subsequent application layer protocol processes (including sending the Select AID command). For example, the NFC card reader may only verify the format of the ATS command or may not verify the ATS command at all. This ensures that the NFC card reader sends the Select AID command to the electronic device, allowing the electronic device to select the first NFC analog card required by the NFC card reader based on the Select AID command, and then perform the card swiping service with the electronic device using the first NFC analog card, further improving the success rate and speed of NFC card swiping.
[0019] In one possible implementation, the method further includes: if no RATS command in the application layer protocol is received from the NFC reader within a preset time period after sending the first SAK command to the NFC reader (e.g., the NFC reader does not send the RATS command when the first SAK command fails to be verified), then after receiving the request command in the access layer protocol sent by the NFC reader, in response to the request command, a request response command in the access layer protocol is sent to the NFC reader; a second selection command is received from the NFC reader, the second selection command being used to select the electronic device to perform NFC interaction with the NFC reader; in response to the second selection command, a second SAK command is sent to the NFC reader, the second SAK command indicating support for the application layer protocol; the aforementioned selection AID command is received from the NFC reader after sending the second SAK command, for example, the NFC reader sends the selection AID command to the electronic device when the second SAK command is verified successfully.
[0020] In some examples, the above method further includes: after sending a second SAK command to the NFC card reader, receiving a RATS command in the application layer protocol sent by the NFC card reader in response to the second SAK command; in response to the RATS command, sending an ATS command to the NFC card reader; the above-mentioned AID selection command is sent by the NFC card reader in response to the ATS command, for example, the NFC card reader sends the AID selection command to the electronic device when the ATS command verification is successful.
[0021] In some examples, the above method further includes: after sending a request-response command to the NFC reader, receiving an anti-collision command sent by the NFC reader in response to the request-response command, for example, the NFC reader sends an anti-collision command when it does not verify the request-response command; in response to the anti-collision command, sending the UID of the NFC emulator card in a default active state to the NFC reader; the second selection command is received from the NFC reader after sending the UID of the NFC emulator card in a default active state to the NFC reader, for example, the NFC reader sends the second selection command when it does not verify the UID sent by the electronic device.
[0022] In the above method, the NFC reader can verify NFC signaling such as the SAK command sent by the electronic device. After the electronic device sends a first SAK command indicating that it does not support the application layer protocol, if it does not receive a RATS command from the NFC reader, it can re-establish access layer protocol communication with the NFC reader and send a second SAK command that supports the application layer protocol. This allows the NFC reader to initiate application layer protocol communication, which can be understood as the electronic device dynamically switching the SAK command used. This ensures that the electronic device receives the selection AID command sent by the NFC reader. The selection AID command allows the electronic device to determine the first NFC emulator required by the NFC reader from one or more NFC emulator cards. In other words, even if the NFC reader verifies the NFC signaling sent by the electronic device, the electronic device can simultaneously activate and coexist multiple NFC emulator cards and automatically and accurately select the first NFC emulator card that meets the current scenario's card-swiping requirements to complete the card-swiping transaction with the NFC reader.
[0023] In one possible implementation, the electronic device is in a powered-off state, meaning the card management method provided by the second aspect and any implementation thereof can be executed by the powered-off electronic device. In this way, the electronic device can automatically and accurately select the first NFC analog card required by the NFC reader and perform a card swiping transaction with the NFC reader using the first NFC analog card, without needing to switch to the NFC analog card in a default active state. Therefore, the card swiping will not fail due to the inability to switch to the NFC analog card in a default active state. In other words, even when the electronic device is powered off, it can still normally complete the NFC analog card swiping transaction with the NFC reader, further improving the user experience.
[0024] Thirdly, this application provides a card management method applied to an electronic device. The method includes: receiving a first selection command in an access layer protocol (e.g., ISO 14443-3 or IEC 14443-3 protocol) sent by an NFC card reader, the first selection command being used to select the electronic device to perform NFC interaction with the NFC card reader; responding to the first selection command, sending a first selection confirmation (SAK) command in the access layer protocol to the NFC card reader, the first SAK command indicating that an application layer protocol (e.g., ISO 14443-4 or IEC 14443-4 protocol) is not supported; if no NFC signal is received within a preset time period after sending the first SAK command to the NFC card reader... The card reader sends a RATS command in the application layer protocol. For example, if the NFC card reader fails to send a RATS command when the first SAK command verification fails, then after receiving a request command in the access layer protocol sent by the NFC card reader, in response to the request command, it sends a request response command in the access layer protocol to the NFC card reader; it receives a second selection command sent by the NFC card reader, which is used to select the electronic device to perform NFC interaction with the NFC card reader; in response to the second selection command, it sends a second SAK command to the NFC card reader, which indicates support for the application layer protocol; it receives a select AID command in the application layer protocol sent by the NFC card reader, for example, if the NFC card reader verifies the second SAK command successfully, it sends a select AID command to the electronic device; it determines the first NFC emulator card from one or more NFC emulator cards (supporting access layer protocols and application layer protocols) of the electronic device according to the select AID command; it performs NFC interaction with the NFC card reader and completes the card swiping service of the first NFC emulator card.
[0025] In some examples, the above method further includes: after sending a second SAK command to the NFC card reader, receiving a RATS command in the application layer protocol sent by the NFC card reader in response to the second SAK command; in response to the RATS command, sending an ATS command to the NFC card reader; the above-mentioned AID selection command is sent by the NFC card reader in response to the ATS command, for example, the NFC card reader sends the AID selection command to the electronic device when the ATS command verification is successful.
[0026] In some examples, the above method further includes: after sending a request-response command to the NFC reader, receiving an anti-collision command sent by the NFC reader in response to the request-response command, for example, the NFC reader sends an anti-collision command when it does not verify the request-response command, or sends an anti-collision command when the request-response command is verified; in response to the anti-collision command, sending the UID of the NFC emulator card in the default active state to the NFC reader; the second selection command is received from the NFC reader after sending the UID of the NFC emulator card in the default active state to the NFC reader, for example, the NFC reader sends the second selection command when it does not verify the UID sent by the electronic device, or sends the second selection command when the UID sent by the electronic device is verified.
[0027] In the above method, the NFC reader can verify NFC signaling such as the SAK command sent by the electronic device. After the electronic device sends a first SAK command indicating that it does not support the application layer protocol, if it does not receive a RATS command from the NFC reader, it can re-establish access layer protocol communication with the NFC reader and send a second SAK command that supports the application layer protocol. This allows the NFC reader to initiate application layer protocol communication, which can be understood as the electronic device dynamically switching the SAK command used. This ensures that the electronic device receives the selection AID command sent by the NFC reader. The selection AID command allows the electronic device to determine the first NFC emulator required by the NFC reader from one or more NFC emulators, instead of using only the default activated NFC emulator and the NFC reader for NFC card swiping. This can be understood as one or more NFC emulators in the electronic device "participating" in every NFC communication. Therefore, even if the NFC reader verifies the NFC signaling sent by the electronic device, the electronic device can still achieve simultaneous activation and coexistence of multiple NFC emulators. Furthermore, even when the NFC reader verifies the NFC signal sent by the electronic device, the electronic device can accurately select the first NFC emulator card that meets the current scenario's swiping requirements based on the AID selection command to complete the swiping transaction. This avoids situations where only an NFC emulator card in a default active state is used for NFC interaction with the NFC reader, but the NFC emulator card in a default active state is not the target PICC of the NFC reader, resulting in swiping failure. It also avoids situations where the electronic device needs to perform multiple NFC communications when randomly switching to an NFC emulator card in a default active state, resulting in slow swiping. This improves the success rate and speed of NFC swiping.
[0028] Fourthly, this application provides a communication device, including a transceiver, a processor, and a memory; the memory is used to store a computer program, and the processor calls the computer program for the communication device to execute the card management method provided in the first aspect and any implementation thereof.
[0029] Fifthly, this application provides an electronic device including a transceiver, a processor, and a memory; the memory is used to store a computer program, and the processor calls the computer program to enable the electronic device to execute the card management method provided by the second and third aspects, and any implementation of the second and third aspects.
[0030] Sixthly, this application provides a computer storage medium including a computer program, which, when executed by a processor, is used to implement the card management method provided by the first aspect and any implementation thereof, or to implement the card management method provided by the second aspect and the third aspect and any implementation thereof.
[0031] In a seventh aspect, this application provides a computer program product, including a computer program that, when run on a processor, is used to implement the card management method provided by the first aspect and any implementation thereof, or to implement the card management method provided by the second aspect and the third aspect and any implementation thereof.
[0032] Eighthly, 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 run the code instructions to execute the card management method provided by the first aspect and any implementation thereof, or to execute the card management method provided by the second aspect and the third aspect and any implementation thereof.
[0033] Ninthly, this application provides an electronic device that includes methods or apparatus for performing any aspect or embodiment of this application. The aforementioned electronic device is, for example, a chip.
[0034] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single implementation. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one implementation. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this application do not necessarily refer to the same implementation. Furthermore, the technical features, technical solutions, and beneficial effects described in this application can be combined in any suitable manner. Those skilled in the art will understand that this application can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular implementation. In other implementations, additional technical features and beneficial effects may be identified in specific implementations that do not embody all implementations. Attached Figure Description
[0035] The following describes the accompanying drawings used in this application.
[0036] Figure 1 This is a schematic diagram illustrating the working principle of Near Field Communication (NFC) provided in this application;
[0037] Figure 2 This is a schematic diagram of the architecture of an NFC system provided in this application;
[0038] Figure 3 This is a schematic diagram of the structure of an electronic device provided in this application;
[0039] Figure 4 This is a schematic diagram of an NFC protocol stack architecture provided in this application;
[0040] Figure 5 This is a flowchart illustrating a communication process provided in this application;
[0041] Figure 6 This is a flowchart illustrating yet another communication process provided in this application;
[0042] Figure 7 This is a schematic diagram of another NFC system architecture provided in this application;
[0043] Figure 8 This is a schematic diagram of another NFC system architecture provided in this application;
[0044] Figure 9 This is a schematic diagram illustrating one method for setting NFC parameters provided in this application;
[0045] Figure 10 This is a flowchart illustrating a card management method provided in this application;
[0046] Figure 11This is a flowchart illustrating yet another card management method provided in this application;
[0047] Figure 12 This is a schematic diagram of the hardware structure of an electronic device provided in this application;
[0048] Figures 13-16 These are schematic diagrams of the structures of some communication devices provided in this application. Detailed Implementation
[0049] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings. The terminology used in the implementation section of this application is only for explaining specific embodiments of this application and is not intended to limit this application.
[0050] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.
[0051] 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.
[0052] The working principle of the near field communication (NFC) technology in the embodiments of this application is described below.
[0053] Figure 1 This is a schematic diagram illustrating the working principle of Near Field Communication (NFC) provided in an embodiment of this application.
[0054] like Figure 1As shown, the two parties communicating using NFC technology can include a proximity coupling device (PCD) and a proximity integrated circuit 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., 106 kilobits per second, 212 kbps, 424 kbps, or 848 kbps) and specific frequencies (e.g., 13.56 mega hertz, MHz). Communication between the PCD and PICC can occur at close range, for example, within a range of approximately 2 to 4 centimeters.
[0055] 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 PCD's 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.
[0056] The NFC system in the embodiments of this application is described below.
[0057] Figure 2 This is a schematic diagram of the architecture of an NFC system 10 provided in an embodiment of this application.
[0058] 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 emulate a PICC (Personalized Control Center) conforming to NFC standards using data from an NFC emulation card, thereby implementing PICC functionality. The electronic device 100 can activate one or more NFC emulation cards and include the NFC parameters of these emulation cards.
[0059] When electronic device 100 and NFC card reader 200 are brought close together, electronic device 100 can act as a PICC (Private Card Center) and communicate with NFC card reader 200 (acting as a PCD) using the NFC parameters of the NFC analog card in electronic device 100. When NFC card reader 200 communicates using NFC technology as a PCD, it can also be referred to as being in PCD mode; similarly, when electronic device 100 communicates using NFC technology as a PICC, it can also be referred to as being in PICC mode.
[0060] In some embodiments, the NFC emulator card in the electronic device 100 can support the NFC protocol, which can be the contactless card standard ISO14443 / IEC14443 protocol. The electronic device 100 in PICC mode can communicate with the NFC card reader 200 in PCD mode using the ISO14443 / IEC14443 protocol. In some embodiments, the NFC emulator card in the electronic device 100 can include a first type and a second type. The first type of NFC emulator card can support the access layer ISO14443-3 / IEC14443-3 protocol (referred to as the access layer protocol) but not the application layer ISO14443-4 / IEC14443-4 protocol (referred to as the application layer protocol). The second type of NFC emulator card can support both the access layer protocol and the application layer protocol. In some examples, the first type of NFC emulator card is a Mifare card (e.g., an access card), and the second type of NFC emulator card is a central processing unit (CPU) card (e.g., a transportation card, car key, digital certificate, bank card, etc.). In some examples, electronic device 100 can use a first type of NFC emulator card and NFC reader 200 to perform access layer protocol communication. In some examples, electronic device 100 can use a second type of NFC emulator card and NFC reader 200 to perform access layer protocol and application layer protocol communication.
[0061] In some embodiments, the electronic device 100 can support both PICC mode and PCD mode. When in PCD mode, the electronic device 100 can act as a PCD transmitter, using the radio frequency field to communicate with the PICC. When in PICC mode, the electronic device 100 can act as a PICC passive receiver of the radio frequency field transmitted by the PCD, communicating with the PCD through load modulation technology. In some examples, after enabling NFC, the electronic device 100 can be in PICC mode; in other examples, after enabling NFC, the electronic device 100 can switch between PICC and PCD modes in a time-sharing manner.
[0062] 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.
[0063] In this embodiment, the NFC card reader 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, smart home devices such as smart screen and smart speaker, wearable devices such as smart bracelet, smart watch, and smart glasses, extended reality devices such as augmented reality, virtual reality, and mixed reality, vehicles, gates, smart locks, card readers, payment terminals (e.g., point of sale (POS) machines), ticket purchase and / or ticket verification terminals, bank service terminals, and document card readers.
[0064] The structure of the electronic device 100 in the embodiments of this application is described below.
[0065] Figure 3 This is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of this application.
[0066] like Figure 3As shown, the electronic device 100 may include a processor 101 and an NFC module 102. The processor 101 may run one or more applications (APPs). In some examples, the one or more applications may include a wallet application, one or more host-based card emulation (HCE) applications, a subscriber identity module (SIM) card application, etc. In some embodiments, the electronic device 100 may also include a secure element (SE) 103 and / or a 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.
[0067] In some embodiments, the electronic device 100 can activate one or more NFC emulation cards in an application based on user input, thereby enabling the electronic device 100 to support one or more NFC services. The business processing logic of the NFC emulation card in the electronic device 100 is specifically implemented by an applet. The applet can be stored and run in the hardware device or software module (e.g., HCE application, SE103, SIM card 104, etc.) corresponding to the NFC emulation card.
[0068] NFC module 102 can be used to enable communication between electronic device 100 and NFC card reader 200 using NFC technology. NFC module 102 may include an NFC controller ( Figure 3 (not shown), NFC transceiver ( Figure 3 (not shown) and NFC memory ( Figure 3 (Not shown), wherein the NFC controller can be connected to the processor 101, and the NFC controller can also be connected to the NFC transceiver and the NFC memory respectively.
[0069] The NFC controller in NFC module 102 can be used for modulation and demodulation of contactless communication signals, control the input and output of data in the NFC memory, and interact with the processor 101. The NFC transceiver in NFC module 102 can be used to transmit and receive NFC signals (e.g., 13.56MHz radio frequency signals). In some embodiments, the NFC transceiver may include an EMC filtering circuit, a matching circuit, a receiving circuit, and an NFC antenna, wherein the NFC antenna may be a loop antenna, used to realize the proximity-based contactless communication capability of NFC module 102. The NFC memory in NFC module 102 can be used to store data sent by NFC module 102 to NFC reader device 200, as well as data received from NFC reader device 200.
[0070] In some embodiments, the NFC memory can be a single memory shared by the NFC module 102 and other modules in the electronic device 100. 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. In other embodiments, the NFC memory can be a collection of multiple memories. For example, the NFC controller may include a first memory among these multiple memories. The first memory can be used to store instructions or data that the NFC controller has used or reused. If the NFC controller needs to reuse the instructions or data, it can directly access them from the first memory, thus reducing the waiting time of the NFC controller. The SE 103 may include a second memory among these multiple memories. The second memory can be used to store card information of NFC emulator cards based on the Security Component (SE) (e.g., including an Applet containing an NFC emulator card). Thus, if the SE 103 needs to read the card information of the NFC emulator card, it can read the card information of the NFC emulator card from the second memory in the SE 103. The SIM card 104 may include a third memory among these multiple memories. The third memory can be used to store card information of NFC emulator cards based on the SIM card (e.g., including Applets of NFC emulator cards). In this way, if the SIM card 104 needs to read the card information of the NFC emulator card, it can read the card information of the NFC emulator card from the third memory in the SIM card 104.
[0071] In some embodiments, the NFC memory can also be used to store routing information. For example, the first memory in the NFC memory can be used to store routing information. In some embodiments, the routing information can be controlled or managed by the NFC controller. The routing information can include a routing table, which consists of a list of routing rules. Each routing rule contains an applet identifier (AID) and a corresponding destination. The AID is the identifier of the applet used to implement the business logic of the NFC emulator card. The destination corresponding to the AID is the location where the applet with that AID runs (i.e., the hardware device or software module corresponding to the NFC emulator card with that AID). In some examples, the destination can include at least one of the following: one or more HCE applications in the processor 101, SE 103, or SIM card 104.
[0072] In some embodiments, SE103 and NFC module 102 may be two separate chips. In other embodiments, SE103 and NFC module 102 may be packaged within a single chip.
[0073] In some embodiments, the card emulation mode of the NFC emulation card of the electronic device 100 may include a hardware-based virtual card mode and a software-based HCE mode.
[0074] 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 NFC commands from external NFC reader 200 and forwards them to SE103 or SIM card 104. The Applet in SE103 or SIM card 104 processes the NFC commands and generates response data for NFC reader 200. SE103 or SIM card 104 can send the response data to NFC module 102, and NFC module 102 can then send the response data to external NFC reader 200. In some examples, a user can activate one or more NFC emulator cards in a wallet application. The wallet application can write the applets and card data of one or more NFC emulator cards to SE103, and SE103 can run the applets of one or more NFC emulator cards. In some examples, a user can activate one or more NFC emulator cards in a SIM card application. The SIM card application can write the applets and card data of one or more NFC emulator cards to SIM card 104 for storage, and SIM card 104 can run the applets of one or more NFC emulator cards.
[0075] In software-based HCE mode, the HCE application 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. NFC module 102, acting as the front end of contactless communication, receives NFC commands from the external NFC reader 200 and forwards them to the HCE application in processor 101. The HCE application can process the NFC commands through the applet running within it or a cloud server, generating response data for the PCD. The HCE application can then send the response data to NFC module 102, which in turn can send the response data to the external NFC reader 200. In some examples, a user can activate one or more NFC emulator cards in the HCE application, which can run one or more NFC emulator card applets. The HCE application can also store the NFC emulator card data on the local memory of electronic device 100 or on a cloud server.
[0076] For example, in the card emulation scenario described above, the electronic device 100 can have a native NFC-related application installed, and users can also download and install third-party applications from an app store. 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, a SIM card application, etc., and the third-party application can be a payment application, a social application, a banking application, etc. The above examples are only used to explain the embodiments of this application and should not be construed as limiting.
[0077] In some embodiments, the processor 101 may further include 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.
[0078] The NFC protocol stack in the embodiments of this application is described below.
[0079] Figure 4 This is a schematic diagram of an NFC protocol stack architecture provided in an embodiment of this application.
[0080] like Figure 4 As shown, the NFC protocol stack can include a physical layer, radio frequency layer, access layer, transport layer, and application layer. Among them,
[0081] The physical layer can be used to implement the physical characteristics of NFC technology communication.
[0082] The radio frequency (RF) layer can be used to implement RF specifications for NFC technology communication, such as data rate and RF signal frequency.
[0083] 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.
[0084] The transport layer includes a high-speed data transmission protocol, which enables data transmission between the PCD and PICC at the application layer.
[0085] 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 code-free payment, electronic tickets, access control, digital ID cards, all-scenario contactless payment, and near-field data transmission. The one or more service management policies may include any one or more of file management, card long-term activation, security management, and service routing management. In some embodiments, the processing logic of the NFC services may be executed by an Applet. In some embodiments, the processing logic of the service management policies may be executed by... Figure 3The NFC basic service module in the processor 101 shown is executed.
[0086] Currently, when electronic device 100 has activated multiple NFC emulator cards, when electronic device 100 is near NFC card reader 200, electronic device 100 will use the NFC parameters of one of the activated NFC emulator cards (such as a preset default activation card) to communicate with NFC card reader 200 using NFC technology. The specific process is as follows: Figure 5 and Figure 6 .
[0087] Figure 5 An exemplary flowchart of a communication process is shown.
[0088] Figure 5 The communication process shown can be applied to an NFC system including electronic device 100 and NFC card reader 200, for example... Figure 2 The NFC system 10 shown is described. Electronic device 100 can be in PICC mode; for example, electronic device 100 is in PICC mode by default after enabling NFC. NFC card reader 200 can be in PCD mode.
[0089] Figure 5 The following explanation uses an NFC simulation card in an active state in electronic device 100 as an example of the first type of NFC simulation card. Figure 5 The communication process shown can be the communication process of the access layer protocol of NFC technology (such as ISO14443-3 protocol / IEC14443-3 protocol).
[0090] Figure 5 The communication process shown may include, but is not limited to, the following steps:
[0091] S100: Electronic device 100 enters the radio frequency field of NFC card reader 200.
[0092] S101: The NFC card reader 200 sends a request command to the electronic device 100.
[0093] In some embodiments of this application, the NFC card reader 200 in PCD mode can broadcast a request command through the radio frequency field. When the electronic device 100 in PICC mode enters the radio frequency field of the NFC card reader 200, the electronic device 100 can receive the request command broadcast by the NFC card reader 200.
[0094] In some embodiments of this application, the request command may be a type A request command (REQA) or a type B request command (REQB) in the ISO14443-3 protocol / IEC14443-3 protocol.
[0095] S102: Electronic device 100 sends a request-response command to NFC card reader 200.
[0096] In some embodiments of this application, the request-response command can be a Type A request-response command (answer to request type A, ATQA) or a Type B request-response command (answer to request type B, ATQB) in the ISO14443-3 / IEC14443-3 protocol. In the ISO14443-3 / IEC14443-3 protocol, an NFC device in PICC mode that receives a REQA / REQB can return ATQA / ATQB if it supports the ISO14443-3 / IEC14443-3 protocol. In some embodiments of this application, the electronic device 100 includes an NFC analog card that supports NFC protocols (e.g., ISO14443 / IEC14443 protocol). Therefore, after receiving a request command broadcast by the NFC card reader 200, the electronic device 100 can send a request-response command to the NFC card reader 200.
[0097] In some embodiments of this application, electronic device 100 can generate a request-response command based on the request-response command parameters in the NFC parameters of an active NFC emulator card, and send the request-response command to NFC reader device 200. In some examples, the request-response command sent by electronic device 100 can indicate whether the active NFC emulator card in electronic device 100 supports anti-collision mechanisms in access layer protocols, such as bit-oriented anti-collision mechanisms in the ISO14443-3 / IEC14443-3 protocol. In some examples, the request-response command sent by electronic device 100 can include the length of the unique identifier (UID) of the active NFC emulator card in electronic device 100.
[0098] S103: NFC card reader device 200 request response command verification passed.
[0099] In some embodiments of this application, the NFC card reader 200 can determine whether the electronic device 100 supports the anti-collision mechanism in the access layer protocol based on the request-response command sent by the electronic device 100. If the determination result is yes, the request-response command sent by the electronic device 100 passes the verification; otherwise, the request-response command fails the verification.
[0100] In some embodiments of this application, the NFC card reader 200 can not only determine whether the electronic device 100 supports the anti-collision mechanism in the access layer protocol, but also determine whether the length of the UID carried in the request-response command (i.e., the UID of the NFC analog card in the active state of the electronic device 100) conforms to the preset length range of the NFC card reader 200. For example, the preset length range is the range of the UID length of the target PICC required by the NFC card reader 200. When the electronic device 100 supports the anti-collision mechanism in the access layer protocol, and the length of the UID carried in the request-response command conforms to the preset length range of the NFC card reader 200, the NFC card reader 200 verifies the request-response command sent by the electronic device 100; otherwise, the verification fails.
[0101] In some embodiments of this application, when the NFC card reader 200 verifies the request-response command sent by the electronic device 100, the NFC card reader 200 can continue to perform subsequent processes of the access layer protocol, such as executing S104.
[0102] S104: NFC card reader 200 sends an anti-collision command to electronic device 100.
[0103] In some embodiments of this application, the anti-collision command can instruct an NFC device in PICC mode to return the entire UID. In some embodiments of this application, the SEL field in the anti-collision command has a value of 93, and the NVB field has a value of 20. In some embodiments of this application, the anti-collision command can also be called a select command. The anti-collision command and the select command described in S107 can be different select commands, for example, they may include different fields and have different values.
[0104] S105: Electronic device 100 sends the UID of an activated NFC analog card to NFC card reader 200.
[0105] In some embodiments of this application, electronic device 100 may send the UID parameter from the NFC parameters of an active NFC analog card to NFC reader device 200.
[0106] S106: The UID verification of the NFC card reader 200 for the activated NFC analog card has passed.
[0107] In some embodiments of this application, the NFC card reader 200 can determine whether the UID of the electronic device 100 belongs to the preset UID list of the NFC card reader 200. If the determination result is yes, the UID verification of the electronic device 100 passes. The preset UID list of the NFC card reader 200 may include one or more UIDs. For example, if the NFC card reader 200 is an access control gate for community A, the preset UID list of the NFC card reader 200 includes the UIDs of the access control cards for community A.
[0108] In some embodiments of this application, when the NFC card reader 200 verifies the UID of the electronic device 100, the NFC card reader 200 can continue to perform subsequent processes of the access layer protocol, such as executing S107.
[0109] S107: NFC card reader 200 sends a select command to electronic device 100.
[0110] In some embodiments of this application, the NFC card reader 200 can determine the selected electronic device 100 and therefore can send a selection command to the electronic device 100. In some examples, after the NFC card reader 200 sends an anti-collision command, it receives a UID sent by an electronic device 100, and there is no conflict between multiple NFC devices in PICC mode (i.e., no card conflict). Therefore, the NFC card reader 200 can determine the selected electronic device 100.
[0111] In some embodiments of this application, the selection command may include the field SEL, the field NVB, the complete UID and CRC of the selected electronic device 100, the field SEL may be 20, and the field NVB may be 70.
[0112] S108: Electronic device 100 sends a select acknowledge (SAK) command to NFC card reader 200 (indicating that the application layer protocol is not supported).
[0113] In some embodiments of this application, the select confirmation command can indicate whether an application layer protocol (e.g., ISO14443-4 protocol or IEC14443-4 protocol) is supported. In some examples, the select confirmation command is 1 byte long, including 8 bits, where the 6th bit is set to 1 to indicate support for the application layer protocol and set to 0 to indicate that the application layer protocol is not supported.
[0114] In some embodiments of this application, the electronic device 100 can generate a selection confirmation command based on the SAK parameter in the NFC parameters of the NFC emulator card in an active state, and send the selection confirmation command to the NFC card reader 200. Since the NFC emulator card in the active state in the electronic device 100 is of the first type, i.e., it does not support application layer protocols, the selection confirmation command sent by the electronic device 100 to the NFC card reader 200 indicates that the application layer protocol is not supported.
[0115] S109: NFC card reader device 200 select confirmation command verification passed.
[0116] In some embodiments of this application, the NFC card reader 200 can determine whether the electronic device 100 supports the application layer protocol based on the received selection confirmation command, thereby realizing the verification of the selection confirmation command. Figure 5 Taking the target PICC required by the NFC card reader 200 as a first type PICC that supports the access layer protocol but does not support the application layer protocol as an example, the NFC card reader 200 can pass the verification of the selection confirmation command when the received selection confirmation command indicates that the application layer protocol is not supported.
[0117] In some embodiments of this application, since the NFC card reader successfully verifies the UID in S106 and successfully verifies the selection confirmation command in S109, the NFC card reader 200 can determine that the verification of the NFC simulated card in the active state in the electronic device 100 is successful, and can execute the card swiping service of the NFC simulated card. The card swiping service can include any one of the following: opening access control, unlocking a door, unlocking a vehicle, making a transaction payment, verifying electronic tickets, verifying digital documents, and using a transportation card to board or alight. In some examples, the NFC card reader 200 can send the card swiping result of the NFC simulated card in the active state in the electronic device 100 to the electronic device 100. Since the NFC card reader 200 successfully verifies the NFC simulated card in the active state in the electronic device 100, the card swiping result indicates success. However, this is not limited to this. In other examples, when the NFC card reader 200 fails to verify the NFC simulated card in the active state in the electronic device 100, the NFC card reader 200 can send a card swiping result indicating failure to the electronic device 100.
[0118] In some examples, the NFC card reader 200 and the electronic device 100 perform... Figure 5During the communication process shown, electronic device 100 can output a swipe notification for an active NFC simulated card. For example, this notification could be a card-shaped icon displaying the name of the active NFC simulated card. The swipe notification for the active NFC simulated card can be used to inform the user that electronic device 100 is using the NFC simulated card for swiping. In some examples, after receiving a swipe result from the NFC reader 200 indicating that the active NFC simulated card in electronic device 100 is active, electronic device 100 can output the swipe result, such as indicating successful or unsuccessful swipe. If the swipe is successful, it can also display payment information.
[0119] Figure 6 An exemplary flowchart of yet another communication process is shown.
[0120] Figure 6 The communication process shown can be applied to an NFC system including electronic device 100 and NFC card reader 200, for example... Figure 2 The NFC system 10 shown is described. Electronic device 100 can be in PICC mode; for example, electronic device 100 is in PICC mode by default after enabling NFC. NFC card reader 200 can be in PCD mode.
[0121] Figure 6 The following explanation uses an NFC simulation card in the electronic device 100 that is in an active state as an example of the second type of NFC simulation card. Figure 6 The communication process shown may include the communication process of the access layer protocol (e.g., ISO14443-3 protocol / IEC14443-3 protocol) and the communication process of the application layer protocol (e.g., ISO14443-4 protocol / IEC14443-4 protocol) of NFC technology.
[0122] Figure 6 The communication process shown may include, but is not limited to, the following steps:
[0123] S200: Electronic device 100 enters the radio frequency field of NFC card reader 200.
[0124] S201: NFC card reader 200 sends a request command to electronic device 100.
[0125] S202: Electronic device 100 sends a request-response command to NFC card reader 200.
[0126] S203: NFC card reader device 200's request response command verification passed.
[0127] S204: NFC card reader 200 sends an anti-collision command to electronic device 100.
[0128] S205: Electronic device 100 sends the UID of an activated NFC analog card to NFC card reader 200.
[0129] S206: The NFC card reader 200 has successfully verified the UID of the activated NFC analog card.
[0130] S207: NFC card reader 200 sends a select command to electronic device 100.
[0131] S208: Electronic device 100 sends a Select Confirmation (SAK) command to NFC card reader 200 (indicating support for application layer protocol).
[0132] S209: NFC card reader device 200 select confirmation command verification passed.
[0133] Figure 6 S200-S209 and Figure 5 Similar to S100-S109. Figure 6 In S208, since the NFC analog card in the electronic device 100 is of type 2, meaning it supports the application layer protocol, the electronic device 100 sends a selection confirmation command to the NFC card reader 200 indicating support for the application layer protocol. Figure 6 In S209, Figure 6 Taking the target PICC required by the NFC card reader 200 as a second type of PICC that supports the application layer protocol as an example, the NFC card reader 200 can pass the verification of the selection confirmation command when the received selection confirmation command indicates support for the application layer protocol.
[0134] In some embodiments of this application, when the NFC card reader 200 verifies the selection confirmation command sent by the electronic device 100, the NFC card reader 200 can initiate an application layer communication process, such as executing S210.
[0135] S210: The NFC card reader 200 sends a request for answer to select (RATS) command to the electronic device 100.
[0136] S211: Electronic device 100 sends an answer to select (ATS) command to NFC card reader 200.
[0137] In some embodiments of this application, the electronic device 100 includes an NFC analog card that supports application layer protocols. Therefore, after receiving the RATS command sent by the NFC card reader 200, the electronic device 100 can send an ATS command to the NFC card reader 200.
[0138] In some embodiments of this application, the ATS command can be used to negotiate communication parameters used in the communication process of the application layer protocol between the electronic device 100 and the NFC card reader 200. The ATS command may include communication parameters in the electronic device 100 for implementing the communication process of the application layer protocol, such as length byte (indicating frame length), interface byte 1 (indicating rate), interface byte 2 (indicating frame wait time (FWT) and start frame guard time (SFGT)), interface byte 3 (indicating whether logical channel identity (CID) is supported), and history byte, etc.
[0139] S212: NFC card reader device 200-pair select response command verification passed.
[0140] In some embodiments of this application, the NFC card reader 200 can obtain communication parameters from the electronic device 100 for implementing the communication process of the application layer protocol according to the Select Response (ATS) command. Furthermore, the NFC card reader 200 can determine whether the communication parameters meet its preset requirements. For example, it can determine whether the communication parameters are the same as the communication parameters required by the NFC card reader 200 for implementing the application layer protocol. If the determination 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 application protocol data units (APDUs) in the application layer protocol, for example, by executing S213.
[0141] S213: The NFC card reader 200 sends a select AID command (including the first AID) to the electronic device 100.
[0142] In some embodiments of this application, the select AID command may carry the first AID corresponding to the target PICC required by the NFC reader device 200.
[0143] S214: Electronic device 100 sends the card information of the NFC analog card corresponding to the first AID to NFC card reader 200.
[0144] In some embodiments of this application, the electronic device 100 can obtain the first AID carried in the select AID command and determine whether there is an NFC simulation card corresponding to the first AID among one or more NFC simulation cards included in the electronic device 100. When the electronic device 100 includes an NFC simulation card corresponding to the first AID, the electronic device 100 can send the card information of the NFC simulation card corresponding to the first AID to the NFC card reader 200.
[0145] In some examples, the card information of an NFC emulator card may include one or more of the following: access control information, key information, transaction account information, and e-ticket information. Access control information may include one or more of the following: card number, card expiration date, etc. Key information may include one or more of the following: key code, key code expiration date, etc. Transaction account information may include one or more of the following: transaction account identifier, remaining balance in the transaction account, etc. E-ticket information may include one or more of the following: e-ticket code, e-ticket verification time, e-ticket expiration date, etc.
[0146] S215: The NFC card reader 200 verifies the card information of the NFC analog card corresponding to the first AID.
[0147] In some embodiments of this application, the NFC card reader 200 can verify the card information of the NFC simulated card corresponding to the received first AID. When the verification is successful, the NFC card reader 200 can perform a card swiping operation on the NFC simulated card. An example of the card swiping operation can be found in [reference needed]. Figure 5 Examples of card swiping transactions are provided. In some examples, the NFC card reader 200 can send the swipe result of an active NFC analog card in the electronic device 100 to the electronic device 100. Since the NFC card reader 200 successfully verifies the active NFC analog card in the electronic device 100, the swipe result indicates success. However, in other examples, if the NFC card reader 200 fails to verify the active NFC analog card in the electronic device 100, the NFC card reader 200 can send a swipe result indicating failure to the electronic device 100.
[0148] In some examples, the NFC card reader 200 and the electronic device 100 perform... Figure 6 During the communication process shown, electronic device 100 can output a card swiping prompt for the activated NFC simulated card, indicating to the user that electronic device 100 is using the NFC simulated card for swiping. In some examples, after receiving the card swiping result of the activated NFC simulated card in electronic device 100 from NFC card reader 200, electronic device 100 can output the swiping result, such as indicating successful or unsuccessful swiping. If the swiping is successful, it can also display information such as payment fees.
[0149] Not limited to Figure 6 In some embodiments of the process shown, the NFC card reader 200 may not verify the request-response command and / or UID during the communication process of the access layer protocol, but may only verify the selection confirmation command. That is, the communication process of the access layer protocol may not include S203 and / or S206.
[0150] based on Figure 5 and Figure 6 As can be seen from the description of the communication process shown, the NFC parameters of the NFC simulation card in the electronic device 100 may include, but are not limited to, the request-response command parameter, the UID parameter, and the selection confirmation command parameter. The request-response command parameter, the UID parameter, and the selection confirmation command parameter can be referred to as the NFC parameters of the access layer protocol.
[0151] Figure 7 This is a schematic diagram of the architecture of another NFC system 10 provided in the embodiments of this application.
[0152] like Figure 7 As shown, the electronic device 100 can activate multiple NFC simulation cards and can include NFC parameters of multiple NFC simulation cards. For example, the electronic device 100 can activate a first type of NFC simulation card 1, a second type of NFC simulation card 2, and a second type of NFC simulation card 3, etc., and can include NFC parameter 1 of NFC simulation card 1, NFC parameter 2 of NFC simulation card 2, and NFC parameter 3 of NFC simulation card 3, etc.
[0153] based on Figure 5 and Figure 6 The illustrated communication process describes how, when multiple NFC emulators are activated on electronic device 100, electronic device 100 will use the NFC parameters of one of the activated NFC emulators to communicate with NFC reader device 200 using NFC technology. For example... Figure 7As shown, in electronic device 100, the first type of NFC emulator card 1 is in an active state, while other NFC emulator cards are in an inactive state. Electronic device 100 can use the NFC parameter 1 of the first type of NFC emulator card 1 to communicate with NFC reader 200 in an attempt to perform NFC service. However, if NFC emulator card 1 cannot perform NFC service with NFC reader 200, for example, if NFC emulator card 1 is not the target PICC required by NFC reader 200, the NFC service will fail. In this case, electronic device 100 in the powered-off state cannot switch the active NFC emulator card, directly causing card swiping failure, and the user cannot use electronic device 100 and NFC reader 200 to perform card swiping business. However, electronic device 100 in the powered-on state can randomly switch the active NFC emulator card, for example, switching NFC emulator card 2 to the active state and NFC emulator card 1 to the inactive state, and re-using the NFC parameters of NFC emulator card 2 to communicate with NFC reader 200, for example, re-performing the NFC service. Figure 5 / Figure 6 The communication process shown is slow, especially since the NFC emulator card that the electronic device 100 randomly switches to in an active state may not be the target PICC required by the NFC card reader 200. This results in the need to execute the NFC technology communication process (such as the access layer protocol communication process) multiple times, making the card swiping process very slow.
[0154] Furthermore, when multiple NFC emulators are activated in the electronic device 100, simultaneous activation and coexistence of these NFC emulators are not possible; that is, not all NFC emulators in the electronic device 100 can be in an active state. This is because if all NFC emulators in the electronic device 100 are active, the electronic device 100 will use the NFC parameters of multiple NFC emulators to communicate with the NFC reader 200, for example... Figure 7 As shown, the electronic device 100 communicates with the NFC reader 200 using NFC parameter 1 of NFC emulator card 1, NFC parameter 2 of NFC emulator card 2, and NFC parameter 3 of NFC emulator card 3. The NFC reader 200 cannot recognize the NFC command that includes NFC parameters of multiple NFC emulator cards, resulting in a conflict of NFC parameters and causing the NFC service to fail.
[0155] This application provides a card management method that allows an NFC card reader 200 in PCD mode to be configured not to verify the NFC parameters of the access layer protocol in the electronic device 100, such as request-response commands, UIDs, and selection confirmation commands. The electronic device 100 in PICC mode can use the NFC parameters of an NFC emulator card in a default active state to communicate with the NFC card reader 200 via the access layer protocol. Since the NFC card reader 200 does not verify the NFC parameters of the access layer protocol, it will initiate an application layer protocol communication process. During the application layer protocol communication, the electronic device 100 can determine the corresponding NFC emulator card from its multiple NFC emulator cards based on the AID in the selection AID command sent by the NFC card reader 200. The electronic device 100 can then use the determined NFC emulator card to perform NFC services with the NFC card reader 200. In other words, each time electronic device 100 communicates with NFC card reader 200 using NFC technology, it determines the corresponding NFC card for NFC service from among multiple NFC emulators in electronic device 100. These multiple NFC emulators include not only those in a default active state but also other NFC emulators. Electronic device 100 will not directly use the NFC emulator in a default active state to perform NFC service with NFC card reader 200. It can be understood that multiple NFC emulators in electronic device 100 "participate" in each NFC communication process, thus achieving simultaneous activation and coexistence of multiple NFC emulators in electronic device 100. The NFC emulators other than those in a default active state can be considered to be in a long-term active state. Therefore, electronic device 100, which achieves simultaneous activation and coexistence of multiple NFC emulators, can automatically and accurately select the appropriate NFC emulator to complete the NFC service with NFC card reader, improving the speed and efficiency of NFC card swiping. Even when electronic device 100 is powered off, it can still perform card swiping normally.
[0156] In some embodiments of this application, the PCD mode NFC reader 200 can also be configured not to verify the NFC parameters of the application layer protocol in the electronic device 100, or only to determine whether the format of the NFC parameters of the application layer protocol is correct (which can be understood as not making special requirements on the specific content of the NFC parameters of the application layer protocol), for example, not verifying the Select Response (ATS) command or only determining whether the format of the ATS command is correct. Therefore, it can be ensured that during the communication process of the application layer protocol, the NFC reader 200 can send the Select AID command to the electronic device 100, thereby realizing the simultaneous activation and coexistence of multiple NFC analog cards of the electronic device 100.
[0157] In some embodiments of this application, the second type of NFC emulator card in the electronic device 100 is in a long-term active state. In some embodiments of this application, the NFC parameters of the access layer protocol of the NFC emulator card in the long-term active state in the electronic device 100 can be set to empty. Optionally, the NFC parameters of the application layer protocol can also be set to empty. Specific implementation examples are provided below. Figure 9 The updated method for obtaining NFC parameters, as shown, will not be detailed here.
[0158] Figure 8 This is a schematic diagram of the architecture of another NFC system 10 provided in the embodiments of this application.
[0159] like Figure 8 As shown, the electronic device 100 can activate multiple NFC emulator cards and can include NFC parameters for multiple NFC emulator cards. These multiple NFC emulator cards can include one NFC emulator card in a default active state and one or more NFC emulator cards in a persistent active state. For example, the electronic device 100 can activate a first-type NFC emulator card 1, a second-type NFC emulator card 2, and a second-type NFC emulator card 3, etc. NFC emulator card 1 is in a default active state, while NFC emulator cards 2 and 3 are in a persistent active state. The electronic device can include NFC parameter 1 for NFC emulator card 1, while the NFC parameters for NFC emulator card 2 and NFC emulator card 3 are empty.
[0160] In some embodiments of this application, the PICC-mode electronic device 100 can use the NFC parameter 1 of the NFC emulator 1 in the default active state to communicate with the NFC reader 200 via the access layer protocol. The NFC parameters do not conflict, and the NFC reader 200 can normally recognize the NFC signaling sent by the electronic device 100. The NFC reader 200 does not verify the request / response command, UID, and SAK command sent by the electronic device 100. Therefore, the NFC reader 200 can normally perform the access layer protocol communication process and will initiate the application layer protocol communication process. During the application layer protocol communication process, the electronic device 100 can determine the NFC emulator corresponding to the first AID from the NFC emulator 2 and NFC emulator 3 in the long-active state based on the first AID in the selection AID command sent by the NFC reader 200. Assuming that the determined NFC emulator corresponding to the first AID is NFC emulator 2, the electronic device 100 can send the card information of NFC emulator 2 to the NFC reader 200 to perform NFC services with NFC emulator 2.
[0161] Figure 9 This is a schematic diagram illustrating an NFC parameter setting method provided in an embodiment of this application.
[0162] Figure 9 The explanation will take the NFC parameters (including ATQA parameters, UID parameters, and SAK parameters) of the access layer protocol as an example.
[0163] like Figure 9 The method for obtaining NFC parameters before the update is shown. The NFC parameters of the NFC simulation card in the electronic device 100 can be obtained by bitwise ANDing the corresponding configured parameters and the corresponding configured mask. For example, the actual ATQA parameter (2 bytes long) is obtained by bitwise ANDing the configured ATQA parameter (2 bytes long) and the configured ATQA mask (2 bytes long). The actual SAK parameter (1 byte long) is obtained by bitwise ANDing the configured SAK parameter (1 byte long) and the configured SAK mask (1 byte long). The actual UID parameter (4 bytes long) is obtained by bitwise ANDing the configured UID parameter (4 bytes long) and the configured UID mask (4 bytes long).
[0164] Figure 9 The updated NFC parameter acquisition method shown can be applied to NFC simulation cards in a long-active state in electronic device 100 to set the NFC parameters of the long-active NFC simulation cards to empty. For example... Figure 9 The updated NFC parameter acquisition method shown allows the NFC parameters of the NFC simulation card in the long-active state in electronic device 100 to be obtained by bitwise ANDing the corresponding configured parameters and the corresponding configured mask. However, since the corresponding configured mask is always set to zero, the resulting NFC parameters are zero. For example, bitwise ANDing the configured ATQA parameter with the ATQA mask set to zero yields zero ATQA parameters; bitwise ANDing the configured SAK parameter with the SAK mask set to zero yields zero SAK parameters; and bitwise ANDing the configured UID parameter with the UID mask set to zero yields zero UID parameters.
[0165] For example, the NFC parameter file of the NFC analog card in the electronic device 100 may include the parameters corresponding to the NFC parameters (e.g., the configured ATQA parameters, the configured UID parameters, and the configured SAK parameters) and the corresponding configured masks (e.g., the configured ATQA mask, the configured UID mask, and the configured SAK mask), based on... Figure 9The updated NFC parameters shown can be obtained by setting the mask configured in the NFC parameter file to zero. For example, an NFC parameter file with the configured mask not set to zero includes: 80E640006D000010A00000033301010200634857504150200057EF55A053810100A5038201C08649A01E8005040878702C81012082020800830302424A8401908501018603020200A12780050FFFFFFFFF8101FF8202FFFF 830C0FFFFFFFFFFFFFFFFFFFFFFF8401FF8501FF8603FFFFFF00|9000, where bits 80-86 are the mask configured for the NFC parameters. based on Figure 9 The updated NFC parameter acquisition method shown allows setting bits 80-86 to zero. Therefore, the NFC parameter file with the mask set to zero includes: 80E640006D000010A00000033301010200634857504150200057EF55A053810100A5038201C08649A01E8005 040878702C81012082020800830302424A8401908501018603020200A1278005000000000 081010082020000830C0000000000000000000000840100850100860300000000|9000.
[0166] Not limited to Figure 9 The example shown, in other examples, Figure 9 The NFC parameter acquisition method shown can also be the NFC parameter acquisition method of the application layer protocol. For example, the ATS parameter actually used by the NFC emulator card can be obtained by bitwise ANDing the corresponding configured ATS parameter and the corresponding configured ATS mask. Since the ATS mask of the NFC emulator card in the long active state is set to zero in the updated NFC parameter acquisition method, the ATS parameter actually used by the NFC emulator card in the long active state is zero.
[0167] Not limited to the above examples, in other examples, the actual UID parameter used, the configured UID parameter and the length of the UID mask can also be 7 bytes or 10 bytes, etc. The embodiments of this application do not limit the length of the NFC parameter.
[0168] The card management method provided in the embodiments of this application will be introduced next.
[0169] Figure 10 This is a flowchart illustrating a card management method provided in an embodiment of this application.
[0170] Figure 10 The method shown can be applied to an NFC system including an electronic device 100 and an NFC card reader 200, for example... Figure 2 The NFC system 10 shown is described. Electronic device 100 can be in PICC mode; for example, electronic device 100 is in PICC mode by default after enabling NFC. NFC card reader 200 can be in PCD mode.
[0171] Figure 10 The following explanation uses an NFC simulation card in the electronic device 100, which is in a default active state, as an example of the first type of NFC simulation card. Figure 10 The method shown may include communication processes for access layer protocols (e.g., ISO 14443-3 / IEC 14443-3) and application layer protocols (e.g., ISO 14443-4 / IEC 14443-4).
[0172] Figure 10 The method shown may include, but is not limited to, the following steps:
[0173] S300: Electronic device 100 enters the radio frequency field of NFC card reader 200.
[0174] S301: NFC card reader 200 sends a request command to electronic device 100.
[0175] S302: Electronic device 100 sends a request-response command to NFC card reader 200.
[0176] Figure 10 S300-S302 and Figure 5 Similar to S100-S102.
[0177] In some embodiments of this application, after receiving a request-response command sent by the electronic device 100, the NFC card reader 200 may not verify the request-response command and may directly proceed with the subsequent processes of the access layer protocol, such as executing S303.
[0178] S303: NFC card reader 200 sends an anti-collision command to electronic device 100.
[0179] S304: Electronic device 100 sends the UID of an NFC emulated card that is in a default active state to NFC card reader 200.
[0180] Figure 10 S303-S304 and Figure 5 Similar to S104-S105.
[0181] In some embodiments of this application, after the NFC card reader 200 receives the UID of the NFC simulated card in the default active state sent by the electronic device 100, it may not verify the UID of the NFC simulated card in the default active state and directly proceed to the subsequent processes of the access layer protocol, such as executing S305.
[0182] S305: NFC card reader 200 sends a select command to electronic device 100.
[0183] S306: Electronic device 100 sends a selection confirmation command to NFC card reader 200 (indicating that the application layer protocol is not supported).
[0184] Figure 10 S305-S306 and Figure 5 Similar to S107-S108.
[0185] In some embodiments of this application, the electronic device 100 can generate a selection confirmation command based on the SAK parameter in the NFC parameters of an NFC emulator card in a default active state, and send the selection confirmation command to the NFC reader device 200. Since the NFC emulator card in the default active state in the electronic device 100 is of type 1, i.e., it does not support application layer protocols, the selection confirmation command sent by the electronic device 100 to the NFC reader device 200 indicates that application layer protocols are not supported.
[0186] In some embodiments of this application, after receiving the SAK command sent by the electronic device 100, the NFC card reader 200 may not verify the SAK command. Therefore, even if the SAK command indicates that the application layer protocol is not supported, the NFC card reader 200 will still initiate the application layer protocol communication process, for example, it may execute S307.
[0187] S307: NFC card reader 200 sends a Select Response Request (RATS) command to electronic device 100.
[0188] S308: Electronic device 100 sends a Select Response (ATS) command to NFC card reader 200.
[0189] In some embodiments of this application, the electronic device 100 can generate an ATS command based on the ATS parameters in the NFC parameters of the application layer protocol of any NFC emulator card in a long-active state, and send the ATS command to the NFC card reader 200. In some examples, the content of the ATS command can be according to... Figure 9 The updated NFC parameter acquisition method shown is set to empty.
[0190] S309: NFC card reader device 200 select response command verification passed.
[0191] Figure 10 S307-S309 and Figure 6 Similar to S210-S212.
[0192] Not limited to the above embodiments, in some other embodiments of this application, after receiving the ATS command sent by the electronic device 100, the NFC card reader 200 may not verify whether the content of the ATS command (i.e., the communication parameters in the electronic device 100 used to implement the application layer protocol communication process) meets the preset requirements of the NFC card reader 200, but only determine whether the format of the ATS command is correct. This can be understood as not making special requirements on the specific content of the ATS command. In S309, if the NFC card reader 200 determines that the format of the ATS command is correct, the verification passes; if the NFC card reader 200 determines that the format of the ATS command is incorrect, the verification fails. When the NFC card reader 200 verifies the ATS command, the NFC card reader 200 and the electronic device 100 can transmit APDUs in the application layer protocol, for example, S310 can be executed.
[0193] In other embodiments of this application, the NFC card reader 200 may also be configured not to verify the NFC parameters of the application layer protocol in the electronic device 100, such as not verifying the ATS commands sent by the electronic device 100.
[0194] S310: The NFC card reader 200 sends a select AID command (including the first AID) to the electronic device 100.
[0195] In some embodiments of this application, the select AID command may carry the first AID corresponding to the target PICC required by the NFC reader device 200.
[0196] S311: Electronic device 100 determines the NFC analog card corresponding to the first AID.
[0197] S312: Electronic device 100 sends the card information of the NFC analog card corresponding to the first AID to NFC card reader 200.
[0198] In some embodiments of this application, the electronic device 100 can obtain a first AID according to a select AID command. Furthermore, the electronic device 100 can determine the NFC emulator corresponding to the first AID from a plurality of NFC emulators. The plurality of NFC emulators may include one NFC emulator in a default active state and one or more NFC emulators in a long-term active state. The electronic device 100 can send the card information of the NFC emulator corresponding to the determined first AID to the NFC card reader 200. An example of the card information of the NFC emulator can be found in [reference needed]. Figure 6 Example of card information for an NFC analog card in S214.
[0199] S313: The NFC card reader 200 verifies the card information of the NFC analog card corresponding to the first AID.
[0200] Figure 10 S313 and Figure 6 It is similar to the S215.
[0201] For example, the electronic device 100 may include an access card (a first type of NFC emulated card) in a default active state, a transit card (a second type of NFC emulated card) in a long-term active state, and a bank card (a second type of NFC emulated card) in a long-term active state. When the NFC card reader 200 is a traffic gate, the electronic device 100 can first use the NFC parameters of the access card to communicate with the NFC card reader 200 through the access layer protocol, and obtain the first AID in the selection AID command sent by the NFC card reader 200 during the application layer protocol communication process. The electronic device 100 can then determine the transit card corresponding to the first AID and use the transit card and the NFC card reader 200 to perform transit card swiping. When the NFC card reader 200 is a POS machine, the electronic device 100 can first use the NFC parameters of the access card to communicate with the NFC card reader 200 through the access layer protocol. During the communication process of the application layer protocol, the electronic device 100 can obtain the first AID in the selection AID command sent by the NFC card reader 200. The electronic device 100 can then determine the bank card corresponding to the first AID and use the bank card and the NFC card reader 200 to conduct transaction payment business.
[0202] Not limited to the above embodiments, in other embodiments of this application, the electronic device 100 may also use preset NFC parameters to perform access layer protocol communication with the NFC reader 200. In some examples, Figure 10The request response command in S302, the UID in S304, and the selection confirmation command in S306 shown can be generated and sent according to preset NFC parameters. S304 sends the UID in the preset NFC parameters. For example, the parameters of the request response command, the parameters of the selection confirmation command, and the UID obtained according to the preset NFC parameters are empty.
[0203] It is understandable that when the electronic device 100 is powered off, it can still transmit APDUs in the application layer protocol with the NFC card reader 200. During this transmission, the electronic device 100 can automatically and accurately select a suitable NFC emulator card and send the card information of the NFC emulator card to the NFC card reader 200, for example, by obtaining the card information of the NFC emulator card through the Applet in SE103 or SIM104, without having to switch the NFC emulator card in the default active state. Therefore, the card swiping will not fail due to the inability to switch the NFC emulator card in the default active state. In this way, even when the electronic device 100 is powered off, it can still complete the NFC service normally with the NFC card reader 200.
[0204] exist Figure 10 In the method shown, the PCD mode NFC reader 200 can be configured not to verify the NFC parameters of the access layer protocol. Therefore, regardless of whether the SAK command sent by the electronic device 100 indicates support for the application layer protocol, the NFC reader 200 will initiate the application layer protocol communication process. Furthermore, the NFC reader 200 can be configured not to verify the NFC parameters of the application layer protocol, or only to determine whether the format of the NFC parameters of the application layer protocol is correct. Therefore, it can be guaranteed that during the application layer protocol communication process, the NFC reader 200 and the electronic device 100 can transmit APDUs in the application layer protocol. During the transmission of APDUs in the application layer protocol, the electronic device 100 can determine the NFC emulator required by the NFC reader 200 for NFC service from the NFC emulator in the default active state and the NFC emulator in the long active state, instead of only using the NFC emulator in the default active state for NFC service. The electronic device 100 achieves the coexistence of multiple active NFC emulators, and the electronic device 100 can achieve this through a single communication process (e.g., Figure 10 The process shown automatically and accurately selects the appropriate NFC simulation card and NFC card reader to complete the NFC service. Regardless of whether the electronic device is powered on or off, it can swipe the card normally, which improves the speed and efficiency of NFC card swiping. For example, the card swiping time is less than 400 milliseconds.
[0205] Not limited to the above embodiments, in some other embodiments of this application, the NFC card reader 200 in PCD mode may not be set to not verify NFC parameters, which can be understood as not modifying the processing logic of the NFC card reader 200. The electronic device 100 in PICC mode can first use the NFC parameters of an NFC simulation card (e.g., a first-type NFC simulation card) in a default active state to communicate with the NFC card reader 200 using the access layer protocol. If the NFC card reader 200 does not initiate the application layer protocol communication process within a preset time, the electronic device 100 can dynamically switch / modify the NFC parameters, for example, modifying the SAK parameter to indicate support for the application layer protocol, and using the new NFC parameters to communicate with the NFC card reader 200 using both the access layer protocol and the application layer protocol. For specific implementation examples, see [link to implementation details]. Figure 11 .
[0206] Figure 11 This is a flowchart illustrating another card management method provided in the embodiments of this application.
[0207] Figure 11 The method shown can be applied to an NFC system including an electronic device 100 and an NFC card reader 200, for example... Figure 2 The NFC system 10 shown is described. Electronic device 100 can be in PICC mode; for example, electronic device 100 is in PICC mode by default after enabling NFC. NFC card reader 200 can be in PCD mode.
[0208] Figure 11 The following explanation uses an NFC simulation card in the electronic device 100, which is in a default active state, as an example of the first type of NFC simulation card. Figure 11 The communication process shown may include communication processes of access layer protocols (e.g., ISO 14443-3 protocol / IEC 14443-3 protocol) and communication processes of application layer protocols (e.g., ISO 14443-4 protocol / IEC 14443-4 protocol).
[0209] Figure 11 The explanation will take the target PICC of the NFC card reader device 200 as a second-type PICC, namely a PICC that supports application layer protocols. Furthermore, Figure 11 The processing logic of the NFC card reader device 200 is illustrated by the example that it does not verify the request response command and UID, but verifies the SAK command.
[0210] Figure 11 The method shown may include, but is not limited to, the following steps:
[0211] S400: Electronic device 100 enters the radio frequency field of NFC card reader 200.
[0212] S401: NFC card reader 200 sends a request command to electronic device 100.
[0213] S402: Electronic device 100 sends a request-response command to NFC card reader 200.
[0214] S403: NFC card reader 200 sends an anti-collision command to electronic device 100.
[0215] S404: Electronic device 100 sends the UID of an NFC emulated card that is in a default active state to NFC card reader 200.
[0216] S405: NFC card reader 200 sends a select command to electronic device 100.
[0217] S406: Electronic device 100 sends a selection confirmation command to NFC card reader 200 (indicating that the application layer protocol is not supported).
[0218] Figure 11 S400-S406 and Figure 10 Similar to the S300-S306.
[0219] S407: NFC card reader 200 failed to verify the select confirmation command.
[0220] In some embodiments of this application, the NFC card reader 200 can determine whether the electronic device 100 supports the application layer protocol based on the received Select Confirmation (SAK) command, thereby realizing the verification of the Select Confirmation command. Figure 11 Taking the target PICC required by the NFC card reader 200 as a second type of PICC that supports the application layer protocol as an example, when the received SAK command indicates that the application layer protocol is not supported, the NFC card reader 200 fails to verify the selection confirmation command and will not initiate the application layer protocol communication process.
[0221] S408: Electronic device 100 determines that it has not received a select response request command within a preset time period.
[0222] In some embodiments of this application, after the electronic device 100 sends a selection confirmation command to the NFC card reader 200, if it does not receive an application layer protocol selection response request (RATS) command within a preset time period, and the electronic device 100 is still within the radio frequency field of the NFC card reader 200, then the electronic device 100 can determine to switch / modify the NFC parameters and obtain new NFC parameters. In some examples, the SAK command in the new NFC parameters is different from that in the old NFC parameters; the SAK command in the new NFC parameters indicates support for the application layer protocol. The electronic device 100 can use the new NFC parameters to communicate with the NFC card reader 200 using NFC technology, and the implementation process includes, for example, S409-S414.
[0223] S409: NFC card reader 200 sends a request command to electronic device 100.
[0224] S410: Electronic device 100 sends a request-response command to NFC card reader 200.
[0225] S411: NFC card reader 200 sends an anti-collision command to electronic device 100.
[0226] S412: Electronic device 100 sends the UID of an NFC emulated card that is in a default active state to NFC card reader 200.
[0227] S413: NFC card reader 200 sends a select command to electronic device 100.
[0228] S414: Electronic device 100 sends a selection confirmation command to NFC card reader 200 (indicating support for application layer protocol).
[0229] S409-S414 are similar to S401-S406 described above. The request-response command in S402, the UID in S404, and the selection-confirmation command in S406 are obtained based on the old NFC parameters (i.e., the NFC parameters of the NFC simulation card in the electronic device 100 that is in a default active state). The request-response command in S410, the UID in S412, and the selection-confirmation command in S414 are obtained based on the modified new NFC parameters. Therefore, the selection-confirmation command in S414 can indicate support for application layer protocols.
[0230] S415: NFC card reader device 200-pair selection confirmation command verification passed.
[0231] In some embodiments of this application, the NFC card reader 200 can determine whether the electronic device 100 supports the application layer protocol based on the received Select Confirmation (SAK) command, thereby realizing the verification of the Select Confirmation command. Figure 11 Taking the target PICC required by the NFC card reader 200 as a second type of PICC that supports the application layer protocol as an example, when the received SAK command indicates support for the application layer protocol, the NFC card reader 200 verifies the selection confirmation command and thus initiates the application layer protocol communication process, such as executing S416.
[0232] S416: NFC card reader 200 sends a Select Response Request (RATS) command to electronic device 100.
[0233] S417: Electronic device 100 sends a Select Response (ATS) command to NFC card reader 200.
[0234] S418: NFC card reader device 200-pair select response command verification passed.
[0235] S419: The NFC card reader 200 sends a select AID command (including the first AID) to the electronic device 100.
[0236] S420: Electronic device 100 determines the NFC analog card corresponding to the first AID.
[0237] S421: Electronic device 100 sends the card information of the NFC analog card corresponding to the first AID to NFC card reader 200.
[0238] S422: The NFC card reader 200 verifies the card information of the NFC analog card corresponding to the first AID.
[0239] Figure 11 S416-S422 and Figure 10 Similar to S307-S313.
[0240] Not limited to the above examples, in other examples, when the electronic device 100 dynamically switches / modifies NFC parameters, it can not only modify the SAK command parameters, but also the request-response command parameters and / or the UID parameters. For example, if no anti-collision command is received within a preset time period, the request-response command parameters can be modified. Or, if no selection command is received within a preset time period, the UID parameters can be modified. The embodiments of this application do not limit the judgment conditions and specific methods for dynamically switching / modifying NFC parameters.
[0241] Not limited to the above embodiments, in other embodiments of this application, the electronic device 100 may also use preset NFC parameters and the NFC card reader 200 to perform access layer protocol communication, for example, when the electronic device 100 does not include a first type of NFC analog card. In some examples, Figure 11 The request-response command in S402, the UID in S404, and the selection confirmation command in S406 shown can be generated and sent according to preset NFC parameters. S404 sends the UID from the preset NFC parameters.
[0242] Not limited to Figure 10 and Figure 11 As shown in the example, in other examples, the electronic device 100 can determine the card information of the corresponding NFC emulated card based on the first AID and other information sent by the NFC card reader 200. The specific parameters for determining the card information of the NFC emulated card are not limited in the embodiments of this application.
[0243] Not limited to Figure 10 and Figure 11 In the example shown, in other examples, the electronic device 100 may also not send the card information of the NFC analog card corresponding to the first AID, for example, Figure 10 S311-S313 or Figure 11 S420-S422 can be used for NFC interaction between NFC card reader 200 and electronic device 100, and to complete the card swiping business of NFC analog card in electronic device 100.
[0244] exist Figure 11 In the method shown, the NFC reader 200 in PCD mode does not need to modify its processing logic. Instead, the electronic device 100 dynamically switches / modifies the NFC parameters used and communicates with the NFC reader 200 using the new NFC parameters, enabling the NFC reader 200 to initiate the application layer protocol communication process. During the application layer protocol communication process, the electronic device 100 can determine the NFC emulator required by the NFC reader 200 for NFC service from NFC emulators in the default active state and those in the long active state, instead of only using the NFC emulator in the default active state. Therefore, even if the processing logic of the NFC reader 200 is not modified, the electronic device 100 can achieve the coexistence of multiple NFC emulators and automatically and accurately select the appropriate NFC emulator to complete the NFC service. This can be understood as achieving forward compatibility of the NFC reader 200 without modifying its processing logic by dynamically switching / modifying the NFC parameters.
[0245] The following describes another hardware structure of the electronic device 100 provided in the embodiments of this application.
[0246] Figure 12 This is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of this application.
[0247] 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 diagram shows more or fewer components, combinations of two or more components, or different component configurations. 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 (ASICs). Figure 12 As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a SIM card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0248] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0249] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0250] The processor 110 may also include a memory for storing instructions and data. In one embodiment, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0251] In one embodiment, the processor 110 may include one or more interfaces. The 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 SIM interface, and / or a universal serial bus (USB) interface, etc.
[0252] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging implementations, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging implementations, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device 100 via the power management module 141.
[0253] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In another embodiment, the power management module 141 can also be located within the processor 110. In yet another embodiment, the power management module 141 and the charging management module 140 can be housed in the same device.
[0254] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0255] Antennas 1 and 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. When an antenna covers multiple communication frequency bands for different communication methods, it can be called a cooperative antenna. For an explanation of cooperative antennas, please refer to the descriptions of antenna cooperative situations one, two, and three above. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In another embodiment, the antenna can be used in conjunction with a tuning switch.
[0256] The mobile communication module 150 can provide wireless communication solutions for applications on the electronic device 100, including second-generation (2G), third-generation (3G), fourth-generation (4G), fifth-generation (5G), and sixth-generation (6G) mobile communication technologies. 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 one embodiment, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In another embodiment, 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.
[0257] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through audio devices (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In one embodiment, the modem processor may be a separate device. In another embodiment, the modem processor may be independent of the processor 110 and housed within the same device as the mobile communication module 150 or other functional modules.
[0258] The wireless communication module 160 can provide wireless communication solutions for use 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), infrared (IR), and wireless communication technologies conforming to the SparkLink Alliance specifications (such as SparkLink Low Energy (SLE) and SparkLink Basic (SLB)). 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.
[0259] In one embodiment, 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).
[0260] 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.
[0261] 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), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In one embodiment, electronic device 100 may include N displays screens 194, where N is a positive integer greater than 1.
[0262] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0263] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, converting it into an image visible to the naked eye. The ISP can also perform algorithmic optimization on image noise, brightness, etc. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In one embodiment, the ISP can be set in the camera 193.
[0264] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In one embodiment, electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0265] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.
[0266] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0267] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0268] The external storage 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 external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0269] Internal memory 121 can be used to store computer executable program code, which includes instructions. 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 electronic device 100 (such as audio data, phonebook, etc.). Furthermore, 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. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory located in the processor.
[0270] Electronic device 100 can implement audio functions through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor. Electronic device 100 can also implement audio functions through connected Bluetooth devices, such as music playback and recording.
[0271] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In one embodiment, the audio module 170 can be located in the processor 110, or some functional modules of the audio module 170 can be located in the processor 110.
[0272] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 170A.
[0273] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.
[0274] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In another embodiment, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In yet another embodiment, electronic device 100 may have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, among other functions.
[0275] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In one embodiment, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In one embodiment, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.
[0276] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. The barometric pressure sensor 180C is used to measure air pressure. The magnetic sensor 180D includes a Hall effect sensor. The accelerometer sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). The distance sensor 180F is used to measure distance. The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a photodetector, such as a photodiode. The LED may be an infrared LED. The ambient light sensor 180L is used to sense ambient light intensity. The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the collected fingerprint characteristics to achieve fingerprint unlocking, accessing application locks, fingerprint photography, fingerprint answering of calls, etc. The temperature sensor 180J is used to detect temperature. The bone conduction sensor 180M can acquire vibration signals.
[0277] Touch sensor 180K, also known as a "touch device," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In another embodiment, touch sensor 180K can also be located on the surface of electronic device 100, in a different position than display screen 194.
[0278] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100. Motor 191 can generate vibration prompts. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, and also to indicate messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card.
[0279] The above description illustrates the method provided in the embodiments of this application. In order to facilitate better implementation of the above solutions in the embodiments of this application, the embodiments of this application also provide corresponding devices or equipment.
[0280] 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.
[0281] The following will combine Figures 13-16 The communication device in the embodiments of this application is illustrated by way of example.
[0282] In the case of using integrated units, see Figure 13 , Figure 13 This is a schematic diagram of the structure of a communication device 1300 provided in an embodiment of this application. The communication device 1300 can be the electronic device 100 in the above embodiments. In some embodiments, 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.
[0283] Figure 13 The transceiver unit 1310 shown can be used to perform the NFC sending and NFC receiving functions performed by the electronic device 100 in the above embodiments of this application.
[0284] In some embodiments, Figure 13 The processing unit 1320 shown can be used to execute the NFC protocol parsing and encapsulation, NFC service processing flow and display functions performed by the electronic device 100 in the above embodiments of this application.
[0285] 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.
[0286] In the case of using integrated units, see Figure 14 , Figure 14 This is a schematic diagram of the structure of a 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.
[0287] Figure 14 The transceiver unit 1410 shown can be used to perform the NFC sending and NFC receiving functions performed by the NFC card reader device 200 in the above embodiments of this application.
[0288] In some embodiments, Figure 14 The processing unit 1420 shown can be used to execute the functional steps related to NFC protocol parsing and encapsulation, NFC service processing flow, etc., performed by the NFC card reader 200 in the above embodiments of this application.
[0289] 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.
[0290] 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 any form that possesses the functions of the aforementioned electronic device 100, but whichever possesses the above-mentioned... 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.
[0291] As one possible product form, the electronic device 100 described in this application embodiment can be implemented using a general bus architecture.
[0292] 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 may be an electronic device 100, or a device therein. 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 referred to 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 referred to as a receiver circuit, is used to implement a receiving function, such as an NFC receiving function; the transmitter, also referred to as a transmitter circuit, is used to implement a sending function, such as an NFC sending function.
[0293] In some embodiments, the communication device 1500 may further 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. Antenna 1503 and / or the radio frequency unit can be located inside the communication device 1500 or separate from the communication device 1500, i.e., antenna 1503 and / or the radio frequency unit can be remotely or distributedly deployed.
[0294] In some embodiments, 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.
[0295] Figure 15 The processor 1501, transceiver 1502, and memory 1504 shown can be connected via a communication bus.
[0296] 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 in the embodiments of this application; 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.
[0297] 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.
[0298] 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.
[0299] 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.
[0300] 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:
[0301] (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.
[0302] As a possible product form, the NFC card reader 200 described in this application embodiment can be implemented using a general bus architecture.
[0303] 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.
[0304] In some embodiments, 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.
[0305] Figure 16 The processor 1601, transceiver 1602, and memory 1604 shown can be connected via a communication bus.
[0306] 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 functional steps related to NFC protocol parsing and encapsulation, NFC service processing flow and / or other processes used in the technology described herein, performed by the NFC card reader 200 in the foregoing embodiments of this application; the transceiver 1602 can be used to perform the functional steps related to NFC sending and NFC receiving performed by the NFC card reader 200 in the foregoing embodiments of this application and / or other processes used in the technology described herein.
[0307] 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.
[0308] 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.
[0309] 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.
[0310] 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.
[0311] 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.
[0312] 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.
[0313] 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.
[0314] 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.
[0315] 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 card management method characterized by comprising: The method is applied to a near field communication (NFC) card reading device, and comprises the following steps: sending a selection command to an electronic device, the selection command being used to select the electronic device to perform NFC interaction with the NFC card reading device; after receiving a first selection acknowledgement (SAK) command sent by the electronic device, sending a selection applet identification (AID) command in an application layer protocol to the electronic device, the first SAK command indicating that the application layer protocol is not supported, and the selection AID command being used to determine a first NFC analog card; completing a card swiping service of the first NFC analog card with the electronic device.
2. The method of claim 1, wherein, The selection AID command is used to determine the first NFC analog card from one or more NFC analog cards in the electronic device, and the one or more NFC analog cards support an access layer protocol and the application layer protocol.
3. The method of claim 1 or 2, wherein, The selection AID command is sent in a case where the NFC card reading device does not verify the first SAK command.
4. The method according to any one of claims 1 to 3, characterized in that, The first NFC analog card supports the access layer protocol and the application layer protocol, the electronic device further comprises a second NFC analog card, the second NFC analog card supports the access layer protocol and does not support the application layer protocol, and the first SAK command is obtained according to NFC parameters of the second NFC analog card; before the step of sending the selection command to the electronic device, the method further comprises the following steps: sending a request command in the access layer protocol to the electronic device; receiving a request response command in the access layer protocol sent by the electronic device, the request response command being obtained according to the NFC parameters of the second NFC analog card; sending an anti-collision command in the access layer protocol to the electronic device; receiving a unique identification (UID) of the second NFC analog card sent by the electronic device.
5. The method according to any one of claims 1 to 4, wherein The method further comprises the following steps: after receiving the first SAK command sent by the electronic device, sending a selection response request (RATS) command in the application layer protocol to the electronic device; receiving a selection response (ATS) command in the application layer protocol sent by the electronic device; The selection AID command is sent in a case where the NFC card reading device determines that the ATS command is correct in format, or the NFC card reading device does not verify the ATS command.
6. The method according to any one of claims 1 to 5, wherein, The access layer protocol is an ISO 14443-3 protocol or an IEC 14443-3 protocol, and the application layer protocol is an ISO 14443-4 protocol or an IEC 14443-4 protocol.
7. A card management method characterized by comprising: The method is applied to an electronic device, and comprises the following steps: receiving a first selection command sent by an NFC card reading device, the first selection command being used to select the electronic device to perform NFC interaction with the NFC card reading device; sending a first selection acknowledgement (SAK) command to the NFC card reading device, the first SAK command indicating that an application layer protocol is not supported; receiving a selection applet identification (AID) command in the application layer protocol sent by the NFC card reading device; determining a first NFC analog card according to the selection AID command, and completing a card swiping service of the first NFC analog card with the NFC card reading device.
8. The method of claim 7, wherein, The select AID command is used to determine the first NFC emulation card from one or more NFC emulation cards in the electronic device, and the one or more NFC emulation cards support an access layer protocol and the application layer protocol.
9. The method of claim 7 or 8, wherein, The select AID command is sent in a case where the NFC reading device does not verify the first SAK command.
10. The method according to any one of claims 7 to 9, characterized in that, The first NFC emulation card supports the access layer protocol and the application layer protocol, and the electronic device further comprises a second NFC emulation card, the second NFC emulation card supports the access layer protocol and does not support the application layer protocol, and the first SAK command is obtained according to NFC parameters of the second NFC emulation card. Before the receiving the first select command sent by the NFC reading device, the method further comprises: receiving a request command in the access layer protocol sent by the NFC reading device; sending a request response command in the access layer protocol to the NFC reading device, the request response command being obtained according to the NFC parameters of the second NFC emulation card; receiving an anti-collision command in the access layer protocol sent by the NFC reading device; sending a unique identification UID of the second NFC emulation card to the NFC reading device.
11. The method of claim 10, wherein, The select AID command is used to determine the first NFC emulation card from one or more NFC emulation cards in the electronic device, and the one or more NFC emulation cards support an access layer protocol and the application layer protocol, and NFC parameters of any one of the one or more NFC emulation cards are obtained according to corresponding configuration parameters and configuration masks by bitwise AND operation, the NFC parameters including a SAK command, a request response command and a UID used to implement a communication process of the access layer protocol, the corresponding configuration mask of the NFC parameters being zero, and the NFC parameters being zero.
12. The method according to any one of claims 7 to 11, wherein, The method further comprises: after the sending the first select confirmation SAK command to the NFC reading device, receiving a select response request RATS command in the application layer protocol sent by the NFC reading device; sending a select response ATS command in the application layer protocol to the NFC reading device, content of the ATS command not meeting preset requirements of the NFC reading device; The receiving the select AID command in the application layer protocol sent by the NFC reading device comprises: after the sending the select response ATS command in the application layer protocol to the NFC reading device, receiving the select AID command sent by the NFC reading device.
13. The method of claim 7 or 8, wherein, The method further comprises: when no RATS command in the application layer protocol is received within a preset time period after the sending the first select confirmation SAK command to the NFC reading device, after receiving a request command in the access layer protocol sent by the NFC reading device, sending a request response command in the access layer protocol to the NFC reading device; receiving a second select command sent by the NFC reader, the second select command being used to select the electronic device to interact with the NFC reader in NFC; sending a second SAK command to the NFC reader, the second SAK command indicating that the application layer protocol is supported; the receiving the select AID command in the application layer protocol sent by the NFC reader comprises: the receiving the select AID command sent by the NFC reader after the sending the second SAK command to the NFC reader.
14. The method according to any one of claims 7 to 13, wherein, The access layer protocol is ISO 14443-3 protocol or IEC 14443-3 protocol, and the application layer protocol is ISO 14443-4 protocol or IEC 14443-4 protocol.
15. A communications device, characterized by The computer program product comprises a transceiver, a processor and a memory, the memory is used to store a computer program, and the processor invokes the computer program to execute the method in any one of claims 1-6 or the method in any one of claims 7-14.
16. A computer storage medium, comprising, The computer storage medium stores a computer program, and the computer program is executed by the processor to implement the method in any one of claims 1-6 or the method in any one of claims 7-14.
17. A computer program product, characterised in that, The computer program product, when running on the processor, is used to implement the method in any one of claims 1-6 or the method in any one of claims 7-14.
18. A chip system, characterized by The computer program product comprises a processing circuit and an interface circuit, the interface circuit is used to receive code instructions and transmit to the processing circuit, and the processing circuit is used to run the code instructions to execute the method in any one of claims 1-6 or the method in any one of claims 7-14.