Sim card switching method and device, terminal and storage medium

CN122802895APending Publication Date: 2026-09-22GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510350295.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-21
Publication Date
2026-09-22

AI Technical Summary

Benefits of technology

[0016]本申请实施例中,在终端设置有至少两张模拟卡的情况下,终端在确认基于第一模拟卡刷卡失败时,自动切换使用第二模拟卡尝试刷卡,无需用户手动切换模拟卡,或提前为模拟卡设置电子围栏,简化了多张模拟卡的使用流程,提高了模拟卡刷卡效率以及成功率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122802895A_ABST
    Figure CN122802895A_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a kind of analog card switching method, device, terminal and storage medium, belong to near field communication technical field.The method comprises: in the case where entering the radio frequency field of card reader, based on first analog card and the instruction interaction of card reader;In the case where based on the first analog card card swiping fails, the first analog card is switched to second analog card, and the second analog card is different from the first analog card;Based on the instruction interaction of second analog card and card reader.The embodiment of the application simplifies the use flow of multiple analog doors, improves the efficiency and success rate of analog card swiping.
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 in particular to an analog card switching method, device, terminal and storage medium. Background Technology

[0002] In recent years, smart terminals have diversified in terms of functionality. For example, smartphones, smartwatches and other devices have NFC (Near Field Communication) analog card function, which means that after registering multiple analog cards, you can complete the card swiping operation simply by bringing them close to the card reader. Summary of the Invention

[0003] This application provides a method, apparatus, terminal, and storage medium for switching analog cards. The technical solution is as follows:

[0004] On one hand, embodiments of this application provide a method for switching between simulated cards, the method comprising:

[0005] When the card enters the radio frequency field of the card reader, the card reader interacts with the card reader based on the first analog card;

[0006] If the first simulated card fails to swipe, the first simulated card will be switched to a second simulated card, which is different from the first simulated card.

[0007] The second simulated card interacts with the card reader using commands.

[0008] On the other hand, embodiments of this application provide a simulated card switching device, the device comprising:

[0009] The instruction interaction module is used to perform instruction interaction with the card reader based on the first analog card when the card enters the radio frequency field of the card reader;

[0010] The switching module is used to switch the first simulated card to a second simulated card when the first simulated card fails to be swiped, the second simulated card being different from the first simulated card;

[0011] The instruction interaction module is used to perform instruction interaction between the second simulated card and the card reader.

[0012] On the other hand, embodiments of this application provide a chip that includes programmable logic circuits and / or program instructions. When the chip is running, it is used to implement the analog card switching method described above.

[0013] On the other hand, embodiments of this application provide a terminal, the terminal including a processor, a memory and an NFC component, wherein the memory stores at least one piece of program code, the at least one piece of program code being loaded and executed by the processor to implement the analog card switching method as described above, or the NFC component is used to implement the analog card switching method as described above.

[0014] On the other hand, embodiments of this application provide a computer-readable storage medium storing at least one piece of program code, which is executed by a processor to implement the emulation card switching method as described above.

[0015] On the other hand, embodiments of this application provide a computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to implement the emulation card switching method provided above.

[0016] In this embodiment, when the terminal has at least two emulated cards, the terminal automatically switches to the second emulated card to attempt to swipe when it confirms that swiping the first emulated card has failed. This eliminates the need for the user to manually switch emulated cards or set up electronic fences for the emulated cards in advance, simplifying the process of using multiple emulated cards and improving the efficiency and success rate of emulated card swiping. Attached Figure Description

[0017] Figure 1 A schematic diagram illustrating an implementation environment as shown in an exemplary embodiment of this application is provided.

[0018] Figure 2 A flowchart illustrating an exemplary embodiment of the present application for a method of switching analog cards is shown.

[0019] Figure 3 A flowchart of a simulation card switching method provided in another exemplary embodiment of this application is shown;

[0020] Figure 4 This is a schematic diagram illustrating the interaction between the terminal and the card reader in a scenario where UID verification fails, as shown in an exemplary embodiment of this application.

[0021] Figure 5 This is an exemplary embodiment of the present application illustrating the simulated card switching process in a scenario where UID verification fails;

[0022] Figure 6 This is a schematic diagram illustrating the interaction between the terminal and the card reader in an encrypted authentication failure scenario, as shown in an exemplary embodiment of this application.

[0023] Figure 7 This is an exemplary embodiment of the present application illustrating the simulated card switching process in a scenario of failed encryption authentication;

[0024] Figure 8 This is a schematic diagram illustrating an exemplary embodiment of the composite card switching process of this application;

[0025] Figure 9 This invention provides a structural block diagram of an analog card switching device according to an exemplary embodiment of the present application.

[0026] Figure 10 A structural block diagram of a terminal provided in an exemplary embodiment of this application is shown. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0028] In this article, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0029] Please refer to Figure 1 The diagram illustrates an implementation environment as shown in an exemplary embodiment of this application. This implementation environment includes a terminal 110 and a card reader 120.

[0030] Terminal 110 is an electronic device with NFC functionality, which can be a smartphone, tablet, smart wearable device, or personal computer, etc. The NFC functionality includes NFC enrollment and NFC card swiping. The NFC enrollment function is used to enroll the card information of a physical NFC card into the terminal and generate a simulated card corresponding to the physical NFC card. The NFC card swiping function is used to interact with a card reader based on the card information of the simulated card to achieve specific card swiping functions, such as opening doors, deducting payments, unlocking vehicles, etc.

[0031] The card reader 120 is a device used to read relevant data from an NFC physical card or an analog card. In some possible application scenarios, the card reader 120 can be an access control card reader installed at an access control point to control the opening and closing of the access control; the card reader 120 can be a transportation card reader installed on a vehicle or transportation station to realize transportation payment; the card reader 120 can also be a vehicle key card reader integrated into a vehicle to realize vehicle unlocking function. This application embodiment does not limit the specific type of the card reader 120.

[0032] In some embodiments, terminal 110 supports single-card activation and multi-card activation modes.

[0033] In single-card activation mode, terminal 110 interacts with card reader 120 based on the contactless parameters of a single analog card. Terminal 110 can switch between different analog cards based on electronic fences or manual user operation.

[0034] In multi-card activation mode, when multiple analog cards meet the composite conditions, terminal 110 can create composite cards corresponding to multiple analog cards and set the contactless parameters of the composite card based on the contactless parameters of each analog card. Subsequently, when interacting with card reader 120, terminal 110 can perform initialization, anti-collision, and protocol transmission interactions with card reader 120 based on the contactless parameters of the composite card, enabling simultaneous activation of multiple analog cards. Then, based on the instructions sent by card reader 120, terminal 110 selects the analog card matching card reader 120 from among the multiple analog cards for interaction, eliminating the need for manual switching of analog cards by the user. It should be noted that in multi-card activation mode, only a single analog access control card can be included among the multiple analog cards corresponding to the same composite card.

[0035] The following embodiments use the analog card switching method for terminal 110 as an example for illustration.

[0036] Please refer to Figure 2 The diagram illustrates a flowchart of an exemplary embodiment of a simulation card switching method provided in this application. The method includes the following steps:

[0037] Step 201: When entering the radio frequency field of the card reader, the card reader performs command interaction based on the first analog card.

[0038] In some embodiments, when the terminal enters the radio frequency field of the card reader, the card reader sends a card reading command to the terminal to obtain relevant information about the analog card in the terminal. Accordingly, the terminal interacts with the card reader based on the first analog card.

[0039] In some embodiments, the card reading command may include a card search command, an anti-collision command, etc. The card search command is used to detect whether a simulated card exists in the reader's radio frequency field, and the anti-collision command is used to obtain the simulated card's UID (Unique Identifier).

[0040] A simulated card is a virtual card used to simulate a physical card. In one possible implementation, the terminal can copy information from the physical card to the simulated card, giving the simulated card the same functionality as the physical card. For example, the terminal can copy the internal data of a physical access control card by bringing it close to the card.

[0041] In another possible implementation, the terminal can obtain a simulated card by configuring a card, for example, by adding a simulated bank card by entering information such as a bank card number and password.

[0042] Different analog cards have their own contactless parameters. Contactless parameters (also known as non-contact parameters) are used to enable wireless communication between contactless IC (Integrated Circuit) cards and card readers. Accordingly, the terminal can interact with the card reader by giving instructions based on the first contactless parameters of the first analog card.

[0043] It's understandable that switching between analog cards involves switching between cards with different contactless parameters.

[0044] In some embodiments, contactless parameters may include UID parameters, ATS (Answer to Select) parameters, SAK (Select AcKnowledge) parameters, ATQA (Answer To Request Type A) parameters, etc.

[0045] ATQA is used to respond to the card reader's card search command, indicating the presence of an analog card in the radio frequency field that can respond to the reader's command. UID is the unique identifier for access control type cards. The SAK parameter, included in the SAK response, is used to respond to the card selection command sent by the card reader. The card reader verifies the communication protocol supported by the analog card by checking specific bytes in the SAK response. The ATS parameter, included in the ATS response, is used to respond to the RATS (Request ATS) command sent by the card reader.

[0046] Optionally, the first analog card is a single analog card, or the first analog card is a first composite card, which is obtained by combining at least two single analog cards. Accordingly, the first contactless parameter corresponding to the first analog card can be the contactless parameter of a single analog card, or the contactless parameter of a composite card obtained by combining multiple single analog cards.

[0047] Because the contactless parameters of different individual analog cards are different, at least two individual analog cards corresponding to the composite card need to meet composite conditions in order to perform contactless parameter fusion later. Composite conditions can include type composite conditions and parameter composite conditions.

[0048] In some embodiments, a single analog card is an analog access control card, and / or, a composite card includes one analog access control card.

[0049] In some embodiments, where both the first and second analog cards are composite cards, at least the analog access control cards that are composited in the first and second analog cards are different.

[0050] In some embodiments, the terminal categorizes a single analog card into access control type and non-access control type. Access control analog cards require UID verification and / or encryption authentication (such as MIFARE authentication).

[0051] Because different simulated access control cards have different UIDs, and each simulated access control card has only one corresponding UID, during the contactless parameter fusion process, the terminal cannot obtain a UID that can represent two or more simulated access control cards through fusion. Therefore, simulated access control cards cannot be fused with each other, meaning that the composite card can contain at most one simulated access control card.

[0052] Because non-access control type and access control type emulation cards use different authentication methods—for example, access control type is authenticated by UID, while non-access control type is not—one access control emulation card can be merged with one or more non-access control emulation cards.

[0053] Similarly, multiple non-access control type analog cards can be merged together.

[0054] Even if at least two analog cards meet the type composite condition, not all contactless parameters of the same type can be merged. Therefore, even if the type composite condition is met, it may still be impossible to create a composite card. For example, if two non-access cards have private ATS parameters, the terminal cannot obtain the target ATS parameter by merging the ATS parameters. Therefore, non-access cards with private ATS parameters cannot be composited.

[0055] To merge the contactless parameters of at least two individual analog cards to obtain the contactless parameters of the composite card, in addition to the at least two individual analog cards meeting the type composite condition, the at least two individual analog cards also need to meet the parameter composite condition. The parameter composite condition can include contactless parameters of the same type having the same format.

[0056] For example, because the contactless parameter formats of the same type may not be consistent—for instance, a simulated access card might have a 7-byte UID while a public transport card has a 4-byte UID—although the simulated access card and the public transport card meet the type compatibility condition, they cannot be combined due to the inconsistent UID lengths. When both the simulated access card and the public transport card have 4-byte UIDs, they meet both the type compatibility and parameter compatibility conditions and can be combined.

[0057] After the contactless parameters of the composite card are obtained through fusion, multiple individual analog cards are simultaneously active. The composite card can exchange commands with the card reader for any of the individual analog cards involved in the fusion. For example, when the composite card integrates analog access cards, bus cards, and car keys, it can exchange commands with bus card readers, access card readers, and car key readers.

[0058] During the instruction exchange between the card reader and the terminal, the terminal responds to the instructions sent by the card reader by sending a response containing the first contactless parameter. For example, after receiving a card search instruction from the card reader, the terminal sends an ATQA response containing the ATQA parameter to the card reader.

[0059] Step 202: If the first simulated card fails to swipe, switch the first simulated card to the second simulated card, which is different from the first simulated card.

[0060] In this embodiment, the terminal is equipped with at least two different analog cards. Since different analog cards cannot be activated simultaneously (for example, if the terminal has at least two different composite cards, and each composite card contains different access control analog cards, they cannot be activated simultaneously), the terminal switches the analog card to the second analog card if the first analog card fails to swipe. This card-switching operation is performed automatically by the terminal and does not require manual operation by the user.

[0061] In some embodiments, the first analog card and the second analog card are analog cards of different types or the same type. For example, the first analog card is an analog access control card, and the second analog card is a non-analog access control card, such as a public transport card; or, both the first analog card and the second analog card are analog access control cards.

[0062] Understandably, this application also applies to situations where card switching is triggered when a card reader and card type do not match. For example, a card reader failing to read an access card caused by a public transport card reader.

[0063] In some embodiments, failure to swipe the first simulated card does not refer to a single failure to swipe the first simulated card, but rather to multiple failures to swipe the card. The following embodiments will describe this in detail.

[0064] Optionally, the second analog card can be a single analog card, or it can be a second composite card, which is obtained by combining at least two single analog cards. Correspondingly, the second contactless parameter of the second analog card can be the contactless parameter of a single analog card, or the contactless parameter of a composite card obtained by combining multiple single analog cards.

[0065] Furthermore, when both the first and second analog cards are composite cards, the first and second analog cards are obtained by combining different single analog cards.

[0066] In some embodiments, the first analog card and the second analog card are different composite cards generated in advance.

[0067] In some embodiments, the second analog card is a composite card newly generated after the first analog card is deemed to have failed to read; for example, the second analog card is a composite card newly generated after replacing the analog access card in the first analog card.

[0068] It should be noted that when both the first and second analog cards are composite cards, switching analog cards can be done by switching to a pre-prepared composite card, or by replacing one or more single analog cards in the current composite card to obtain a new composite card.

[0069] Step 203: Perform command interaction with the card reader based on the second simulated card.

[0070] Furthermore, the terminal interacts with the card reader using the second contactless parameters corresponding to the second simulated card. The process of interacting with the card reader using the second contactless parameters is similar to that using the first contactless parameters, and will not be described in detail here.

[0071] In summary, in this embodiment of the application, when the terminal is equipped with at least two simulated cards, the terminal automatically switches to the second simulated card to attempt to swipe when it confirms that swiping the first simulated card has failed. This eliminates the need for the user to manually switch simulated cards or set up electronic fences for the simulated cards in advance, simplifying the process of using multiple simulated cards and improving the efficiency and success rate of swiping simulated cards.

[0072] In some embodiments, during the interaction between the terminal and the card reader, the card reader does not send a clear instruction to the terminal indicating whether the card swipe was successful or failed. Instead, the terminal infers whether the card swipe was successful or failed.

[0073] In some embodiments, the card reader does not send a card reading failure message to the first emulated card.

[0074] For example, when the simulated card is an unencrypted card, the card reader will not send a clear instruction to the terminal indicating whether the card swipe was successful or failed.

[0075] For example, in some cases, the terminal may not receive or the card reader may not return authentication failure or success information. This could be due to signal interference.

[0076] In some embodiments, during the instruction interaction between the first simulated card and the card reader, the terminal determines the card swiping status of the first simulated card. This swiping status indicates whether the first simulated card was swiped successfully or failed.

[0077] If the determined card swipe situation indicates that the first simulated card failed to swipe, the terminal will switch the first simulated card to the second simulated card.

[0078] Since card swiping failures can be caused by factors other than incorrect contactless parameters or authentication failures, such as communication environment issues, the terminal does not trigger card switching immediately upon a single card swipe failure of the first simulated card in order to improve the accuracy of the card switching timing. Instead, it determines the card swiping status of the first simulated card within a preset time period and then decides whether card switching is necessary based on the card swiping status.

[0079] In one possible implementation, the terminal determines the swiping status of the first simulated card based on the instruction interaction with the card reader within a preset time period.

[0080] In one possible design, the preset duration is longer than the duration of a single complete command interaction between the emulated card and the card reader. That is, within the preset duration, the terminal can perform multiple rounds of command interaction between the emulated card and the card reader.

[0081] The shorter the preset duration, the lower the emulation card switching latency; the longer the preset duration, the higher the emulation card switching latency.

[0082] In an illustrative example, the preset duration is 300ms, meaning the terminal determines the swiping status of the first simulated card based on the instruction interactions with the card reader within 300ms. This application does not limit the specific length of the preset duration.

[0083] In some embodiments, the preset duration may start from the moment of entering the radio frequency field of the card reader, or from a certain stage in the process of command interaction with the card reader.

[0084] Optionally, for different emulated cards, the terminal can identify the card swiping status based on a unified preset duration; or, for different emulated cards, the terminal can identify the card swiping status based on different preset durations.

[0085] In some embodiments, the preset duration may include a first preset duration and a second preset duration, wherein the first preset duration and the second preset duration may be the same or different.

[0086] In some embodiments, different types of cards correspond to different preset durations. For example, an unencrypted card corresponds to a first preset duration, and an encrypted card corresponds to a second preset duration. As another example, the first preset duration for an unencrypted card is shorter than the second preset duration for an encrypted card.

[0087] In one possible implementation, the terminal can set a preset duration for the emulated card based on whether it is an encrypted card. For example, if the emulated card is unencrypted, the preset duration is 200ms; if the emulated card is encrypted, the preset duration is 300ms (since encrypted cards require key authentication, the overall command interaction process is longer).

[0088] Of course, the terminal can also set a preset duration for the emulation card based on other attributes of the emulation card (such as the encryption method used by the emulation card, the number of single emulation cards in the emulation card, etc.), and this embodiment does not limit this.

[0089] In one possible implementation, the preset duration is the timer duration. Accordingly, if the terminal determines that the first simulated card swipe has failed within the timer duration, the terminal will switch the first simulated card to the second simulated card.

[0090] Optionally, the timer may be started upon entering the radio frequency field of the card reader, or during instruction interaction with the card reader (e.g., during the anti-collision and selection phase). In some embodiments, the timer may be started when the terminal enters the radio frequency field generated by the card reader, acquires energy through electromagnetic induction, and initializes into an idle state; or, the timer may be started when the terminal begins anti-collision and selection with the card reader. This application does not limit the specific timing of timer activation.

[0091] Since the terminal may have more than one emulated card, even if the second emulated card is used for command interaction, the card swipe may still fail. To ensure that subsequent emulated card switching can still be performed, in one possible implementation, the terminal starts a timer when command interaction is performed based on the i-th emulated card. If, within the timer's duration, it is determined that the card swipe based on the i-th emulated card has failed, the terminal switches the i-th emulated card to the (i+1)-th emulated card.

[0092] In one illustrative embodiment, the analog card switching process is as follows: Figure 3 As shown.

[0093] Step 301: When entering the radio frequency field of the card reader, start the timer and perform command interaction with the card reader based on the first analog card.

[0094] Step 302: If, within the timer's duration, the first simulated card fails to swipe, the first simulated card is switched to the second simulated card, and the timer is restarted.

[0095] Step 303: The analog card interacts with the card reader using commands.

[0096] Step 304: If the second simulated card fails to swipe within the timer's duration, switch the second simulated card to a third simulated card. The third simulated card is different from the second and first simulated cards.

[0097] Step 305: Conduct instruction interaction between the third analog card and the card reader.

[0098] Card switching logic under different card swipe failure scenarios

[0099] The communication process between the Proximity Integrated Circuit Card (PICC) and the Proximity Coupling Device (PCD) can be divided into the following stages:

[0100] 1. Radio Frequency Field Activation

[0101] The PCD generates a 13.56MHz radio frequency field. After the PICC enters the radio frequency field, it obtains energy through electromagnetic induction and begins initialization. Once the PICC is ready, it enters the IDLE state and waits for the PCD's request.

[0102] 2. Request and Wake-up (REQA / WUPA)

[0103] The PCD sends a REQA (Request Command Type A) or WUPA (Wake-Up Command Type A) command to request communication with the PICC. REQA is used to request cards in the IDLE state, and WUPA is used to wake up cards in the HALT state.

[0104] After receiving the command, PICC replies with an ATQA (Answer to Request Type A), which includes basic card information (such as UID length, protocol support, etc.). If PCD does not receive an ATQA, it can be determined that a timeout has occurred or the card is not responding.

[0105] 3. Conflict Prevention and UID Acquisition (ANTICOLLISION)

[0106] If multiple cards exist in the RF field, PCD needs to resolve conflicts to select one card.

[0107] The PCD sends an ANTICOLLISION command, and the PICC replies with part of its UID (usually the first 4 bytes). The PCD verifies the correctness of the UID using BCC (Block Check Character). If multiple cards reply, the PCD uses an anti-collision algorithm (such as bitframe anti-collision) to select one card. The PCD sends a SELECT command, containing the complete UID, to confirm the selection of that card.

[0108] 4. Select Card

[0109] The PCD sends a SELECT command, including the complete UID. The PICC replies with a SAK (Select Acknowledge) to confirm the successful selection and indicate the protocol supported by the card (such as ISO / IEC 14443-4). If the SAK indicates support for ISO / IEC 14443-4, the PCD and PICC will enter higher-level protocol communication.

[0110] 5. Authentication and key exchange (optional, depending on the application)

[0111] In some applications (such as access control systems or payment systems), PCD and PICC may need to perform authentication and key exchange. Common authentication protocols include: MIFARE Classic (e.g., using the CRYPTO1 encryption algorithm) and ISO / IEC 14443-4 (which supports more advanced encryption protocols such as AES).

[0112] Once certified, PCD and PICC can securely transmit data.

[0113] 6. Data Exchange

[0114] PCD and PICC transmit data according to the protocol. Data is transmitted in blocks or frames.

[0115] PCD and PICC use the ACK / NACK mechanism to confirm the correct reception of data.

[0116] If data verification fails, PCD or PICC will request a retransmission.

[0117] 7. RF Field Deactivation

[0118] After communication is complete, the PCD can send an HLTA (Halt Command) to put the PICC into HALT state. In HALT state, the PICC no longer responds to REQA, but can respond to WUPA. The PCD then shuts down the RF field, releasing the PICC.

[0119] Based on whether encryption authentication is required, emulated cards can be divided into unencrypted emulated cards and encrypted emulated cards. When using an unencrypted emulated card, the card reader verifies whether the card's UID is on the allowed list. When using an encrypted emulated card, the card reader verifies whether the unencrypted emulated card's UID is on the allowed list, and if so, performs authentication and key exchange with the unencrypted emulated card; alternatively, the card reader may only perform authentication and key exchange with the unencrypted emulated card.

[0120] It is evident that when the terminal fails to swipe the first simulated card, it may be due to either a failed UID verification (stage 3) or a failed encryption authentication (stage 5). Accordingly, the terminal's determination of the first simulated card swiping status based on the instruction interactions with the card reader within a preset time period may include:

[0121] Case 1: Obtain the number of UID reads within the first preset time period; if the number of UID reads reaches the threshold, determine that the card swiping of the first simulated card has failed.

[0122] In one possible scenario, for the first emulated card that is not encrypted, after the card reader obtains the UID of the first emulated card, it will verify the UID by checking whether the UID belongs to the allowed list. If the first emulated card is not compatible with the current card reader, a UID matching the current UID cannot be found in the allowed list. Consequently, the UID fails verification and cannot proceed to the subsequent card selection stage, instead, the process of obtaining the UID is repeated continuously.

[0123] Therefore, in one possible implementation, the terminal can count the number of UID reads during the instruction interaction between the first emulated card and the card reader. Optionally, the terminal can count the number of UID reads based on the ANTICOLLISION instruction.

[0124] The terminal acquires the number of UID reads within a first preset time period, and if the number of UID reads reaches a threshold, it determines that the card swiping of the first simulated card has failed. For illustration, this threshold can be 5 times.

[0125] Optionally, the terminal can first detect whether the number of UID reads has reached a threshold within a preset time period, and immediately determine that the first simulated card swipe has failed when the number of UID reads reaches the threshold, and switch to a simulated card. For example, if the number of UID reads reaches 5 times in 100ms, the terminal will determine that the first simulated card swipe has failed in 100ms and switch to a simulated card. Alternatively, the terminal can detect whether the number of UID reads has reached the threshold after the first preset time period, and determine that the first simulated card swipe has failed when the number of UID reads reaches the threshold, and switch to a simulated card.

[0126] Indicative, such as Figure 4 As shown, the access control card reader obtains the UID via the ISO14443-3 protocol. Since the obtained UID is not in the allowed list, the access control card reader continuously loops to obtain the UID without entering the card selection stage. When the timer expires and the UID has been read 5 times, the NFC firmware determines that the simulated card swipe has failed, and thus notifies the eSE component to switch to a simulated card.

[0127] Regarding the card switching method in this situation, in one possible implementation, when the number of UID reads reaches a threshold, the terminal switches the first emulated card to any second emulated card.

[0128] Indicative, such as Figure 5 As shown, terminal 501 has three simulated access control cards A, B, and C, with UID1, UID2, and UID3 respectively. When entering the radio frequency field of access control card reader 502, terminal 501 first interacts with access control card reader 502 using the UID1 of simulated access control card A. After access control card reader 502 obtains the complete UID1 of simulated access control card A, UID verification fails because UID1 is not in access control card reader 502's allowed list. When the timer expires and the UID reading count reaches 5 times, the terminal switches the card and interacts with access control card reader 502 using the UID2 of simulated access control card B. After access control card reader 502 obtains the complete UID2 of simulated access control card B, UID verification passes because UID2 is in access control card reader 502's allowed list, and the card is swiped successfully.

[0129] In another possible implementation, since the card reader used with the unencrypted emulated card usually verifies the UID of the unencrypted emulated card, while the card reader used with the encrypted emulated card usually performs encryption authentication rather than UID verification, in order to increase the probability of switching to the emulated card adapted to the current card reader and thus improve the card swiping efficiency (each card swipe failure requires a timer duration before card switching, so the more card switchings, the lower the card swiping efficiency, and vice versa), when the number of UID reads reaches the threshold, the terminal switches the first emulated card to the unencrypted second emulated card.

[0130] In some embodiments, when setting up the emulated cards, the terminal obtains whether each emulated card is an encrypted emulated card. When a card swipe fails due to excessive UID read attempts, the terminal prioritizes selecting the unencrypted emulated cards to switch to.

[0131] To illustrate, the terminal is equipped with simulated access cards A, B, and C. Simulated access cards A and C are unencrypted, while simulated access card B is encrypted. When a card swipe based on the first contactless parameter corresponding to simulated access card A fails, and the reason for the failure is that the UID is not verified, the terminal automatically switches simulated access card A to simulated access card C, and then performs a card swipe based on the second contactless parameter corresponding to simulated access card C.

[0132] It should be noted that if an unencrypted emulation card is unavailable, the terminal can switch to using an encrypted second emulation card.

[0133] Scenario 2: If an encryption authentication failure instruction is received, the card swiping status of the first simulated card is determined to be a card swiping failure.

[0134] In one possible scenario, the current card reader is used in conjunction with an encrypted card, meaning the card reader needs to perform encrypted authentication with the encrypted card. If the first emulated card is not compatible with the current card reader—for example, if the first emulated card is a non-encrypted emulated card, or if the first emulated card is an encrypted emulated card compatible with other encrypted card readers—the card reader will report an encryption card authentication failure.

[0135] Therefore, in one possible implementation, upon receiving an encryption authentication failure instruction, the terminal determines that the swipe of the first simulated card has failed. This encryption authentication failure instruction is sent by the card reader when the encrypted card fails authentication.

[0136] In some embodiments, as soon as the terminal receives the encryption authentication failure instruction, it determines that the card swiping of the first simulated card has failed, and then switches to the simulated card without waiting for a preset time, such as the second preset time.

[0137] In some embodiments, when applied to automatic switching of access control analog cards, since encrypted access control cards typically use the MIFARE protocol for authentication, the terminal executes card switching logic if the card swipe failure is due to MIFARE protocol authentication failure. If the card swipe failure is due to non-MIFARE protocol (such as ISO / IEC 14443-4) authentication failure (possibly a non-access control card reader), the terminal does not execute card switching logic.

[0138] Indicative, such as Figure 6 As shown, the access control card reader obtains the UID via the ISO14443-3 protocol and further selects the UID for MIFARE protocol authentication. When an encryption authentication failure command is received, the NFC firmware determines that the encryption card authentication has failed and notifies the eSE component to switch to an emulated card.

[0139] Regarding the card switching method in this situation, in one possible implementation, upon receiving an encryption authentication failure instruction, the terminal switches the first emulated card to an encrypted second emulated card.

[0140] When a card swipe fails due to encrypted access card authentication failure, it indicates that the current card reader is an encrypted card reader. Therefore, to avoid switching to an unencrypted emulated card and subsequently experiencing swipe failures after switching cards, the terminal prioritizes switching the first emulated card to the corresponding encrypted second emulated card when encrypted card authentication fails.

[0141] In some embodiments, when setting up the emulated cards, the terminal obtains whether each emulated card is an encrypted emulated card. When it is detected that the card swipe failed due to failure of encryption authentication, the terminal first determines the card to be switched from the encrypted emulated cards.

[0142] Indicative, such as Figure 7 As shown, terminal 701 is equipped with three simulated access control cards A, B and C, which have UID1, UID2 and UID3 respectively. Simulated access control cards A and C are encrypted access control cards, while the simulated access control card is an unencrypted access control card.

[0143] Upon entering the radio frequency field of the encrypted access control card reader 702, terminal 701 first interacts with the encrypted access control card reader 702 based on the UID1 of the simulated access control card A, and enters the MIFARE protocol authentication stage. If the MIFARE protocol authentication between the simulated access control card A and the encrypted access control card reader 702 fails, terminal 701 switches cards, prioritizing the encrypted access control card C. Terminal 701 then interacts with the encrypted access control card reader 702 based on the UID3 of the simulated access control card C, and enters the MIFARE protocol authentication stage. When the MIFARE protocol authentication between the simulated access control card C and the encrypted access control card reader 702 is successful, the card is swiped successfully.

[0144] In other possible implementations, upon receiving an encryption authentication failure instruction, the terminal switches the first emulation card to any second emulation card.

[0145] Of course, the terminal can also switch between simulated cards in a preset order if the first simulated card fails to swipe. This preset order can be a default simulated card switching order (e.g., related to the simulated card entry order), a custom simulated card switching order (e.g., a user-defined switching order), or a switching order determined based on the success rate of swiping simulated cards.

[0146] Scenario 3: If no successful encryption authentication instruction is received within the second preset time period, the card swiping status of the first simulated card is determined to be a card swiping failure.

[0147] In one possible scenario, when the first simulated card is an encrypted card, during the process of the terminal performing encrypted authentication with the card reader based on the first simulated card, the terminal may fail to enter the subsequent communication process because it does not receive the encrypted authentication result sent by the card reader, or the card reader does not reply with the encrypted authentication result, thus causing the card swipe to fail.

[0148] Therefore, in one possible implementation, the terminal continuously checks whether it has received a successful encryption authentication instruction within a second preset time period. If the second preset time period is reached and no successful encryption authentication instruction is received within the second preset time period, the terminal determines that the first simulated card swipe has failed and triggers a simulated card switch.

[0149] Optionally, in this scenario, the terminal can switch the first emulator card to any second emulator card, or, according to a preset card switching order, switch to the second emulator card after the first emulator card.

[0150] In some embodiments, cases 1 / 2 / 3 can be combined or substituted arbitrarily without conflict.

[0151] In some embodiments, cases 1 / 2 / 3 may also exist individually.

[0152] In this embodiment, the terminal specifies a card-switching strategy based on the reason for the card swipe failure. For example, if the reason for the card swipe failure is the failure of encrypted emulation card authentication, it will prioritize switching to other encrypted emulation cards, which helps to increase the probability of successful card swipe after switching, thereby shortening the card swipe time and improving card swipe efficiency.

[0153] The above embodiments are illustrated using the switching between different access control simulation cards as an example.

[0154] In various embodiments of this application, the first contactless parameter of the first simulated card is the contactless parameter of the first simulated access control card, or the contactless parameter of the first composite card, wherein the first composite card corresponds to at least two simulated cards, and the first composite card corresponds to at least two simulated cards including the first simulated access control card.

[0155] The second contactless parameter of the second simulated card is the contactless parameter of the second simulated access control card, or the contactless parameter of the second composite card. The second composite card corresponds to at least two simulated cards, and the second composite card corresponds to at least two simulated cards, including the second simulated access control card.

[0156] Furthermore, the first contactless parameter includes the UID of the first simulated access card, and the second contactless parameter includes the UID of the second simulated access card.

[0157] In an illustrative example, in a multi-card switching scenario, such as Figure 8 As shown, terminal 801 is equipped with two access control simulation cards, one bus simulation card, and one car key simulation card. Access control simulation card A, the bus simulation card, and the car key simulation card are combined into composite card A, and the UID in the first contactless parameter of composite card A is the UID of access control simulation card A; access control simulation card B, the bus simulation card, and the car key simulation card are combined into composite card B, and the UID in the second contactless parameter of composite card B is the UID of access control simulation card B.

[0158] When using a composite card for swiping, terminal 801 first uses the first contactless parameter corresponding to composite card A to interact with the card reader (terminal 801 interacts with access control card reader 802 based on the UID1 of the simulated access control card A, and access control card reader 802 obtains the complete UID1 of the simulated access control card A). When access control card reader 802 is the card reader corresponding to access control simulated card B, the card swiping fails because the UID1 of access control simulated card A cannot pass the card reader's UID verification based on the first contactless parameter. When the card swiping fails and the timer duration is reached, terminal 801 executes card switching logic, switching to using the second contactless parameter to interact with the card reader (terminal 801 interacts with access control card reader 802 based on the UID2 of the simulated access control card B, and access control card reader 802 obtains the complete UID2 of the simulated access control card B). Since the UID2 of the access control simulation card B in the second contactless parameter can be verified by the card reader's UID, the card swipe based on the second contactless parameter is successful, and the door is opened.

[0159] It should be noted that the aforementioned composite card can be pre-built or built in real time when a simulated card switching is required. For example, a first composite card (derived from a simulated access card A, a bus card, and a car key) and a second composite card (derived from a simulated access card B, a bus card, and a car key) can be pre-built; or, a first composite card (derived from a simulated access card A, a bus card, and a car key) can be pre-built, and when a simulated card switching requirement exists, the simulated access card A in the first composite card can be replaced with the simulated access card B to obtain the second compatible access card.

[0160] The execution entity of the simulated KA-C-K logic

[0161] In one possible design, the above-mentioned card emulation switching method can be executed by the terminal's processor, that is, the processor triggers the NFC component to perform card emulation switching based on whether the card swipe is successful or not.

[0162] In another possible design, to enable automatic switching of the analog card even when the terminal is powered off, the aforementioned analog card switching method can be executed by the NFC component, independent of the processor. This NFC component includes an NFC chip and an embedded security chip (eSE).

[0163] In one possible implementation, the analog card switching logic can be set in the NFC firmware of the NFC chip. When the terminal enters the reader's radio frequency field and obtains energy through electromagnetic induction, the NFC firmware can then run the analog card switching logic.

[0164] The NFC component's embedded security chip (which also obtains power through electromagnetic induction to operate) stores different emulated cards. The NFC firmware runs the emulated card switching logic, and when it determines that a card needs to be switched, it generates a card switching event. The embedded security chip then switches the emulated card based on the card switching event, thus achieving automatic switching of emulated cards.

[0165] In this embodiment, by embedding the analog card switching logic into the NFC firmware, the NFC component can automatically perform analog card switching even when the terminal is not powered on, thus avoiding the inability to use NFC for card swiping due to the terminal running out of power.

[0166] Optimized configuration of emulation card

[0167] Since triggering the switching of the analog card has a certain delay, and the more times the switching occurs, the higher the total delay, in order to minimize the number of analog card switching and improve card swiping efficiency, the terminal can optimize the configuration of the first analog card used (i.e. the analog card used first when entering the radio frequency field).

[0168] In one possible implementation, the terminal can identify the analog card with the highest historical success rate as the first analog card to be used when entering the radio frequency field.

[0169] In some embodiments, the terminal maintains a cumulative number of successful card swipes for different emulated cards. Upon successful card swipe, the terminal updates the cumulative number of successful card swipes for the currently used emulated card and designates the emulated card with the highest cumulative number of successful card swipes as the first emulated card.

[0170] Optionally, the cumulative number of successful card swipes can be the number of successful card swipes within the target time period. For example, the cumulative number of successful card swipes over the past 15 days.

[0171] In an illustrative example, the terminal has three emulated cards, with current cumulative successful swipe counts for emulated card A (10 times), emulated card B (5 times), and emulated card C (8 times), respectively. During this swipe, the terminal sets emulated card A as the first emulated card. If emulated card C was used for this successful swipe, the terminal updates the cumulative successful swipe count for emulated card C to 9 times. If, during subsequent swipes, the cumulative successful swipe count for emulated card C increases to 11 times, the terminal sets emulated card C as the first emulated card.

[0172] Optionally, when switching between emulated cards is required, the terminal can switch between emulated cards in descending order of the cumulative successful card swipe count. For example, when the current cumulative successful card swipe counts for each emulated card are emulated card A (10 times), emulated card B (5 times), and emulated card C (8 times), the terminal first interacts with the card reader using emulated card A. If the swipe fails, the terminal switches to emulated card C to interact with the card reader; if the swipe still fails, the terminal switches to emulated card B to interact with the card reader.

[0173] Optionally, the cumulative number of successful card swipes for different simulated cards can be maintained by the processor or by the NFC chip (the specific update logic can be set in the NFC firmware). With NFC chip maintenance, the simulated card configuration can be optimized even when the terminal is powered off.

[0174] In this embodiment, the terminal maintains the cumulative number of successful card swipes for different analog cards and sets the preferred analog card to be used when entering the radio frequency field based on the cumulative number of successful card swipes. This helps to improve the success rate of the first use of the analog card, thereby improving the card swipe efficiency.

[0175] In another possible implementation, in response to a emulation card setting command, the terminal identifies the emulation card indicated by the emulation card setting command as the first emulation card. This emulation card setting command is triggered when the geographical location changes, and / or by an emulation card setting operation.

[0176] Because users' use of emulated cards has certain regional characteristics—for example, using access card A in city A and access card B in city B—the terminal can dynamically adjust the priority emulated card when the user's geographical location changes. For instance, when the terminal detects that it is located in city A, it automatically sets the emulated card containing the UID of access card A as the first emulated card; when the terminal detects that it is located in city B, it automatically sets the emulated card containing the UID of access card B as the first emulated card.

[0177] In addition to automatically triggering emulation card setting commands based on changes in geographical location, users can also manually set the preferred emulation card through the emulation card setting operation. For example, a user can select the preferred emulation card from three composite cards and use that emulation card to interact with the card reader when entering the radio frequency field.

[0178] Optionally, the emulation card settings can further configure the switching order between the emulation cards.

[0179] In some embodiments, where the emulation card switching logic is executed by the NFC chip, the terminal processor sends an emulation card setting command to the NFC chip so that the NFC chip can perform emulation card optimization configuration. Specifically, the NFC chip updates its configuration each time it receives an emulation card setting command, and retains and uses this configuration upon receiving the next emulation card setting command.

[0180] In this embodiment, the terminal can optimize the configuration of the first analog card used when entering the radio frequency field based on changes in geographical location and / or received analog card setting operations, which helps to reduce the number of analog card switching and improve card swiping efficiency.

[0181] Application scenarios of analog card-slicing logic

[0182] In one possible implementation, in order to simplify the setup process of an electronic fence (i.e., when the location is determined to be within a certain electronic fence based on location information, the corresponding emulated card of the electronic fence is used), the terminal generates an electronic fence based on the emulated card used when the card was swiped successfully and the geographical location information, wherein the electronic fence is used to indicate the emulated card used in different geographical locations.

[0183] Optionally, when the automatic geofence generation function is enabled, the terminal uses the aforementioned automatic card switching logic based on the simulated card used when the card was successfully swiped and the geographical location information to construct the geofence. The construction of the geofence requires the simulated card and geographical location information used in multiple successful card swipes.

[0184] Optionally, after generating the electronic fence, the terminal can automatically set the currently used analog card based on the electronic fence.

[0185] When setting non-contact parameters based on an electronic fence, positioning functionality is required, which leads to additional power consumption. Therefore, in one possible implementation, the analog card switching scheme provided in this application can be used as an alternative to the electronic fence scheme. Optionally, when the terminal's power consumption is too high, and / or, the terminal's battery level is low, and / or, power-saving mode is enabled, the terminal can use the analog card switching scheme instead of the electronic fence scheme.

[0186] Of course, in other possible implementations, the simulated card switching scheme provided in this application embodiment can also be combined with the electronic fence scheme. For example, the terminal first determines the first simulated card to be used based on the electronic fence scheme, and automatically switches the card using the simulated card switching scheme when the first simulated card fails to be swiped. This embodiment will not be elaborated here.

[0187] Please refer to Figure 9 This illustration shows a structural block diagram of an analog card switching device provided in an exemplary embodiment of this application. The device includes:

[0188] The instruction interaction module 901 is used to perform instruction interaction with the card reader based on the first analog card when the card reader's radio frequency field is entered;

[0189] The switching module 902 is used to switch the first simulated card to a second simulated card when the first simulated card fails to swipe, the second simulated card being different from the first simulated card;

[0190] The instruction interaction module 901 is also used to perform instruction interaction with the card reader based on the second simulated card.

[0191] Optionally, the switching module 902 is further configured to:

[0192] Determine the card swiping status of the first simulated card;

[0193] If the determined card swiping situation indicates that the first simulated card failed to swipe, the first simulated card will be switched to the second simulated card.

[0194] Optionally, the switching module 902 is used for:

[0195] Based on the instruction interaction with the card reader within a preset time period, the card swiping status of the first simulated card is determined.

[0196] Optionally, the preset duration is the timer duration of the timer, and the timer is started when entering the radio frequency field of the card reader, or during the process of command interaction with the card reader.

[0197] Optionally, after switching the first emulation card to the second emulation card, the switching module 902 is further configured to:

[0198] Restart the timer;

[0199] If the second simulated card fails to swipe within the timer duration, the second simulated card will be switched to a third simulated card, which is different from both the second and first simulated cards.

[0200] The instruction interaction module 901 is also used to perform instruction interaction with the card reader based on the third simulated card.

[0201] Optionally, the preset duration may include a first preset duration and a second preset duration, wherein the first preset duration and the second preset duration may be the same or different; the switching module 902 is used for:

[0202] Obtain the number of UID reads within a first preset time period; if the number of UID reads reaches a threshold, determine that the card swiping of the first simulated card has failed.

[0203] And / or,

[0204] Upon receiving an encryption authentication failure instruction, the card swiping status of the first simulated card is determined to be a card swiping failure;

[0205] And / or, if no successful encryption authentication instruction is received within the second preset time period, the card swiping status of the first simulated card is determined to be a card swiping failure.

[0206] Optionally, upon receiving the encryption authentication failure instruction, the switching module 902 is configured to:

[0207] Switch the first emulation card to an encrypted second emulation card;

[0208] And / or,

[0209] Switch the first emulator card to any second emulator card.

[0210] Optionally, if the number of UID reads reaches a threshold within a first preset time period, the switching module 902 is used to:

[0211] Switch the first emulation card to the unencrypted second emulation card;

[0212] And / or,

[0213] Switch the first emulator card to any second emulator card.

[0214] Optionally, the device is an NFC component, and the NFC component includes an NFC chip and an embedded security chip, wherein the embedded security chip stores different analog cards.

[0215] Optionally, the first analog card is a single analog card or a first composite card, wherein the first composite card is obtained by combining at least two single analog cards;

[0216] The second analog card is either a single analog card or a second composite card, wherein the second composite card is obtained by combining at least two single analog cards.

[0217] In summary, in this embodiment of the application, when the terminal is equipped with at least two simulated cards, the terminal automatically switches to the second simulated card to attempt to swipe when it confirms that swiping the first simulated card has failed. This eliminates the need for the user to manually switch simulated cards or set up electronic fences for the simulated cards in advance, simplifying the process of using multiple simulated cards and improving the efficiency and success rate of swiping simulated cards.

[0218] It should be noted that the apparatus provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the apparatus can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and their implementation process can be found in the method embodiments, which will not be repeated here.

[0219] Please refer to Figure 10 The diagram illustrates a structural block diagram of a terminal provided in an exemplary embodiment of this application. The terminal may include one or more components such as a processor 1001, a memory 1002, and an NFC component 1003.

[0220] Optionally, the processor 1001 connects various parts of the terminal using various interfaces and lines, and performs various functions of the terminal and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 1002, and calling data stored in the memory 1002.

[0221] Optionally, the processor 1001 may be implemented in at least one of the following hardware forms: Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA).

[0222] Processor 1001 can integrate one or more of the following: a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Neural-network Processing Unit (NPU), and a baseband chip. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content displayed on the touchscreen; the NPU implements artificial intelligence (AI) functions; and the baseband chip handles wireless communication. It is understood that the baseband chip can also be implemented as a separate chip without being integrated into processor 1001.

[0223] The memory 1002 may include RAM (Random Access Memory) or ROM (Read-Only Memory). The memory 1002 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 1002 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for at least one function, instructions for implementing the various method embodiments described above, etc.; the data storage area may store data created based on the use of the electronic device, etc.

[0224] The NFC component 1003 may include an NFC chip and an embedded security chip. The NFC chip implements NFC functionality, and the embedded security chip implements NFC-related security functions. The NFC chip and the embedded security chip support communication. In some embodiments, the NFC chip runs NFC firmware to control logic such as NFC card swiping and card switching, while the embedded security chip stores the emulated card. The embedded security chip is a non-essential component; when the terminal uses HCE (Host-based Card Emulation) to emulate a card based on a host card, the terminal does not need to use the embedded security chip. The NFC chip 1003 can be used for communication between the emulated card and the card reader, thereby enabling command interaction between the terminal and the card reader.

[0225] The simulated card switching method provided in this application embodiment can be executed by the processor 1001 or by the NFC component 1003.

[0226] In addition, those skilled in the art will understand that the structure of the terminal shown in the above figures does not constitute a limitation on the computer device. The computer device may include more (e.g., display components, sensor components) or fewer components than shown, or combine certain components, or have different component arrangements.

[0227] This application also provides a computer-readable storage medium storing at least one instruction, which is executed by a processor to implement the emulation card switching method as described in the above embodiments.

[0228] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the emulation card switching method provided in the above embodiment.

[0229] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0230] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for switching analog cards, characterized in that, The method includes: When the card enters the radio frequency field of the card reader, the card reader interacts with the card reader based on the first analog card; If the first simulated card fails to swipe, the first simulated card will be switched to a second simulated card, which is different from the first simulated card. The second simulated card interacts with the card reader using commands.

2. The method according to claim 1, characterized in that, The method further includes: Determine the card swiping status of the first simulated card; The step of switching the first simulated card to the second simulated card when the first simulated card fails to swipe includes: If the determined card swiping situation indicates that the first simulated card failed to swipe, the first simulated card will be switched to the second simulated card.

3. The method according to claim 2, characterized in that, Determining the card swiping status of the first simulated card includes: Based on the instruction interaction with the card reader within a preset time period, the card swiping status of the first simulated card is determined.

4. The method according to claim 3, characterized in that, The preset duration is the timer duration of the timer, and the timer is started when it enters the radio frequency field of the card reader, or during the process of command interaction with the card reader.

5. The method according to claim 4, characterized in that, After switching the first emulation card to the second emulation card, the method further includes: Restart the timer; If the second simulated card fails to swipe within the timer duration, the second simulated card will be switched to a third simulated card, which is different from both the second and first simulated cards. The third analog card interacts with the card reader via commands.

6. The method according to claim 3, characterized in that, The preset duration includes a first preset duration and a second preset duration, wherein the first preset duration and the second preset duration may be the same or different. Determining the card swiping status of the first simulated card based on the instruction interaction with the card reader within the preset duration includes: Obtain the number of UID reads within the first preset time period; if the number of UID reads reaches the threshold, determine that the card swiping of the first simulated card is a card swiping failure; And / or, Upon receiving an encryption authentication failure instruction, the card swiping status of the first simulated card is determined to be a card swiping failure; And / or, If no successful encryption authentication instruction is received within the second preset time period, the card swiping status of the first simulated card is determined to be a card swiping failure.

7. The method according to claim 6, characterized in that, Upon receiving the encryption authentication failure instruction, switching the first emulation card to the second emulation card includes: Switch the first emulation card to an encrypted second emulation card; And / or, Switch the first emulator card to any second emulator card.

8. The method according to claim 6, characterized in that, When the number of UID reads reaches a threshold, switching the first emulation card to the second emulation card includes: Switch the first emulation card to the unencrypted second emulation card; And / or, Switch the first emulator card to any second emulator card.

9. The method according to any one of claims 1 to 8, characterized in that, The method is executed by an NFC component, which includes an NFC chip and an embedded security chip that stores different analog cards.

10. The method according to any one of claims 1 to 8, characterized in that, The first analog card is either a single analog card or a first composite card, wherein the first composite card is obtained by combining at least two single analog cards; The second analog card is either a single analog card or a second composite card, wherein the second composite card is obtained by combining at least two single analog cards.

11. An analog card switching device, characterized in that, The device includes: The instruction interaction module is used to perform instruction interaction with the card reader based on the first analog card when the card enters the radio frequency field of the card reader; The switching module is used to switch the first simulated card to a second simulated card when the first simulated card fails to be swiped, the second simulated card being different from the first simulated card; The instruction interaction module is used to perform instruction interaction between the second simulated card and the card reader.

12. A chip, characterized in that, The chip includes programmable logic circuits and / or program instructions. When the chip is running, it is used to implement the analog card switching method as described in any one of claims 1 to 10.

13. A terminal, characterized in that, The terminal includes a processor, a memory, and an NFC component. The memory stores at least one piece of program code, which is loaded and executed by the processor to implement the analog card switching method as described in any one of claims 1 to 10. Alternatively, the NFC component is used to implement the analog card switching method as described in any one of claims 1 to 10.

14. A computer-readable storage medium, characterized in that, The storage medium stores at least one piece of program code, which is executed by a processor to implement the analog card switching method as described in any one of claims 1 to 10.

15. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to implement the analog card switching method as described in any one of claims 1 to 10.