Analog card switching method, device, electronic device and storage medium for near field communication

By dynamically modifying the card identification of the general simulation card, the automatic switching of multiple permission simulation cards is realized, which solves the problem of cumbersome manual card selection operation and improves the switching efficiency and convenience.

CN114466337BActive Publication Date: 2025-05-13GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011240751.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-09
Publication Date
2025-05-13
Estimated Expiration
2040-11-09

AI Technical Summary

Technical Problem

When using multiple analog cards to swipe NFC cards, users need to manually select the analog card to swipe. The operation is cumbersome, and the analog card switching time is long and the card cutting efficiency is low.

Method used

By dynamically modifying the card identification of the general simulation card in the first device, it allows it to send the card identification corresponding to the simulated cards of different permissions in each round of NFC interaction, automatic switching of multiple permissions simulation cards is realized.

Benefits of technology

It reduces the time during the switching process of analog cards, improves switching efficiency, simplifies user operations, realizes automatic switching of multiple analog cards, and improves convenience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114466337B_ABST
    Figure CN114466337B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a method, device, electronic device and storage medium for switching simulated cards in near field communication. The method includes: a first device receives a first instruction sent by a second device in the current round of NFC interaction with a second device; obtains a first card identifier currently corresponding to an activated universal simulated card according to the first instruction; sends the first card identifier to the second device, and the first card identifier is used for identity confirmation in the second device; modifies the card identifier corresponding to the universal simulated card to a second card identifier, and the second card identifier is used for identity confirmation in the next round of NFC interaction with the second device, and the first card identifier and the second card identifier correspond to different permission simulated cards respectively. The above-mentioned method, device, electronic device and storage medium for switching simulated cards in near field communication can automatically switch permission simulated cards in NFC interaction, and reduce the time in the simulation card switching process, thereby improving switching efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method, device, electronic device and storage medium for switching analog cards in near field communication. Background Art

[0002] Near Field Communication (NFC) is an emerging technology. Devices using NFC technology (such as mobile phones, smart wearable devices, etc.) can exchange data when they are close to each other. This technology is widely used in people's lives, such as common subways, buses, UnionPay QuickPass, access control systems, etc. At present, many mobile phones, wearable devices and other electronic devices have NFC functions. These electronic devices with NFC functions can realize the card swiping function through NFC technology by binding or opening various simulated cards (such as bus cards, bank cards and access control cards, etc.).

[0003] When multiple simulated cards are bound or activated in an electronic device, such as community access cards, unit access cards, get off work attendance cards, etc., the user needs to manually select the simulated card to be swiped before using NFC to swipe the card, which is cumbersome. Summary of the invention

[0004] The embodiments of the present application disclose a method, device, electronic device and storage medium for switching simulated cards in near field communication, which can automatically switch the permission simulated cards in NFC interaction, reduce the time in the simulated card switching process, and improve the switching efficiency.

[0005] The embodiment of the present application discloses a method for switching an analog card in near field communication, which is applied to a first device. The method includes:

[0006] In a current round of near field communication (NFC) interaction with a second device, receiving a first instruction sent by the second device;

[0007] Acquire, according to the first instruction, a first card identifier currently corresponding to the activated universal simulated card;

[0008] Sending the first card identifier to the second device, where the first card identifier is used for identity confirmation in the second device;

[0009] The card identifier corresponding to the universal simulated card is modified to a second card identifier, where the second card identifier is used for identity confirmation in the next round of NFC interaction with the second device, wherein the first card identifier and the second card identifier correspond to different permission simulated cards respectively.

[0010] The embodiment of the present application discloses a near field communication analog card switching device, which is applied to a first device, and the device includes:

[0011] A receiving module, configured to receive a first instruction sent by a second device in a current round of near field communication (NFC) interaction with the second device;

[0012] An identification acquisition module, used for acquiring a first card identification currently corresponding to the activated universal simulated card according to the first instruction;

[0013] a sending module, configured to send the first card identifier to the second device, wherein the first card identifier is used for identity confirmation in the second device;

[0014] A modification module is used to modify the card identifier corresponding to the universal simulated card to a second card identifier, wherein the second card identifier is used for identity confirmation in the next round of NFC interaction with the second device, wherein the first card identifier and the second card identifier correspond to different permission simulated cards respectively.

[0015] An embodiment of the present application discloses an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method described above.

[0016] An embodiment of the present application discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method described above is implemented.

[0017] The embodiment of the present application discloses a method, device, electronic device and storage medium for switching analog cards in near field communication. In the current NFC interaction with the second device, the first device receives a first instruction sent by the second device, obtains the first card identifier currently corresponding to the activated universal analog card according to the first instruction, and sends the first card identifier to the second device for identity confirmation, and then modifies the card identifier corresponding to the universal analog card to the second card identifier, and the second card identifier is used for identity confirmation in the next round of NFC interaction with the second device, wherein the first card identifier and the second card identifier respectively correspond to different permission analog cards, and by dynamically modifying the card identifier corresponding to the universal analog card, the first device can send the card identifiers corresponding to different permission analog cards to the second device in each round of NFC interaction with the second device, thereby realizing automatic switching of multiple permission analog cards and improving convenience. Moreover, since the card identifier corresponding to the universal analog card is used for identity confirmation in each round of NFC interaction, there is no need to frequently perform operations such as activation and deactivation of the analog card, which reduces the switching time of the analog card and improves the switching efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 An application scenario diagram of a method for switching a simulated card for near field communication in an embodiment;

[0020] Figure 2 is a structural block diagram of a first device in an embodiment;

[0021] Figure 3 is a flow chart of a method for switching an analog card in near field communication in one embodiment;

[0022] Figure 4 A flowchart of entering a permission card in one embodiment;

[0023] Figure 5 A schematic diagram showing a created permission simulation card in one embodiment;

[0024] Figure 6 is a flow chart of a method for switching analog cards for near field communication in another embodiment;

[0025] Figure 7 This is a structural block diagram of an NFC chip according to an embodiment;

[0026] Figure 8 A block diagram of an analog card switching device for near field communication in one embodiment;

[0027] Fig. 9 FIG. 4 is a structural block diagram of an electronic device in another embodiment. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0029] It should be noted that the terms "including" and "having" and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.

[0030] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first card identification may be referred to as a second event, and similarly, a second event may be referred to as a first event. Both the first event and the second event are events, but they are not the same event.

[0031] The NFC technology standard is a short-range (within 10cm) wireless communication technology initiated by Philips (later an independent NXP company) and jointly promoted by famous manufacturers such as Nokia and Sony. The operating frequency of NFC is usually 13.56MHz. NFC technology can mainly include three different modes: 1. Card simulation mode, which can use electronic devices supporting NFC technology as various cards (such as bank cards, bus cards, access cards, etc.), and perform corresponding processing in other NFC radio devices (such as electronic transfer, opening doors, etc.); 2. Card reader mode, which can read and write information from other media such as labels, stickers, business cards with NFC chips through electronic devices supporting NFC technology; 3. Peer-to-peer mode, which can be used for data exchange between different NFC devices, such as exchanging pictures and other data.

[0032] Users can use the card simulation function of NFC technology on electronic devices to activate / bind multiple cards on the electronic devices. However, when swiping an NFC card, since only one of the cards can be used for interaction, the user needs to manually select the card to be swiped before swiping the card, which is cumbersome.

[0033] In order to solve the problem of cumbersome operation caused by manual card selection by users, some automatic card selection solutions have also appeared. Users can add multiple analog cards to the automatic card selection list. When swiping the card, the electronic device will automatically switch the analog cards in the list. When switching cards, the electronic device must first deactivate the currently selected analog card, and then activate the next analog card to be used, etc., resulting in a long switching time and low card switching efficiency.

[0034] Figure 1 FIG. 1 is an application scenario diagram of a method for switching a simulated card in near field communication in an embodiment. Figure 1As shown, the first device 10 supports NFC technology, and the first device 10 can establish an NFC communication connection with the second device 20. The first device 10 may include but is not limited to electronic devices such as mobile phones, smart wearable devices, and tablet computers. The second device 20 may be an NFC radio frequency device, an NFC card reader, etc., which has an NFC card reading function and can read and write information from other media such as labels, stickers, and business cards with NFC chips. The second device 20 may include but is not limited to NFC card readers of subway gates, access control card readers, and UnionPay POS (point of sale) machines. When the first device 10 is in the NFC radio frequency field generated by the second device 20, the first device 10 can establish an NFC communication connection with the second device 20 and perform data exchange through the NFC communication connection.

[0035] The first device 10 may have card identifiers of multiple permission simulation cards recorded in it. In the current round of NFC interaction between the first device 10 and the second device 20, the first device 10 may receive a first instruction sent by the second device 20, and obtain the first card identifier currently corresponding to the activated universal simulation card according to the first instruction. The first device 10 may send the first card identifier to the second device 20, and the second device 20 may receive the first card identifier sent by the first device 10, and confirm the identity of the first device 10 according to the first card identifier.

[0036] After sending the first card identifier to the second device 20, the first device 10 may modify the card identifier corresponding to the universal simulation card to the second card identifier, and the first card identifier and the second card identifier respectively correspond to different permission simulation cards. In the next round of NFC interaction with the second device, the first device 10 may obtain the second card identifier corresponding to the universal simulation card, and send the second card identifier to the second device 20 for identity confirmation. By dynamically modifying the card identifier corresponding to the universal simulation card, the first device 10 may send the card identifiers corresponding to different permission simulation cards to the second device 20 in each round of NFC interaction with the second device 20, thereby realizing automatic switching of multiple permission simulation cards and improving convenience.

[0037] Figure 2 FIG. 1 is a structural block diagram of a first device in an embodiment. Figure 2As shown, the first device 10 may include a processor 110, an NFC chip 120, an NFC antenna 130, etc. The NFC antenna 130 may be used to receive an NFC signal sent by the second device 20, and send a signal required to be transmitted by the NFC chip 120 to the second device 20, etc. The processor 120 may be used to control the NFC chip 120, and call the function of the NFC chip 120 to perform corresponding operations. Optionally, the processor 120 may include an application processor (AP), a central processing unit (CPU), etc., which are not limited here.

[0038] In the embodiment of the present application, in the NFC interaction between the first device 10 and the second device 20, the NFC antenna 130 may receive a first instruction sent by the second device 20, and send the first instruction to the NFC chip 120. The NFC chip 120 may obtain the card identifier corresponding to the activated universal simulated card according to the first instruction, and send the card identifier corresponding to the universal simulated card to the second device 20 through the NFC antenna 130. The processor 110 may also modify the card identifier corresponding to the universal simulated card, so that the card identifiers corresponding to different authority simulated cards may be sent to the second device 20 in each round of NFC interaction with the second device 20, so as to realize automatic switching of multiple authority simulated cards.

[0039] It should be noted that the first device 10 may include: Figure 2 More or fewer components as shown, for example, the first device 10 may also include a display module, which is electrically connected to the processor 110 and can be used to display the interface of the application in the first device 10, etc., which is not limited here.

[0040] like Figure 3 As shown, in one embodiment, a near field communication analog card switching method is provided, which can be applied to the first device mentioned above, and the method may include the following steps:

[0041] Step 310: In a current round of near field communication (NFC) interaction with a second device, a first instruction sent by the second device is received.

[0042] In an embodiment of the present application, the first device may refer to an electronic device with a card emulation function using NFC technology, and the second device may refer to a device with an NFC card reading function. The second device may provide an NFC radio frequency field, and continuously discover devices that enter the NFC radio frequency field generated by the second device. In some embodiments, a user may select a card in an application running on the first device. After obtaining the card selected by the user, the first device may call a function function of the NFC chip, and pass function parameters to the NFC chip through the function function to control the NFC chip to enter the card emulation mode. In the card emulation mode, the first device may not generate an NFC radio frequency field, but instead respond passively after detecting the NFC radio frequency field entering another device.

[0043] When the NFC chip of the first device enters the NFC radio frequency field generated by the second device, the NFC chip can trigger a first event (Field on event), which can be used to indicate that the NFC module detects the NFC radio frequency field generated by the second device. After the first device enters the NFC radio frequency field generated by the second device, an NFC communication connection can be established with the second device.

[0044] In some embodiments, after the first device enters the NFC radio frequency field generated by the second device, the NFC chip of the first device may be in an idle state or a dormant state, and the second device may send a card request instruction in real time or periodically, and the card request instruction may be used to call a card in its NFC radio frequency field. Different card request instructions may be sent for different types of cards. For example, for a Class A card, a REQA instruction may be sent, and for a Class B card, a REQB instruction may be sent, but not limited thereto, wherein the carrier modulation depth and binary number encoding method of different types of cards may be different. After the card emulation function is turned on in the NFC chip of the first device, when the first device receives the card request instruction sent by the second device, it may be determined that a new round of NFC interaction with the second device has been entered, and the first device may return a response instruction to the second device.

[0045] After the second device receives the response instruction returned by the first device, it can send a first instruction to the first device, and the first instruction can be used to obtain the card identifier corresponding to the card currently used by the NFC chip of the first device under the card emulation function. Optionally, the first instruction can be a conflict detection instruction (ANTICOLLISION), and after the first device receives the first instruction, it can return the card identifier corresponding to the currently used emulated card to the second device.

[0046] In some embodiments, after the second device receives the response instruction returned by the first device, it can determine whether the NFC chip of the first device supports the anti-collision protocol (such as ISO1443A-3 protocol, etc.) according to the response instruction. If the first device supports the anti-collision protocol, the first instruction can be sent to the first device based on the anti-collision mechanism. In the anti-collision mechanism, the second device only selects one device to send the first instruction each time, that is, it only interacts with one card. By determining whether the NFC chip of the first device supports the anti-collision protocol, it can prevent conflicts when multiple cards exist in the NFC radio frequency field at the same time.

[0047] Step 320: Obtain the first card identifier currently corresponding to the activated universal simulated card according to the first instruction.

[0048] In the current NFC technology, when entering card information, the created simulated card is usually in one-to-one correspondence with the entered card. For example, when a user enters different cards such as a work access card, a community access card, a bank card, etc., a simulated card corresponding to each physical card can be created respectively. The card identifier of the created simulated card is in an unchangeable state. The card identifier can be used to uniquely identify the identity of the simulated card. The card identifier may include the UID (Unique Identifie) of the simulated card, etc. The UID of the simulated card corresponds one-to-one to the entered physical card. When the user needs to use one of the cards, he or she can select it.

[0049] In an embodiment of the present application, the first device may pre-create a universal simulation card, which may refer to a universal authority simulation card that can be used for identity confirmation in multiple different NFC card readers. For example, the universal simulation card can be used as a unit access card, a community access card, a get off work attendance card, a dormitory access card, and other different authority simulation cards. Unlike traditional simulation cards, the card identifier corresponding to the universal simulation card can be dynamically modified.

[0050] The first device can input multiple different permission cards, and create permission simulation cards corresponding to each input permission card, and can set and store the card identification corresponding to each permission simulation card, wherein the permission card refers to a card that can be used for permission verification, such as an access card, an attendance card, etc. The first device can perform multiple rounds of NFC interaction with the second device, and modify the card identification corresponding to the universal simulation card in turn according to the multiple card identifications corresponding to the multiple stored permission simulation cards, so that the card identification corresponding to the universal simulation card changes in each round of NFC interaction.

[0051] Exemplarily, the first device creates three permission simulation cards, and the card identifiers of the three permission simulation cards are 11223344, 55667788, and AABBCCDD, respectively. The card identifier corresponding to the universal simulation card can be modified to 11223344, 55667788, and AABBCCDD, respectively. In the first round of NFC interaction between the first device and the second device, the card identifier corresponding to the universal simulation card is 11223344, in the second round of NFC interaction between the first device and the second device, the card identifier corresponding to the universal simulation card is 55667788, and in the third round of NFC interaction between the first device and the second device, the card identifier corresponding to the universal simulation card is AABBCCDD.

[0052] In the current round of NFC interaction between the first device and the second device, the first device receives the first instruction sent by the second device, and can obtain the first card identifier currently corresponding to the activated universal simulated card according to the first instruction, and send the first card identifier to the second device. The first card identifier is the card identifier corresponding to the universal simulated card in the current round of NFC interaction.

[0053] Optionally, the first device may activate the universal analog card to put the universal analog card in an activated state. Activating the universal analog card may be understood as setting communication parameters for the universal analog card, and the communication parameters may include but are not limited to the structure of the transmitted data packet, the size of the data packet, the transmission rate, etc. Only an activated analog card can achieve NFC communication with the second device.

[0054] In some embodiments, the first device may activate the universal simulation card when any permission simulation card in the NFC card simulation function is triggered; it may also activate the universal simulation card in the first round of NFC interaction with the second device, that is, when the request instruction sent by the second device is received for the first time; it may also activate the universal simulation card when the NFC radio frequency field of the second device is detected for the first time, etc., but not limited thereto. It can be understood that the timing of the first device activating the universal simulation card is not limited in the embodiments of the present application.

[0055] In order to prevent conflicts between multiple cards, analog cards with conflicting communication parameters are not allowed to be activated at the same time. Usually, there are conflicts in communication parameters between cards of the same type. Therefore, in the related art, if it is necessary to switch analog cards, the current card needs to be deactivated and the new card needs to be activated during each switch.

[0056] In the embodiment of the present application, the first device only activates the universal simulation card, and modifies the card identifier corresponding to the universal simulation card according to the stored permission simulation cards. In different rounds of NFC interaction with the second device, since the card identifier corresponding to the universal simulation card changes, the NFC chip of the first device can send different card identifiers to the second device to achieve the effect of switching between different permission simulation cards, and essentially only uses the universal simulation card for communication. Therefore, there is no need to repeatedly deactivate and reactivate the card, which can save waiting time during the card switching process and improve switching efficiency.

[0057] Step 330: Send the first card identifier to the second device, where the first card identifier is used for identity confirmation in the second device.

[0058] Since the currently activated simulated card is a universal simulated card, and the card identifier currently corresponding to the universal simulated card is the first card identifier, the NFC chip of the first device can obtain the first card identifier and send the first card identifier to the second device. After receiving the first card identifier, the second device can perform identity confirmation based on the first card identifier to determine whether the user is a legitimate user. If the user is determined to be a legitimate user, the corresponding permissions can be enabled. For example, if the second device is an NFC card reader in an access control card system, when the user is determined to be a legitimate user based on the first card identifier, the access control card system can control the opening of the door, etc.

[0059] If the second device cannot determine that the user is a legitimate user based on the first card identifier, it can continue to confirm the identity of the card identifier sent by the first device in the next round of NFC interaction.

[0060] Step 340: modify the card identifier corresponding to the universal simulated card to a second card identifier, where the second card identifier is used for identity confirmation in the next round of NFC interaction with the second device.

[0061] After sending the first card identifier to the second device, the first device may modify the card identifier corresponding to the universal simulated card to the second card identifier, wherein the first card identifier and the second card identifier may correspond to different permission simulated cards respectively.

[0062] As a specific implementation, the first device may erase the first card identifier stored in the identifier storage area corresponding to the universal simulated card in the NFC chip, and then write the second card identifier into the identifier storage area corresponding to the universal simulated card in the NFC chip, which can ensure that the universal simulated card corresponds to only one card identifier each time, thereby improving the accuracy of the NFC interaction process. When the first device enters the next round of NFC interaction with the second device, the NFC chip may obtain the second card identifier corresponding to the universal simulated card from the identifier storage area corresponding to the universal simulated card, and send the second card identifier to the second device, which verifies the second card identifier. At the same time, the first device may modify the card identifier corresponding to the universal simulated card to the card identifier of another permission simulated card.

[0063] In an embodiment of the present application, each round of NFC interaction between the first device and the second device may refer to a complete polling. One polling may include an interactive process from the second device sending a request instruction to the first device returning a card identifier corresponding to the universal simulated card. Steps 310 to 340 may be executed for each round of NFC interaction. Through multiple pollings, the second device obtains the card identifiers of all permission simulated cards stored in the first device, thereby realizing automatic card switching. The card switching process is fast, allowing users to confirm their identity without feeling it, thereby improving convenience.

[0064] Exemplarily, a multi-round NFC interaction process between the first device and the second device may be as shown in Table 1.

[0065] Table 1

[0066] instruction hexadecimal direction REQA 26 PCD→PICC ATQA 04 00 PICC→PCD ANTICOLLISION 93 20 PCD→PICC UID 11 22 33 44+CRC PICC→PCD REQA 26 PCD→PICC ATQA 04 00 PICC→PCD ANTICOLLISION 93 20 PCD→PICC UID 55 66 77 88+CRC PICC→PCD REQA 26 PCD→PICC ATQA 04 00 PICC→PCD ANTICOLLISION 93 20 PCD→PICC UID AABB CC DDC+CRC PICC→PCD

[0067] Among them, REQA is a request instruction, ATQA is a response instruction, ANTICOLLISION is a conflict detection instruction, that is, the first instruction mentioned above, PCD (Proximity Coupling Device) may refer to the second device mentioned above, PICC (Proximity Integrated Circuit Card) may refer to the first device mentioned above, and UID is an instruction for the first device to return the card identification to the second device.

[0068] In Table 1, three permission simulation cards may be stored in the first device, and the card identifiers of the three permission simulation cards are 11223344, 55667788, and AABBCCDD, respectively. Each round of NFC interaction between the first device and the second device may include four instructions REQA~UID, and the four instructions REQA~UID serve as a complete polling. In the first round of NFC interaction, the card identifier corresponding to the universal simulation card is the card identifier 11223344 of the first permission simulation card, and the first device may send the card identifier 11223344 to the second device; in the second round of NFC interaction, the card identifier corresponding to the universal simulation card is modified to the card identifier 55667788 of the second permission simulation card, and the first device may send the card identifier 55667788 to the second device; in the third round of NFC interaction, the card identifier corresponding to the universal simulation card is modified to the card identifier AABBCCDD of the third permission simulation card, and the first device may send the card identifier AABBCCDD to the second device.

[0069] In some embodiments, the first device and the second device may continuously poll multiple permission simulation cards, for example, the three rounds of polling in Table 1 above may be continuously cycled until the first device leaves the NFC radio frequency field of the second device. The first device may also stop interacting with the second device after completing the polling of all permission simulation cards.

[0070] It can be seen intuitively from Table 1 that in each round of NFC interaction between the first device and the second device, since the card identifier corresponding to the universal simulated card has changed, the first device can return the card identifier of the simulated card with different permissions to the second device to realize the polling of the simulated cards with different permissions. It should be noted that the communication instructions and the transmitted data content in Table 1 are only used to illustrate the embodiments of the present application, and do not impose specific restrictions on the embodiments of the present application. The first device and the second device can adjust the communication instructions and the transmitted data content according to actual needs, wherein the byte length of the card identifier can also be adjusted according to actual needs, and the present application example does not impose any restrictions.

[0071] In an embodiment of the present application, the first device receives a first instruction sent by the second device during the current NFC interaction with the second device, obtains the first card identifier currently corresponding to the activated universal simulated card according to the first instruction, and sends the first card identifier to the second device for identity confirmation, and then modifies the card identifier corresponding to the universal simulated card to the second card identifier, and the second card identifier is used for identity confirmation in the next round of NFC interaction with the second device, wherein the first card identifier and the second card identifier respectively correspond to different permission simulated cards, and by dynamically modifying the card identifier corresponding to the universal simulated card, the first device can send the card identifiers corresponding to different permission simulated cards to the second device in each round of NFC interaction with the second device, thereby realizing automatic switching of multiple permission simulated cards and improving convenience. Moreover, since the card identifier corresponding to the universal simulated card is used for identity confirmation in each round of NFC interaction, there is no need to frequently perform operations such as activating and deactivating the simulated card, which reduces the switching time of the simulated card and improves the switching efficiency.

[0072] In one embodiment, the step of modifying the card identifier corresponding to the universal simulated card to the second card identifier may include: modifying the card identifier corresponding to the universal simulated card to the second card identifier according to the card identifier set.

[0073] The first card identification and the second card identification in the above embodiment both belong to a card identification set, and the card identification set can be used to store the card identification corresponding to each permission simulation card entered, and the card identification set can include N card identifications corresponding to N permission simulation cards, respectively, where N is an integer greater than or equal to 2. The card identification corresponding to the universal simulation card can be modified in sequence according to the N card identifications stored in the card identification set.

[0074] Optionally, an independent storage area can be allocated in the memory for storing the card identification set, or a new configuration file can be established to specifically store the card identification set, so as to facilitate subsequent access, speed up the modification of the card identification corresponding to the universal simulated card, ensure the accuracy of the modification, and ensure security.

[0075] In some embodiments, the card identification set may be a card identification sequence, and the N card identifications stored in the card identification sequence may be arranged in a certain order, and the data storage format of the card identification sequence may include but is not limited to arrays, linked lists, lists and other formats. As a specific implementation, the N card identifications in the card identification sequence may be arranged in the order of the entry time of the authority simulation cards corresponding to the respective card identifications. The card identification corresponding to the authority simulation card entered for the first time may be stored in the first position of the card identification sequence, and the card identification corresponding to the authority simulation card entered for the second time may be stored in the second position of the card identification sequence... and so on.

[0076] The first device can start from the first card identifier in the card identifier sequence, and after sending the card identifier corresponding to the universal simulated card to the second device each time, it can read the card identifiers from the card identifier sequence in sequence according to the order of N card identifiers in the card identifier sequence, and modify the card identifier corresponding to the universal simulated card to the read card identifier.

[0077] For example, the card identification sequence includes card identification A, card identification B, card identification C and card identification D. The card identification corresponding to the universal simulated card can be modified in the order of card identification A, card identification B, card identification C and card identification D.

[0078] In some embodiments, when the first device modifies the card identifier corresponding to the universal simulated card, it can determine whether the first card identifier currently corresponding to the universal simulated card is the last card identifier in the card identifier sequence. If the first card identifier is not the last card identifier in the card identifier sequence, the next card identifier arranged after the first card identifier can be read from the card identifier sequence, and the next card identifier can be used as the second card identifier, and the card identifier corresponding to the universal simulated card can be modified to the second card identifier.

[0079] For example, the card identification sequence includes card identification A, card identification B, card identification C and card identification D. If the first card identification currently corresponding to the universal simulated card is card identification B, which is not the last card identification in the card identification sequence, the next card identification (i.e., card identification C) can be read from the card identification sequence, and the card identification corresponding to the universal simulated card can be modified to card identification C.

[0080] If the first card identifier currently corresponding to the universal simulated card is the last card identifier in the card identifier sequence, the first card identifier can be read from the card identifier sequence, and the first card identifier can be used as the second card identifier, and then the card identifier corresponding to the universal simulated card can be modified to the second card identifier. After completing a cycle from the first card identifier to the last card identifier in the card identifier sequence, that is, after the second device completes polling of all authorized simulated cards in the first device, it can return to the first card identifier and continue identity confirmation.

[0081] For example, the card identification sequence includes card identification A, card identification B, card identification C and card identification D. If the first card identification currently corresponding to the universal simulated card is card identification D, which is the last card identification in the card identification sequence, the first card identification (i.e., card identification A) can be read from the card identification sequence, and the card identification corresponding to the universal simulated card can be modified to card identification A.

[0082] After the second device verifies the received card identifier, the user leaves the second device. At this time, the first device moves away from the second device and leaves the NFC radio frequency field of the second device. After the first device leaves the NFC radio frequency field of the second device, the NFC interaction with the second device is stopped, and the modification of the card identifier corresponding to the universal simulation card can be stopped. The card identifier corresponding to the universal simulation card can be the card identifier set by the last modification, or the card identifier corresponding to the universal simulation card can be restored to the default card identifier. Optionally, the default card identifier can be the first card identifier in the card identifier sequence, which can ensure that all permission simulation cards will be polled the next time the permission simulation card is used for identity confirmation.

[0083] In some embodiments, when the user uses the NFC card simulation function of the first device, the user lifts the first device and brings it close to the second device to swipe the card. The first device can collect posture information in real time, and when it detects that the first device is put down according to the collected posture information, it can indicate that the identity authentication has been completed, and the NFC interaction with the second device can be stopped, that is, the card identifier corresponding to the universal simulation card is stopped from being sent to the second device, and the modification of the card identifier corresponding to the universal simulation card can be stopped at the same time. Stopping the NFC interaction with the second device immediately after completing the identity authentication can save the power consumption of the first device.

[0084] In an embodiment of the present application, the card identification of the universal simulation card can be modified in sequence according to the arrangement order of each card identification stored in the card identification sequence, which can ensure that the second device polls all the permission simulation cards stored in the first device in sequence and quickly switches all the permission simulation cards, thereby improving the card switching efficiency and ensuring the accuracy of permission verification using the card simulation function of NFC.

[0085] In some embodiments, when the first device enters the authority simulation card, the card identification corresponding to the authority simulation card may be stored in the card identification sequence. Figure 4 As shown, in one embodiment, before the step of receiving the first instruction sent by the second device in the current round of near field communication NFC interaction with the second device, the method may include the following steps:

[0086] Step 402: Create a hidden universal simulated card, and set the card identifier corresponding to the universal simulated card as a default card identifier.

[0087] The hidden universal simulated card is invisible to the user. The user cannot see the created universal simulated card in the application, which makes it impossible for the user to perceive the card switching process when the card is automatically switched, thereby improving the convenience of swiping the card using NFC technology. When creating a universal simulated card, the user can set the card ID corresponding to the universal simulated card as the default card ID. Optionally, the default card ID can be the card ID corresponding to the permission simulated card entered for the first time, that is, the first card ID in the card ID sequence. The default card ID can also be any pre-set string.

[0088] The first device may record a permission card, which may be a physical permission card. The first device may read card information from the permission card and create a corresponding permission simulation card. In some embodiments, when recording the first permission card, the first device may obtain the card information of the first permission card, obtain the card identification of the first permission card, and store the card identification of the first permission card in the card identification sequence. At the same time, a universal simulation card in a hidden state may be created, and the card identification corresponding to the universal simulation card may be set as the card identification of the first permission card.

[0089] In some embodiments, the first device may also create a hidden universal simulation card when the user activates the NFC card simulation function. At this time, if no permission card is entered into the first device, the card identifier corresponding to the universal simulation card may be set to any pre-set string, and when the first permission card is entered, the card identifier corresponding to the universal simulation card may be modified to the card identifier of the first permission card.

[0090] It should be noted that the embodiment of the present application does not limit the timing of creating a universal simulation card. The first device can also create a pre-used simulation card at other times. For example, when the user first triggers the NFC card simulation function and performs a card swiping operation on the permission simulation card, a universal simulation card can be created, etc. It is not limited to the above-mentioned methods.

[0091] Step 404, when entering a permission card, obtain the card information corresponding to the currently entered permission card, the card information includes the card identifier of the currently entered permission card.

[0092] Step 406: Create a permission simulation card corresponding to the currently entered permission card according to the card information, and store the card identification of the currently entered permission card in the card identification sequence.

[0093] Each time the first device enters a permission card, the card information corresponding to the currently entered permission card can be obtained, and the card information may include but is not limited to the card identification, card type, card function, card issuing unit, etc. of the currently entered permission card. Among them, the card type may include but is not limited to Class A card, Class B card, Class F card, Class V card, etc., and different types of cards may correspond to different working channels. The card function may refer to the purpose of the card, for example, the card function of the access card is to open the door lock with permission, the card function of the attendance card is to register information, and the card function of the transaction card is to transfer numerical resources, etc., but is not limited to this. The card issuing unit may refer to the object that issues the permission card, such as XX community, YY company, MM bank, DD school, etc.

[0094] The first device may create a permission simulation card corresponding to the currently entered permission card according to the acquired card information, and the created permission simulation card may correspond to the entered permission card one by one and be bound to the card identifier of the corresponding permission card. The first device may store the card identifier of the currently entered permission card in the card identifier sequence, so that in the NFC interaction with the second device, the card identifier in the card identifier sequence may be used to modify the card identifier corresponding to the universal simulation card, so that the second device may poll all permission simulation cards created by the first device.

[0095] The first device may also display the created permission simulation card in the interface of the application program, so that the user can intuitively see through the interface that the permission card has been successfully entered. Figure 5 FIG. 1 is a schematic diagram showing a created permission simulation card in one embodiment. Figure 5 As shown, three recorded permission simulation cards can be displayed in the card package interface 510, and different permission simulation cards can be used to perform different permission verification operations. In one embodiment, when the user clicks to enter the card package interface, or when the user clicks to enter the card package interface and triggers any permission simulation card, the first device can activate the hidden universal simulation card, modify the card ID corresponding to the universal simulation card, and send the card IDs of the three recorded permission simulation cards to the second device for identity verification in turn. There is no need for the user to specifically select one of the cards, which simplifies the card selection operation during NFC card simulation and improves convenience.

[0096] In an embodiment of the present application, a universal simulation card in a hidden state can be created, and when a permission card is entered, the card identifier of the entered permission card can be stored in a card identifier sequence. This can facilitate the subsequent modification of the card identifier corresponding to the universal simulation card using the card identifier sequence during permission verification of NFC card simulation, thereby realizing polling of all entered permission simulation cards and improving the efficiency of automatic card switching.

[0097] like Figure 6As shown, in one embodiment, another analog card switching method for near field communication is provided, which can be applied to the first device mentioned above, and the method may include the following steps:

[0098] Step 602: In a current round of near field communication (NFC) interaction with a second device, a first instruction sent by the second device is received.

[0099] Step 604: Obtain the first card identifier currently corresponding to the activated universal simulated card according to the first instruction.

[0100] Step 606: Send the first card identifier to the second device, where the first card identifier is used for identity confirmation in the second device.

[0101] The description of steps 602 to 606 may refer to the relevant description in the above embodiments, which will not be repeated here.

[0102] Step 608: Adjust the field strength detection threshold to the maximum limit value.

[0103] The communication protocol of NFC technology stipulates that the card ID of the simulated card can be changed only after the external field strength disappears. When the first device is in the NFC radio frequency field generated by the second device, the card ID corresponding to the universal simulated card is not allowed to be modified. In the relevant NFC technology, the device detects whether it is in the NFC radio frequency field of the NFC card reader based on the received signal strength. When the signal strength is greater than a certain value, it can be considered to be in the NFC radio frequency field.

[0104] In an embodiment of the present application, after the first device sends the first card identification to the second device, the field strength detection threshold can be adjusted to the maximum limit value. In related technologies, the field strength detection threshold is usually the value set by the device when it leaves the factory and remains fixed. The NFC chip can compare the received field strength signal with the default threshold. If it is greater than the default threshold, the NFC chip can be considered to be in the NFC radio frequency field.

[0105] The NFC chip of the first device can adjust the field strength detection threshold from the default threshold to the maximum limit value, so that the field strength signal received by the NFC chip is always less than the adjusted field strength detection threshold, so that the NFC chip can consider that the first device is not in the NFC radio frequency field. The default threshold may refer to the initial value set by the first device when it leaves the factory.

[0106] Step 610: If the NFC radio frequency field strength generated by the second device is less than the adjusted field strength detection threshold within the first time period, it is determined that the first device is not in the NFC radio frequency field generated by the second device.

[0107] The NFC chip in the first device can record the duration that the received field strength signal is less than the adjusted field strength detection threshold. When the duration reaches the first duration, it can be determined that the first device is not in the NFC radio frequency field generated by the second device, thereby preventing false detection and improving the accuracy of the NFC chip in determining whether to leave the NFC radio frequency field.

[0108] Figure 7 FIG. 1 is a structural block diagram of an NFC chip according to an embodiment. Figure 7 As shown, in one embodiment, the NFC chip 700 may include an MCU (Microcontroller Unit) 710, a comparator 720, a PMU (Power Management Unit) 730, and an analog-to-digital converter (A / D converter) 740. The first device may adjust the field strength detection threshold to the maximum limit value through the MCU 710 in the NFC chip 700, and then compare the NFC radio frequency field strength generated by the second device with the adjusted field strength detection threshold through the comparator 720 in the NFC chip 700. The comparator 720 outputs a valid signal only when the NFC radio frequency field strength generated by the second device is greater than the adjusted field strength detection threshold. If the NFC radio frequency field strength generated by the second device is less than the adjusted field strength detection threshold, the comparator 720 does not output a valid signal.

[0109] Optionally, the field strength detection threshold may include a detection voltage threshold. The external field strength signal received by the NFC antenna in the first device is divided by the first resistor R1 outside the NFC chip 700 and input to a pin of the comparator 720 (i.e. Figure 7 The other input terminal of the comparator 720 can be controlled by the MCU 710 , and the MCU can input a detection voltage threshold (ie, V(DT)) to the comparator 720 .

[0110] When V(RX) is greater than V(DT), the comparator 720 outputs a valid signal to the analog-to-digital converter 740, which can convert the valid signal into a digital signal and send the converted digital signal to the MCU 710 for processing. At this time, the NFC chip can consider that the first device is in the NFC radio frequency field of the second device. When V(RX) is less than V(DT), the comparator 720 does not output a valid signal, and the MCU 710 does not receive the signal transmitted by the analog-to-digital converter 740, and the NFC chip can consider that the first device is not in the NFC radio frequency field of the second device.

[0111] After the NFC chip 700 sends the first card identifier currently corresponding to the universal analog card to the second device, the MCU710 can adjust V(DT) from the default threshold to the maximum limit value (such as 0xFF, etc.), which can be a value that the external field strength signal cannot reach, and the comparator 720 will not output a valid signal. Further, the MCU710 can record the duration of the signal transmitted by the analog-to-digital converter 740 that is not received, that is, the duration of the comparator 720 not outputting a valid signal can be recorded. When the duration reaches the first duration, the NFC chip can assume that the first device is not in the NFC radio frequency field of the second device. The first duration can be set according to actual needs, such as 10ms (milliseconds), 20ms, 23ms, etc., but is not limited to this.

[0112] In some embodiments, since the NFC chip adjusts the field strength detection threshold to the maximum limit value and the received field strength signal is always less than the adjusted field strength detection threshold, the NFC chip may also record the adjustment time when the field strength detection threshold is adjusted to the maximum limit value, and when the time from the current moment to the adjustment moment reaches a first time length, it is determined that the first device is not in the NFC radio frequency field generated by the second device.

[0113] Step 612: When it is determined that the first device is not in the NFC radio frequency field generated by the second device, the card identifier corresponding to the universal analog card is modified to the second card identifier.

[0114] The description of step 612 may refer to the relevant description in the above embodiments, which will not be repeated here.

[0115] Step 614: restore the adjusted field strength detection threshold to the default threshold.

[0116] In one embodiment, Figure 7 As shown, after the first device modifies the card identifier corresponding to the universal analog card, the MCU710 of the NFC chip 700 can restore the output V(DT) from the maximum limit value to the default threshold. Since the first device is closer to the second device, the V(RX) input to the comparator 720 is larger. After restoring V(DT) to the default threshold, the comparator 720 can output a valid signal again, so that the NFC chip 700 can determine that the first device is in the NFC radio frequency field of the second device. By modifying the field strength detection threshold, the first device can enter, leave, and other states during the automatic card cutting process. The user does not need to frequently move the first device close to, away from, and close to the second device, which improves simplicity. In addition, the field strength detection threshold is adjusted by the NFC chip itself, without the need for the processor of the first device, which can increase the adjustment speed and further improve the efficiency of automatic card cutting.

[0117] Step 616: When it is detected that the NFC radio frequency field strength generated by the second device is greater than the default threshold, it is determined that the first device is in the NFC radio frequency field generated by the second device, and the next round of NFC interaction with the second device is entered.

[0118] When the NFC chip of the first device determines that the first device is in the NFC radio frequency field generated by the second device, it can enter the next round of NFC interaction with the second device and continue to execute steps 602 to 616 until the first device is away from the second device. At this time, the field strength signal received by NFC is less than the default threshold, and the card identifier corresponding to the universal simulated card will no longer be sent to the second device. Using the method described in the embodiment of the present application, when the user brings the first device close to the second device, the first device can automatically send the card identifiers of all entered permission simulated cards to the second device in turn, thereby realizing automatic switching of the cards. In addition, during the switching process, there is no need to activate or deactivate the simulated card, which greatly reduces the time of the entire card swiping process and improves the efficiency of card swiping.

[0119] In the embodiment of the present application, by dynamically modifying the card identifier corresponding to the universal simulation card, the first device can send the card identifier corresponding to the different permission simulation card to the second device in each round of NFC interaction with the second device, so as to realize the automatic switching of multiple permission simulation cards and improve convenience. And by dynamically adjusting the field strength detection threshold, the state of the first device entering and leaving the NFC radio frequency field can be simulated to ensure the normal modification of the card identifier corresponding to the universal simulation card. The user does not need to frequently move the first device close to, away from, and close to the second device again. The entire process of automatically switching the simulation card is fast, allowing the user to complete the identity confirmation without feeling, thereby improving the card swiping efficiency of the NFC technology.

[0120] like Figure 8 As shown, in one embodiment, a near field communication simulated card switching device 800 is provided, which can be applied to the first device mentioned above. The near field communication simulated card switching device 800 can include a receiving module 810, an identification acquisition module 820, a sending module 830 and a modifying module 840.

[0121] The receiving module 810 is used to receive a first instruction sent by the second device in a current round of near field communication NFC interaction with the second device.

[0122] The identification acquisition module 820 is used to acquire the first card identification currently corresponding to the activated universal simulated card according to the first instruction.

[0123] The sending module 830 is used to send a first card identifier to the second device, where the first card identifier is used for identity confirmation in the second device.

[0124] The modification module 840 is used to modify the card identifier corresponding to the universal simulated card to a second card identifier, where the second card identifier is used for identity confirmation in the next round of NFC interaction with the second device, wherein the first card identifier and the second card identifier correspond to different permission simulated cards respectively.

[0125] In one embodiment, the NFC simulation card switching device 800 further includes an activation module for activating the universal simulation card when any authority simulation card in the NFC card simulation function is triggered.

[0126] In the embodiment of the present application, by dynamically modifying the card identifier corresponding to the universal simulated card, the first device can send the card identifier corresponding to the simulated card with different permissions to the second device in each round of NFC interaction with the second device, so as to realize the automatic switching of multiple simulated cards with different permissions and improve convenience. Moreover, since the card identifier corresponding to the universal simulated card is used for identity confirmation in each round of NFC interaction, it is not necessary to frequently perform operations such as activating and deactivating the simulated card, which reduces the switching time of the simulated card and improves the switching efficiency.

[0127] In one embodiment, the first card identifier and the second card identifier both belong to a card identifier set, and the card identifier set includes N card identifiers corresponding to N authority simulation cards respectively, where N is an integer greater than or equal to 2.

[0128] The modification module 840 is further used to modify the card identifier corresponding to the universal simulated card into a second card identifier according to the card identifier set.

[0129] In one embodiment, the card identification set is a card identification sequence, and the N card identifications in the card identification sequence are arranged in the order of the entry time of the authority simulation cards corresponding to the respective card identifications.

[0130] In one embodiment, the modification module 840 includes a reading unit and a modification unit.

[0131] The reading unit is used for reading the next card identification arranged after the first card identification from the card identification sequence if the first card identification is not the last card identification in the card identification sequence, and using the next card identification as the second card identification.

[0132] The reading unit is further configured to read the first card identifier from the card identifier sequence if the first card identifier is the last card identifier in the card identifier sequence, and use the first card identifier as the second card identifier.

[0133] The modification unit is used to modify the card identifier corresponding to the universal simulated card to a second card identifier.

[0134] In an embodiment of the present application, the card identification of the universal simulation card can be modified in sequence according to the arrangement order of each card identification stored in the card identification sequence, which can ensure that the second device polls all the permission simulation cards stored in the first device in sequence and quickly switches all the permission simulation cards, thereby improving the card switching efficiency and ensuring the accuracy of permission verification using the card simulation function of NFC.

[0135] In one embodiment, the simulated card switching device 800 for near field communication includes not only a receiving module 810, an identification acquisition module 820, a sending module 830, a modification module 840 and an activation module, but also a creation module, an entry module and a storage module.

[0136] A creation module is used to create a hidden universal simulation card and set the card ID corresponding to the universal simulation card as the default card ID.

[0137] The entry module is used to obtain the card information corresponding to the currently entered permission card when entering the permission card, and the card information includes the card identifier of the currently entered permission card.

[0138] The storage module is used to create a permission simulation card corresponding to the currently entered permission card according to the card information, and store the card identification of the currently entered permission card in the card identification sequence.

[0139] In an embodiment of the present application, a universal simulation card in a hidden state can be created, and when a permission card is entered, the card identifier of the entered permission card can be stored in a card identifier sequence. This can facilitate the subsequent modification of the card identifier corresponding to the universal simulation card using the card identifier sequence during permission verification of NFC card simulation, thereby realizing polling of all entered permission simulation cards and improving the efficiency of automatic card switching.

[0140] In one embodiment, the modification module 840 is further configured to modify the card identifier corresponding to the universal analog card to the second card identifier when it is determined that the first device is not in the NFC radio frequency field generated by the second device.

[0141] In one embodiment, the above-mentioned near-field communication simulation card switching device 800 includes not only a receiving module 810, an identification acquisition module 820, a sending module 830, a modification module 840, an activation module, a creation module, an entry module and a storage module, but also a threshold adjustment module, a departure determination module and a near-field determination module.

[0142] The threshold adjustment module is used to adjust the field intensity detection threshold to a maximum limit value.

[0143] The departure determination module is used to determine that the first device is not in the NFC radio frequency field generated by the second device if the NFC radio frequency field strength generated by the second device is less than the adjusted field strength detection threshold within a first time period.

[0144] In one embodiment, the threshold adjustment module is further used to adjust the field strength detection threshold to a maximum limit value through a microcontroller in the NFC chip.

[0145] The departure determination module is also used to compare the NFC radio frequency field strength generated by the second device with the adjusted field strength detection threshold through a comparator in the NFC chip. If the NFC radio frequency field strength generated by the second device is less than the adjusted field strength detection threshold, the comparator does not output a valid signal. If the comparator does not output a valid signal within a first time period, it is determined that the first device is not in the NFC radio frequency field generated by the second device.

[0146] The threshold adjustment module is also used to restore the adjusted field strength detection threshold to the default threshold.

[0147] The near field determination module is used to determine that the first device is in the NFC radio frequency field generated by the second device and enter the next round of NFC interaction with the second device when it is detected that the NFC radio frequency field strength generated by the second device is greater than a default threshold.

[0148] In the embodiment of the present application, by dynamically modifying the card identifier corresponding to the universal simulation card, the first device can send the card identifier corresponding to the different permission simulation card to the second device in each round of NFC interaction with the second device, so as to realize the automatic switching of multiple permission simulation cards and improve convenience. And by dynamically adjusting the field strength detection threshold, the state of the first device entering and leaving the NFC radio frequency field can be simulated to ensure the normal modification of the card identifier corresponding to the universal simulation card. The user does not need to frequently move the first device close to, away from, and close to the second device again. The entire process of automatically switching the simulation card is fast, allowing the user to complete the identity confirmation without feeling, thereby improving the card swiping efficiency of the NFC technology.

[0149] Fig. 9 FIG. 1 is a block diagram of an electronic device in another embodiment. The electronic device may be a mobile phone, a tablet computer, a smart wearable device, etc. Fig. 9 As shown, the electronic device 900 may include one or more of the following components: a processor 910, a memory 920 coupled to the processor 910, and an NFC module 930 coupled to the processor. The NFC module 930 may include the above-mentioned NFC chip and NFC antenna, etc. The memory 920 may store one or more computer programs, and the one or more computer programs may be configured to be executed by one or more processors 910 to implement the methods described in the above embodiments.

[0150] The processor 910 may include one or more processing cores. The processor 910 uses various interfaces and lines to connect various parts of the entire electronic device 900, and executes various functions and processes data of the electronic device 900 by running or executing instructions, programs, code sets or instruction sets stored in the memory 920, and calling data stored in the memory 920. Optionally, the processor 910 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 910 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 910, but may be implemented separately through a communication chip.

[0151] The memory 920 may include a random access memory (RAM) or a read-only memory (ROM). The memory 920 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 920 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The data storage area may also store data created by the electronic device 900 during use, etc.

[0152] It can be understood that the electronic device 900 may include more or fewer structural elements than those in the above structural block diagram, for example, including a power supply, input buttons, speakers, a screen, an RF (Radio Frequency) circuit, a Wi-Fi (Wireless Fidelity) module, a Bluetooth module, a sensor, etc., and no limitation is made here.

[0153] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program implements the methods described in the above embodiments when executed by a processor.

[0154] An embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program can be executed by a processor to implement the methods described in the above embodiments.

[0155] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM), etc.

[0156] As used herein, any reference to memory, storage, database, or other medium may include nonvolatile and / or volatile memory. Suitable nonvolatile memory may include ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), or Flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), memory bus direct RAM (RDRAM), and direct memory bus dynamic RAM (DRDRAM).

[0157] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present application.

[0158] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0159] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0160] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several requests for a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform some or all of the steps of the above-mentioned methods of various embodiments of the present application.

[0161] The above is a detailed introduction to a near field communication analog card switching method, device, electronic device and storage medium disclosed in the embodiment of the present application. The principle and implementation method of the present application are described in detail using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for those of ordinary skill in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A near field communication analog card switching method, characterized in that: Applied to a first device, the method includes: In a current round of near field communication (NFC) interaction with a second device, receiving a first instruction sent by the second device; Acquire, according to the first instruction, a first card identifier currently corresponding to the activated universal simulated card; Sending the first card identifier to the second device, where the first card identifier is used for identity confirmation in the second device; Adjust the field strength detection threshold from the default threshold to the maximum limit; When it is detected that the NFC radio frequency field strength generated by the second device is less than the adjusted field strength detection threshold, it is determined that the first device is not in the NFC radio frequency field generated by the second device, and the card identifier corresponding to the universal simulation card is modified to the second card identifier, and the second card identifier is used for identity confirmation in the next round of NFC interaction with the second device, wherein the first card identifier and the second card identifier respectively correspond to different permission simulation cards; in the case where the first device and the second device perform multiple rounds of NFC interaction, the card identifier corresponding to the universal simulation card changes in each round of NFC interaction.

2. The method according to claim 1, characterized in that The first card identifier and the second card identifier both belong to a card identifier set, and the card identifier set includes N card identifiers corresponding to N authority simulation cards, respectively, where N is an integer greater than or equal to 2; The step of modifying the card identifier corresponding to the universal simulated card to a second card identifier includes: The card identifier corresponding to the universal simulated card is modified to a second card identifier according to the card identifier set.

3. The method according to claim 2, characterized in that The card identification set is a card identification sequence, and the N card identifications in the card identification sequence are arranged in the order of the entry time of the authority simulation cards corresponding to the respective card identifications.

4. The method according to claim 3, characterized in that Before receiving the first instruction sent by the second device in the current round of near field communication NFC interaction with the second device, the method further includes: Creating a hidden universal simulated card, and setting the card identifier corresponding to the universal simulated card as a default card identifier; When entering a permission card, obtaining card information corresponding to the currently entered permission card, wherein the card information includes a card identifier of the currently entered permission card; A permission simulation card corresponding to the currently entered permission card is created according to the card information, and the card identification of the currently entered permission card is stored in a card identification sequence.

5. The method according to claim 3, characterized in that: The step of modifying the card identifier corresponding to the universal simulated card to a second card identifier according to the card identifier set includes: If the first card identifier is not the last card identifier in the card identifier sequence, then reading the next card identifier arranged after the first card identifier from the card identifier sequence, and using the next card identifier as the second card identifier; If the first card identifier is the last card identifier in the card identifier sequence, reading the first card identifier from the card identifier sequence and using the first card identifier as the second card identifier; The card identifier corresponding to the universal simulated card is changed to the second card identifier.

6. The method according to claim 1, characterized in that The step of determining that the first device is not in the NFC radio frequency field generated by the second device when it is detected that the NFC radio frequency field strength generated by the second device is less than the adjusted field strength detection threshold comprises: If, within the first time period, the NFC radio frequency field strength generated by the second device is less than the adjusted field strength detection threshold, it is determined that the first device is not in the NFC radio frequency field generated by the second device.

7. The method according to claim 6, characterized in that The step of adjusting the field intensity detection threshold to a maximum limit value comprises: The field strength detection threshold is adjusted to the maximum limit value by the microcontroller in the NFC chip; If the NFC radio frequency field strength generated by the second device is less than the adjusted field strength detection threshold within the first time period, determining that the first device is not in the NFC radio frequency field generated by the second device includes: The comparator in the NFC chip compares the NFC radio frequency field strength generated by the second device with the adjusted field strength detection threshold, and if the NFC radio frequency field strength generated by the second device is less than the adjusted field strength detection threshold, the comparator does not output a valid signal; If the comparator does not output a valid signal within the first time period, it is determined that the first device is not in the NFC radio frequency field generated by the second device.

8. The method according to claim 1, characterized in that After the card identifier corresponding to the universal simulated card is modified to the second card identifier, the method further includes: Restoring the adjusted field strength detection threshold to a default threshold; When it is detected that the NFC radio frequency field strength generated by the second device is greater than the default threshold, it is determined that the first device is in the NFC radio frequency field generated by the second device, and enters the next round of NFC interaction with the second device.

9. The method according to any one of claims 1 to 4, characterized in that: Before receiving the first instruction sent by the second device in the current round of near field communication NFC interaction with the second device, the method further includes: When any permission simulation card in the NFC card simulation function is triggered, the universal simulation card is activated.

10. A near field communication analog card switching device, characterized in that: Applied to a first device, the apparatus comprises: A receiving module, configured to receive a first instruction sent by a second device in a current round of near field communication (NFC) interaction with the second device; An identification acquisition module, used for acquiring a first card identification currently corresponding to the activated universal simulated card according to the first instruction; a sending module, configured to send the first card identifier to the second device, wherein the first card identifier is used for identity confirmation in the second device; A threshold adjustment module, used to adjust the field strength detection threshold from a default threshold to a maximum limit value; a departure determination module, configured to determine that the first device is not in the NFC radio frequency field generated by the second device when it is detected that the NFC radio frequency field strength generated by the second device is less than the adjusted field strength detection threshold; A modification module is used to modify the card identifier corresponding to the universal simulated card to a second card identifier, wherein the second card identifier is used for identity confirmation in the next round of NFC interaction with the second device, wherein the first card identifier and the second card identifier respectively correspond to different permission simulation cards; when the first device and the second device perform multiple rounds of NFC interaction, the card identifier corresponding to the universal simulated card changes in each round of NFC interaction.

11. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method according to any one of claims 1 to 9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • DEVICE CONTROL METHOD, DEVICE AND equipment

    CN109257071A

  • Near field communication (NFC) method, device and electronic equipment

    CN111581994A