Near field communication card selection method, near field communication device and electronic equipment

By detecting the RF characteristics of the NFC card reader and matching it with the template, automatically selecting NFC cards and swiping cards using card switching methods, the problem of existing NFC cards taking time and poor user experience is solved, and a more efficient swiping process is achieved.

CN120068903APending Publication Date: 2025-05-30SHENZHEN GOODIX TECH CO LTD

Patent Information

Application Number
CN202411936795.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The existing NFC card swiping method takes a long time, and users need to manually select cards, resulting in poor user experience.

Method used

By detecting the RF characteristics of the NFC card reader, matching it with the preset RF feature template, selecting the appropriate card from multiple NFC cards, and swiping the card using card switching method.

Benefits of technology

It reduces the time-consuming and time-consuming of NFC card swiping, improves card swiping efficiency, and allows users to use NFC card swiping without any sense.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120068903A_ABST
    Figure CN120068903A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a near field communication card selection method, a near field communication device and electronic equipment. The method comprises the steps that the NFC device detects RF characteristics of an NFC card reader; the NFC device matches the detected RF features with one or more preset RF feature templates so as to select an NFC card from a plurality of NFC cards, and each RF feature template is associated with the NFC card; and if the selected NFC card is not unique, the NFC device swipes the selected NFC card in a card switching mode. According to the embodiment of the invention, the card swiping efficiency of the NFC card can be improved, and the card swiping time consumption is reduced. And the NFC device is used for card selection, so that shutdown card swiping can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of near-field communication technology, and particularly to a method for selecting an NFC card, a near-field communication device, and an electronic device. Background Art

[0002] NFC (Near Field Communication) is a short-range wireless communication technology that allows electronic devices to perform fast data exchange within an extremely short distance (usually a few centimeters). When an NFC device is in the Card Emulation mode of operation, the NFC device emulates a real smart card and completes operations such as payment or authentication by transmitting and responding to signals. Currently, the target reader device types on the market are mainly divided into three categories: mobile payment, electronic ticket reading, and authentication. When a device with NFC technology emulates multiple types of cards as described above, the card selection is mainly completed by the user manually selecting the card or by swiping the card in a card switching manner according to a predetermined order. These two methods take a relatively long time to swipe the card and require interaction between the user and the NFC device, resulting in a poor user experience. Summary of the Invention

[0003] In view of the above problems, embodiments of this application provide a method for selecting an NFC card, a near-field communication device, and an electronic device, so as to at least partially reduce the time taken to swipe an NFC card and enable the user to use the NFC card to swipe without feeling it.

[0004] In a first aspect, embodiments of this application provide a method for selecting an NFC card. The method is applied to an electronic device, which includes an NFC device. The method includes: the NFC device detects the RF characteristics of an NFC reader; the NFC device matches the detected RF characteristics with one or more preset RF characteristic templates to select an NFC card from multiple NFC cards, where each RF characteristic template is associated with an NFC card; if the selected NFC card is not unique, the NFC device swipes the selected NFC cards in a card switching manner.

[0005] In some embodiments, the method further includes: if no NFC card is selected, the NFC device swipes the multiple NFC cards in a card switching manner.

[0006] In some embodiments, the NFC device swipes an NFC card in a card switching manner, including: when swiping at least one NFC card, performing a swipe timing for the swiping time of the NFC card and identifying a preset swiping event during the swiping process; if a preset swiping event is identified before the swiping timing times out, switching to the next NFC card for swiping based on the identified preset swiping event and stopping the swiping timing; if the swiping timing times out, switching to the next NFC card in the card sorting order for swiping.

[0007] In some embodiments, the preset swiping event includes at least one of the following: the type of the NFC reader does not match the type of the NFC card, and the mutual authentication protocol between the NFC reader and the NFC card does not match.

[0008] In some embodiments, the preset swiping event is that the type of the NFC reader does not match the type of the NFC card. Among them, identifying the preset swiping event during the swiping process includes: when receiving the application identifier AID sent by the NFC reader, determining whether the AID sent by the NFC reader matches the AID associated with the NFC card; if the AID sent by the NFC reader does not match the AID associated with the NFC card, then the type of the NFC card does not match the type of the NFC reader; switching to the next NFC card for swiping based on the identified preset swiping event includes: switching to the NFC card corresponding to the AID sent by the NFC reader for swiping.

[0009] In some embodiments, the preset swiping event is that the mutual authentication protocol of the NFC reader does not match the mutual authentication protocol of the NFC card. Among them, identifying the preset swiping event during the swiping process includes: identifying the second mutual authentication protocol of the NFC reader and determining whether the second mutual authentication protocol is consistent with the first protocol mutual authentication protocol of the NFC card; switching to the next NFC card for swiping based on the identified preset swiping event includes: switching to the next NFC card in the card sorting order for swiping.

[0010] In some embodiments, when the NFC device swipes an NFC card in a card switching manner, it further includes: if the departure exceeds a preset duration during the swiping of the NFC card, exiting the NFC card selection.

[0011] In some embodiments, when the NFC device swipes an NFC card in a card switching manner, it further includes: when switching to each NFC card, not responding to the in-position detection instruction of the NFC reader until the NFC reader performs a swiping interaction again or receives a preset number of in-position detection instructions.

[0012] In some embodiments, the above method further includes: in the initialization stage, the NFC device receives and stores the RF configuration of a preset NFC card, as well as the difference items between the RF configurations of other NFC cards and the RF configuration of the preset NFC card; wherein, when the NFC device swipes an NFC card in a card switching manner, it adapts to the NFC reader based on the stored RF configuration and the difference items.

[0013] In some embodiments, the above method further includes: when the RF configuration is updated in real time, the NFC device receives and updates the difference items.

[0014] In some embodiments, the detected RF features and each RF feature template include: card detection pulse information, transmission event sequence information, and transmission event timing information.

[0015] In some embodiments, the NFC device matches the detected RF features with a preset RF feature template, including: matching the detected card detection pulse information with the card detection pulse information in the RF feature template; if the detected card detection pulse information matches the card detection pulse information in the RF feature template, then matching the detected transmission event sequence information with the transmission event sequence information in the RF feature template; if the detected transmission event sequence information matches the transmission event sequence information in the RF feature template, then matching the detected transmission event timing information with the transmission event timing information in the RF feature template; if the detected transmission event timing information matches the transmission event timing information in the RF feature template, then the detected RF features match the RF feature template.

[0016] In some embodiments, when the NFC device matches the detected RF features with a preset RF feature template, it further includes: if any one of the detected RF features does not match the corresponding feature in the RF feature template, then matching the detected RF features with the next RF feature template until the matching end condition is reached.

[0017] In some embodiments, matching the detected transmission event sequence information with the transmission event sequence information in the RF feature template includes: calculating the cross-correlation between the detected transmission event sequence information and the transmission event sequence information in the RF feature template to obtain a first cross-correlation degree; if the calculated first cross-correlation degree is greater than or equal to a first threshold, the detected transmission event sequence information matches the transmission event sequence information in the RF feature template; and / or matching the detected transmission event timing information with the transmission event timing information in the RF feature template includes: calculating the cross-correlation between the detected transmission event timing information and the transmission event timing information in the RF feature template to obtain a second cross-correlation degree; if the calculated second cross-correlation degree is greater than or equal to a second threshold, the detected transmission event timing information matches the transmission event timing information in the RF feature template.

[0018] In some embodiments, the above method further includes: in the RF feature learning stage, the NFC device swipes an NFC card in a card switching manner; the NFC device detects RF features during each NFC card swiping process; if the NFC card is swiped successfully, the NFC device associates and stores the detected RF features with the NFC card to obtain an RF feature template and its association with the NFC card.

[0019] In some embodiments, determining whether the NFC card is swiped successfully includes: determining whether another swipe is made within a preset time, and if no NFC card is swiped again within the preset time, it is determined that the NFC card is swiped successfully; and / or determining whether the swipe is successful based on the feedback of the NFC reader.

[0020] In some embodiments, before the NFC device associates and stores the detected RF features with the NFC card, it further includes: determining whether the detected RF features meet the data quality requirements according to whether the commands in the transmission event sequence in the detected RF features are periodic; wherein, when the detected RF features meet the data quality requirements, the NFC device associates and stores the detected RF features with the NFC card.

[0021] In some embodiments, the card detection pulse information includes: the pulse interval and pulse width of the card detection pulse; and / or the transmission event sequence information includes a command coding sequence encoded from a command sequence sent by the NFC reader; the NFC device detects RF characteristics during each NFC card swiping process, including: receiving a command sent by the NFC reader, encoding the obtained command to obtain a command coding sequence; and / or the transmission time sequence information includes a time interval sequence; the NFC device detects RF characteristics during each NFC card swiping process, including: detecting the timestamp of each transmission event, determining the time interval between transmission events based on the timestamp of each transmission event to obtain a time interval sequence.

[0022] In a second aspect, an embodiment of the present application provides an NFC device, including: a selection module, configured to detect the RF characteristics of the NFC reader, match the detected RF characteristics with one or more preset RF characteristic templates, so as to select an NFC card from multiple NFC cards, where each RF characteristic template is associated with an NFC card; a switching module, configured to, if the selected NFC card is not unique, swipe the selected NFC cards in a card switching manner.

[0023] In some embodiments, the switching module is further configured to, if no NFC card is selected, swipe the multiple NFC cards in a card switching manner.

[0024] In some embodiments, the switching module is specifically configured to: when swiping at least one NFC card, perform swiping timing on the swiping time of the NFC card and identify a preset swiping event during the swiping process; if a preset swiping event is identified before the swiping timing times out, switch to the next NFC card for swiping based on the identified preset swiping event and stop the swiping timing; if the swiping timing times out, switch to the next NFC card in the sorted order of the NFC cards for swiping.

[0025] In some embodiments, the preset swiping event includes at least one of the following: the type of the NFC reader does not match the type of the NFC card; the interactive authentication protocol of the NFC reader does not match the interactive authentication protocol of the NFC card.

[0026] In some embodiments, the preset card - swiping event is that the type of the NFC card reader does not match the type of the NFC card. Among them, identifying the preset card - swiping event during the card - swiping process includes: when receiving the application identifier AID sent by the NFC card reader, determining whether the AID sent by the NFC card reader matches the AID associated with the NFC card; if the AID sent by the NFC card reader does not match the AID associated with the NFC card, then the type of the NFC card does not match the type of the NFC card reader; switching to the next NFC card for card - swiping based on the identified preset card - swiping event includes: switching to the NFC card corresponding to the AID sent by the NFC card reader for card - swiping.

[0027] In some embodiments, the switching module is further configured to: if the departure exceeds a preset duration during the NFC card - swiping process, exit the NFC card selection.

[0028] In some embodiments, the switching module is further configured to: when switching to each NFC card, not respond to the in - place detection instruction of the NFC card reader until the NFC card reader conducts card - swiping interaction again, or receives a preset number of in - place detection instructions.

[0029] In some embodiments, the detected RF features and each RF feature template include: card detection pulse information, transmission event sequence information, and transmission event timing information.

[0030] In some embodiments, the selection module is specifically configured to: match the detected card detection pulse information with the card detection pulse information in the RF feature template; if the detected card detection pulse information matches the card detection pulse information in the RF feature template, then match the detected transmission event sequence information with the transmission event sequence information in the RF feature template; if the detected transmission event sequence information matches the transmission event sequence information in the RF feature template, then match the detected transmission event timing information with the transmission event timing information in the RF feature template; if the detected transmission event timing information matches the transmission event timing information in the RF feature template, then the detected RF feature matches the RF feature template.

[0031] In some embodiments, the switching module is further configured to use the NFC card for card - swiping in a card - switching manner during the RF feature learning stage; the selection module is further configured to detect the RF features during the card - swiping process of each NFC card; if the card - swiping with the NFC card is successful, then associate and store the detected RF features with the NFC card to obtain the RF feature template and its association relationship with the NFC card.

[0032] In some embodiments, the selection module is further configured to determine whether the detected RF feature meets the data quality requirements according to whether the commands in the transmission event sequence in the detected RF feature are periodic; wherein, when the detected RF feature meets the data quality requirements, the detected RF feature is associated with and stored in the NFC card.

[0033] In a third aspect, an embodiment of the present application provides an electronic device, including the above-mentioned NFC device.

[0034] In a fourth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the NFC card selection method according to the above.

[0035] In the technical solution provided by the embodiment of the present application, the NFC device detects the RF feature of the NFC reader, matches the detected RF feature with a preset RF feature template to select an NFC card from multiple NFC cards, and further swipes the selected NFC card in a card switching manner. It can improve the NFC card swiping efficiency and reduce the swiping time. And the card selection is performed by the NFC device, enabling swiping the card when the device is powered off.

[0036] These aspects or other aspects of the present application will be more clearly understood in the following description of the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained according to these drawings.

[0038] Figure 1 The structural schematic diagram of an electronic device capable of applying the technical solution of the embodiment of the present application is shown.

[0039] Figure 2 The schematic block diagram of an NFC device according to an embodiment of the present application is shown.

[0040] Figure 3 The flowchart of an NFC card selection method according to an embodiment of the present application is shown.

[0041] Figure 4 The schematic diagram of a typical transmission process is shown.

[0042] Figure 5 The flowchart of an RF feature template matching method according to an embodiment of the present application is shown.

[0043] Figure 6 The figure shows a schematic diagram of the shift alignment calculation in the RF feature template matching according to an embodiment of the present application.

[0044] Figure 7 The figure shows a flowchart of a method for generating an RF feature template according to an embodiment of the present application.

[0045] Figure 8 The figure shows a flowchart of a typical method for generating an RF feature template according to an embodiment of the present application.

[0046] Figure 9 The figure shows a flowchart of a typical method for matching an RF feature template according to an embodiment of the present application.

[0047] Figure 10 The figure shows a flowchart of a method for swiping a selected NFC card in a card switching manner according to an embodiment of the present application.

[0048] Figure 11 The figure shows a schematic diagram of exemplary multiple NFC cards and RF feature selection results.

[0049] Figure 12 The figure shows a structural block diagram of an NFC device provided by an embodiment of the present application. Detailed implementation manners

[0050] The following details the implementation manners of the present application. Examples of the implementation manners are shown in the drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The implementation manners described below with reference to the drawings are exemplary only for explaining the present application and should not be construed as limiting the present application.

[0051] In order to enable those skilled in the art of the present technology to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts fall within the scope of protection of the present application.

[0052] In the embodiments of the present application, it should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.

[0053] Moreover, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or apparatus that comprises a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or apparatus. Without further limitation, an element defined by the phrase "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or apparatus that comprises the element.

[0054] In the description of the embodiments of the present application, words such as "example" or "for example" are used to indicate exemplification, illustration or description. Any embodiment or design solution described as "for example" or "for instance" in the embodiments of the present application is not construed as being more preferred or having more advantages than another embodiment or design solution. The use of words such as "example" or "for example" is intended to present relative concepts in a clear manner.

[0055] In addition, "a plurality of" in the embodiments of the present application means two or more. In view of this, "a plurality of" in the embodiments of the present application can also be understood as "at least two". "At least one" can be understood as one or more, for example, understood as one, two or more. For example, including at least one means including one, two or more, and there is no limitation on which ones are included. For example, including at least one of A, B, and C, then what can be included are A, B, C, A and B, A and C, B and C, or A, B, and C.

[0056] It should be noted that in the embodiments of the present application, "and / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / ", unless otherwise specified, generally represents an "or" relationship between the associated objects before and after.

[0057] It should be pointed out that "connection" in the embodiments of the present application can be understood as electrical connection, and the connection of two electrical components can be a direct or indirect connection between the two electrical components. For example, the connection between A and B can be either a direct connection between A and B or an indirect connection between A and B through one or more other electrical components.

[0058] Figure 1 The structural schematic diagram of an electronic device capable of applying the technical solution of the embodiments of the present application is shown. Please refer to Figure 1 As shown, the typical hardware structure of the electronic device 100 may include: a processor 101, a memory 102, a radio device 103, an audio output unit 104, an A / V input unit 105, a display unit 106, a user input unit 107, an interface unit 108, and a power supply 109. It should be understood that Figure 1This is only an exemplary illustration of the embodiments of the present application and does not limit the electronic device 100.

[0059] The display unit 106 includes various types of display panels and can display visual graphics, such as a graphical user interface (GUI). The user input unit 107 may include a touch panel, and the touch panel may cover the display panel. The audio output unit 104 includes a speaker, etc. The A / V input unit 105 includes an image processor 1051 and a microphone 1052.

[0060] The memory 102 can store data and instructions that can run on the processor 101, and the instructions include an operating system 111, etc. Refer to Figure 1 As shown, the memory 102 stores one or more application programs 110. The one or more application programs 110 include weather, instant messaging, phone, text message, email, or stock, etc.

[0061] Please continue to refer to Figure 1 As shown, in the embodiments of the present application, the electronic device 100 further includes an NFC device 200. The processor 101 can communicate with the NFC device 200. Specifically, the processor 101 can communicate with the NFC device 200. The processor 101 and the NFC device 200 can be connected through a bus interface such as an I2C (Inter-Integrated Circuit) interface or a UART (Universal Asynchronous Receiver / Transmitter) interface. The communication between the processor 101 and the NFC device 200 can be carried out through an NCI (NFC Controller Interface) protocol. The foregoing operating system 111 and / or application program 110 can control the NFC device 200 to implement NFC functions such as mobile payment, identity recognition, access control, obtaining electronic tag information, data exchange, device connection, electronic wallet, and electronic bus card.

[0062] The electronic device 100 can operate in an active mode or a passive mode. The active mode can include a Peer-to-Peer mode (abbreviated as P2P mode) and a Reader / Writer mode (abbreviated as RW mode). In the Peer-to-Peer mode, two NFC-enabled electronic devices 100 are paired and connected, enabling peer-to-peer data transmission, such as quickly transferring files between two electronic devices 100. In the Reader / Writer mode, the NFC-enabled electronic device 100 reads and writes information from media such as tags, stickers, and business cards with NFC chips. The passive mode includes a Card Emulation mode (abbreviated as CE mode), which is also known as NFC card emulation mode, card mode, card emulation mode, etc. In the Card Emulation mode, the NFC device operates similar to a standard contactless smart card. This allows the electronic device 100 to be used in existing contactless smart card infrastructures to perform operations such as access control, contactless payment, firmware replacement, or data transmission. The NFC device emulating the smart card usually operates in the passive NFC mode, and the data transmission is secure at this time. In the Card Emulation mode, the electronic device 100 can be used as a credit card, transportation card, access control card, train ticket, and so on.

[0063] In some specific implementations, referring to Figure 2 as shown, the NFC device 200 can include an NFC controller 201, an NFC antenna interface 202, and an NFC antenna 203. The NFC controller 201 can implement the processing of analog and digital protocols defined by NFC card emulation, reader / writer, and Peer-to-Peer modes. The NFC antenna 203 can perform electromagnetic coupling with the antenna of the NFC reader 300 to transmit electromagnetic signals through near-field coupling.

[0064] Continuing to refer to Figure 2 , the NFC antenna 203 can use a dedicated NFC antenna and / or reuse components of the electronic device. For example, the frame of the electronic device 100 is reused as the NFC antenna 203. In an electronic device 100 with a wireless charging coil, the wireless charging coil of the electronic device 100 can be reused as the NFC antenna 203. Based on the product application scenario and functional requirements, the NFC device 200 can include one or more NFC antennas 201. In a specific implementation, for example, in a smartphone, NFC antennas can be set at positions such as the top and the middle of the back to facilitate communication between the smartphone and the NFC reader or reading NFC cards and NFC tags. The NFC antenna interface 202 can include a receiving matching circuit, a filtering circuit, and a receiving circuit, etc. The matching circuit can be used to match the operating frequency and input impedance, and the filtering circuit can be used to filter out the high-order harmonics of the crystal oscillator.

[0065] Continuing to refer to Figure 2In some specific implementations, the NFC device 200 may further include a secure element (SE) 204. The secure element 204 is a tamper-proof hardware module for securely storing and processing sensitive information, such as payment information, identity credentials, etc. The secure element 204 may run one or more card applications (applets), which are also called smart card applications or applets. A card application is a small program unit running inside the secure element 204, which can be regarded as a software module that performs specific functions in the secure space of the secure element 204.

[0066] Continue reading Figure 2 , the security unit 204 can be integrated in the electronic device 100 in a variety of ways. In some specific implementations, the security unit 204 serves as a security chip in the electronic device 100. In this case, the security unit 204 is also called an embedded secure element (eSE) or a built-in secure unit. When the security unit 204 is an embedded secure unit, the security unit 204 is generally only connected to the NFC controller 201. The security unit 204 can communicate with the processor 101 of the electronic device 100 through the NFC controller 201 and perform near field communication through the NFC controller 201. For other integration methods of the security unit 204, please refer to the prior art, which will not be elaborated in this specification.

[0067] In the electronic device 100, when the application 110 (e.g., wallet 110a) needs to perform operations such as payment and identity authentication, it generally first accesses the card application in the security unit 204, and the card application implements functions such as transaction processing and authentication. In the NFC card emulation mode, when the external NFC card reader 300 initiates a communication request, the NFC controller 201 can transmit the signal of the NFC card reader 300 to the security unit 204. After receiving the request, the card application in the security unit 204 performs corresponding processing according to the type of request (such as identity authentication request, payment request, etc.). After the processing is completed, the card application returns the result to the NFC card reader 300 through the security unit 204 and the NFC controller 201.

[0068] In the electronic device 100, the NFC device 200 can simulate multiple NFC cards, and the wallet 110a can manage multiple NFC cards. Specifically, the wallet 110a can add, update, and delete NFC cards. In some implementations, the wallet 110a can receive card-related information input by the user and add the corresponding NFC card. In some implementations, the wallet 110a can directly read the information of a physical card through the NFC device 200. When the physical card (such as a bank card, a transit card, etc.) is placed on the NFC sensing area of the electronic device 100, the wallet 110a starts the reading process, works in cooperation with the NFC device 200, reads the data in the card according to the corresponding NFC communication protocol, and the wallet 110a adds the NFC card based on the read data. For example, when reading a bank card, information such as the issuer identification and card number is obtained; when reading a transit card, information such as the balance in the card and route information is obtained. When the wallet 110a adds an NFC card, it stores the NFC card information. Specifically, sensitive information such as the card number can be stored in the security unit 204, non-sensitive information may be stored in other storage areas local to the electronic device 100, and some card information can be backed up to the cloud server.

[0069] In the case where multiple NFC cards are added, in some embodiments, the wallet 110a can provide a user interface for the user to manually set the card swiping order (also known as card sorting) to facilitate the user to preferentially use the card that best suits the usage scenario when multiple NFC cards coexist. In some embodiments, the wallet 110a can automatically adjust the card swiping order based on the usage scenario and geographical location, etc. When the user brings the electronic device 100 close to the NFC reader 300, the wallet 110a cooperates with the NFC device 200 in the preset order or the card swiping order obtained by automatic adjustment, and attempts to use the NFC card for card swiping in sequence. According to the manually set or automatically adjusted card swiping order, attempting to use the NFC card for card swiping in sequence, this card swiping method is called swiping cards in a card switching manner. In some embodiments, the wallet 110a can provide a user interface for the user to manually select the target NFC card for card swiping. For example, when the user selects a transit card from a transit card, a bank card, and an access control card, the NFC device 200 uses the transit card to interact with the NFC reader 300 for transit card swiping.

[0070] When swiping a card in the card switching mode or when the user selects a card, there is a problem of a long card swiping time, and the user needs to participate in the card selection method, which reduces the user experience of the NFC card. Moreover, when the user uses the wallet 110a to select a card, the user interface needs to be displayed through the display unit 106, increasing the power consumption of the electronic device 100. In addition, since the card swiping process requires the participation of the wallet 110a, it is impossible to perform card swiping when the device is turned off. Especially, there are a wide variety of NFC card readers and a large number of NFC cards. When the user operates and uses them, they need to know the type of the NFC card reader in advance and manually select the NFC card for card swiping scenarios. Manually selecting an NFC card for card swiping is relatively cumbersome and slow. For example, when there is a large flow of people at the turnstile at the subway exit, it will cause a long queue, affecting the efficiency.

[0071] Therefore, an embodiment of the present application provides an NFC card selection method to at least partially reduce the card swiping time of using an NFC card and enable the user to use the NFC card for card swiping without feeling it. The NFC card selection method of the embodiment of the present application can be implemented by the NFC device 200 in the electronic device 100 as shown in Figure 1 Specifically, it can be implemented by the NFC card selection unit in the NFC controller 201 of the NFC device 200 as shown in Figure 2 Please refer to Figure 3 As shown, an NFC card selection method in an embodiment includes the following steps.

[0072] Step S301, the NFC device detects the RF characteristics of the NFC card reader.

[0073] There are various NFC cards and various NFC card readers, and various NFC card readers have various RF characteristics. Based on the RF characteristics, different NFC card readers and NFC cards can be at least partially distinguished. The RF characteristic refers to the information related to the NFC card reader collected after detecting the approach when the NFC device is in the card emulation mode. The collection time belongs to the silent collection time, that is, during this time period, the NFC device does not perform command interaction with the NFC card reader. The collection time is generally between dozens of ms and 1 s, and the collection duration can be configured according to the actual card swiping experience.

[0074] In some embodiments, the RF characteristics of the NFC card reader include information in multiple dimensions to identify the NFC card reader from multiple dimensions. In some embodiments, the RF characteristics detected by the NFC device include card detection pulse information, transmission event sequence information, and transmission event timing information.

[0075] In some specific embodiments, in the electronic device 100, the NFC controller 201 of the NFC device 200 can monitor the RF characteristics of the NFC card reader 300. Please refer to Figure 1 and 2, the NFC reader 300 operates in the card detection mode. In the card detection mode, the NFC reader 300 polls for the presence of an NFC card by periodically sending card detection pulse signals. Specifically, if an NFC card approaches, the NFC reader 300 will detect the NFC card due to detuning, which causes the transmitted signal to weaken. After detecting the detuning, the NFC reader wakes up to communicate with the NFC card. To reduce the power consumption of card detection, the card detection mode is typically the Instantaneous Card Detection (ICD) mode, and the NFC reader 300 periodically sends ICD pulse signals. In the electronic device 100, when the NFC device 200 of the electronic device 100 is in the card emulation mode, when the NFC device 200 enters the RF field range of the NFC reader 300, the NFC antenna 203 of the NFC device 200 can sense the card detection pulse signal and convert the corresponding RF signal into an electrical signal. The NFC controller 201 of the NFC device 200 can process this electrical signal and analyze the card detection pulse signal to obtain card detection pulse information. Specifically, the card detection pulse information may include the pulse interval and pulse width of the card detection pulse.

[0076] Furthermore, after detecting the NFC card, the NFC reader 300 enters the polling mode from the card detection mode. In the polling mode, the NFC reader 300 attempts to identify and communicate with different types of NFC cards, which may include Type A, Type B, Type F, and Type V (ISO15693), etc. In a typical polling cycle, the NFC reader 300 will activate the RF field (FON, also known as the opening field), then the NFC reader 300 sends a specific command (CMD), and after a certain time, it closes the RF field (FOFF, also known as the closing field). If no NFC card response is detected, the NFC reader 300 will repeat this process. In this specification, the opening field, sending the command, and closing the field are referred to as transmission events. Transmission events have timing, and the transmission events within a period of time form a transmission event sequence. In the electronic device 100, the NFC controller 201 of the NFC device 200 can detect the transmission events of the NFC reader 300 after it enters the polling mode from the card detection mode to obtain the transmission event sequence information. The transmission event sequence information may be a command sequence including the opening field information, the received command, and the closing field information. In a specific implementation, the NFC controller 201 of the NFC device 200 can also encode the opening field information, the received command, and the closing field information to obtain a command encoding sequence. Specifically, the command encoding sequence may be a quantized digital sequence, that is, the NFC controller 201 of the NFC device 200 encodes the opening field information, the received command, and the closing field information into numbers respectively.

[0077] Further, in the electronic device 100, the NFC controller 201 of the NFC device 200 can also detect the time intervals of the start, command, and end, so as to generate transmission event timing information. The transmission event timing information includes the time intervals between transmission events, forming a time interval sequence including multiple time intervals. In some specific implementations, the NFC controller 201 of the NFC device 200 detects the timestamps of each transmission event, determines the time intervals between transmission events based on the timestamps of each transmission event, and obtains the time interval sequence.

[0078] In a typical implementation, in the electronic device 100, the NFC controller 201 of the NFC device 200 receives the ICD pulse signal sent by the NFC card reader 300 and generates card detection pulse information including the pulse width and pulse interval. Subsequently, the controller 201 of the NFC device 200 detects the transmission events and the timestamps of each transmission event after the NFC card reader 300 responds to detecting that the NFC card enters the polling mode from the ICD mode, encodes the transmission events to obtain transmission event sequence information, and determines the time intervals between transmission events based on the timestamps to obtain the time interval sequence. Specifically, the transmission event sequence information can be a command encoding sequence obtained by encoding the start information, received commands, and end information. Specifically, the command encoding sequence can be a quantized digital sequence, and the encoding method can convert the start information, received commands, and end information into corresponding numbers based on the mapping relationship between transmission events and numbers.

[0079] Figure 4 A typical transmission process is shown, such as Figure 4 As shown, the transmission events include start information, received commands (CMD), and end information. The timing information on the air interface of the card reader includes the start timestamp (FON timestamp) of the NFC card reader 300, the guard time (GT) timestamp, the timestamp of the received command (CMD timestamp), and the end timestamp (FOFF timestamp). After collecting the corresponding timestamp information, the corresponding time interval sequence is obtained through the intervals between the timestamps.

[0080] Step S302, the NFC device matches the detected RF features with one or more preset RF feature templates to select an NFC card from multiple NFC cards, where each RF feature template is associated with an NFC card.

[0081] In some specific embodiments, corresponding to the detected RF features, each RF feature template may include: card detection pulse information, transmission event sequence information, and transmission event timing information. In the electronic device 100, the RF feature template may be pre-stored in the NFC controller 201, the security unit 204, and the memory 102 of the NFC device 200, which is not limited in the embodiments of the present application.

[0082] As a typical implementation, as Figure 5 shown, the NFC controller 201 of the NFC device 200 matching the detected RF features with a preset RF feature template includes the following steps.

[0083] Match the detected card detection pulse information with the card detection pulse information in the RF feature template (step S501). In the embodiments of the present application, the card detection pulse information is earlier than the transmission event sequence information and the transmission event timing information in terms of acquisition time, and the amount of calculation required for matching is small. Performing the card detection pulse information matching first can improve the matching speed, thereby improving the speed of selecting an NFC card and reducing the time-consuming of swiping the NFC card.

[0084] In a specific implementation, the NFC controller 201 of the NFC device 200 matches the detected pulse width with the pulse width in the RF feature template to determine whether the pulse widths match; matches the detected pulse interval with the pulse interval in the RF feature template to determine whether the pulse intervals match. Further, based on the matching results of the pulse interval and the pulse width, it is determined whether the detected card detection pulse information matches the card detection pulse information in the RF feature template. Specifically, if both the pulse interval and the pulse width match, the detected card detection pulse information matches the card detection pulse information in the RF feature template.

[0085] If the detected card detection pulse information matches the card detection pulse information in the RF feature template, match the detected transmission event sequence information with the transmission event sequence information in the RF feature template (step S502). In the embodiments of the present application, if the transmission event sequence does not match, the detected RF features do not match the RF feature template. By performing the transmission event sequence information matching first and then the transmission event timing information matching, unnecessary matching processes can be avoided, the matching efficiency can be improved, and the matching time-consuming can be reduced, thereby reducing the time-consuming of selecting an NFC card.

[0086] As a typical implementation, the NFC controller 201 of the NFC device 200 matches the detected transmission event sequence information with the transmission event sequence information in the RF feature template, including: calculating the cross-correlation between the detected transmission event sequence information and the transmission event sequence information in the RF feature template to obtain a first cross-correlation degree; if the calculated first cross-correlation degree is greater than or equal to the first threshold, the detected transmission event sequence information matches the transmission event sequence information in the RF feature template. In a specific implementation, the detected command coding sequence is matched with the command coding sequence in the RF feature template, that is, based on the cross-correlation between the detected command coding sequence and the command coding sequence in the RF feature template, it is determined whether the two match.

[0087] If the detected transmission event sequence information matches the transmission event sequence information in the RF feature template, the detected transmission event timing information is matched with the transmission event timing information in the RF feature template (step S503).

[0088] As a typical implementation, the NFC controller 201 of the NFC device 200 matches the detected transmission event timing information with the transmission event timing information in the RF feature template, including: calculating the cross-correlation between the detected transmission event timing information and the transmission event timing information in the RF feature template to obtain a second cross-correlation degree; if the calculated second cross-correlation degree is greater than or equal to the second threshold, the detected transmission event timing information matches the transmission event timing information in the RF feature template.

[0089] If the detected transmission event timing information matches the transmission event timing information in the RF feature template, the detected RF feature matches the RF feature template (step S504). If the detected RF feature matches the RF feature template, the NFC card associated with the RF feature template is used as the selected NFC card.

[0090] In some specific implementations, refer to Figure 5As shown, if any one of the detected RF features does not match the corresponding feature in the RF feature template, it is determined that the detected RF features do not match the RF feature template (step S505), that is, the NFC card associated with the RF feature template is not selected. Further, it is determined whether the matching end condition is reached (step S506). If the matching end condition is not reached, the detected RF features are matched with the next RF feature template (step S507); if the matching end condition is reached, the matching ends and the card selection result is obtained. The card selection result can be zero, one or more NFC cards. The matching end condition can be that all RF feature templates have been matched. If the matching end condition is not reached (that is, not all RF feature templates have been matched), the next RF feature template is matched.

[0091] Figure 6 The typical implementation manners of matching the transmission event sequence information and the transmission event timing information in the embodiments of the present application are shown, such as Figure 6 As shown, it is assumed that the length of the pre-collected template data sequence x is M, and the length of the data sequence y collected during matching is N. The sequence y is moved with a step of 1 to calculate with x, and the calculation results after each move are saved. The length r of the calculation result sequence after the move is completed is M + N - 1. Then, the maximum value in the calculation result sequence is compared with the threshold. If it is greater than or equal to the threshold, it can be considered that the x and y sequences are the same or similar. The cross-correlation can be used to detect the similarity between two signals or time series and help identify patterns and trends.

[0092] Through Figure 7 As shown in the matching process, the matching is performed in turn with the information of three dimensions, and the template information that cannot be matched can be quickly filtered out. When the number of templates is large, the cards ranked later can be matched more quickly; the information of the three dimensions can adopt different strategies according to their respective features, enhancing the processing ability for abnormal data and improving the robustness of the entire system.

[0093] In the embodiments of the present application, one or more RF feature templates and their association relationships with NFC cards can be obtained and stored in advance. The implementation manners of generating the RF feature templates are described below.

[0094] In some implementation manners, in the electronic device 100, the wallet 110a can provide a user interface for the user to select an NFC card for swiping. After the user selects an NFC card through the user interface provided by the wallet 110a, the wallet 110a cooperates with the NFC device 200 to communicate with the NFC card reader 300. During this process, the NFC device 200 detects the RF features. When the NFC card is successfully swiped, the detected RF features are associated with and stored in the NFC card, and the RF feature template and its association relationship with the NFC card are obtained.

[0095] In some embodiments, such as Figure 7 shown, in the electronic device 100, the NFC device 200 can obtain the RF feature template and its association with the NFC card according to the following steps. As Figure 7 shown in the RF feature template generation method, it is possible to obtain the RF feature template without the user selecting a card, which can improve the user experience. The specific steps are as follows.

[0096] In the RF feature learning stage, the NFC device 200 uses the NFC card to swipe the card in a card switching manner (step S701). The card sorting for card switching can be the order set for multiple NFC cards in the wallet 110a, or it can be automatically adjusted based on usage scenarios and geographical locations, etc. The RF feature learning stage can be the first N swipes of each NFC card. It can be set that after each NFC card completes N swipes, the RF feature template of this NFC card is not learned. The specific number of swipes can be adaptively set according to the actual product requirements.

[0097] The NFC device 200 detects the RF feature during the swiping process of each NFC card (step S702). The detected RF features can specifically include: card detection pulse information, transmission event sequence information, and transmission event timing information. During the process of detecting the RF feature, the NFC device 200 does not respond to the transmission events of the NFC reader 300. After detecting the RF feature, the NFC device 200 interacts with the NFC reader 300 to perform the card swiping.

[0098] In a specific implementation, the card detection pulse information includes the pulse interval and pulse width of the card detection pulse. The transmission event sequence information includes a command encoding sequence obtained by encoding the command sequence sent by the NFC reader. The NFC device 200 detects the commands sent by the NFC reader during the swiping process of each NFC card, encodes the obtained commands, and obtains the command encoding sequence. The transmission time timing information includes a time interval sequence. The NFC device 200 detects the timestamp of each transmission event during the swiping process of each NFC card, determines the time interval between transmission events based on the timestamp of each transmission event, and obtains the time interval sequence.

[0099] Determine whether the card swiping is successful (step S703). In some implementations, it can be determined whether to swipe the card again within a preset time. If no NFC card is swiped again within the preset time, it is determined that the card swiping of this NFC card is successful. In some implementations, it can be determined whether the card swiping is successful based on the feedback of the NFC reader 300.

[0100] If the NFC card is successfully swiped, the NFC device 200 will associate and store the detected RF features with the NFC card to obtain an RF feature template and its association with the NFC card (step S705). In a specific implementation, the NFC device 200 can store the RF feature template and its association with the NFC card in the non-volatile storage space of the NFC controller 201 or in the non-volatile storage space of the security unit 204.

[0101] In some embodiments, further referring to Figure 7 As shown, before the NFC device 200 associates and stores the detected RF features with the NFC card, the NFC device 200 can also determine whether the detected RF features meet the data quality requirements according to whether the commands in the transmission event sequence in the detected RF features are periodic (step S704). Specifically, when the detected RF features meet the data quality requirements, the NFC device 200 executes step S705 to associate and store the detected RF features with the NFC card.

[0102] Furthermore, as Figure 7 shown, if the NFC card is not successfully swiped or does not meet the data quality requirements, the detected RF features are discarded (step S706).

[0103] Through the learning process as Figure 7 shown, one NFC card can be associated with one or more RF feature templates. During template matching, if any RF feature template matching the NFC card is found, the NFC card is taken as the selected NFC card.

[0104] Figure 8 Illustrates a typical implementation of generating an RF feature template according to an embodiment of the present application. As Figure 8 shown, in the electronic device 100, starting from the NFC device 200 detecting an approach event, the RF features of the NFC card reader 300 are silently collected for a period of time. After the collection is completed, the obtained data is processed. First, the obtained ICD pulse signal is parsed, including whether the NFC card reader 300 has an ICD pulse signal, the ICD pulse width, and the interval between ICD pulses (referred to as the pulse interval). Subsequently, the command content sent by the NFC card reader 300 and Figure 4Describe the information of each timestamp, and at the same time encode different commands to form a digital sequence of commands. Then, temporarily store the obtained ICD-related information, command encoding sequence, and timestamp information, for example, store it in the Static Random-Access Memory (SRAM) of the NFC device 200. Next, process the obtained timestamp sequence into a time interval sequence. At this time, three-dimensional RF features are obtained. The first dimension is ICD pulse information, the second dimension is the command encoding sequence, and the third dimension is the time interval sequence. After processing, perform a quality judgment on the collected data to ensure the legality of the collected data. If the data is illegal, it needs to be collected again; if the data is legal, it is necessary to judge whether the user swipes the card again in a short time. If there is an operation of swiping the card again, there is a high probability that the current transaction is not successful; if the user does not swipe the card again for a long time, it can be considered that the current transaction is successful, and the three-dimensional information stored temporarily is stored in the non-volatile storage space of the NFC device 200, such as the memory of the NFC controller 201 or the security unit 204. A single card can correspond to a single or multiple RF feature templates. The advantage of this template entry process is that it is imperceptible to the user, and the template is directly entered during the card swiping process without a separate entry process.

[0105] Figure 9 Shows a typical implementation of matching the RF feature template according to an embodiment of the present application, such as Figure 9 As shown, in the electronic device 100, the matching process starts with the NFC device 200 detecting an entry event, and silently collects the RF features of the NFC card reader 300 for a period of time. The obtained information is the same as that in the template entry process, which is also three-dimensional information, ICD pulse signal-related information, command sequence information, and time interval sequence information. All RF feature templates corresponding to NFC cards are obtained in advance, and these information are loaded from the NFC controller 201 or the non-volatile storage device stored in the security unit 204 to the SRAM after the NFC device 200 is powered on.

[0106] During the matching process, the RF feature templates are sequentially taken out from multiple RF feature templates. In the first step, compare the currently sampled ICD pulse information with the first dimension ICD pulse information of the RF feature template, including whether the sampled ICD pulse width matches the ICD pulse width of the RF feature template, and whether the sampled ICD pulse interval matches the ICD pulse interval of the RF feature template. If they do not match, change to the next template information in sequence. If they match, proceed to the next step of processing.

[0107] Next is the matching process of the second - dimension command - encoding sequence. The cross - correlation calculation is performed between the sampled command - encoding sequence and the command - encoding sequence of the RF feature template. The calculated result is compared with the pre - stored command - sequence threshold of the RF feature template. If it is less than the preset command - sequence threshold, it indicates that the sampled data is quite different from the template, and it is considered that the sampled data does not match the template. Then, the next RF feature template is selected in order, and the matching starts again from the information of the first dimension; if it is greater than or equal to the preset command - sequence threshold, it indicates that the sampled data is the same as or similar to the template, and the matching further proceeds to the next - dimension feature information.

[0108] Finally, the matching process is performed using the third - dimension time - interval information. Similarly, the cross - correlation calculation is performed between the sampled time - interval sequence and the command sequence. The calculated result is compared with the pre - stored time - interval - sequence threshold of the RF feature template. If it is less than the preset time - interval - sequence threshold, it indicates that the time interval of the sampled data is quite different from that of the RF feature template, and it is considered that the time interval of this sampling does not match the time interval of the RE feature template. Then, the next template is selected in order, and the matching starts again from the information of the first dimension; if it is less than or equal to the preset command - sequence threshold, it indicates that the sampled data is the same as or similar to the template. At this time, the information of all three dimensions is matched, and it is considered that the NFC card is selected. By matching with all RF feature templates, 0 or 1 or multiple NFC cards can be selected.

[0109] Step S303, if the selected NFC card is not unique, the NFC device swipes the selected NFC cards in a card - switching manner. In some embodiments, as Figure 3 shown, the method may further include step S304, if no NFC card is selected, the NFC device swipes the above - mentioned multiple NFC cards in a card - switching manner.

[0110] NFC card readers generally have an in - position detection function. That is, after a complete interaction between an NFC card and an NFC card reader, the NFC card reader will continuously send a certain fixed command to interact with the NFC card. If the NFC card has not left the NFC card reader, it will continuously respond to this command, and the NFC card reader believes that the NFC card has not been removed, so it will not initiate a new round of interaction. During the card - swiping and card - switching processes, after switching from one card to the second NFC card, the NFC card reader needs to initiate a new round of interaction to effectively interact with the second NFC card. Although the communication parameters change when switching from one card to another, the in - position detection of the card reader believes that there is always an interaction and the NFC card has not been removed, so the NFC card reader will not initiate a new round of interaction. In some embodiments, during the card - swiping process of the NFC device with the card - switching method for NFC cards, when switching to each NFC card, it does not respond to the in - position detection instruction of the NFC card reader until the NFC card reader conducts a new card - swiping interaction or receives a preset number of in - position detection instructions.

[0111] There are various types of NFC card readers, and the NFC device cannot be compatible with all NFC card readers with a single set of configurations. For each card type, a set of RF configuration parameters (abbreviated as RF configuration) is preset in the electronic device. In the power - on mode of the electronic device and in non - card - switching scenarios, the wallet will send the corresponding RF configuration to the NFC device according to the card type to adapt to different NFC card readers. However, in the shutdown or screen - off state, the NFC device is in an autonomous mode, and the wallet cannot send the RF configuration in real - time. In some embodiments, during the initialization phase, the NFC device receives and stores the RF configuration of the preset NFC card, as well as the difference items between the RF configurations of other NFC cards and the RF configuration of the preset NFC card. Among them, when the NFC device swipes the NFC card in the card - switching method, it adapts to the NFC card reader based on the stored RF configuration and difference items. Further, when the RF configuration is updated in real - time, the NFC device receives and updates this difference item. For example, during the initialization phase, the wallet sends the complete RF configuration of the transportation card type to the NFC device, and at the same time sends the difference items between the RF configurations of other types of cards and the transportation card RF configuration to the NFC device, which can save space. When the RF configuration needs to be updated in real - time, only the difference item needs to be reset, which can improve performance.

[0112] In the electronic device 100, the NFC device 200 includes an NFC controller 201 and a security unit 204. While the NFC controller 201 performs NFC card switching, it activates and deactivates the card applications corresponding to the NFC cards in the security unit 204. This operation does not depend on the processor 102 and the wallet 110a. Exemplarily, in the initialization stage, the applications corresponding to the access control card and the car key application are activated by default, and the application corresponding to the second card is deactivated. During the card swiping process, when the card switching condition is met and the second card is switched to, the application corresponding to the first card is deactivated, and the application corresponding to the second card is activated. Optionally, after the car key application is activated, it may not be deactivated and activated subsequently.

[0113] The following describes the specific implementation manner of swiping the multiple NFC cards or the selected NFC cards from them in the form of card switching.

[0114] In some embodiments, as Figure 10 shown, in the electronic device 100, the NFC device 200 swiping the NFC card in the form of card switching includes the following steps. Through this card swiping method, there is no need to wait for the card swiping timing to time out, which improves the card switching efficiency, thereby reducing the time-consuming for selecting an NFC card and enabling the card swiping to be completed more quickly.

[0115] Step S1001, when swiping each NFC card, perform card swiping timing on the card swiping time of the NFC card and identify the preset card swiping events during the card swiping process. In some embodiments, the preset card swiping events include at least one of the following: the type of the NFC reader does not match the type of the NFC card, and the mutual authentication protocol between the NFC reader and the NFC card does not match.

[0116] Step S1002, determine whether the card swiping timing times out and whether a preset card swiping event is identified. If a preset card swiping event is identified before the card swiping timing times out, execute step S1003. If the card swiping timing times out, execute step S1004.

[0117] Step S1003, based on the identified preset card swiping event, switch to the next NFC card for card swiping and stop the card swiping timing.

[0118] Step S1004, switch to the next NFC card of the NFC card according to the card sorting for card swiping.

[0119] In some specific implementations, the preset card - swiping event is that the type of the NFC reader does not match the type of the NFC card. Among them, identifying the preset card - swiping event during the card - swiping process includes: when receiving the application identifier (AID) sent by the NFC reader, determining whether the AID sent by the NFC reader matches the AID associated with the NFC card; if the AID sent by the NFC reader does not match the AID associated with the NFC card, then the type of the NFC card does not match the type of the NFC reader. Switching to the next NFC card for card - swiping based on the identified preset card - swiping event includes: switching to the NFC card corresponding to the AID sent by the NFC reader for card - swiping.

[0120] Exemplarily, in the electronic device 100, the NFC device 200 modifies the Select Acknowledge (SAK) of the access control card to support the SAK of ISO - DEP (a contactless communication protocol based on the ISO14443 standard for providing data transmission between smart cards and readers), that is, changing from 0x08 (only supporting access control) to 0x28 (multi - protocol, supporting both access control and transportation). This modification does not affect the results of the access control card and the access control reader. When switching to interact with the access control card and the car key reader, the car key reader will decide whether to start reading the car key information according to the value of the SAK. When the reader identifies that the SAK is 0x28, the reader will continue to read the car key information. When the SAK is not equal to 0x28, it will not continue to read the car key information. Before the car key reader reads the car key information, the car key reader will use a unique and fixed application identifier (AID) to match the car key application in the security unit 204. The NFC controller 201 identifies that it is currently communicating with the car key reader according to this unique and fixed application identifier, and the NFC controller 201 switches the NFC card to the car key to communicate with the car key reader.

[0121] In some specific implementations, the preset card - swiping event is that the interactive authentication protocol of the NFC reader does not match the interactive authentication protocol of the NFC card. Among them, identifying the preset card - swiping event during the card - swiping process includes: identifying the second interactive authentication protocol of the NFC reader and determining whether the second interactive authentication protocol is consistent with the first protocol interactive authentication protocol of the NFC card. Switching to the next NFC card for card - swiping based on the identified preset card - swiping event includes: switching to the next NFC card of this NFC card for card - swiping according to the card sorting.

[0122] In some specific implementations, when the NFC device swipes the NFC card in a card - switching manner, it further includes: if the departure exceeds the preset duration during the NFC card - swiping process, exit the NFC card selection. After the NFC device enters again, the NFC device can perform the NFC card selection process of the embodiment of the present application again.

[0123] Figure 11 shows exemplary multiple NFC cards and RF feature selection results. Refer to Figure 11 as shown, in the electronic device 100, an exemplary user-side card pool includes access card 1, access card 2, transportation card 1, transportation card 2, car key 1, car key 2, etc. These NFC cards can be managed through the wallet 110a. Specifically, the user can manually enter the NFC card information through the user interface provided by the wallet 110a, or synchronize the NFC card information from other electronic devices or cloud servers of the user to the electronic device 100. When the electronic device 100 is in the card emulation mode, after the NFC device 200 enters the working range of the NFC card reader 300, the NFC device 200 detects the RF feature of the NFC card reader 300, and matches the detected RF feature with one or more preset RF feature templates to select an NFC card from multiple NFC cards, such as Figure 11 as shown, the exemplary situations of the selected NFC card can include but are not limited to: Situation 1, that is, access card 2 is selected; Situation 2, that is, access card 1 and transportation card 2 are selected; Situation 3, that is, access card 2, transportation card 1, and car key 2 are selected. Further, the NFC device 200 swipes the selected NFC card in a card switching manner until the card swiping is successful or all selected NFC cards are traversed.

[0124] Through the method of the embodiment of the present application, it is possible to avoid frequent manual operations by the user, automatically select the corresponding NFC card through the features of the card reader, and it can be used both when the target device's screen is off and when it is shut down.

[0125] The embodiment of the present application provides an NFC device, and this NFC device can implement the NFC card selection method. As Figure 12 shown, the NFC device 400 may include: a selection module 401, configured to detect the RF feature of the NFC card reader, match the detected RF feature with one or more preset RF feature templates to select an NFC card from multiple NFC cards, where each RF feature template is associated with an NFC card; a switching module 402, configured to, if the selected NFC card is not unique, swipe the selected NFC card in a card switching manner.

[0126] In some embodiments, the switching module 402 is further configured to, if no NFC card is selected, swipe the multiple NFC cards in a card switching manner.

[0127] In some embodiments, the switching module 402 is specifically configured to: when at least one NFC card is swiped, perform swiping timing on the swiping time of the NFC card and identify a preset swiping event during the swiping process; if a preset swiping event is identified before the swiping timing times out, switch to the next NFC card for swiping based on the identified preset swiping event and stop the swiping timing; if the swiping timing times out, switch to the next NFC card in the card sorting order for swiping.

[0128] In some embodiments, the preset swiping event includes at least one of the following: the type of the NFC reader does not match the type of the NFC card; the interactive authentication protocol of the NFC reader does not match the interactive authentication protocol of the NFC card.

[0129] In some embodiments, the preset swiping event is that the type of the NFC reader does not match the type of the NFC card. Among them, identifying the preset swiping event during the swiping process includes: when receiving the application identifier AID sent by the NFC reader, determining whether the AID sent by the NFC reader matches the AID associated with the NFC card; if the AID sent by the NFC reader does not match the AID associated with the NFC card, then the type of the NFC card does not match the type of the NFC reader; switching to the next NFC card for swiping based on the identified preset swiping event includes: switching to the NFC card corresponding to the AID sent by the NFC reader for swiping.

[0130] In some embodiments, the switching module 402 is further configured to: if the departure exceeds a preset duration during the NFC card swiping process, exit the NFC card selection.

[0131] In some embodiments, the switching module 402 is further configured to: when switching to each NFC card, not respond to the in-position detection instruction of the NFC reader until the NFC reader performs swiping interaction again or receives a preset number of in-position detection instructions.

[0132] In some embodiments, each RF feature template includes: card detection pulse information, transmission event sequence information, and transmission event timing information.

[0133] In some embodiments, the selection module 401 is specifically configured to: match the detected card detection pulse information with the card detection pulse information in the RF feature template; if the detected card detection pulse information matches the card detection pulse information in the RF feature template, then match the detected transmission event sequence information with the transmission event sequence information in the RF feature template; if the detected transmission event sequence information matches the transmission event sequence information in the RF feature template, then match the detected transmission event timing information with the transmission event timing information in the RF feature template; if the detected transmission event timing information matches the transmission event timing information in the RF feature template, then the detected RF feature matches the RF feature template.

[0134] In some embodiments, the switching module 402 is further configured to use the NFC card to swipe cards in a card switching manner during the RF feature learning stage; the selection module 401 is further configured to detect the RF feature during the swiping process of each NFC card; if the swiping of the NFC card is successful, then associate and store the detected RF feature with the NFC card to obtain the RF feature template and its association relationship with the NFC card.

[0135] In some embodiments, the selection module 401 is further configured to: determine whether the NFC card is swiped successfully. In a specific implementation, the selection module 401 determines whether to swipe the card again within a preset time. If no NFC card is swiped again within the preset time, it is determined that the NFC card is swiped successfully. In some other specific implementations, the selection module 401 determines whether the swiping is successful based on the feedback of the NFC card reader.

[0136] In some embodiments, the selection module 401 is further configured to determine whether the detected RF feature meets the data quality requirements according to whether the commands in the transmission event sequence in the detected RF feature are periodic; wherein, when the detected RF feature meets the data quality requirements, the detected RF feature is associated and stored with the NFC card.

[0137] In some embodiments, the selection module 401 and the switching module 402 may be implemented as computer program codes, such as the computer program codes executed by the NFC controller 201 as shown in Figure 2 When these computer program codes are executed by the processor of the NFC controller 201, they implement, for example, the NFC card selection method as shown in Figure 3 In some other embodiments, the selection module 401 and the switching module 402 may be implemented by the hardware and software codes of the NFC controller 201 and the security unit 204, and the NFC controller 201 and the security unit 204 jointly implement, for example, the NFC card selection method as shown in Figure 3 shown.

[0138] An embodiment of the present application further provides an electronic device, which includes a device body and the NFC device 200 as described above Figure 2 shown, Figure 12 and the NFC device 400 shown. The electronic device may be, but is not limited to, a weighing scale, a body fat scale, a nutrition scale, an infrared electronic thermometer, a pulse oximeter, a body composition analyzer, a mobile power supply, a wireless charger, a fast charger, a vehicle charger, an adapter, a display, a USB (Universal Serial Bus) expansion dock, a stylus, a true wireless earphone, a car center console screen, a car, a smart wearable device, a mobile terminal, a smart home device. The smart wearable device includes, but is not limited to, a smart watch, a smart bracelet, and a cervical massager. The mobile terminal includes, but is not limited to, a smart phone, a laptop computer, a tablet computer, and a POS (point of sales terminal) machine. The smart home device includes, but is not limited to, a smart socket, a smart rice cooker, a smart sweeper, and a smart light. The electronic device can be implemented as Figure 1 the electronic device 100 shown.

[0139] The above are only the preferred embodiments of the present application, and do not impose any formal restrictions on the present application. Although the present application has been disclosed above with preferred embodiments, it is not intended to limit the present application. Any person skilled in the art can make some changes or modifications to equivalent embodiments by using the disclosed technical content within the scope of the technical solution of the present application. However, as long as it does not depart from the content of the technical solution of the present application, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present application still fall within the scope of the technical solution of the present application.

Claims

1. A near field communication NFC card selection method, characterized in that: The method is applied to an electronic device, the electronic device includes an NFC device, and the method includes: The NFC device detects the RF characteristics of the NFC reader; The NFC device matches the detected RF feature with one or more preset RF feature templates to select an NFC card from a plurality of NFC cards, wherein each of the RF feature templates is associated with an NFC card; If the selected NFC card is not unique, the NFC device swipes the selected NFC card in a card switching manner.

2. The method according to claim 1, characterized in that Also includes: If no NFC card is selected, the NFC device swipes the multiple NFC cards in a card switching manner.

3. The method according to claim 1 or 2, characterized in that The NFC device swipes the NFC card in a card switching manner, including: When using at least one NFC card to swipe, timing the swiping time of the NFC card and identifying a preset swiping event in the swiping process; If a preset card swiping event is identified before the card swiping timer times out, switching to the next NFC card for swiping based on the identified preset card swiping event, and stopping the card swiping timer; If the card swiping timer times out, the next NFC card of the NFC card is switched to be swiped according to the card sequence.

4. The method according to claim 3, characterized in that The preset card swiping event includes at least one of the following: The type of the NFC card reader does not match the type of the NFC card; The interactive authentication protocol of the NFC card reader does not match the interactive authentication protocol of the NFC card.

5. The method according to claim 4, characterized in that The preset card swiping event is that the type of the NFC card reader does not match the type of the NFC card, wherein: The preset card swiping event in the card swiping process includes: upon receiving an application identifier AID sent by an NFC card reader, determining whether the AID sent by the NFC card reader matches the AID associated with the NFC card; if the AID sent by the NFC card reader does not match the AID associated with the NFC card, the type of the NFC card does not match the type of the NFC card reader; The switching of the next NFC card for swiping the card based on the recognized preset card swiping event includes: switching the NFC card corresponding to the AID sent by the NFC card reader for swiping the card.

6. The method according to claim 4, characterized in that The preset card swiping event is that the interactive authentication protocol of the NFC card reader does not match the interactive authentication protocol of the NFC card, wherein: The identifying of the preset card swiping event in the card swiping process includes: identifying a second interactive authentication protocol of the NFC card reader, and determining whether the second interactive authentication protocol is consistent with a first interactive authentication protocol of the NFC card; The switching of the next NFC card for swiping the card based on the recognized preset card swiping event includes: switching the next NFC card of the NFC card for swiping the card according to the card sequence.

7. The method according to claim 3, characterized in that The NFC device swipes the NFC card in a card switching manner, and further includes: If the user is away from the card for more than a preset time during the NFC card swiping process, the card will be switched to the first NFC card in the card sequence.

8. The method according to claim 1 or 2, characterized in that: The NFC device swipes the NFC card in a card switching manner, and further includes: When switching to each NFC card, the NFC card reader's presence detection instruction is not responded to until the NFC card reader performs a card swipe interaction again or receives a preset number of presence detection instructions.

9. The method according to claim 1 or 2, characterized in that: Also includes: In the initialization phase, the NFC device receives and stores the RF configuration of a preset NFC card and the difference between the RF configuration of other NFC cards and the RF configuration of the preset NFC card; When the NFC device swipes the NFC card in a card switching manner, the NFC card reader is adapted based on the stored RF configuration and difference items.

10. The method according to claim 9, characterized in that Also includes: When the RF configuration is updated in real time, the NFC device receives and updates the difference item.

11. The method according to claim 1, characterized in that The detected RF signature and each of the RF signature templates include: card detection pulse information, transmission event sequence information, and transmission event timing information.

12. The method according to claim 11, characterized in that The NFC device matches the detected RF feature with a preset RF feature template, including: Matching the detected card detection pulse information with the card detection pulse information in the RF feature template; If the detected card detection pulse information matches the card detection pulse information in the RF feature template, matching the detected transmission event sequence information with the transmission event sequence information in the RF feature template; If the detected transmission event sequence information matches the transmission event sequence information in the RF feature template, matching the detected transmission event timing information with the transmission event timing information in the RF feature template; If the detected transmission event timing information matches the transmission event timing information in the RF feature template, the detected RF feature matches the RF feature template.

13. The method according to claim 12, characterized in that Also includes: If any of the detected RF features does not match the corresponding feature in the RF feature template, the detected RF feature is matched with the next RF feature template until the matching end condition is reached.

14. The method according to claim 12, characterized in that The matching of the detected transmission event sequence information with the transmission event sequence information in the RF feature template includes: calculating the mutual correlation between the detected transmission event sequence information and the transmission event sequence information in the RF feature template to obtain a first mutual correlation; if the calculated first mutual correlation is greater than or equal to a first threshold, the detected transmission event sequence information matches the transmission event sequence information in the RF feature template; and / or The matching of the detected transmission event timing information with the transmission event timing information in the RF feature template includes: calculating the cross-correlation between the detected transmission event timing information and the transmission event timing information in the RF feature template to obtain a second cross-correlation; if the calculated second cross-correlation is greater than or equal to a second threshold, the detected transmission event timing information matches the transmission event timing information in the RF feature template.

15. The method according to claim 1 or 11, characterized in that: Also includes: In the RF feature learning stage, the NFC device uses the NFC card to swipe in a card switching mode; The NFC device detects RF characteristics during each NFC card swiping process; If the NFC card is successfully swiped, the NFC device will associate and store the detected RF feature with the NFC card to obtain an RF feature template and its association with the NFC card.

16. The method according to claim 15, characterized in that Determining whether the NFC card is successfully swiped includes: Determine whether the card is swiped again within a preset time, and if no NFC card is swiped again within the preset time, determine that the NFC card is swiped successfully; and / or Determine whether the card swiping is successful based on the feedback from the NFC card reader.

17. The method according to claim 15, characterized in that Before the NFC device associates and stores the detected RF feature with the NFC card, the method further includes: Determining whether the detected RF feature meets data quality requirements based on whether a command in a transmission event sequence in the detected RF feature has periodicity; Wherein, when the detected RF feature meets the data quality requirement, the NFC device associates and stores the detected RF feature with the NFC card.

18. The method according to claim 15, characterized in that The card detection pulse information includes: a pulse interval and a pulse width of the card detection pulse; and / or The transmission event sequence information includes a command coding sequence obtained by encoding a command sequence sent by an NFC card reader; the NFC device detects RF characteristics during each NFC card swiping process, including: receiving a command sent by the NFC card reader, encoding the acquired command, and obtaining a command coding sequence; and / or The transmission event timing information includes a time interval sequence; the NFC device detects RF characteristics during each NFC card swiping process, including: detecting the timestamp of each transmission event, determining the time interval between transmission events based on the timestamp of each transmission event, and obtaining the time interval sequence.

19. A near field communication (NFC) device, characterized in that: include: A selection module, configured to detect an RF feature of an NFC card reader, and match the detected RF feature with one or more preset RF feature templates to select an NFC card from a plurality of NFC cards, wherein each of the RF feature templates is associated with an NFC card; The switching module is used to swipe the selected NFC card in a card switching manner if the selected NFC card is not unique.

20. The device according to claim 19, characterized in that The switching module is further configured to swipe the multiple NFC cards in a card switching manner if no NFC card is selected.

21. The device according to claim 19 or 20, characterized in that The switching module is specifically used for: When using at least one NFC card to swipe, timing the swiping time of the NFC card and identifying a preset swiping event in the swiping process; If a preset card swiping event is identified before the card swiping timer times out, switching to the next NFC card for swiping based on the identified preset card swiping event, and stopping the card swiping timer; If the card swiping timer times out, the next NFC card of the NFC card is switched to be swiped according to the card sequence.

22. The device according to claim 21, characterized in that The preset card swiping event includes at least one of the following: the type of the NFC card reader does not match the type of the NFC card; the interactive authentication protocol of the NFC card reader does not match the interactive authentication protocol of the NFC card.

23. The device according to claim 22, characterized in that The preset card swiping event is that the type of the NFC card reader does not match the type of the NFC card, wherein: The preset card swiping event in the card swiping process includes: upon receiving an application identifier AID sent by an NFC card reader, determining whether the AID sent by the NFC card reader matches the AID associated with the NFC card; if the AID sent by the NFC card reader does not match the AID associated with the NFC card, the type of the NFC card does not match the type of the NFC card reader; The switching of the next NFC card for swiping the card based on the recognized preset card swiping event includes: switching the NFC card corresponding to the AID sent by the NFC card reader for swiping the card.

24. The device according to claim 21, characterized in that The switching module is further used for: If the user is away from the card for more than a preset time during the NFC card swiping process, the card will be switched to the first NFC card in the card sequence.

25. The device according to claim 19 or 20, wherein the switching module is further used for: When switching to each NFC card, the NFC card reader's presence detection instruction is not responded to until the NFC card reader performs a card swipe interaction again or receives a preset number of presence detection instructions.

26. The device according to claim 19, characterized in that The detected RF signature and each of the RF signature templates include: card detection pulse information, transmission event sequence information, and transmission event timing information.

27. The device according to claim 26, characterized in that The selection module is specifically used for: Matching the detected card detection pulse information with the card detection pulse information in the RF feature template; If the detected card detection pulse information matches the card detection pulse information in the RF feature template, matching the detected transmission event sequence information with the transmission event sequence information in the RF feature template; If the detected transmission event sequence information matches the transmission event sequence information in the RF feature template, matching the detected transmission event timing information with the transmission event timing information in the RF feature template; If the detected transmission event timing information matches the transmission event timing information in the RF feature template, the detected RF feature matches the RF feature template.

28. The device according to claim 19 or 26, characterized in that The switching module is also used to use the NFC card to swipe the card in a card switching mode during the RF feature learning phase; The selection module is also used to detect RF features during each NFC card swiping process; if the NFC card is swiped successfully, the detected RF features are associated with the NFC card and stored to obtain the RF feature template and its association with the NFC card.

29. The device according to claim 28, characterized in that The selection module is further used to determine whether the detected RF feature meets the data quality requirement according to whether the command in the transmission event sequence in the detected RF feature has periodicity; Wherein, when the detected RF feature meets the data quality requirement, the detected RF feature is associated with the NFC card and stored.

30. An electronic device, characterized in that: A near field communication (NFC) device comprising any one of claims 19 to 29.

31. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1 to 18.

Citation Information

Patent Citations

  • SIM (Subscriber Identification Module) card switching circuit and SIM card switching method

    CN106358179A

  • Method for selecting card during card reading, terminal equipment and storage medium

    CN115221906A

  • Screen display method, terminal and computer readable storage medium

    CN115665314A

  • NFC-based card swiping method, electronic equipment and storage medium

    CN118214997A

  • Emulated Card Selection Method and Mobile Device

    US20210067201A1

Cited By

  • Vehicle-mounted NFC service system and method, vehicle and equipment

    CN121174124A