Card switching method and electronic equipment
By obtaining and using identification data in electronic devices to match non-standard cards, the problem that multiple non-standard cards in the same geofence cannot be automatically switched is solved, and the effect of automatically activating cards and improving user experience is achieved.
Patent Information
- Application Number
- CN202311627829.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-05-30
AI Technical Summary
In electronic devices, when multiple non-standard cards are included in the same geofence, the activated cards cannot be automatically switched, resulting in users needing to make manual selections, reducing the user experience.
By obtaining the identification data of the electronic device, using the data to match the corresponding non-standard card, and automatically activate the card when matching the non-standard card to complete the NFC transaction.
It realizes automatic matching and activation of corresponding non-standard cards when executing NFC transactions, avoiding the step of manually switching cards by users and improving user experience.
Smart Images

Figure CN120074587A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic technologies, and more particularly, to a method for switching cards and an electronic device. Background Art
[0002] Currently, various near field communication (NFC) security services can be supported in an electronic device. The NFC security services can be implemented through cards added to the electronic device, such as various cards like bank cards, bus cards, access control cards, work cards, electronic identity cards, car keys, etc. can be added to the electronic device. Among them, the number of each type of card can be one or more, for example, the electronic device is configured with two access control cards, multiple bank cards, etc.
[0003] In actual use, the electronic device can activate a small application program (applet) corresponding to the card, so that the subsequent electronic device can execute the corresponding NFC service through the card.
[0004] Generally, the electronic device can classify the above-mentioned cards into standard cards (abbreviated as standard cards) that can be distinguished by an Application Identity (AID) and non-standard cards (abbreviated as non-standard cards) that cannot be distinguished by an AID.
[0005] Since there may be multiple cards in the electronic device, for different service scenarios, the electronic device needs to activate different cards for NFC transactions. To improve the user experience, the intelligent selection card mechanism can achieve automatic switching of some cards without the user having to manually select. Under the intelligent selection card mechanism, different non-standard cards can be distinguished by a geographical fence (usually with a precision of 500 - 2000 meters). For example, in geographical fence 1, a non-standard card A can be configured, and in geographical fence 2, another non-standard card B can be configured. In this way, when the electronic device is in geographical fence 1, the non-standard card 1 can be automatically switched, and when the electronic device is in geographical fence 2, the non-standard card 2 can be automatically switched. However, when there are multiple non-standard cards in the same geographical fence, the electronic device cannot automatically switch the activated card. Summary of the Invention
[0006] This application provides a method for switching cards and an electronic device. The technical solution can obtain the identification data of the electronic device when the electronic device performs an NFC transaction, and use the identification data to match the corresponding non-standard card. When a non-standard card is matched, the non-standard card is automatically activated to complete the NFC transaction.
[0007] In a first aspect, a method for switching cards is provided. The method is applied to an electronic device, and a standard card and a non-standard card are included in a first application program of the electronic device. The method includes: when performing a Near Field Communication (NFC) transaction, obtaining first identification data of the electronic device, where the first identification data includes location information, altitude information, or attitude information of the electronic device; matching a target non-standard card according to the first identification data; activating the target non-standard card in the first application program; and performing the NFC transaction using the target non-standard card.
[0008] For example, the first application program may be a wallet application program.
[0009] It should be understood that the first identification data may further include other content, such as air pressure information, etc., which is not limited in the embodiments of the present application.
[0010] Based on the embodiments of the present application, when the electronic device performs an NFC transaction (swiping the card), first identification data of the electronic device is obtained, a target non-standard card is matched according to the first identification data, the target non-standard card is activated in the first application program, and the NFC transaction is performed using the target non-standard card.
[0011] In this way, the electronic device can automatically match the corresponding target non-standard card through the identification data during the NFC transaction, and activate the target non-standard card to perform the NFC transaction, thereby avoiding the user from manually switching cards and improving the user experience.
[0012] In combination with the first aspect, in an implementation manner of the first aspect, when performing a Near Field Communication (NFC) transaction, the method further includes: receiving a first signaling, where the first instruction is used to indicate the type of card that the NFC device expects to obtain; sending a first response signaling, where the first response signaling is used to indicate the type of card activated by the electronic device; and within a preset time, not receiving a second signaling, where the second signaling is used to indicate the card that the NFC device expects to transact.
[0013] For example, the first signaling is a 14443-3 instruction, the first response signaling is a 14443-3 response instruction, and the second signaling is a 14443-4 instruction. The preset time may be 800 ms, or 600 ms, etc.
[0014] Based on the embodiments of the present application, when the electronic device performs an NFC transaction, it can receive the first signaling sent by the NFC device and send a first response signaling, which is beneficial for the electronic device to determine the type of card expected by the NFC device and beneficial for the NFC device to determine the type of card currently activated by the electronic device.
[0015] In combination with the first aspect, in an implementation of the first aspect, the using the target non-standard card to perform the NFC transaction includes: receiving the first signaling and using the target non-standard card to perform the NFC transaction.
[0016] Based on the embodiments of the present application, when the electronic device receives the first signaling again, it can use the target non-standard card to perform the NFC transaction. Since the target non-standard card is matched by the electronic device according to the first identification data, this NFC transaction can be successful.
[0017] In combination with the first aspect, in an implementation of the first aspect, the method further includes: when the target non-standard card is not matched, displaying a first prompt message for prompting whether the NFC transaction is successful.
[0018] It should be understood that the present application does not limit the specific form of this first prompt message. For example, the first prompt message can be a text display box, or the first prompt message can also be displayed separately in a display interface.
[0019] Since when the electronic device performs the NFC transaction, it will default to activate a card or use the card used in the previous NFC transaction, and this card may or may not be the non-standard card required for this NFC transaction. In the embodiments of the present application, when the target non-standard card is not matched through the first identification data, the electronic device can display the first prompt message to prompt the user whether the NFC transaction is successful. In this way, it is beneficial for the electronic device to determine whether the NFC transaction is successful.
[0020] In combination with the first aspect, in an implementation of the first aspect, the method further includes: in response to an operation of determining that the NFC transaction is successful, updating the identification data of the non-standard card that performs the NFC transaction to the first identification data.
[0021] For example, the first prompt message may include a confirmation function button, and the operation of determining that the NFC transaction is successful may be the operation of the user clicking the confirmation function button.
[0022] Based on the embodiments of the present application, when the electronic device detects the operation of the user determining that the NFC transaction is successful, it means that the identification data of the currently activated non-standard card is inaccurate or the electronic device does not store the identification data of the non-standard card. Therefore, the electronic device can update the identification data of the non-standard card that performs the NFC transaction to the first identification data, which can make the identification data of the non-standard card more accurate, so that when the non-standard card needs to be used to perform the NFC transaction next time, the non-standard card can be successfully matched according to the identification data.
[0023] In combination with the first aspect, in one implementation of the first aspect, the method further includes: in response to an operation of determining that the NFC transaction is unsuccessful, displaying a second prompt message for prompting to select a non-standard card for performing the NFC transaction; in response to an operation of the user selecting a second target non-standard card, updating the identification data of the second target non-standard card to the first identification data; and performing the NFC transaction using the second target non-standard card.
[0024] For example, the first prompt message may include a failure function button, and the operation of determining that the NFC transaction is unsuccessful may be an operation of the user clicking the failure function button.
[0025] Based on the embodiments of the present application, when the electronic device detects an operation of the user determining that the NFC transaction is unsuccessful, it means that the currently activated non-standard card is not the non-standard card required for this NFC. Then the electronic device can display a second prompt message to prompt the user to select the required non-standard card; when detecting an operation of the user selecting a second target non-standard card, updating the identification data of the second target non-standard card to the first identification data, and performing the NFC transaction using the second target non-standard card.
[0026] In this way, the second target non-standard card is the non-standard card required for this NFC transaction, but the electronic device does not match the second target non-standard card through the first identification data, which means that the identification data of the second target non-standard card stored in the electronic device is inaccurate or the identification data of the second target non-standard card is not stored. Therefore, the electronic device can update the identification data of the second target non-standard card to the first identification data, which can make the identification data of the second target non-standard card more accurate, so that when the second target non-standard card needs to be used to perform the NFC transaction next time, the second target non-standard card can be successfully matched according to the identification data.
[0027] In combination with the first aspect, in one implementation of the first aspect, the method further includes: canceling the display of the first prompt message when no operation of the user is detected within a preset time.
[0028] Exemplarily, the preset time may be 5 seconds, 8 seconds, etc.
[0029] Based on the embodiments of the present application, when the electronic device does not detect any operation of the user within the preset time, it can cancel the display of the first prompt message, thereby saving the power consumption of the electronic device.
[0030] In combination with the first aspect, in one implementation of the first aspect, the matching of the target non-standard card according to the first identification data includes: matching the content included in the first identification data with the content included in the preset identification data one by one in a preset order.
[0031] Exemplarily, the preset order may be position information, height information, attitude information, or the preset order may be height information, position information, attitude information, etc. The embodiments of the present application do not limit the specific order in the preset order.
[0032] Based on the embodiments of the present application, the electronic device can match the content included in the first identification data with the content included in the preset identification data one by one according to the preset order, so that it is not necessary to compare all the content in the first identification data at the beginning, thereby saving the power consumption of the electronic device.
[0033] Combined with the first aspect, in an implementation manner of the first aspect, before matching the content included in the first identification data with the content included in the preset identification data according to the preset order, the method further includes: determining the number of non-standard cards; if there is one non-standard card, using the one non-standard card as the target non-standard card that is matched; if there are multiple non-standard cards, matching the content included in the first identification data with the content included in the preset identification data of the multiple non-standard cards according to the preset order.
[0034] Based on the embodiments of the present application, before matching the content included in the first identification data with the content included in the preset identification data according to the preset order, the electronic device can also first determine the number of non-standard cards in the electronic device. When it is determined that there is one non-standard card, using the one non-standard card as the target non-standard card that is matched. In this way, the electronic device can simply match the target non-standard card. If the electronic device determines that there are multiple non-standard cards, it can match the content included in the first identification data with the content included in the preset identification data of the multiple non-standard cards according to the preset order, thereby saving the power consumption of the electronic device.
[0035] Combined with the first aspect, in an implementation manner of the first aspect, the matching the content included in the first identification data with the content included in the preset identification data of the multiple non-standard cards according to the preset order includes: matching the position information in the first identification data with the position information in the preset identification data of the multiple non-standard cards respectively to determine non-standard cards that meet the first preset condition; when there is one first non-standard card that meets the first preset condition, using the first non-standard card as the target non-standard card that is matched.
[0036] The first preset condition may be that the difference in position information is less than a threshold.
[0037] Since in actual application scenarios, it is a relatively common phenomenon that the geographical locations of multiple non-standard cards (such as access control cards) are different. Therefore, based on the embodiments of the present application, the electronic device can first match the location information in the identification data with the location information in the preset identification data of multiple non-standard cards. When there is a first non-standard card that meets the first preset condition, the first non-standard card is used as the matched target non-standard card. In this way, the electronic device can conveniently match the target non-standard card.
[0038] Combined with the first aspect, in an implementation manner of the first aspect, the method further includes: when there are multiple first non-standard cards that meet the first preset condition, respectively match the height information in the first identification data with the height information in the preset identification data of the multiple first non-standard cards to determine a non-standard card that meets the second preset condition; when there is a second non-standard card that meets the second preset condition, use the second non-standard card as the matched target non-standard card.
[0039] The second preset condition may be that the difference in height information is less than a threshold.
[0040] Based on the embodiments of the present application, when there are multiple first non-standard cards that meet the location information, the electronic device continues to match the height information in the preset identification data of the multiple first non-standard cards. When there is a second non-standard card that meets the second preset condition, use the second non-standard card as the matched target non-standard card. In this way, the electronic device can conveniently match the target non-standard card.
[0041] Combined with the first aspect, in an implementation manner of the first aspect, the method further includes: when there are multiple second non-standard cards that meet the second preset condition, respectively match the attitude information in the first identification data with the attitude information in the preset identification data of the multiple second non-standard cards to determine a non-standard card that meets the third preset condition; when there is a third non-standard card that meets the third preset condition, use the third non-standard card as the matched target non-standard card.
[0042] The third preset condition may be that the difference in attitude information is less than a threshold.
[0043] Based on the embodiments of the present application, when there are multiple second non-standard cards that meet the height information, the electronic device continues to match the attitude information in the preset identification data of the multiple second non-standard cards. When there is a third non-standard card that meets the third preset condition, use the third non-standard card as the matched target non-standard card. In this way, the electronic device can conveniently match the target non-standard card.
[0044] In combination with the first aspect, in an implementation manner of the first aspect, the method further includes: when there are multiple third non-standard cards that meet the third preset condition, determining that the target non-standard card is not matched.
[0045] Based on the embodiments of the present application, when the electronic device determines that there are multiple third non-standard cards that meet the third preset condition, it determines that the target non-standard card is not matched.
[0046] In combination with the first aspect, in an implementation manner of the first aspect, the method further includes: displaying a third prompt message for prompting that the target non-standard card is not matched.
[0047] Based on the embodiments of the present application, when the electronic device determines that the target non-standard card is not matched, it can display a third prompt message to prompt the user that the target non-standard card is not matched. This is beneficial for the user to modify the card swiping posture.
[0048] In combination with the first aspect, in an implementation manner of the first aspect, the method further includes: displaying a fourth prompt message for displaying the recommended posture for the electronic device to perform the NFC transaction.
[0049] Based on the embodiments of the present application, the electronic device can also display a fourth prompt message for displaying the recommended posture for the electronic device to perform the NFC transaction, thereby providing guidance on the card swiping posture for the user and prompting the convenience of the operation.
[0050] In combination with the first aspect, in an implementation manner of the first aspect, the method further includes: the electronic device displays the recommended postures in the order of the priority of the recommended postures.
[0051] Based on the embodiments of the present application, the priority order of the recommended postures can be pre-stored in the electronic device, so that when recommending the card swiping posture to the user, the recommended postures can be displayed in this priority order.
[0052] In combination with the first aspect, in an implementation manner of the first aspect, before the electronic device performs the NFC transaction, the method further includes: in response to the operation of adding the target non-standard card, adding the target non-standard card; in response to the operation of performing the second NFC transaction, obtaining the second identification data of the electronic device; and updating the identification data of the target non-standard card according to the second identification data.
[0053] It should be understood that the second identification data may be the same as or different from the first identification data.
[0054] Based on the embodiments of the present application, when the electronic device adds a target non-standard card and uses the target non-standard card to perform a second NFC transaction, the electronic device can obtain second identification data of the electronic device and update the identification data of the target non-standard card to the second identification data, which is beneficial to subsequent matching of the target non-standard card by the electronic device.
[0055] Combined with the first aspect, in one implementation manner of the first aspect, the attitude information includes direction information or tilt information, or the attitude information includes direction information and tilt information.
[0056] In other examples, the attitude information may further include other information indicating the attitude of the electronic device by the user, which is not limited in the embodiments of the present application.
[0057] In a second aspect, an electronic device is provided, including: one or more processors; one or more memories; the one or more memories store one or more programs, and when the one or more programs are executed by the one or more processors, the method for switching cards as described in the first aspect and any of its possible implementation manners is executed.
[0058] In a third aspect, a card switching device is provided, including modules for implementing the method for switching cards as described in the first aspect and any of its possible implementation manners.
[0059] In a fourth aspect, a chip is provided, the chip includes a processor and a communication interface, the communication interface is used to receive a signal and transmit the signal to the processor, and the processor processes the signal so that the method for switching cards as described in the first aspect and any of its possible implementation manners is executed.
[0060] In a fifth aspect, a readable storage medium is provided, and instructions are stored in the readable storage medium. When the instructions are run on an electronic device, the method for switching cards as described in the first aspect and any of its possible implementation manners is executed.
[0061] In a sixth aspect, a program product is provided, the program product includes program code, and when the program code is run on an electronic device, the method for switching cards as described in the first aspect and any of its possible implementation manners is executed. Description of the Drawings
[0062] Figure 1 It is a schematic diagram of a non-NFC device using a geographical fence no-go area.
[0063] Figure 2 It is a schematic architecture diagram of an electronic device provided by the embodiments of the present application.
[0064] Figure 3 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
[0065] Figure 4 It is a schematic diagram for distinguishing the posture of an electronic device in identification data provided by an embodiment of the present application.
[0066] Figure 5 It is a schematic diagram for distinguishing cards in an electronic device through identification data provided by an embodiment of the present application.
[0067] Figure 6 It is a schematic flowchart for updating the white list of intelligent flash cards provided by an embodiment of the present application.
[0068] Figure 7 It is a schematic flowchart for switching cards provided by an embodiment of the present application.
[0069] Figure 8 It is a schematic flowchart for switching cards provided by an embodiment of the present application.
[0070] Figure 9 It is a schematic flowchart for switching cards provided by an embodiment of the present application.
[0071] Figure 10 It is a schematic flowchart for matching non-standard cards through identification data provided by an embodiment of the present application.
[0072] Figure 11 It is a schematic diagram for recommending a user's card swiping posture provided by an embodiment of the present application.
[0073] Figure 12 It is a schematic diagram for recommending multiple user's card swiping postures provided by an embodiment of the present application.
[0074] Figure 13 It is a schematic flowchart for a method of switching cards provided by an embodiment of the present application.
[0075] Figure 14 It is a schematic block diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0076] Next, the technical solutions in the present application will be described in conjunction with the accompanying drawings.
[0077] Currently, various near field communication (NFC) security services can be supported in an electronic device. The NFC security service can be implemented through the cards added to the electronic device, such as various cards like bank cards, bus cards, access control cards, work cards, electronic identity cards, car keys, etc. that can be added to the electronic device. Among them, the number of each type of card can be one or more, such as the electronic device is configured with two access control cards, multiple bank cards, etc.
[0078] In actual use, the electronic device can activate the applet corresponding to the card, so that the electronic device can subsequently execute the corresponding NFC service through the card.
[0079] Generally, the electronic device can classify the above-mentioned cards into standard cards (referred to as standard cards for short) that can be distinguished by the Application Identity (AID) and non-standard cards (referred to as non-standard cards or non-standard cards for short) that cannot be distinguished by the AID.
[0080] Among them, the cards that support the ISO / IEC 14443-4 protocol are also called standard cards. It should also be noted that in the ISO / IEC 14443-4 protocol, each card is identified by the AID, so the cards that support the ISO / IEC 14443-4 protocol are also called AID cards. That is to say, after the NFC device and the standard card in the electronic device complete the primary handshake through the ISO / IEC 14443-3 protocol, they then interact with transaction-related instructions through the ISO / IEC 14443-4 protocol (for example, the NFC device sends an instruction to select the target card; the electronic device returns a response indicating that the target card is selected or not selected to the NFC device), etc.
[0081] However, in a real scenario, there may also be cards in the secure element (SE) module that support the ISO / IEC 14443-3 protocol but do not support the ISO / IEC 14443-4 protocol, such as bus cards that cannot achieve interoperability, old version access control cards, etc. Among them, cards that support the ISO / IEC 14443-3 protocol but do not support the ISO / IEC 14443-4 protocol are also called non-standard cards, which can be abbreviated as non-standard cards for short. It should also be noted that in the ISO / IEC 14443-3 protocol, each card is identified by a user ID (UID), so non-standard cards are also called UID cards. Then, after the non-standard card in the electronic device and the NFC device complete the primary handshake through the ISO / IEC 14443-3 protocol, they may directly interact with instructions related to transactions through the ISO / IEC 14443-3 protocol. That is to say, the electronic device may not receive the instruction from the NFC device to select a certain card sent through the ISO / IEC 14443-4 protocol.
[0082] Among them, standard cards are, for example, bus cards, keys, electronic certificates, etc. that can achieve interoperability. Non-standard cards are, for example, bus cards that cannot achieve interoperability, old version access control cards, etc.
[0083] Since there may be multiple cards in the electronic device, for different business scenarios, the electronic device needs to activate different cards for NFC transactions. To improve the user experience, the intelligent selection card mechanism can achieve automatic switching of some cards without the user having to select manually. Under the intelligent selection card mechanism, different non-standard cards can be distinguished by a geographical fence (usually with an accuracy of 500-2000 meters). For example, in geographical fence 1, a non-standard card A can be configured, and in geographical fence 2, another non-standard card B can be configured. In this way, when the electronic device is in geographical fence 1, non-standard card 1 can be automatically switched, and when the electronic device is in geographical fence 2, non-standard card 2 can be automatically switched. However, when there are multiple non-standard cards in the same geographical fence, the electronic device cannot automatically switch the activated card.
[0084] Exemplarily, refer to Figure 1 , Figure 1 is a schematic diagram of using a geographical fence to block NFC devices. As Figure 1 shown in (a) of
[0085] For another example, referring to Figure 1 (b) in, when NFC device 1 (such as an access control) and NFC device 2 (such as an access control) are in the same geographical fence and the heights of NFC device 1 and NFC device 2 are different. For example, NFC device 1 and NFC device 2 are access controls located on different floors of the same building.
[0086] In this case, when the electronic device swipes the access control card, the electronic device cannot automatically switch the activated access control card and still requires the user to manually switch it, which reduces the user experience.
[0087] In view of this, the embodiments of the present application provide a method and an electronic device for switching cards. This technical solution can obtain the identification data of the electronic device when the electronic device performs an NFC transaction, and use the identification data to match the corresponding non-standard card. When the non-standard card is matched, the non-standard card is automatically activated to complete the NFC transaction.
[0088] Figure 2 is a schematic architecture diagram of an electronic device provided by the embodiments of the present application. As Figure 2 shown, the electronic device 100 can at least include an application (App) layer, an application framework layer, and a chip layer. The electronic device 100 can also include a system library and a kernel layer (not shown in the figure).
[0089] Among them, the application layer can include a series of application packages. As Figure 2 shown, the application packages can at least include applications such as a camera, a gallery, a calendar, and a wallet.
[0090] In the embodiments of the present application, the wallet App can be used to manage the cards for performing NFC services. For example, the user can add a bank card, a bus card, an access control card, etc. in the wallet App. The wallet App can also be called a smart flash card management App.
[0091] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.
[0092] As Figure 2 shown, the application framework layer can include a window manager, a content provider, a resource manager, a smart flash card service, a sensor service, etc.
[0093] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0094] The content provider is used to store and obtain data, and make this data accessible to applications. The data may include videos, images, audio, incoming and outgoing calls, browsing history and bookmarks, phone books, etc.
[0095] The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc.
[0096] The intelligent flash card service can be used to read the data of each sensor in the sensor service to determine the corresponding identification data when the electronic device 100 executes the NFC service, and perform operations such as automatically switching cards in the subsequent process.
[0097] The sensor service can be used to obtain the data of each sensor. For example, the sensor service may include a gravity sensor service, a magnetometer service, a barometer service, a location service, etc. Among them, the gravity sensor service can be used to obtain the attitude information of the electronic device 100 when swiping the card. For example, the attitude information may be the inclination of the electronic device 100; the magnetometer service can be used to obtain the attitude information when swiping the card. For example, the attitude information may be the direction (east, south, west, north) of the electronic device 100; the barometer service can be used to obtain the altitude information of the electronic device 100 when swiping the card; the location service can be used to obtain the location information of the electronic device 100 when swiping the card.
[0098] The application layer and the application framework layer can run in the virtual machine. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0099] As Figure 2 shown, the chip layer may include an NFC chip, a secure element (SE) chip, etc.
[0100] Among them, the SE chip may include an SE module. The SE module includes a card operating system (COS) module, a contactless registry service (CRS) module, and applications in the SE module (such as Card 1, Card 2, etc.). The COS is the operating system of the SE module, which is used to preprocess the received application protocol data unit (APDU) instructions and distribute the instructions to the corresponding services or application programs in the SE module for processing. The CRS is a system application in the SE module, which is responsible for the registration management of the applications in the SE module, and activates or deactivates (i.e., cancels the activation of) the applications in the SE module. The applications in the SE module can also be called Applets or cards.
[0101] The NFC chip may include an NFC module. The NFC module can be used to support the communication between the electronic device 100 and other NFC devices (such as card reading devices). The NFC module may include a contactless front-end (CLF). The CLF is the controller of the NFC chip, which can receive the APDU instructions of the NFC device and send the received APDU instructions to the card COS of the SE module, so that the COS can distribute the received APDU instructions to the corresponding applications in the SE module for business transactions.
[0102] Exemplarily, Figure 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 3As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0103] It can be understood that the structure schematically shown in the embodiments of this application does not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or have different component arrangements. The components shown may be implemented in hardware, software, or a combination of software and hardware.
[0104] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0105] In this application, the processor 110 can be used to perform encoding and decoding operations on images. For example, the processor 110 in a device can be used to change the brightness and darkness of a display screen according to binary encoding information, and the binary encoding information includes the device connection information of the device. The processor in another device can be used to identify the device connection information from the acquired images.
[0106] Among them, the controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
[0107] A memory can also be set in the processor 110 to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0108] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus interface, etc.
[0109] The I2C interface is a two-way synchronous serial bus, including a serial data line (SDA) and a serial clock line (derail clock line, SCL).
[0110] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple groups of I2S buses. The processor 110 can be coupled to the audio module 170 through the I2S bus to achieve communication between the processor 110 and the audio module 170.
[0111] The PCM interface can also be used for audio communication to sample, quantize, and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled through the PCM bus interface.
[0112] The UART interface is a general-purpose serial data bus for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160.
[0113] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193.
[0114] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc.
[0115] The USB interface 130 is an interface that complies with the USB standard specification, and can specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and peripheral devices.
[0116] It can be understood that the interface connection relationships between the modules illustrated in the embodiments of the present application are only illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0117] The charging management module 140 is used to receive a charging input from a charger. Among them, the charger can be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module 140 can receive the charging input from a wired charger through the USB interface 130. In some embodiments of wireless charging, the charging management module 140 can receive the wireless charging input through the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the device through the power management module 141.
[0118] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110.
[0119] The wireless communication function of the electronic device 100 can be implemented by antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modulation and demodulation processor, baseband processor, etc.
[0120] The mobile communication module 150 can provide solutions for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100.
[0121] The modulation and demodulation processor can include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Subsequently, the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to speaker 170A, receiver 170B, etc.), or displays an image or video through the display screen 194. In some embodiments, the modulation and demodulation processor can be an independent device. In other embodiments, the modulation and demodulation processor can be independent of the processor 110 and be disposed in the same device as the mobile communication module 150 or other functional modules.
[0122] The wireless communication module 160 can provide solutions for wireless communication including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), Bluetooth low energy (BLE), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. applied to the electronic device 100.
[0123] In some embodiments, antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
[0124] The electronic device 100 realizes the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0125] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), or can be a display panel made of one of materials such as organic light-emitting diode (OLED), active-matrix organic light emitting diode (AMOLED), flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, or quantum dot light emitting diodes (QLED). In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0126] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor, etc.
[0127] The ISP is used to process the data fed back by the camera 193. The camera 193 is used to capture static images or videos. The digital signal processor is used to process digital signals. In addition to being able to process digital image signals, it can also process other digital signals.
[0128] The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs.
[0129] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to implement the storage capacity expansion of the electronic device 100.
[0130] The internal memory 121 can be used to store computer-executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121.
[0131] The electronic device 100 can implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, and an application processor, etc. Such as music playback, recording, etc.
[0132] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
[0133] The speaker 170A, also known as the "loudspeaker", is used to convert an audio electrical signal into a sound signal.
[0134] The receiver 170B, also known as the "earpiece", is used to convert an audio electrical signal into a sound signal.
[0135] The microphone 170C, also known as the "microphone" or "transmitter", is used to convert a sound signal into an electrical signal.
[0136] The headphone jack 170D is used to connect a wired headphone.
[0137] The pressure sensor 180A is used to sense a pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194.
[0138] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100.
[0139] The barometric pressure sensor 180C is used to measure barometric pressure. In some embodiments, the electronic device 100 calculates the altitude based on the barometric pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.
[0140] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes).
[0141] The distance sensor 180F is used to measure distance.
[0142] The fingerprint sensor 180H is used to collect fingerprints.
[0143] The touch sensor 180K, also known as the "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also known as the "touch display screen".
[0144] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain the vibration signal of the vibrating bone mass of the human vocal tract. The bone conduction sensor 180M can also contact the human pulse to receive the blood pressure pulsation signal.
[0145] The keys 190 include a power-on key, volume keys, etc.
[0146] The motor 191 can generate a vibration prompt.
[0147] The indicator 192 can be an indicator light, which can be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, etc.
[0148] The SIM card interface 195 is used to connect to the SIM card.
[0149] In the embodiments of the present application, when the electronic device uses a card to perform the NFC service, it can obtain the identification data of the electronic device when swiping the card, and use the identification data to match the corresponding non-standard card. When the non-standard card is matched, the electronic device can automatically activate the non-standard card to perform the NFC service. Thus, it can avoid the user from manually switching the card and improve the user experience.
[0150] In other embodiments, when the electronic device fails to match the corresponding non-standard card using the identification data, it displays a prompt message to the user to prompt the user to select the corresponding non-standard card; the electronic device can also recommend the swiping gesture to the user to distinguish it from the identification data of other cards.
[0151] For example, the identification data can include but is not limited to position information, height information, direction information, tilt information, etc. Table 1 shows the relevant information of the identification data.
[0152] Table 1 Identification Data
[0153] Identification data Source Description Location information Geographical location Geographical planar location of the electronic device (such as longitude and latitude) Altitude information Barometer Stereoscopic altitude of the electronic device Direction information Magnetometer Direction when the electronic device swipes the card (such as east, south, west, north) Inclination information Gravity sensor Inclination when the electronic device swipes the card (such as up and down, sideways)
[0154] The direction information and tilt information in the identification data can be referred to as the posture information of the electronic device. It can be understood that the posture information can also include other information in addition to the direction information and tilt information, which is not limited in the embodiments of the present application.
[0155] Exemplarily, Figure 4 is a schematic diagram for distinguishing the posture of the electronic device in the identification data provided by the embodiments of the present application. As Figure 4 shown, the electronic device can determine the direction when swiping the card through the magnetometer. The direction here can be the direction of the line connecting the center of the first side (such as the bottom) to the center of the second side (such as the top) of the electronic device, such as east, south, west, north, northeast, southeast, northwest, southwest, etc.
[0156] For example, when multiple access control devices are in different directions, the direction when the electronic device swipes the card is different, so that the electronic device can distinguish multiple access control cards through the direction.
[0157] Continue to refer to Figure 4, when the line connecting the center of the first side (such as the bottom) and the center of the second side (such as the top) of the electronic device is perpendicular to the ground plane, it can be understood that the inclination of the electronic device is 0, and at this time, it can be understood that the electronic device is perpendicular to the ground plane. When the line connecting the center of the first side (such as the bottom) and the center of the second side (such as the top) of the electronic device is not perpendicular to the ground plane, the inclination of the electronic device is positive or negative.
[0158] For example, Access Control 1, Access Control 2, and Access Control 3 are all perpendicular to the ground plane. When the electronic device uses Card 1 to swipe Access Control 1, it can use a posture perpendicular to the ground plane. When using Card 2 to swipe Access Control 2, it can use a posture with a positive inclination. When using Card 3 to swipe Access Control 3, it can use a posture with a negative inclination. Thus, the electronic device can distinguish Card 1, Card 2, and Card 3 by the inclination.
[0159] In this way, even if multiple non-standard cards (such as access control cards) are in the same geographical fence, the electronic device can distinguish different non-standard cards through the identification data, so that the electronic device can automatically switch the activated non-standard card to avoid manual selection by the user.
[0160] Exemplarily, Figure 5 is a schematic diagram of distinguishing cards in an electronic device through identification data provided by an embodiment of the present application. As Figure 5 shown, NFC device 200b is at height 1, and NFC devices 200c, 200d, 200e, and 200f are at height 2. Assume that the electronic device uses Card 1 to transact with NFC device 200b, uses Card 2 to transact with NFC device 200c, uses Card 3 to transact with NFC device 200d, uses Card 4 to transact with NFC device 200e, and uses Card 5 to transact with NFC device 200f. In this way, when the electronic device 200a swipes the card, it can distinguish Card 1 from Card 2, or Card 1 from Card 3, or Card 1 from Card 4, or Card 1 from Card 5 by different heights.
[0161] See Figure 5 , for Card 2, Card 3, Card 4, and Card 5, when the electronic device uses Card 3 to transact with NFC device 200d, the line connecting the center of the first side (such as the bottom) and the center of the second side (such as the top) of the electronic device is parallel to the ground plane. For example, the electronic device swipes the card horizontally. For example, the direction of the electronic device is east, while when the electronic device uses Card 2, Card 4, and Card 5, it does not swipe the card horizontally. Thus, Card 3 can be distinguished from Card 2, Card 3 from Card 4, and Card 3 from Card 5 by the direction.
[0162] See Figure 5For cards 2, 4, and 5, when the electronic device uses card 4 to conduct a transaction with NFC device 200e, the orientation of the electronic device is different from that of cards 2 and 5, so that the electronic device can distinguish card 4 from cards 2 and 5 by the orientation.
[0163] See Figure 5 For cards 2 and 5, when the electronic device uses card 2 to conduct a transaction with NFC device 200c, the line connecting the center of the first side (such as the bottom) to the center of the second side (such as the top) of the electronic device is perpendicular to the ground plane, and the inclination is 0; while when the electronic device uses card 2 to conduct a transaction with NFC device 200c, the inclination of the electronic device is not 0, so that the electronic device can distinguish cards 2 and 5 by the inclination.
[0164] In this way, even if multiple non-standard cards (such as access control cards) are in the same geographical fence, the electronic device can distinguish different non-standard cards by identifying data, so that the electronic device can automatically switch the activated non-standard card, avoiding the user from manually selecting, and improving the user experience.
[0165] Figure 6 FIG. is a schematic flowchart of updating the smart flash card white list provided by an embodiment of the present application. As Figure 6 shown, the method may include steps 310 to 340.
[0166] 310. The smart flash card App adds card 1 according to the user's operation.
[0167] The smart flash card App may be the wallet App in the electronic device and can be used to manage the cards performing NFC services. The user can perform operations such as adding or deleting cards in the wallet App.
[0168] Exemplarily, the smart flash card App may add card 1 according to the user's operation. For example, the card 1 may be an access control card.
[0169] 320. The smart flash card App generates a smart flash card white list.
[0170] Exemplarily, after the smart flash card App adds card 1 according to the user's operation, the smart flash card App may generate a new smart flash card white list, and the new smart flash card white list includes the newly added card 1.
[0171] When the card 1 is a standard card, the identifier of the card 1 is its application identifier AID, and the identification data of the card 1 is blank. When the card 1 is a non-standard card, the smart flash card App may assign or specify a corresponding identifier for the card 1.
[0172] 330. The smart flash card App sends the smart flash card white list to the smart flash card service.
[0173] It is understandable that the Smart Flash Card App can send the new smart flash card whitelist to the smart flash card service after each update of the smart flash card whitelist.
[0174] 340, the smart flash card service updates the smart flash card whitelist.
[0175] The smart flash card service can update the smart flash card whitelist after receiving the new smart flash card whitelist, so that the smart flash card whitelist in the smart flash card service is up-to-date. This is beneficial for the smart flash card service to automatically switch the activated card according to the smart flash card whitelist subsequently.
[0176] In some examples, the method may further include steps 350 - 360.
[0177] 350, the Smart Flash Card App displays a prompt message to remind the user to use Card 1 to make a single swipe with the NFC device.
[0178] Exemplarily, the Smart Flash Card App can display a prompt message in the display interface. This prompt message can be used to prompt the user to use Card 1 to make a single swipe with the corresponding NFC device. Thus, when the user makes a swipe with Card 1, the electronic device can obtain data from various sensors to determine the identification data of Card 1.
[0179] 360, the smart flash card service uses the obtained identification data as the identification data of Card 1.
[0180] The smart flash card service can obtain data from various sensors of the electronic device when the user makes a swipe with Card 1 to determine the identification data of Card 1 and associate the identification data with Card 1.
[0181] In this way, when the user makes a subsequent swipe, the smart flash card service can obtain the corresponding identification data and perform a match based on the identification data. When Card 1 is matched, Card 1 can be automatically activated to execute the NFC service, thus avoiding the user from manually selecting the card and improving the user experience.
[0182] The following will be combined with Figures 7 - 13 to introduce in detail the technical solution of the method for switching cards in the embodiments of the present application.
[0183] Exemplarily, Figure 7 is a schematic flowchart of a method for switching cards provided by an embodiment of the present application. As Figure 7 shown, the method 400 may include steps 410 to step 480.
[0184] The method 400 can be applied to the scenario where the electronic device 400a conducts an NFC transaction with an NFC device. For example, the NFC device can be an external card reader, such as an access control gate. The electronic device 400a can include multiple access control cards, and at least an NFC module, an SE module, and a smart flash card service can be included in the electronic device 400a.
[0185] 410, the NFC device sends a 14443-3 instruction to the NFC module.
[0186] The 14443-3 instruction is an instruction that supports the international standard protocol for contactless IC cards. Among them, the standard card described in the previous text supports the 14443-4 instruction, and the non-standard card supports the 14443-3 instruction. For the standard card, after the NFC device and the standard card in the electronic device 400a complete the primary handshake through the 14443-3 instruction, relevant transaction instructions are then exchanged through the 14443-4 instruction, such as selecting a certain standard card through the 14443-4 instruction.
[0187] Exemplarily, when the electronic device 400a approaches the NFC device, the NFC device can send a 14443-3 instruction to the NFC module in the electronic device 400a, and the 14443-3 instruction can perform a primary handshake process with the NFC module, etc. For example, the 14443-3 instruction can be used to indicate obtaining the type of the card (standard card or non-standard card).
[0188] 420, the NFC module sends a 14443-3 response instruction to the NFC device.
[0189] The NFC module sends a 14443-3 response instruction to the NFC device to complete the primary handshake process with the NFC device, etc. For example, the 14443-3 response instruction can include the type of the card (standard card or non-standard card).
[0190] 430, the NFC module sends a message indicating the existence of the 14443-3 instruction to the smart flash card service.
[0191] After the NFC module receives the 14443-3 instruction, it can also send a message indicating the existence of the 14443-3 instruction to the smart flash card service.
[0192] 440, the smart flash card service obtains the identification data 1 of the current card swipe.
[0193] After the smart flash card service receives the message indicating the existence of the 14443-3 instruction sent by the NFC module, it can determine that a non-standard card may be required to perform the NFC transaction. Therefore, the smart flash card service can obtain the identification data 1 of the current card swipe. It should be understood that the content included in the identification data 1 can refer to the description in the previous text.
[0194] In some examples, the smart flash card service can also set a timer. For example, the timer can be 800 ms, 600 ms, etc. The embodiments of the present application do not limit the specific value of this timer.
[0195] 450. After the preset time, the smart flash card service does not receive a message with the 14443-4 instruction.
[0196] The embodiments of the present application do not limit the specific execution order of step 440 and step 450. In other examples, step 450 can also be executed before step 440.
[0197] It should be understood that the preset time can be the value of the timer in the foregoing text. After the preset time, the smart flash card service does not receive a message with the 14443-4 instruction, indicating that the NFC device does not send the 14443-4 instruction to the NFC module to select a certain standard card. There may be the following several situations here.
[0198] Exemplarily, when the electronic device 400a is close to the NFC device, the NFC module can default to activate a certain card.
[0199] Situation 1: The NFC device expects a certain standard card, and the card activated by the electronic device 400a at this time is a non-standard card. The NFC device determines that the card activated at this time is a non-standard card in the 14443-3 response instruction, the NFC transaction fails, and the NFC device no longer sends the 14443-4 instruction.
[0200] For situation 1, if the electronic device 400a determines according to the 14443-3 instruction that a standard card needs to be activated, it can automatically switch to a certain default standard card for the next transaction.
[0201] Situation 2: Based on the interaction information of steps 410-420, the NFC device expects a certain non-standard card, and the card activated by the electronic device 400a at this time is the non-standard card expected by the NFC device, and the NFC transaction has been successful. Situation 3: The NFC device expects a certain non-standard card, and the card activated by the electronic device 400a at this time is a standard card or another non-standard card that is not expected by the NFC, and the NFC transaction has failed.
[0202] For situation 3, the electronic device 400a can continue to execute the following steps.
[0203] 460. The smart flash card service matches the non-standard card 1 according to the identification data 1 of the current card swipe.
[0204] Since the Flash Card service has obtained the identification data 1 of the current card swipe, and the Flash Card white list in the Flash Card service includes multiple non-standard cards and their corresponding identification data, the Flash Card service can match the currently obtained identification data 1 with the stored data. When the non-standard card 1 is matched, it indicates that the identification data corresponding to the non-standard card 1 is the same as the currently obtained identification data 1, and thus it can be determined that the non-standard card 1 is the non-standard card expected to be transacted by the external NFC device.
[0205] It should be understood that the specific method by which the Flash Card service matches the card according to the identification data 1 will be described in detail below and will not be elaborated here for the time being.
[0206] In some other examples, the Flash Card service may also fail to match a non-standard card based on the identification data 1 of the current card swipe. This situation will be specifically introduced below and will not be elaborated here for the time being.
[0207] 470, the Flash Card service sends an instruction message to activate the non-standard card 1 to the SE module.
[0208] After the Flash Card service matches the non-standard card 1, it can send an instruction message to activate the non-standard card 1 to the SE module. For example, the Flash Card service can send this instruction message to the COS in the SE module, and the instruction message can include information (such as identification) of the non-standard card 1 to instruct the COS to activate the non-standard card 1.
[0209] 480, the SE module activates the non-standard card 1 according to the instruction message.
[0210] Exemplarily, the COS in the SE module can switch the activated card to the non-standard card 1 according to the instruction message sent by the Flash Card service, so that the electronic device 400a can subsequently use the activated non-standard card to continue NFC transactions.
[0211] In some examples, the method 400 may further include steps 485 - 495.
[0212] 485, the NFC device sends a 14443-3 instruction to the NFC module.
[0213] 490, the NFC module sends a 14443-3 response instruction to the NFC device.
[0214] It should be understood that for the descriptions of steps 485-490, reference can be made to the relevant descriptions of steps 410-420. It can be understood that if the electronic device 400a has been in a state close to the NFC device after step 410, step 485 can be separated from step 410 by a certain time interval. Alternatively, after the first close of the electronic device 400 to the NFC device (the first card swipe) fails, when the user closes the electronic device 400a to the NFC device again (the second card swipe), this step 485 can be executed.
[0215] 495. The NFC device and the electronic device 400a have a successful transaction.
[0216] In this step, since the electronic device 400a has switched the activated card to the non-standard card 1, the NFC device can successfully transact with the electronic device 400.
[0217] For example, if the NFC device is an access control, in this step, the electronic device 400a can successfully open the access control.
[0218] Based on the embodiments of the present application, when the NFC device conducts an NFC transaction with the electronic device, the electronic device can obtain the identification data of the current card swipe. If the currently activated card is not the card expected by the NFC device, the electronic device can match a non-standard card according to the currently obtained identification data. After matching the non-standard card, the activated card can be switched to the matched non-standard card, so that a successful transaction can be made with the NFC device using the non-standard card.
[0219] Figure 8 It is a schematic flowchart of a method for switching cards provided by the embodiments of the present application. As Figure 8 shown, the method 700 may include steps 710 to step 795.
[0220] 710. The NFC device sends a 14443-3 instruction to the NFC module.
[0221] 720. The NFC module sends a 14443-3 response instruction to the NFC device.
[0222] 730. The NFC module sends a message indicating the existence of the 14443-3 instruction to the smart flash card service.
[0223] 740. The smart flash card service obtains the identification data of the current card swipe.
[0224] This step 740 is an optional step. In some examples, this step 740 may not be executed.
[0225] It should be understood that for the descriptions of steps 710-740, reference can be made to the relevant descriptions of steps 410-440 in the foregoing text.
[0226] 750, The NFC device sends a 14443-4 instruction to the NFC module.
[0227] Exemplarily, the 14443-4 instruction can be used to indicate the selection of a certain standard card. For example, the AID of the expected transaction can be carried in the 14443-4 instruction.
[0228] In some cases, if the default activated card in the electronic device 400a is a standard card, but this standard card is not the standard card expected by the NFC device for transaction. Therefore, the electronic device 400a can send a 14443-4 instruction to select the standard card expected for transaction.
[0229] 760, The NFC module sends a message indicating the existence of the 14443-4 instruction to the Flash Card service.
[0230] When the NFC module receives the 14443-4 instruction, it can also send a message indicating the existence of the 14443-4 instruction to the Flash Card service.
[0231] 770, The Flash Card service sends indication information for activating Standard Card 1 to the SE module.
[0232] Exemplarily, based on the 14443-4 instruction, the Flash Card service can determine the standard card to be activated. For example, for Standard Card 1, the Flash Card service can send indication information for activating Standard Card 1 to the SE module.
[0233] For example, the Flash Card service can send this indication information to the COS in the SE module. The indication information can include information (such as an identifier) of Standard Card 1 to instruct the COS to activate Standard Card 1.
[0234] 780, The SE module activates Standard Card 1 according to the indication information.
[0235] Exemplarily, the COS in the SE module can switch the activated card to Standard Card 1 according to the indication information sent by the Flash Card service, so that the electronic device 400a can subsequently use the activated Standard Card 1 to continue NFC transactions.
[0236] In some examples, the method 700 may further include steps 785-795.
[0237] 785, The NFC device sends a 14443-3 instruction to the NFC module.
[0238] 790, The NFC module sends a 14443-3 response instruction to the NFC device.
[0239] It should be understood that for steps 785-790, reference can be made to the relevant descriptions of steps 485-490 in the foregoing text.
[0240] 795. The NFC device and the electronic device 400a have successfully completed a transaction.
[0241] In this step, since the electronic device 400a has switched the activated card to the standard card 1 expected to be selected by the NFC device, the NFC device can successfully complete a transaction with the electronic device 400.
[0242] For example, if the NFC device is an access control, in this step, the electronic device 400a can successfully open the access control.
[0243] Figure 9 It is a schematic flowchart of another method for switching cards provided by an embodiment of the present application. As Figure 9 shown, the method 500 may include steps 501 to 514.
[0244] The method 500 can be applied to the scenario where the electronic device 400a conducts an NFC transaction with an NFC device. For example, the NFC device may be an external card reader, such as an access control gate. The electronic device 400a may include multiple access control cards, and at least may include an NFC module, an SE module, a smart flash card service, and a smart flash card management App, etc.
[0245] 501. The NFC device sends a 14443-3 instruction to the NFC module.
[0246] 502. The NFC module sends a 14443-3 response instruction to the NFC device.
[0247] 503. The NFC module sends a message indicating the existence of the 14443-3 instruction to the smart flash card service.
[0248] 504. The smart flash card service obtains the identification data 2 of the current card swipe.
[0249] 505. After a preset time, the smart flash card service does not receive a message indicating the existence of the 14443-4 instruction.
[0250] It should be understood that steps 501 to 505 can refer to the relevant descriptions of steps 410 to 450 in the foregoing text. For the sake of brevity, they will not be elaborated here.
[0251] 506. The smart flash card service does not match a non-standard card based on the identification data 2 of the current card swipe.
[0252] Since the Flash Card service has obtained the identification data 2 of the current card swipe, and the Flash Card whitelist in the Flash Card service includes multiple non-standard cards and their corresponding identification data, the Flash Card service can match the currently obtained identification data 2 with the stored data. When no corresponding non-standard card is matched, it can be determined that there is a non-standard card swipe event that cannot be recognized by the electronic device.
[0253] 507, the Flash Card service sends a message indicating the existence of an unrecognized non-standard card swipe event to the Flash Card management App and sends the identification data 2.
[0254] Exemplarily, the Flash Card management App is the Wallet App.
[0255] When the Flash Card service fails to match a non-standard card based on the identification data 2, it can send a message indicating the existence of an unrecognized non-standard card swipe event to the Flash Card management App, and send the identification data 2 obtained from the current card swipe to the Flash Card management App.
[0256] 508, the Flash Card management App displays a first prompt message to prompt whether the card swipe is successful.
[0257] Exemplarily, the electronic device 400a can display the first prompt message in the display interface of the Flash Card management App, and the first prompt message can be used to prompt the user whether the card swipe is successful. For example, a display box for the first prompt message can be displayed in the display interface of the Flash Card management App, and the display box can include text content such as "Was this card swipe successful?", "Was the card swipe successful?", etc. The embodiments of the present application do not limit the specific content of the first prompt message.
[0258] It should be understood that in addition to displaying the first prompt message, the display interface of the Flash Card management App can also display a function control 1 for determining successful card swipe and a function control 2 for determining failed card swipe.
[0259] In some other examples, the electronic device 400a can also output the first prompt message by voice. For example, the first prompt message can be "Was this card swipe successful?", "Was the card swipe successful?", etc.
[0260] Based on the user's operation of determining successful or failed card swipe, the electronic device 400a can have the following several solutions.
[0261] Solution A:
[0262] The electronic device 400a continues to execute steps 509a - 511a.
[0263] 509a, when the Flash Card management App detects that the user determines a successful card swipe operation, it updates the identification data of the currently activated non-standard card to the identification data 2.
[0264] Exemplarily, when the Smart Flash Card Management App detects that the user clicks on the function control 1 for determining successful card swiping, it can determine that the current card swiping is successful. In the case where the current card swiping is successful, if the identification data of the currently activated non-standard card is not stored in the electronic device 400a or the stored identification data of the non-standard card is incorrect, resulting in the Smart Flash Card Service failing to match the non-standard card according to the identification data 2, the Smart Flash Card Management App can update the identification data of the currently activated non-standard card to the identification data 2 obtained this time, so that the identification data of the currently activated non-standard card is more accurate.
[0265] 510a, the Smart Flash Card Management App sends a message to the Smart Flash Card Service that the identification data of the activated non-standard card is the identification data 2.
[0266] In some examples, after the Smart Flash Card Management App updates the identification data of the non-standard card to the identification data 2, it can send a message or indication information with the identification data of the updated non-standard card being the identification data 2 to the Smart Flash Card Service. Alternatively, the Smart Flash Card Management App can also send indication information to the Smart Flash Card Service, and this indication information can be used to instruct the Smart Flash Card Service to update the identification data of the non-standard card to the identification data 2, and the Smart Flash Card Service completes the specific update of the identification data.
[0267] In other examples, the Smart Flash Card Management App can also update the Smart Flash Card white list, update the identification data of the non-standard card in the Smart Flash Card white list to the identification data 2, and send the updated Smart Flash Card white list to the Smart Flash Card Service.
[0268] 511a, the Smart Flash Card Service updates the identification data of the activated non-standard card to the identification data 2.
[0269] The Smart Flash Card Service updates the identification data of the activated non-standard card to the identification data 2, so that when the non-standard card is used to perform an NFC transaction again later, the Smart Flash Card Service can directly match the non-standard card according to the obtained identification data.
[0270] In this way, the electronic device has updated the identification data of the activated non-standard card to the identification data obtained from the current card swiping. When the electronic device 400a conducts a transaction with the NFC device again later, the electronic device can successfully match the non-standard card according to the identification data of the card swiping and complete the transaction successfully, without the user having to make a manual selection, which can improve the user experience.
[0271] Solution B, the electronic device 400a continues to execute step 509b.
[0272] 509b, the Smart Flash Card Management App does not detect the user's operation within the preset time T2 and cancels the display of the first prompt message.
[0273] Exemplarily, within a preset time T2, the Smart Flash Card Management App does not detect the user's task operation. For example, if the user does not click the above-mentioned function control 1 or function control 2, the Smart Flash Card Management App may cancel the display of the first prompt message.
[0274] When the user performs any operation on the electronic device within the preset time T2, it is possible that the current card swipe has been successful and the user does not need to perform any further operation. Therefore, the Smart Flash Card Management App may cancel the display of the first prompt message.
[0275] The embodiments of the present application do not limit the specific value of the preset time T2. For example, the preset time T2 may be 2 seconds, 5 seconds, etc.
[0276] Solution C, the electronic device 400a continues to execute steps 509c - 513.
[0277] 509c, the Smart Flash Card Management App detects that the user determines that the card swipe operation has failed and displays a second prompt message to prompt the user to select a target non-standard card.
[0278] Exemplarily, when the Smart Flash Card Management App detects the operation that the user clicks the function control 2 for determining card swipe failure, it can determine that the current card swipe has failed. Then, the Smart Flash Card Management App may display the second prompt message, which can be used to prompt the user to select a target non-standard card.
[0279] In this step 509c, when the Smart Flash Card Management App detects that the user determines that the card swipe operation has failed, it can determine that the currently activated non-standard card is not the card expected by the NFC device, and the Smart Flash Card Management Service fails to match the corresponding non-standard card according to the current identification data 2. Therefore, the user needs to manually select a target non-standard card.
[0280] 510c, the Smart Flash Card Management App updates the identification data of the target non-standard card selected by the user to the identification data 2.
[0281] The Smart Flash Card Management App may update the identification data of the target non-standard card to the currently obtained identification data 2 after detecting that the user selects the target non-standard card, so as to make the identification data of the target non-standard card more accurate.
[0282] 511c, the Smart Flash Card Management App sends the target non-standard card and the identification data 2 to the Smart Flash Card Service.
[0283] At this time, the Smart Flash Card Management App sends the target non-standard card selected by the user and its corresponding identification data 2 to the Smart Flash Card Service, so as to facilitate the Smart Flash Card Service to update the identification data of the target non-standard card and switch the target non-standard card subsequently.
[0284] 512c, the intelligent flash card service updates the identification data of the target non-standard card to identification data 2.
[0285] The intelligent flash card service updates the identification data of the target non-standard card to identification data 2, so that when the target non-standard card is used again to perform an NFC transaction later, the intelligent flash card service can directly match the target non-standard card according to the obtained identification data.
[0286] 513, the intelligent flash card service sends a message to activate the target non-standard card to the SE module.
[0287] Exemplarily, the intelligent flash card service can send the message to activate the target non-standard card to the COS in the SE module. For example, the identification of the target non-standard card can be carried in the message.
[0288] 514, the SE module activates the target non-standard card.
[0289] For example, the COS in the SE module can activate the target non-standard card according to the above message. It should be understood that the SE module activating the target non-standard card can be understood as the SE module switching the originally activated card to the target non-standard card, and the target non-standard card can be directly used for NFC transactions.
[0290] In some examples, the solution C may further include steps 515-517.
[0291] 515, the NFC device sends a 14443-3 instruction to the NFC module.
[0292] 516, the NFC module sends a 14443-3 response instruction to the NFC device.
[0293] It should be understood that for steps 515-516, reference can be made to the relevant descriptions of steps 485-490 in the foregoing text.
[0294] 517, the NFC device and the electronic device 400a complete a successful transaction.
[0295] In this step, since the electronic device 400a has switched the activated card to the target non-standard card selected by the user, the NFC device can complete a successful transaction with the electronic device 400.
[0296] For example, if the NFC device is an access control, in this step, the electronic device 400a can successfully open the access control.
[0297] In this way, when the electronic device 400a conducts a transaction with the NFC device again later, the electronic device can successfully match the target non-standard card according to the identification data of the card swipe and complete a successful transaction without the user having to make a manual selection again, which can improve the user experience.
[0298] The following will combine with Figure 10 to introduce the process of the electronic device in the embodiment of the present application to match the non-standard card through the identification data.
[0299] Figure 10 is a schematic flowchart of matching a non-standard card through identification data provided by an embodiment of the present application. As Figure 10 shown, the matching method 600 may include steps 601 to step 619.
[0300] 601. When the currently activated card of the electronic device is a standard card, determine the number of non-standard cards.
[0301] When the currently activated card is a standard card, the electronic device can match the corresponding non-standard card according to the identification data obtained from this card swipe.
[0302] When the electronic device matches the corresponding non-standard card according to the identification data, it can first determine the number of non-standard cards in the electronic device.
[0303] 602. The electronic device determines whether the number of non-standard cards is 1.
[0304] Exemplarily, the electronic device can determine the number of non-standard cards through the stored intelligent flash card white list. It should be understood that the electronic device can also determine the number of non-standard cards through other means.
[0305] When the electronic device determines that the number of non-standard cards is 1, step 603 can be executed. When the electronic device determines that the number of non-standard cards is not 1, step 604 can be executed.
[0306] 603. The electronic device uses this 1 non-standard card as the matched non-standard card.
[0307] When it is determined that the number of non-standard cards is 1, since there is only 1 non-standard card in the electronic device, this 1 non-standard card can be used as the determined non-standard card.
[0308] When the electronic device determines that the number of non-standard cards is not 1, it means that there are multiple non-standard cards in the electronic device. Then the electronic device can compare the identification data obtained from this card swipe with the identification data of the multiple stored non-standard cards.
[0309] Since the identification data can at least include position information, height information, direction information, and tilt information, the electronic device can make comparisons one by one.
[0310] Exemplarily, the following takes the electronic device as an example to first compare from the position information, then from the height information, and finally from the direction information and tilt information for description.
[0311] 604. The electronic device compares the location information in the current identification data with the location information of all non-standard cards to determine the location difference.
[0312] When the electronic device determines that the number of non-standard cards is not 1, the electronic device can compare the location information in the currently obtained identification data with the location information of all non-standard cards to determine the location difference from each non-standard card. For example, this location difference can be expressed in meters.
[0313] 605. The electronic device determines whether there is a non-standard card with a location difference less than threshold A.
[0314] When the electronic device determines that there is no non-standard card with a location difference less than threshold A, step 606 can be executed. When the electronic device determines that there is a non-standard card with a location difference less than threshold A, step 607 can be executed.
[0315] The embodiments of the present application do not limit the specific value of this threshold A. For example, this threshold A can be 5 meters or 10 meters.
[0316] 606. The electronic device determines that no non-standard card is matched.
[0317] When the electronic device determines that there is no non-standard card with a location difference less than threshold A, it can be determined that the location information in the current identification data is different from the location information of any non-standard card, and thus it can be determined that no non-standard card is matched.
[0318] 607. The electronic device determines whether the number of non-standard cards that meet the foregoing conditions is 1.
[0319] The foregoing condition is that the location difference is less than threshold A. When the electronic device determines that there is a non-standard card with a location difference less than threshold A, it can be determined that there is a non-standard card with the same location information as the location information in the current identification data among multiple non-standard cards.
[0320] In this case, the electronic device can further determine whether the number of this non-standard card is 1.
[0321] 608. When the electronic device determines that the number of non-standard cards is 1, this 1 non-standard card is used as the matched non-standard card.
[0322] Since there is only 1 non-standard card matched according to the location information, it can be determined that this 1 non-standard card is the matched non-standard card.
[0323] When the electronic device determines that the number of non-standard cards is not 1, it can continue to perform height matching among multiple non-standard cards with matching locations.
[0324] 609. The electronic device compares the height information in the current identification data with the height information of multiple non-standard cards with matching locations to determine the height difference.
[0325] For example, if the electronic device matches 5 non-standard cards through location information, it can continue to match the height information in the currently obtained identification data with the height information of these 5 non-standard cards to determine the height differences respectively.
[0326] 610, the electronic device determines whether there is a non-standard card with a height difference less than threshold B.
[0327] When the electronic device determines that there is no non-standard card with a location difference less than threshold B, it can execute step 611. When the electronic device determines that there is a non-standard card with a location difference less than threshold B, it can execute step 612.
[0328] The embodiments of the present application do not limit the specific value of threshold B. For example, threshold B can be 50 meters or 40 meters, etc.
[0329] 611, the electronic device determines that no non-standard card is matched.
[0330] When the electronic device determines that there is no non-standard card with a location difference less than threshold B, it can determine that the height information in the current identification data is different from the height information of multiple non-standard cards that are location-matched, and thus can determine that no non-standard card is matched.
[0331] 612, the electronic device determines whether the number of non-standard cards that meet the foregoing conditions is 1.
[0332] The foregoing conditions are that the location difference is less than threshold B. When the electronic device determines that there is a non-standard card with a location difference less than threshold B, it can further determine whether the number of non-standard cards with a location difference less than threshold B is 1.
[0333] 613, when the electronic device determines that the number of non-standard cards is 1, it uses this 1 non-standard card as the matched non-standard card.
[0334] Since the number of non-standard cards matched according to the height information is only 1, it can be determined that this 1 non-standard card is the matched non-standard card.
[0335] When the electronic device determines that the number of non-standard cards is not 1, it can continue to perform attitude information matching among multiple non-standard cards with matching heights.
[0336] 614, the electronic device compares the attitude information in the current identification data with the attitude information of the non-standard cards with matching heights to determine the attitude difference.
[0337] The electronic device can continue to compare the attitude information in the currently obtained identification data with the attitude information of multiple non-standard cards with matching heights to determine the attitude differences respectively.
[0338] The attitude information may include one or both of direction information and inclination information.
[0339] For example, if the attitude information is direction information, the electronic device may compare the direction information in the currently acquired identification data with the direction information in multiple non-standard cards that match the height, and respectively determine the direction differences from the identification data of the multiple non-standard cards.
[0340] For another example, if the attitude information is inclination information, the electronic device may compare the inclination information in the currently acquired identification data with the inclination information in the identification data of multiple non-standard cards that match the height, and respectively determine the inclination differences from the identification data of the multiple non-standard cards.
[0341] For another example, if the attitude information is direction information and inclination information, the electronic device may compare the direction information and inclination information in the currently acquired identification data with the direction information and inclination information in the identification data of multiple non-standard cards that match the height, and respectively determine the direction differences and inclination differences from the identification data of the multiple non-standard cards.
[0342] 615. The electronic device determines whether there is a non-standard card with an attitude difference less than threshold C.
[0343] 616. When the electronic device determines that there is no non-standard card with an attitude difference less than threshold C, the electronic device determines that no non-standard card is matched.
[0344] Since the electronic device determines that there is no non-standard card with an attitude difference less than threshold C, it can be determined that no corresponding non-standard card is matched by the attitude. And it has been determined before that there are multiple non-standard cards with height matching, but it is impossible to confirm which one. Therefore, the electronic device can determine that no non-standard card is matched.
[0345] It should be understood that the specific value of threshold C in the embodiments of the present application is not limited. For example, when the attitude information is direction information, threshold C can be 5 degrees or 10 degrees. When the attitude information is inclination difference, threshold C can be 5 degrees or 10 degrees.
[0346] 617. The electronic device determines whether the number of non-standard cards that meet the foregoing conditions is 1.
[0347] The foregoing condition is that the attitude difference is less than threshold C. When the electronic device determines that there is a non-standard card with an attitude difference less than threshold C, it further determines whether the number of non-standard cards that meet this condition is 1.
[0348] 618. When the electronic device determines that the number of non-standard cards is 1, it takes this 1 non-standard card as the matched non-standard card.
[0349] When the electronic device determines that the number of non-standard cards is 1, since there is only 1 non-standard card that matches the pose information, it can be determined that this 1 non-standard card is the finally matched non-standard card.
[0350] 619, when the electronic device determines that the number of non-standard cards is not 1, it determines that it is impossible to distinguish from other non-standard cards in terms of pose, and determines that no non-standard card is matched.
[0351] When the electronic device determines that the number of non-standard cards is not 1, it means that there are multiple non-standard cards in the electronic device with the same pose as the identification data currently obtained. The electronic device cannot distinguish the currently obtained identification data from the identification data of these multiple non-standard cards in terms of pose, and it can be determined that no non-standard card is matched.
[0352] In this case, the electronic device can also recommend the current card-swiping posture to the user to distinguish the identification data of the current card from the identification data of other non-standard cards.
[0353] It can be understood that the embodiment of the present application does not limit the comparison order of the position information, height information, and pose information in the identification data. In other examples, the electronic device can also first compare the height information in the identification data, then compare the position information, and then compare the pose information.
[0354] Based on the embodiment of the present application, the electronic device can compare the identification data of the current card swipe with the identification data of other stored non-standard cards to determine whether a corresponding non-standard card can be matched.
[0355] As mentioned above, when the pose information in the identification data currently obtained by the electronic device cannot be distinguished from the identification data of the non-standard card, the electronic device can also recommend the card-swiping posture to the user to distinguish the identification data of the current card from the identification data of other non-standard cards. The following will be combined with Figure 11 introduce this technical solution.
[0356] Exemplarily, Figure 11 is a schematic diagram showing a recommended card-swiping posture for the user provided by the embodiment of the present application. As Figure 11 shown, the electronic device 400a can display a third prompt message in the Smart Flash Card Management App, and this third prompt message can be used to prompt the user to modify the card-swiping method.
[0357] For example, when there is a conflict in the pose information in the identification data, the Smart Flash Card Management App can display the card-swiping posture of the non-standard card A that already exists in the electronic device 400a, and recommend that the user adjust the card-swiping posture. For example, from another angle, it is recommended that the user use the non-standard card B for card swiping.
[0358] The Smart Flash Card Management App can also display an action guide for adjusting the card-swiping posture, so as to guide the user to swipe the card according to the corresponding posture.
[0359] In this way, the identification data of different non-standard cards in the electronic device can be made different, so that when the electronic device swipes a card, the corresponding non-standard card can be matched according to the identification data, and the matched non-standard card can be automatically activated to execute the NFC service, avoiding the user manually switching cards each time.
[0360] In some other examples, when the user adds non-standard card B in the Smart Flash Card Management App, if the user swipes the added non-standard card B according to the guidance of the electronic device, the electronic device can obtain the identification data of this card swipe. If it is determined that the identification data of this card swipe is the same as the identification data of other non-standard cards already stored in the electronic device, the Smart Flash Card Management App can also display the same card swipe posture of non-standard card A already existing in the electronic device, and suggest that the user adjust the card swipe posture. After the user adjusts the card swipe posture, the electronic device uses the obtained identification data as the identification data of non-standard card B. In this way, the identification data of the added non-standard cards in the electronic device can be made different, so that when the electronic device swipes a card, the corresponding non-standard card can be matched according to the identification data, and the matched non-standard card can be automatically activated to execute the NFC service, avoiding the user manually switching cards each time.
[0361] In some cases, when the electronic device recommends a card swipe posture to the user, there can be multiple card swipe postures.
[0362] Exemplarily, Figure 12 is a schematic diagram showing multiple recommended card swipe postures provided by an embodiment of the present application. As Figure 12 shown, there can be multiple card swipe postures of the electronic device. When the electronic device recommends a card swipe posture to the user, it can preferentially display the card swipe postures with a high recommendation degree to the user.
[0363] As Figure 12 shown in the first figure on the left in , when the straight line connecting the center of the first side (such as the bottom) to the center of the second side (such as the top) of the electronic device is perpendicular to the ground plane, it can be understood that the inclination of the electronic device is 0. At this time, it is most convenient for the user to hold the electronic device to swipe the card. Therefore, the recommendation degree of the card swipe posture when the inclination of the electronic device is 0 is the highest, for example, the recommended value is A.
[0364] On this basis, when the electronic device tilts a certain angle to the left and right sides, it is also relatively convenient for the user to hold the electronic device to swipe the card. As Figure 12 shown in the second and third figures on the left in , the recommendation degree of this posture is the second highest, for example, the recommended value is B, where B is less than A.
[0365] When the straight line connecting the center of the first side (such as the bottom) to the center of the second side (such as the top) of the electronic device is parallel to the ground plane, the electronic device is in a horizontal state. As Figure 12As shown in the fourth and fifth figures from the left in [reference], the recommendation degree of this posture is the second lowest. For example, the recommended value is C, where C is less than B.
[0366] On this basis, the electronic device further tilts a certain angle to the left and right sides, such as Figure 12 As shown in the sixth and seventh figures from the left in [reference], the recommendation degree of this posture is the second lowest. For example, the recommended value is D, where D is less than C.
[0367] Such as Figure 12 As shown in the eighth figure from the left in [reference], the posture of the electronic device is opposite to the posture shown in the first figure. At this time, it is the least convenient for the user to hold the electronic device for card swiping. Therefore, the recommendation degree of this posture is the lowest. For example, the recommended value is E, where E is less than D.
[0368] It can be understood that various card swiping postures of the electronic device can be pre-stored in the electronic device. When it is necessary to recommend a card swiping posture to the user, the card swiping postures can be recommended to the user in the order from high to low of the recommendation degree.
[0369] Figure 13 is a schematic flowchart of a method for switching cards provided by an embodiment of the present application. As Figure 13 shown, this method 800 can be applied to an electronic device. The first application program in the electronic device includes a standard card and a non-standard card. This method 800 can include steps 810 to step 840.
[0370] Exemplarily, the first application program can be a Wallet App. That the first application program includes a standard card and a non-standard card can be understood as that standard cards and non-standard cards can be added to the first application program.
[0371] 810. When the electronic device performs a Near Field Communication (NFC) transaction, obtain first identification data of the electronic device, where the first identification data includes location information, height information, or posture information.
[0372] It should be understood that other information, such as air pressure information, etc., can also be included in the first identification data. The first identification data can also include location information, height information, and posture information.
[0373] In some examples, the posture information can include direction information or inclination information, or the posture information can include direction information and inclination information, etc.
[0374] In other examples, the posture information can also include other information for representing the posture of the electronic device, which is not limited in the embodiments of the present application.
[0375] Exemplarily, when the electronic device performs an NFC transaction (swiping the card), the electronic device may obtain the first identification data through a sensor. For the specific manner in which the electronic device obtains the location information, altitude information, and attitude information, reference may be made to the relevant descriptions in the foregoing text.
[0376] 820, the electronic device matches the target non-standard card according to the first identification data.
[0377] The electronic device may match the obtained first identification data with the stored identification data to match the corresponding target non-standard card.
[0378] It should be understood that the identification data of the non-standard card may be stored in the electronic device or in the cloud server.
[0379] 830, the electronic device activates the target non-standard card in the first application.
[0380] When the electronic device matches the target non-standard card, it may activate the target non-standard card to perform an NFC transaction, so that the electronic device automatically switches the activated non-standard card.
[0381] 840, the electronic device uses the target non-standard card to perform an NFC transaction.
[0382] It should be understood that the electronic device uses the activated target non-standard card to perform an NFC transaction. Since the target non-standard card is matched according to the identification data of the electronic device, this NFC transaction can be successful.
[0383] Based on the embodiments of the present application, when the electronic device performs an NFC transaction (swiping the card), the first identification data of the electronic device is obtained, and the target non-standard card is matched according to the first identification data. When the target non-standard card is matched, the target non-standard card is activated in the first application, and the NFC transaction is performed using the target non-standard card.
[0384] In this way, the electronic device can automatically match the corresponding target non-standard card through the identification data during the NFC transaction, and activate the target non-standard card to perform the NFC transaction, thereby avoiding the user from manually switching the card and improving the user experience.
[0385] In some embodiments, when performing a Near Field Communication (NFC) transaction, the method 800 further includes:
[0386] Receiving a first signaling, the first instruction is used to indicate the type of card that the NFC device expects to obtain;
[0387] Sending a first response signaling, the first response signaling is used to indicate the type of card activated by the electronic device;
[0388] Within a preset time, the second signaling is not received, and the second signaling is used to indicate the card that the NFC device expects to transact with.
[0389] For example, the first signaling is a 14443-3 instruction, the first response signaling is a 14443-3 response instruction, and the second signaling is a 14443-4 instruction.
[0390] The preset time can be 800 ms, 600 ms, etc.
[0391] Based on the embodiments of the present application, when an electronic device performs an NFC transaction, it can receive the first signaling sent by the NFC device and send a first response signaling, which is beneficial for the electronic device to determine the type of card expected by the NFC device and beneficial for the NFC device to determine the type of card currently activated by the electronic device.
[0392] In some embodiments, performing an NFC transaction using a target non-standard card includes:
[0393] Receiving the first signaling and performing an NFC transaction using the target non-standard card.
[0394] Based on the embodiments of the present application, when the electronic device receives the first signaling again, it can perform an NFC transaction using the target non-standard card. Since the target non-standard card is matched by the electronic device according to the first identification data, this NFC transaction can succeed.
[0395] In some embodiments, the method 800 further includes:
[0396] When the target non-standard card is not matched, the electronic device displays a first prompt message for prompting whether the NFC transaction is successful.
[0397] It should be understood that the present application does not limit the specific form of the first prompt message. For example, the first prompt message can be a text display box, or the first prompt message can also be displayed separately in a display interface.
[0398] In other examples, when the electronic device does not match the target non-standard card, it can also voice broadcast the first prompt message.
[0399] Since when the electronic device performs an NFC transaction, it will default to activating a card or using the card used in the previous NFC transaction, and this card may or may not be the non-standard card required for this NFC transaction. In the embodiments of the present application, when the target non-standard card is not matched through the first identification data, the electronic device can display a first prompt message to prompt the user whether this NFC transaction is successful. In this way, it is beneficial for the electronic device to determine whether this NFC transaction is successful.
[0400] In some embodiments, the method 800 further includes:
[0401] In response to an operation of determining that the NFC transaction is successful, the electronic device updates the identification data of the non-standard card that performs the NFC transaction to the first identification data.
[0402] For example, the first prompt message may include a confirmation function button, and the operation of determining that the NFC transaction is successful may be an operation in which the user clicks the confirmation function button.
[0403] Based on the embodiments of the present application, when the electronic device detects an operation in which the user determines that the NFC transaction is successful, it means that the identification data of the currently activated non-standard card is inaccurate or the electronic device does not store the identification data of the non-standard card. Therefore, the electronic device can update the identification data of the non-standard card that performs the NFC transaction to the first identification data, which can make the identification data of the non-standard card more accurate, so that when the non-standard card needs to be used to perform an NFC transaction next time, the non-standard card can be successfully matched according to the identification data.
[0404] In some embodiments, the method 800 further includes:
[0405] In response to an operation of determining that the NFC transaction is not successful, the electronic device displays a second prompt message for prompting to select a non-standard card that performs the NFC transaction;
[0406] In response to an operation in which the user selects a second target non-standard card, the electronic device updates the identification data of the second target non-standard card to the first identification data;
[0407] The electronic device uses the second target non-standard card to perform an NFC transaction.
[0408] For example, the first prompt message may include a failure function button, and the operation of determining that the NFC transaction is not successful may be an operation in which the user clicks the failure function button.
[0409] Based on the embodiments of the present application, when the electronic device detects an operation in which the user determines that the NFC transaction is not successful, it means that the currently activated non-standard card is not the non-standard card required for this NFC. Then the electronic device can display a second prompt message to prompt the user to select the required non-standard card; when detecting an operation in which the user selects a second target non-standard card, the identification data of the second target non-standard card is updated to the first identification data, and the second target non-standard card is used to perform an NFC transaction.
[0410] In this way, the second target non-standard card is the non-standard card required for this NFC transaction, but the electronic device fails to match the second target non-standard card through the first identification data, which means that the identification data of the second target non-standard card stored in the electronic device is inaccurate or the identification data of the second target non-standard card is not stored. Therefore, the electronic device can update the identification data of the second target non-standard card to the first identification data, which can make the identification data of the second target non-standard card more accurate, so that when the second target non-standard card needs to be used to perform an NFC transaction next time, the second target non-standard card can be successfully matched according to the identification data.
[0411] In some embodiments, the method 800 further includes:
[0412] If no user operation is detected within a preset time, the first prompt message is cancelled from display.
[0413] Exemplarily, the preset time may be 5 seconds, 8 seconds, or the like.
[0414] Based on the embodiments of the present application, when the electronic device does not detect any user operation within the preset time, the first prompt message can be cancelled from display, thereby saving the power consumption of the electronic device.
[0415] In some embodiments, matching the target non-standard card according to the first identification data includes:
[0416] The electronic device matches the content included in the first identification data with the content included in the preset identification data in a preset order.
[0417] Exemplarily, the preset order may be position information, height information, attitude information, or the preset order may be height information, position information, attitude information, etc. The embodiments of the present application do not limit the specific order in the preset order.
[0418] The preset identification data may be data pre-stored in the electronic device, or the preset identification data may also be stored by the electronic device in a cloud server.
[0419] Based on the embodiments of the present application, the electronic device can match the content included in the first identification data with the content included in the preset identification data in a preset order, so that it is not necessary to compare all the content in the first identification data at the beginning, thereby saving the power consumption of the electronic device.
[0420] In some embodiments, before matching the content included in the first identification data with the content included in the preset identification data in a preset order, the method 800 further includes:
[0421] The electronic device determines the number of non-standard cards;
[0422] If there is a non-standard card, the electronic device uses the non-standard card as the matched target non-standard card;
[0423] If there are multiple non-standard cards, the electronic device matches the content included in the first identification data with the content included in the preset identification data of the multiple non-standard cards in a preset order.
[0424] Based on the embodiments of the present application, before matching the content included in the first identification data with the content included in the preset identification data in a preset order, the electronic device may first determine the number of non-standard cards in the electronic device. When it is determined that there is one non-standard card, the one non-standard card is used as the matched target non-standard card. In this way, the electronic device can simply match the target non-standard card. When the electronic device determines that there are multiple non-standard cards, it matches the content included in the first identification data with the content included in the identification data of the multiple pre-stored non-standard cards one by one in a preset order, thereby saving the power consumption of the electronic device.
[0425] In some embodiments, matching the content included in the first identification data with the content included in the preset identification data of the multiple non-standard cards in a preset order includes:
[0426] The electronic device matches the location information in the first identification data with the location information in the preset identification data of the multiple non-standard cards respectively to determine the non-standard cards that meet the first preset condition;
[0427] When there is one first non-standard card that meets the first preset condition, the electronic device uses the first non-standard card as the matched target non-standard card.
[0428] Exemplarily, referring to Figure 10 , this first preset condition may be that the difference in location information is less than threshold A. The specific value of threshold A in the embodiments of the present application is not limited. For example, threshold A may be 5 meters or 10 meters.
[0429] Since in actual application scenarios, it is a relatively common phenomenon that the geographical locations of multiple non-standard cards (such as access control cards) are different. Therefore, based on the embodiments of the present application, the electronic device may first match according to the location information in the identification data with the location information in the preset identification data of the multiple non-standard cards. When there is one first non-standard card that meets the first preset condition, the first non-standard card is used as the matched target non-standard card. In this way, the electronic device can conveniently match the target non-standard card.
[0430] In some embodiments, the method 800 further includes:
[0431] When there are multiple first non-standard cards that meet the first preset condition, the electronic device matches the height information in the first identification data with the height information in the preset identification data of the multiple first non-standard cards respectively to determine the non-standard card that meets the second preset condition;
[0432] When there is one second non-standard card that meets the second preset condition, the electronic device uses the one second non-standard card as the matched target non-standard card.
[0433] The second preset condition may be that the difference in height information is less than threshold B.
[0434] Based on the embodiments of the present application, when there are multiple first non-standard cards that meet the position information, the electronic device continues to match the height information in the preset identification data of the multiple first non-standard cards. When there is one second non-standard card that meets the second preset condition, the second non-standard card is used as the matched target non-standard card. In this way, the electronic device can conveniently match the target non-standard card.
[0435] In some embodiments, the method 800 further includes:
[0436] When there are multiple second non-standard cards that meet the second preset condition, the electronic device matches the attitude information in the first identification data with the attitude information in the preset identification data of the multiple second non-standard cards respectively to determine the non-standard card that meets the third preset condition;
[0437] When there is one third non-standard card that meets the third preset condition, the electronic device uses the one third non-standard card as the matched target non-standard card.
[0438] The third preset condition may be that the difference in attitude information is less than threshold C.
[0439] Based on the embodiments of the present application, when there are multiple second non-standard cards that meet the height information, the electronic device continues to match the attitude information in the preset identification data of the multiple second non-standard cards. When there is one third non-standard card that meets the third preset condition, the third non-standard card is used as the matched target non-standard card. In this way, the electronic device can conveniently match the target non-standard card.
[0440] In some embodiments, the method 800 further includes:
[0441] When there are multiple third non-standard cards that meet the third preset condition, the electronic device determines that the target non-standard card has not been matched.
[0442] Based on the embodiments of the present application, when the electronic device determines that there are multiple third non-standard cards that meet the third preset condition, it determines that the target non-standard card has not been matched.
[0443] In some embodiments, the method 800 further includes:
[0444] Displaying a third prompt message for prompting that the target non-standard card is not matched.
[0445] Exemplarily, referring to Figure 11 , the third prompt message may be used to prompt the user that they cannot be distinguished from the identification data of other non-standard cards in terms of posture.
[0446] Based on the embodiments of the present application, when the electronic device determines that the target non-standard card is not matched, it can display a third prompt message to prompt the user that the target non-standard card is not matched. This is beneficial for the user to modify the card swiping posture.
[0447] In some embodiments, the method 800 further includes:
[0448] Displaying a fourth prompt message for displaying a recommended posture for the electronic device to perform an NFC transaction.
[0449] Exemplarily, referring to Figure 12 , the fourth prompt message may be used to display the recommended posture of the electronic device 400.
[0450] Based on the embodiments of the present application, the electronic device can also display a fourth prompt message to display the recommended posture for the electronic device to perform an NFC transaction, thereby providing guidance on the card swiping posture for the user and prompting the convenience of the operation.
[0451] In some embodiments, the method 800 further includes:
[0452] The electronic device displays the recommended postures in the order of the priority of the recommended postures.
[0453] Exemplarily, referring to Figure 12 , the electronic device may include multiple recommended postures with a priority order.
[0454] Based on the embodiments of the present application, the priority order of the recommended postures may be pre-stored in the electronic device, so that when recommending the card swiping posture to the user, the recommended postures can be displayed in this priority order.
[0455] In some embodiments, before the electronic device performs an NFC transaction, the method 800 further includes:
[0456] In response to an operation of adding a target non-standard card, the electronic device adds the target non-standard card;
[0457] In response to an operation of performing a second NFC transaction, the electronic device obtains second identification data of the electronic device;
[0458] The electronic device saves the second identification data as the preset identification data of the target non-standard card.
[0459] It should be understood that the second identification data may be the same as or different from the first identification data.
[0460] Based on the embodiments of the present application, when the user adds a target non-standard card and uses the target non-standard card to perform a second NFC transaction, the electronic device can obtain the second identification data of the electronic device and update the identification data of the target non-standard card to the second identification data, which is beneficial for the subsequent matching of the target non-standard card by the electronic device.
[0461] In some embodiments, the attitude information includes direction information or inclination information, or the attitude information includes both direction information and inclination information.
[0462] In other examples, the attitude information may further include other information indicating the attitude of the electronic device by the user, which is not limited in the embodiments of the present application.
[0463] Figure 14 It is a schematic block diagram of an electronic device provided by the embodiments of the present application. As Figure 14 shown, the electronic device 900 may include one or more processors 910; one or more memories 920; the one or more memories 920 store one or more instructions, and when the instructions are executed by the one or more processors 910, the method for switching cards as described in any of the possible implementation manners in the foregoing is executed.
[0464] Exemplarily, the electronic device 900 may be the electronic device 100, the electronic device 200a, the electronic device 400a, etc. in the foregoing.
[0465] The embodiments of the present application further provide a device, including a processor and a communication interface. The communication interface is configured to receive a signal and transmit the signal to the processor, and the processor processes the signal so that the method for switching cards as described in any of the possible implementation manners in the foregoing is executed.
[0466] The device may be a chip. For example, the chip may be a chip system or an independent chip, etc.
[0467] The embodiments of the present application further provide a readable storage medium, in which instructions are stored. When the instructions run on an electronic device, the electronic device is caused to execute the above-mentioned related method steps to implement the method for switching cards in the above embodiments.
[0468] The embodiments of the present application further provide a program product. When the program product runs on an electronic device, the electronic device is caused to execute the above-mentioned related steps to implement the method for switching cards in the above embodiments.
[0469] An embodiment of the present application further provides a switching card device, including modules for implementing the method of switching cards described in any of the previous embodiments.
[0470] In addition, an embodiment of the present application further provides a device, which may specifically be a chip, component or module. The device may include a processor and a memory connected to each other; wherein, the memory is used to store instructions, and when the device runs, the processor may execute the instructions stored in the memory so that the device executes the method of switching cards in each of the above method embodiments.
[0471] Among them, the devices, readable storage media, program products or devices provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be elaborated here.
[0472] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0473] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated here.
[0474] In several embodiments provided by the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.
[0475] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0476] In addition, in each embodiment of the present application, each functional unit may be integrated into one processing unit, may exist physically alone for each unit, or two or more units may be integrated into one unit.
[0477] If the above-mentioned function is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories, random access memories, magnetic disks, or optical discs that can store program codes.
[0478] As described above, the above are only the specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed in the present application can easily think of changes or substitutions, which should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for switching cards, characterized in that, the method is applied to an electronic device, and the first application program of the electronic device includes standard cards and non-standard cards. The method includes: When performing a Near Field Communication (NFC) transaction, obtaining first identification data of the electronic device, where the first identification data includes location information, altitude information, or attitude information of the electronic device; Matching a target non-standard card according to the first identification data; Activating the target non-standard card in the first application program; Performing the NFC transaction using the target non-standard card.
2. The method according to claim 1, characterized in that, when performing a Near Field Communication (NFC) transaction, the method further includes: Receiving a first signaling, where the first instruction is used to indicate the type of card that the NFC device expects to transact; Sending a first response signaling, where the first response signaling is used to indicate the type of card activated by the electronic device; Within a preset time, not receiving a second signaling, where the second signaling is used to indicate the card that the NFC device expects to transact.
3. The method according to claim 2, characterized in that, the performing the NFC transaction using the target non-standard card includes: Receiving the first signaling and performing the NFC transaction using the target non-standard card.
4. The method according to any one of claims 1-3, characterized in that, the method further includes: When the target non-standard card is not matched, displaying a first prompt message, where the first prompt message is used to prompt whether the NFC transaction is successful.
5. The method according to claim 4, characterized in that, the method further includes: In response to an operation of determining that the NFC transaction is successful, updating the identification data of the non-standard card performing the NFC transaction to the first identification data.
6. The method according to claim 4, characterized in that, the method further includes: In response to an operation of determining that the NFC transaction is not successful, displaying a second prompt message, where the second prompt message is used to prompt to select a non-standard card for performing the NFC transaction; In response to an operation of the user selecting a second target non-standard card, updating the identification data of the second target non-standard card to the first identification data; Performing the NFC transaction using the second target non-standard card.
7. The method according to claim 4, characterized in that, the method further includes: Within a preset time, when no operation of the user is detected, canceling the display of the first prompt message.
8. The method according to any one of claims 1-7, characterized in that, the matching the target non-standard card according to the first identification data includes: Matching the content included in the first identification data with the content included in the preset identification data in a preset order.
9. The method according to claim 8, characterized in that, before the matching the content included in the first identification data with the content included in the preset identification data in a preset order, the method further includes: Determining the number of non-standard cards; If there is one non-standard card, using the one non-standard card as the matched target non-standard card; If there are multiple non-standard cards, match the content included in the first identification data with the content included in the preset identification data of the multiple non-standard cards according to a preset order.
10. The method according to claim 9, wherein, the matching of the content included in the first identification data with the content included in the preset identification data of the multiple non-standard cards according to a preset order includes: matching the position information in the first identification data with the position information in the preset identification data of the multiple non-standard cards respectively to determine non-standard cards that meet the first preset condition; when there is one first non-standard card that meets the first preset condition, use the first non-standard card as the target non-standard card that is matched.
11. The method according to claim 10, wherein, the method further includes: when there are multiple first non-standard cards that meet the first preset condition, match the height information in the first identification data with the height information in the preset identification data of the multiple first non-standard cards respectively to determine non-standard cards that meet the second preset condition; when there is one second non-standard card that meets the second preset condition, use the one second non-standard card as the target non-standard card that is matched.
12. The method according to claim 11, wherein, the method further includes: when there are multiple second non-standard cards that meet the second preset condition, match the attitude information in the first identification data with the attitude information in the preset identification data of the multiple second non-standard cards respectively to determine non-standard cards that meet the third preset condition; when there is one third non-standard card that meets the third preset condition, use the one third non-standard card as the target non-standard card that is matched.
13. The method according to claim 12, wherein, the method further includes: when there are multiple third non-standard cards that meet the third preset condition, determine that the target non-standard card is not matched; display a third prompt message for prompting that the target non-standard card is not matched.
14. The method according to claim 3 or 4, wherein, the method further includes: display a fourth prompt message for displaying the recommended attitude for the electronic device to perform the NFC transaction.
15. The method according to claim 14, wherein, the method further includes: the electronic device displays the recommended attitudes in the order of the priority of the recommended attitudes.
16. The method according to any one of claims 1-15, wherein, before the electronic device performs the NFC transaction, the method further includes: in response to an operation of adding the target non-standard card, add the target non-standard card; in response to an operation of performing a second NFC transaction, obtain second identification data of the electronic device; save the second identification data as the preset identification data of the target non-standard card.
17. The method according to any one of claims 1-15, wherein, The attitude information includes direction information or inclination information, or the attitude information includes direction information and inclination information.
18. An electronic device, characterized in that, comprising: one or more processors; one or more memories; the one or more memories store one or more programs, and when the one or more programs are executed by the one or more processors, the method for switching cards according to any one of claims 1-17 is executed.
19. A chip, characterized in that, the chip includes a processor and a communication interface, the communication interface is used to receive a signal and transmit the signal to the processor, and the processor processes the signal so that the method for switching cards according to any one of claims 1-17 is executed.
20. A readable storage medium, characterized in that, the readable storage medium stores instructions, and when the instructions run on an electronic device, the method for switching cards according to any one of claims 1-17 is executed.