WO2022083551A1 - 一种模拟卡的切换方法、电子设备和通信系统 - Google Patents
一种模拟卡的切换方法、电子设备和通信系统 Download PDFInfo
- Publication number
- WO2022083551A1 WO2022083551A1 PCT/CN2021/124450 CN2021124450W WO2022083551A1 WO 2022083551 A1 WO2022083551 A1 WO 2022083551A1 CN 2021124450 W CN2021124450 W CN 2021124450W WO 2022083551 A1 WO2022083551 A1 WO 2022083551A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- card
- protocol
- electronic device
- information
- nfc
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 185
- 230000006854 communication Effects 0.000 title claims abstract description 40
- 238000004891 communication Methods 0.000 title claims abstract description 39
- 230000008569 process Effects 0.000 claims abstract description 136
- 230000004913 activation Effects 0.000 claims description 33
- 238000004088 simulation Methods 0.000 claims description 32
- 230000006870 function Effects 0.000 claims description 22
- 230000004044 response Effects 0.000 claims description 22
- 238000004590 computer program Methods 0.000 claims description 18
- 238000012790 confirmation Methods 0.000 claims description 5
- 230000003213 activating effect Effects 0.000 claims 1
- 230000008859 change Effects 0.000 description 18
- 238000010586 diagram Methods 0.000 description 17
- 238000007726 management method Methods 0.000 description 16
- 238000005516 engineering process Methods 0.000 description 15
- 238000012545 processing Methods 0.000 description 13
- 238000010295 mobile communication Methods 0.000 description 11
- 206010010099 Combined immunodeficiency Diseases 0.000 description 8
- 239000002131 composite material Substances 0.000 description 4
- 238000012546 transfer Methods 0.000 description 4
- 241000209219 Hordeum Species 0.000 description 3
- 235000007340 Hordeum vulgare Nutrition 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 3
- 238000013528 artificial neural network Methods 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000001360 collision-induced dissociation Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 230000007717 exclusion Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000005855 radiation Effects 0.000 description 2
- 230000011664 signaling Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 230000001133 acceleration Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000003416 augmentation Effects 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000007175 bidirectional communication Effects 0.000 description 1
- 210000000988 bone and bone Anatomy 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000003862 health status Effects 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000005236 sound signal Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K17/00—Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations
- G06K17/0022—Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisions for transferring data to distant stations, e.g. from a sensing device
- G06K17/0029—Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisions for transferring data to distant stations, e.g. from a sensing device the arrangement being specially adapted for wireless interrogation of grouped or bundled articles tagged with wireless record carriers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/067—Record carriers with conductive marks, printed circuits or semiconductor circuit elements, e.g. credit or identity cards also with resonating or responding marks without active components
- G06K19/07—Record carriers with conductive marks, printed circuits or semiconductor circuit elements, e.g. credit or identity cards also with resonating or responding marks without active components with integrated circuit chips
- G06K19/0723—Record carriers with conductive marks, printed circuits or semiconductor circuit elements, e.g. credit or identity cards also with resonating or responding marks without active components with integrated circuit chips the record carrier comprising an arrangement for non-contact communication, e.g. wireless communication circuits on transponder cards, non-contact smart cards or RFIDs
- G06K19/0725—Record carriers with conductive marks, printed circuits or semiconductor circuit elements, e.g. credit or identity cards also with resonating or responding marks without active components with integrated circuit chips the record carrier comprising an arrangement for non-contact communication, e.g. wireless communication circuits on transponder cards, non-contact smart cards or RFIDs the arrangement being a circuit for emulating a plurality of record carriers, e.g. a single RFID tag capable of representing itself to a reader as a cloud of RFID tags
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/0013—Methods or arrangements for sensing record carriers, e.g. for reading patterns by galvanic contacts, e.g. card connectors for ISO-7816 compliant smart cards or memory cards, e.g. SD card readers
- G06K7/0034—Methods or arrangements for sensing record carriers, e.g. for reading patterns by galvanic contacts, e.g. card connectors for ISO-7816 compliant smart cards or memory cards, e.g. SD card readers the connector being capable of simultaneously receiving a plurality of cards in the same insertion slot
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/10009—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves
- G06K7/10237—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves the reader and the record carrier being capable of selectively switching between reader and record carrier appearance, e.g. in near field communication [NFC] devices where the NFC device may function as an RFID reader or as an RFID tag
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/10009—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves
- G06K7/10297—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves arrangements for handling protocols designed for non-contact record carriers such as RFIDs NFCs, e.g. ISO/IEC 14443 and 18092
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/22—Payment schemes or models
- G06Q20/227—Payment schemes or models characterised in that multiple accounts are available, e.g. to the payer
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/30—Payment architectures, schemes or protocols characterised by the use of specific devices or networks
- G06Q20/32—Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
- G06Q20/326—Payment applications installed on the mobile devices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/30—Payment architectures, schemes or protocols characterised by the use of specific devices or networks
- G06Q20/32—Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
- G06Q20/327—Short range or proximity payments by means of M-devices
- G06Q20/3278—RFID or NFC payments by means of M-devices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/30—Payment architectures, schemes or protocols characterised by the use of specific devices or networks
- G06Q20/34—Payment architectures, schemes or protocols characterised by the use of specific devices or networks using cards, e.g. integrated circuit [IC] cards or magnetic cards
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/30—Payment architectures, schemes or protocols characterised by the use of specific devices or networks
- G06Q20/34—Payment architectures, schemes or protocols characterised by the use of specific devices or networks using cards, e.g. integrated circuit [IC] cards or magnetic cards
- G06Q20/342—Cards defining paid or billed services or quantities
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/30—Payment architectures, schemes or protocols characterised by the use of specific devices or networks
- G06Q20/34—Payment architectures, schemes or protocols characterised by the use of specific devices or networks using cards, e.g. integrated circuit [IC] cards or magnetic cards
- G06Q20/351—Virtual cards
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/30—Payment architectures, schemes or protocols characterised by the use of specific devices or networks
- G06Q20/34—Payment architectures, schemes or protocols characterised by the use of specific devices or networks using cards, e.g. integrated circuit [IC] cards or magnetic cards
- G06Q20/352—Contactless payments by cards
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/30—Payment architectures, schemes or protocols characterised by the use of specific devices or networks
- G06Q20/36—Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/06—Buying, selling or leasing transactions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/02—Banking, e.g. interest calculation or account maintenance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/40—Business processes related to the transportation industry
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/18—Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M2250/00—Details of telephonic subscriber devices
- H04M2250/04—Details of telephonic subscriber devices including near field communication means, e.g. RFID
Definitions
- the present application relates to the field of near field communication (Near Field Communication, NFC for short), and in particular, to a switching method of an analog card, an electronic device and a communication system.
- NFC Near Field Communication
- NFC is a short-range, high-frequency wireless communication technology that allows contactless point-to-point data transfer between NFC electronic devices within a distance of 10 centimeters. NFC technology has become a relevant international standard and is widely used.
- the present application provides a method, device and communication system for switching an analog card, which are used to improve the efficiency of card swiping.
- an embodiment of the present application provides a communication system, including: a near field communication NFC card reader and an electronic device with NFC function, the electronic device is provided with a first analog card and a second analog card, so The first simulation card is an activation card, the card support protocol of the first simulation card is the first protocol, and the card support protocol of the second simulation card is the second protocol;
- the NFC card reader is used to obtain the first information of the first analog card from the electronic device, determine the first protocol according to the first information and the protocol supported by itself, and execute the first protocol with the electronic device.
- the business process of the first agreement is used to obtain the first information of the first analog card from the electronic device, determine the first protocol according to the first information and the protocol supported by itself, and execute the first protocol with the electronic device.
- the electronic device is configured to modify the protocol information of the first analog card from the first information to the second information if the identification information is not obtained when the business process of the first protocol is executed;
- the NFC card reader is further configured to obtain the second information from the electronic device, determine the second protocol according to the card support protocol corresponding to the second information and the protocol supported by itself, and communicate with the electronic device. executing the business process of the second protocol;
- the electronic device is further configured to, if identification information is acquired when executing the business process of the second protocol, switch the first simulation card to the second simulation card corresponding to the identification information according to the identification information.
- the first protocol includes the ISO14443-3 protocol
- the second protocol includes the ISO14443-3 protocol and the ISO14443-4 protocol.
- the electronic device is further configured to display the default card as the second simulated card in response to the first operation input by the user.
- the first simulated card is an access control card
- the second simulated card is a bus card
- an embodiment of the present application provides a method for switching an analog card, which is applied to an electronic device.
- the electronic device is provided with a first analog card and a second analog card, and the first analog card is an activation card.
- the card support protocol of the first analog card is the first protocol, and the card support protocol of the second analog card is the second protocol; the method includes:
- the protocol information of the first analog card is modified from the first information to the second information;
- the first emulated card is switched to the second emulated card corresponding to the identification information according to the identification information.
- the first protocol includes a protocol that does not select identification information
- the business process of executing the first protocol includes: executing the business process of the protocol that does not select identification information
- the second protocol includes a protocol that does not select identification information and a protocol that selects identification information
- the business process of executing the second specified protocol includes: executing the business process of not selecting identification information and A business process that executes a protocol for selecting identification information.
- the first protocol includes the ISO14443-3 protocol
- the second protocol includes the ISO14443-3 protocol and the ISO14443-4 protocol.
- the identification information includes an application identifier AID.
- the protocol information of the first analog card is a selection confirmation SAK.
- it also includes:
- the default card is presented as the second emulated card.
- it also includes:
- the prompt information is used to prompt the user to swipe the card successfully or fail to swipe the card.
- the first simulated card is an access control card
- the second simulated card is a bus card
- an embodiment of the present application provides an electronic device, the electronic device includes a processor and an NFC controller, the electronic device is provided with a first analog card and a second analog card, the first analog card In order to activate the card, the card support protocol of the first simulation card is the first protocol, and the card support protocol of the second simulation card is the second protocol;
- the NFC controller is configured to send the first information of the first analog card to the NFC card reader, so that the NFC card reader can determine the first protocol according to the first information and the protocol supported by itself, and execute the business process of the first agreement with the electronic device;
- the NFC controller is further configured to send the first service information generated when the NFC card reader and the electronic device execute the service process of the first protocol to the processor;
- the processor is configured to perform information exchange with the NFC controller if the first service information does not include identification information, so that the NFC controller changes the protocol information of the first analog card from the first One information is modified to the second information;
- the NFC controller is further configured to send second information to the NFC card reader, so that the NFC card reader obtains the second information from the electronic device, according to the second information and the protocol supported by itself determining a second agreement, and executing the business process of the second agreement with the electronic device;
- the NFC controller is further configured to send the second service information generated when the NFC card reader and the electronic device execute the service process of the second protocol to the processor;
- the processor is further configured to trigger the second NFC controller if the second service information includes identification information;
- the NFC controller is further configured to switch the first analog card to the second analog card corresponding to the identification information according to the identification information.
- an electronic device including:
- a display screen ; one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions for When the instruction is executed by the device, the device is caused to perform the following steps:
- a display screen ; one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions for When the instruction is executed by the device, the device is caused to perform the following steps:
- the protocol information of the first analog card is modified from the first information to the second information;
- the first emulated card is switched to the second emulated card corresponding to the identification information according to the identification information.
- the device when the instruction is executed by the device, the device is caused to specifically perform the following steps:
- the first protocol includes a protocol that does not select identification information, and executes a business process of the protocol that does not select identification information.
- the device when the instruction is executed by the device, the device is caused to specifically perform the following steps:
- the second protocol includes a protocol that does not select identification information and a protocol that selects identification information, a business process that executes a protocol that does not select identification information, and a business process that executes a protocol that selects identification information.
- the first protocol includes the ISO14443-3 protocol
- the second protocol includes the ISO14443-3 protocol and the ISO14443-4 protocol.
- the identification information includes an application identifier AID.
- the protocol information of the first analog card includes a selection confirmation SAK.
- the device when the instruction is executed by the device, the device is caused to perform the following steps:
- the default card is presented as the second emulated card.
- the device when the instruction is executed by the device, the device is caused to perform the following steps:
- the prompt information is used to prompt the user to swipe the card successfully or fail to swipe the card.
- the first simulated card is an access control card
- the second simulated card is a bus card
- an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium includes a stored program, wherein when the program runs, the device where the computer-readable storage medium is located is controlled to execute the first step.
- the embodiments of the present application provide a computer program product containing instructions, when the computer program product runs on a computer or any at least one processor, the computer causes the computer to execute the second aspect or the second aspect.
- the electronic device adjusts the protocol information of the first simulated card of the activation card, so that the NFC card reader can execute the business process of the specified protocol with the electronic device according to the adjusted protocol information and the protocol supported by itself. , the electronic device obtains the identification information when executing the business process of the specified protocol, and automatically switches the first analog card to the second analog card corresponding to the identification information based on the identification information, realizing automatic card replacement, thereby improving the efficiency of card swiping.
- FIG. 1 is a schematic structural diagram of an NFC communication system in some embodiments
- FIG. 2 is a schematic diagram of a hardware structure of an electronic device in some embodiments
- 3 is a block diagram of a software structure of an electronic device in some embodiments.
- FIG. 4 is a schematic diagram of a card package page of a wallet application in some embodiments.
- 5a to 5d are schematic diagrams of manual card changing in the related art
- 6a to 6b are schematic diagrams of switching analog cards based on location in the related art
- FIG. 7 is a schematic diagram of a switching method of an analog card in some embodiments.
- 8a to 8c are interface schematic diagrams of a bus card swiping operation in some embodiments.
- 9a to 9c are schematic interface diagrams of access control card swiping operations in some embodiments.
- FIG. 10 is a flowchart of a method for switching an analog card in some embodiments.
- 11 is a signaling flow chart of a method for switching an analog card in some embodiments.
- 13 is a flow chart of judging whether to change the card in some embodiments.
- Figure 14 is a flow diagram of switching module cards in some embodiments.
- Figure 15a is a schematic diagram of a scheme of manually changing cards in the related art
- Fig. 15b is a schematic diagram of the scheme of automatic card replacement in the embodiment of the present application.
- FIG. 16 is a flowchart of a method for switching an analog card in other embodiments of the present application.
- NFC is a short-range, high-frequency wireless communication technology that allows contactless point-to-point data transfer between NFC electronic devices within a distance of 10 centimeters.
- the transmission speed of NFC technology includes 106Kbit/s, 212Kbit/s or 424Kbit/s.
- NFC technology has become a relevant international standard and is widely used.
- an NFC communication system is provided, and the NFC communication system may include: an electronic device 100 and an NFC card reader 101 .
- the electronic device 100 refers to an electronic device with an NFC function
- an electronic device with an NFC function may also be referred to as an NFC electronic device.
- Proximity-based contactless communication can be implemented between the electronic device 100 and the NFC card reader 101 .
- the electronic device 100 and the NFC card reader 101 can communicate NFC at lower data rates and can comply with any suitable standard, such as ISO/IEC 7816, ISO/IEC 18092, ECMA-340, ISO/IEC 21481, ECMA- 352, ISO 1444 or ISO 15693 protocols.
- the electronic device 100 and the NFC card reader 101 can also communicate NFC at higher data rates and can comply with any suitable standard, such as the Transfer JetTM protocol.
- the electronic device 100 includes, but is not limited to, onboard Or other operating system devices.
- Electronic device 100 includes, but is not limited to, cell phones, tablet computers, desktop computers, laptop computers, handheld computers, wearable devices, head mounted displays, reader devices, portable music players, portable game consoles, notebook computers, super Ultra-mobile personal computer (UMPC), netbook, and cellular phone, personal digital assistant (PDA), augmented reality (AR) or virtual reality , referred to as: VR) equipment.
- PDA personal digital assistant
- AR augmented reality
- VR virtual reality
- the NFC card reader 101 includes, but is not limited to, an access control card reader, a card reader configured at a bus gate (bus POS machine), a card reader configured at a subway gate, a card reader configured at a gate A card reader for a lock, an NFC payment terminal (eg, a bank card POS machine) configured in a transaction place, a card reader configured on a car door handle, or a card reader configured on a treadmill.
- FIG. 1 only shows some components inside the electronic device 100 , and other components in the electronic device 100 can be referred to as shown in FIG. 2 .
- FIG. 2 a hardware structure diagram of the electronic device 100 in FIG. 1 is provided. As shown in FIG.
- the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a general Serial bus (universal serial bus, USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, a microphone 170C, an earphone 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 and the like.
- SIM subscriber identification module
- the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
- the controller can generate an operation control signal according to the instruction operation code and the timing signal, and complete the control of fetching and executing instructions.
- a memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is cache memory.
- This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
- the processor 110 may include one or more interfaces.
- the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
- I2C integrated circuit
- I2S integrated circuit built-in audio
- PCM pulse code modulation
- PCM pulse code modulation
- UART universal asynchronous transceiver
- MIPI mobile industry processor interface
- GPIO general-purpose input/output
- SIM subscriber identity module
- USB universal serial bus
- the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
- the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
- the charging management module 140 is used to receive charging input from the charger.
- the charger may be a wireless charger or a wired charger.
- the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
- the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 charges the battery 142 , it can also supply power to the electronic device through the power management module 141 .
- the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
- the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160.
- the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance).
- the power management module 141 may also be provided in the processor 110 .
- the power management module 141 and the charging management module 140 may also be provided in the same device.
- the wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
- Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
- Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
- the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
- the mobile communication module 150 may provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 100 .
- the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
- the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
- the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 .
- at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110.
- the modem processor may include a modulator and a demodulator.
- the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
- the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
- the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
- the application processor outputs sound signals through audio devices (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 194 .
- the modem processor may be a separate device.
- the modulation and demodulation processor may be independent of the processor 110, and may be provided in the same device as the mobile communication module 150 or other functional modules.
- the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
- WLAN wireless local area networks
- BT Bluetooth
- GNSS global navigation satellite system
- FM frequency modulation
- NFC near field communication
- IR infrared technology
- the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
- the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
- the wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .
- the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
- the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
- the GNSS may include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou navigation satellite system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
- global positioning system global positioning system, GPS
- global navigation satellite system global navigation satellite system, GLONASS
- Beidou navigation satellite system beidou navigation satellite system, BDS
- quasi-zenith satellite system quadsi -zenith satellite system, QZSS
- SBAS satellite based augmentation systems
- the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
- the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
- the GPU is used to perform mathematical and geometric calculations for graphics rendering.
- Processor 110 may include one or more GPUs that execute instructions to generate or change display information.
- the electronic device 101 can realize the shooting function through an ISP, one or more cameras 193, a video codec, a GPU, one or more display screens 194, an application processor, and the like.
- the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 .
- the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example to save files like music, video etc in external memory card.
- Internal memory 121 may be used to store computer executable program code, which includes instructions.
- the internal memory 121 may include a storage program area and a storage data area.
- the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
- the storage data area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100 and the like.
- the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
- the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
- the electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.
- the sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air 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, and an ambient light sensor 180L, bone conduction sensor 180M, etc.
- the touch sensor 180K is also called “touch device”.
- the touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
- the touch sensor 180K is used to detect a touch operation on or near it.
- the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
- Visual output related to touch operations may be provided through display screen 194 .
- the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the location where the display screen 194 is located.
- the SIM card interface 195 is used to connect a SIM card.
- the SIM card can be contacted and separated from the electronic device 100 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195 .
- the electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
- the SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card and so on. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the plurality of cards may be the same or different.
- the SIM card interface 195 can also be compatible with different types of SIM cards.
- the SIM card interface 195 is also compatible with external memory cards.
- the electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
- the electronic device 100 employs an eSIM, ie: an embedded SIM card.
- the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
- the electronic device 100 further includes: an NFC controller (NFC Controller, NFCC for short) 102 and an NFC transceiver 103 .
- the NFC controller 102 is connected with the processor 110 and the NFC transceiver 103 .
- the NFC controller 102 is mainly used to modulate and demodulate the contactless communication signal and interact with the processor 110 .
- the NFC controller 102 may also be an NFC chip that implements the above functions.
- the NFC transceiver 103 is mainly used to transmit and receive radio frequency signals, and may include an electromagnetic compatibility (EMC) filter circuit, a matching circuit, a receiving circuit, an NFC antenna, and the like.
- EMC electromagnetic compatibility
- the NFC antenna may be a loop antenna for implementing proximity-based contactless communication capability; in other embodiments, the NFC antenna may also be the antenna 2 in FIG. 2 .
- the NFC communication system further includes a safe element (SE for short).
- SE safe element
- the NFC controller 102 implements the methods in the embodiments of the present application by coupling different security units.
- Security cells can exist in various forms.
- the security unit SE1 may be integrated on a printed circuit board (PBC) of the electronic device 100.
- the security unit SE1 may be independent of other software and hardware of the electronic device 100.
- the security unit SE2 can also be integrated in an integrated circuit card (universal integrated circuit card, UICC), for example, the security unit SE2 is integrated in a SIM card (eSIM card), and the SIM card is manufactured and sold by a telecom operator, so that This reduces the cost of electronic equipment manufacturers.
- the security element inSE may also be coupled in the processor 110 .
- the security unit SE 3 may be configured on the server side.
- the security unit may also be integrated on a system-on-chip (System on Chip, SOC for short).
- the electronic device 101 may include one or more secure elements that may operate independently of each other.
- the main function of the security unit is the secure storage of applications and data, and provides secure computing services to the outside world.
- the security unit can also communicate with other electronic devices through the NFC controller 102 to realize the security of data storage and communication process.
- the security element may be a tamper-resistant component used to provide security, confidentiality, and to support various application environments.
- the secure element may also include one or more applications that execute in the secure element's environment (eg, in the secure element's operating system and/or in a Java runtime environment running on the secure element).
- the one or more applications may include one or more applications for NFC payment (eg, Huawei Wallet) stored in the internal memory 121 ,Alipay Wait).
- the security unit also supports the secure isolation of application data, that is, for security, the security unit may not allow access between different applications; the security unit also provides symmetric and asymmetric encryption algorithms and certificate capabilities required by various mobile payment services. Provides a program interface for secure transaction application access and supports bidirectional communication with the NFC controller 102 or processor 110.
- a software structural block diagram of an electronic device 100 is provided.
- the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces.
- the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, and a kernel layer.
- the application layer can include a series of application packages.
- the application package can include applications such as camera, gallery, calendar, call, map, WLAN, Bluetooth, music, video, short message, wallet, etc.
- the wallet may include an NFC wallet, which is a native application installed in the electronic device 100 before the electronic device 100 (eg, a mobile phone) leaves the factory, and the NFC wallet may implement NFC-related functions.
- the NFC wallet may be, for example, Huawei Samsung UnionPay Wallet etc.; and, the NFC wallet can be managed according to the service provider of the application, such as updating the application, adding a bank card, etc.
- the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
- the application framework layer includes some predefined functions. As shown in Figure 3, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, an NFC manager (Nfc Manager), and the like.
- the NFC manager can be used to manage all the NFC adapters indicated in the electronic device 100 .
- the function NfcAdapter can be used to represent the NFC communication-related components of the electronic device 100 (such as the NFC controller 102, the NFC transceiver 103, the security unit, etc.), and the NfcAdapter is the entry for the application to access the NFC function, mainly to obtain an NFC adapter. , you can use the getDefaultAapater() function to get the Adapter supported by the system.
- the NFC manager is also used to process data from NFC-related applications such as an NFC wallet; or, the NFC manager forwards data received from the NFC card reader 101 to NFC-related applications such as an NFC wallet.
- a system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 3D graphics engine (eg: SGL), etc.
- the Android runtime includes core libraries and a virtual machine.
- the Android runtime is responsible for the scheduling and management of the Android system.
- the kernel layer includes display driver, camera driver, audio driver, sensor driver, etc.
- the NFC radio frequency field is generally sent by the NFC card reader 101, and one of 106Kbit/s, 212Kbit/s or 424Kbit/s can be selected as the transmission speed and the electronic device. 100 to communicate.
- the electronic device 100 can sense the radio frequency field emitted by the NFC card reader 101.
- the NFC antenna (or coil) of the electronic device 100 is the load of the NFC card reader 101 transmitting antenna (or coil).
- the NFC card reader 101 is modulated, so that the electronic device 100 can transmit data back to the NFC card reader 101 at the same transmission speed.
- Data transfer of energy from electronic device 100 to NFC reader 101 .
- the ability to obtain data backhaul through the load modulation technology can greatly reduce the power consumption of the electronic device 100 and prolong the battery life.
- the electronic device 100 may have three working modes, namely, a card reader mode (Reader/Writer Mode), a peer-to-peer mode (P2P Mode), and a card emulation mode (Card Emulation Mode).
- the electronic device 100 can emulate an emulated card through the card emulation technology, so as to perform data interaction with the NFC card reader 101 .
- the simulated card refers to a contactless radio frequency card that is simulated by the electronic device 100 through NFC hardware and conforms to NFC-related standards.
- the card simulation mode is mainly used in non-contact scenarios such as consumption, transportation, access control, etc.
- the user can bring the electronic device 100 close to the NFC card reader 101 and enter a password to confirm the transaction or directly receive the transaction, which makes it possible without changing the current status.
- the electronic device 100 can be used to perform non-contact NFC services on the basis of facilities.
- the solutions provided by the embodiments of the present application can be implemented based on the card emulation mode.
- FIG. 4 a schematic diagram of a card package page of a wallet application is provided.
- the card package page includes a status bar 10 , a card package and a page switching bar 20 .
- the status bar 10 includes the operator, current time, network status and power level, as shown in Figure 4, the operator is China Mobile , the current time is 08:08, the network status includes wifi and NFC, and the black part in the power level can represent the remaining power of the electronic device 100 .
- the electronic device 100 can simulate a plurality of simulated cards through the wallet application.
- the simulated cards can include bank cards, bus cards, access control cards, electronic ID cards, smart door lock cards, etc.
- Cards, access control cards, electronic ID cards and smart door lock cards are all categories of analog cards.
- the type of access control card may include a unique identifier (Unique Identifier, UID for short) type or type.
- UID Unique Identifier
- the card package in Figure 4 includes “bank card”, “transportation card” and “key”, where “bank card” includes investment promotion bank credit card and China Construction Bank Savings Card , “Transportation Card” includes Shenzhen Pass , “key” includes access control card and smart door lock card, among which, the access control card includes “my home”, and the smart door lock card includes highland barley smart lock . Users can also add new emulated cards to the card pack.
- the page switching bar 20 includes multiple page switching buttons, and the page switching buttons are used to switch multiple pages in the wallet application.
- the multiple page switching buttons include the “Home” button, “Life” ” button, “card pack” button and “my” button, for example, when the user clicks the “card pack” button, the electronic device 100 displays the card pack page.
- the user can set the default card in the wallet application, for example, as shown in Figure 4, the user sets the access control card "My Home” as the default card.
- the activation card is the access card "My Home”
- the NFC card reader 101 is the card reader of the Shenzhen bus gate. At this time, it is necessary to switch the default card access card to the target card bus card to complete the card swiping operation.
- the access control card is a default card
- the NFC card reader 101 is a card reader of a bus gate. Then when the user swipes the card at the bus gate through the electronic device 100, the default card access control card will pop up on the electronic device 100. As shown in FIG. 5a, the access control card "My Home” will pop up on the electronic device 100; The access control card is switched to the bus card. As shown in Figure 5b, the user clicks the bus card "Shenzhen Pass" on the electronic device 100; as shown in Figure 5c, the access control card "My Home” is switched to the bus card "Shenzhen Pass”.
- the bus card "Shenzhen Pass” pops up on the electronic device 100, and the balance of the bus card is ⁇ 27.18 and a "recharge” button is displayed below the bus card; then, as shown in Figure 5d, the electronic device 100 passes the bus card "Shenzhen Pass". Complete the card transaction at the bus gate.
- the transaction time is 2020/9/14 17:08, the transaction amount is ⁇ 2.00, and the balance of the bus card is ⁇ 25.18.
- the electronic device 100 no matter what type of card reader the NFC card reader 101 is, the electronic device 100 always pops up a default card when detecting the NFC radio frequency field of the NFC card reader 101.
- the NFC card reader 101 is a card reader of a bus gate. At this time, the user needs to manually change the card, and after the card is replaced, the card swiping operation is performed again, thereby reducing the card swiping efficiency.
- NCI NFC Controller Interface
- NCI is a standard protocol for the NFC controller 102 to communicate with the operating system.
- the type of NCI may include command type, notification type or data type.
- the NCI of the notification type is an NCI in which the NFC controller 102 communicates with the NFC card reader 101 and notifies the operating system side of the communication status.
- the electronic device 100 selects the analog card corresponding to the AID according to the acquired AID, and then switches the default card to the analog card corresponding to the AID.
- the default card is an access control card and the NFC card reader 101 is a card reader of a bus gate
- the electronic device 100 cannot recognize the NFC card reader based on the AID
- the electronic device 100 cannot automatically switch the access control card to the bus card based on AID, and the user needs to manually change the card (see Figure 5a to Figure 5d for the manual card change process), and after the card is changed The card swiping operation is performed again, thereby reducing the card swiping efficiency.
- a solution for switching analog cards based on location is provided, a geo-fence is established with the access control card swiping point as the center, and the geo-fence covers a predetermined area (the circle in Fig. 6a). The area shown), the access card swiping point is equipped with an access card reader.
- the activation card of the electronic device 100 is the default card bus card; the user enters the predetermined area of the geo-fence, namely: When the position of the user's electronic device 100 is within the predetermined area of the geo-fence, the electronic device 100 deactivates the default card bus card and activates the access card, so as to switch the bus card to the access card based on the location; the user leaves the predetermined area of the geo-fence, That is, when the position of the user's electronic device 100 is outside the predetermined area of the geo-fence, the electronic device 100 deactivates the access card and activates the default bus card, so as to restore the default bus card.
- the predetermined area of the geo-fence will cover the bus card swiping point (or subway card swiping point), and the bus card swiping point is provided with an NFC card reader. 101.
- the electronic device 100 will switch the default bus card to the access control card as soon as he enters the predetermined area of the geo-fence;
- the NFC card reader 101 is a card reader of a bus gate, since the NFC card reader 101 does not send AID to the electronic device, the electronic device 100 cannot identify the NFC card reader 101 based on the AID.
- the electronic device 100 cannot automatically switch the access control card to the bus card based on AID, and the user needs to manually change the card (see Figure 5a to Figure 5d for the process of manual card change), and swipe the card again after changing the card. operation, thereby reducing the card swiping efficiency.
- the embodiment of the present application provides a method for switching an analog card, which is applied to an electronic device.
- a first simulation card and a second simulation card are arranged on it, the first simulation card is an activation card, the card support protocol of the first simulation card is the first protocol, and the card support protocol of the second simulation card is the first simulation card.
- Two protocols; the method includes: the NFC card reader obtains the first information of the first analog card from the electronic device, determines the first protocol according to the first information and the protocol it supports, and communicates with the electronic device.
- Execute the business process of the first protocol if the electronic device does not obtain identification information when executing the business process of the first protocol, modify the protocol information of the first analog card from the first information to the second information; NFC
- the card reader obtains the second information from the electronic device, determines the second protocol according to the card support protocol corresponding to the second information and the protocol supported by itself, and executes the second protocol with the electronic device.
- the business process if the electronic device obtains identification information when executing the business process of the second protocol, the electronic device switches the first emulation card to the second emulation card corresponding to the identification information according to the identification information.
- the first protocol includes a protocol that does not select identification information
- the business process of executing the first protocol includes: executing the business process of the protocol that does not select identification information
- the second protocol includes a protocol for not selecting identification information and a protocol for selecting identification information
- the business process for executing the second protocol includes: executing a business process for not selecting identification information and executing a business process for selecting identification information The business process of the agreement.
- the identification information includes AID; the protocol information of the first analog card includes selection confirmation (Select AcKnowledge, SAK for short).
- the electronic device includes a processor and an NFC controller.
- the NFC controller sends the first information of the first analog card to the NFC card reader, so that the NFC card reader can determine the first protocol according to the first information and the protocol supported by itself, and communicate with the electronic card.
- the device executes the business process of the first protocol.
- the NFC controller sends first service information generated when the NFC card reader and the electronic device execute the service process of the first protocol to the processor. If the first service information does not include identification information, the processor exchanges information with the NFC controller, so that the NFC controller modifies the protocol information of the first analog card from the first information for the second information.
- the NFC controller sends the second information to the NFC card reader, so that the NFC card reader obtains the second information from the electronic device, and determines the second protocol according to the second information and the protocol supported by itself, and execute the business process of the second protocol with the electronic device; the NFC controller sends the second service information generated when the NFC card reader and the electronic device execute the business process of the second protocol to the electronic device. the processor described above. If the second service information includes identification information, the processor triggers the second NFC controller. The NFC controller switches the first emulated card to a second emulated card corresponding to the identification information according to the identification information.
- the first service information includes the first NCI flow.
- the processor is specifically configured to determine that the first service information does not include identification information if the NFC radio frequency activation notification message in the first NCI stream sent by the NFC controller is not received within the first set time period; or , the processor is specifically configured to receive the NFC radio frequency activation notification message in the first NCI stream sent by the NFC controller within the first set time period, and not receive the NFC controller within the second set time period
- the sent AID notification message in the first NCI stream determines that the first service information does not include identification information.
- the second service information includes a second NCI flow.
- the processor is specifically configured to receive the NFC radio frequency activation notification message in the second NCI stream sent by the NFC controller within the first set time period, and receive the message sent by the NFC controller within the second set time period.
- the AID notification message in the second NCI stream it is determined that the second service information includes identification information.
- the information exchange with the NFC controller specifically includes: if the first service information does not include identification information, the processor specifically includes: information, send a configuration control command to the NFC controller; the NFC controller sends a configuration control command response message to the processor; the processor sends a parameter configuration command to the NFC controller, and the parameter configuration command includes the first Second information; the NFC controller sends a parameter configuration command response message to the processor.
- the processor is configured to, if the second service information includes identification information, perform information exchange with the NFC controller, so that the NFC controller converts the protocol of the first analog card The information is modified from the second information to the first information.
- the information exchange between the processor and the NFC controller specifically includes: if the first service information includes identification information, the processor sends the information to the NFC controller.
- the controller sends a configuration control command; the NFC controller sends a configuration control command response message to the processor; the processor sends a parameter configuration command to the NFC controller, the parameter configuration command includes first information; the NFC The controller sends a parameter configuration command response message to the processor.
- the electronic device adjusts the protocol information of the first simulated card of the activation card, so that the NFC card reader can execute the business process of the specified protocol with the electronic device according to the adjusted protocol information and the protocol supported by itself, and the electronic device executes the business process of the specified protocol.
- the identification information is obtained when specifying the business process of the protocol, and the first simulation card is automatically switched to the second simulation card corresponding to the identification information based on the identification information, thereby realizing automatic card replacement, thereby improving the efficiency of card swiping.
- the electronic device is provided with a first analog card and a second analog card.
- the first emulated card is different from the second emulated card.
- the first simulated card is an access control card
- the second simulated card is a bus card.
- the first simulated card is the access control card "My Home”
- the second simulated card is the bus card "Shenzhen Pass”.
- the electronic device simulates different types of simulated cards through the card simulation technology.
- the simulated cards can include local bus cards, interconnection traffic cards, my home access control cards, and highland barley smart lock cards.
- different local bus cards may have different types, for example, the local bus cards may include Shenzhen Tong, Shanghai Tong, etc., and Shenzhen Tong and Shanghai Tong are different types of analog cards.
- different interconnection traffic cards may be of the same type.
- interconnection transportation cards may include Shenzhen interconnection cards, Beijing-Tianjin-Hebei interconnection cards, etc. Shenzhen interconnection cards and Beijing-Tianjin-Hebei interconnection cards are the same type of analog card.
- simulated cards are exemplary descriptions of the embodiments of the present application, and the simulated cards may also include other types of simulated cards, which are not limited in the embodiments of the present application.
- SAK is used to represent the card support protocol
- the card support protocol is the protocol supported by the analog card.
- one type of emulated card may have one SAK, and one SAK may correspond to one or more card supported protocols.
- the composite card refers to an analog card that supports both the ISO14443-3 protocol and the ISO14443-4 protocol.
- the NFC card reader 101 may include a card reader at a Shenzhen bus gate, a card reader at a Shanghai bus gate, a community access control card reader, a company access control card reader, a highland barley smart lock card reader, and the like. type of card reader. It should be noted that the NFC card readers listed above are exemplary descriptions of the embodiments of the present application, and the NFC card readers may also include other types of card readers, which are not limited in the embodiments of the present application.
- one type of card reader may support one or more protocols.
- the protocols supported by the community access control card reader include ISO14443-3 protocol
- the protocols supported by the card reader of Shenzhen bus gates include ISO14443-3 protocol and ISO14443-4 protocol
- the protocols supported by the card reader of Shanghai bus gates include ISO14443-3 protocol and ISO14443-4 protocol.
- the AID is the ID of the applet (Application) stored in the security unit or the application on the operating system side.
- one AID corresponds to one type of analog card.
- the AID can be used to indicate the card reading type of the NFC card reader. Therefore, if the electronic device obtains the AID, it can identify the card reading type of the card reader according to the AID.
- the electronic device can switch the activation card to the analog card corresponding to the AID based on the AID, thereby realizing automatic card replacement and improving the efficiency of card swiping.
- the analog card corresponding to the AID is Shenzhen Tong.
- the AID is A000000632010105
- the analog card corresponding to the AID is the Shenzhen Connect Interconnection Card. Since the Beijing-Tianjin-Hebei Interconnection Card and the Shenzhen Interconnection Card are the same type of analog card, the AID corresponding to the Beijing-Tianjin-Hebei Interconnection Card is also A000000632010105.
- the protocol supported by the cell access control card reader is the ISO14443-3 protocol. Since the ISO14443-3 protocol is a protocol that does not select AID, the cell access control card reader does not have the corresponding AID.
- the card reading type of the NFC card reader may include the types of analog cards that the electronic device can read. As shown in Table 2 above, one NFC card reader may correspond to one or more AIDs, in other words, one NFC card reader can read Get one or more types of analog cards.
- the card reader of Shenzhen bus gate corresponds to two AIDs, then the card reader of Shenzhen bus gate can read two types of analog cards, Shenzhen Tong and Shenzhen Tong Interconnection Card; the card reader of Shanghai bus gate If the device corresponds to an AID, the card reader of the Shanghai bus gate can read a type of analog card from Shanghai Tong.
- the protocol that does not select AID includes the ISO14443-3 protocol
- the business process does not execute the business process of the ISO14443-4 protocol.
- the NFC card reader executes the business process of not selecting AID. Therefore, the ISO14443-3 protocol can be called the protocol of not selecting identification information (AID).
- the NFC card reader may determine the first protocol based on the protocols supported by the SAK and the NFC card reader, and execute the business process of the first protocol with the electronic device. After the NFC card reader reads the SAK from the electronic device, the card support protocol corresponding to the SAK can be determined according to the SAK, and then the first protocol can be determined according to the card support protocol corresponding to the SAK and the protocol supported by the NFC card reader. The electronic device executes the business process of the first protocol.
- the card support protocol corresponding to SAK includes the protocol that does not select AID (for example, ISO14443-3 protocol), and the protocol supported by the NFC card reader includes the protocol that does not select AID (for example, ISO14443-3 protocol) and the protocol that selects AID protocol (for example, ISO14443-4 protocol)
- the first protocol determined by the NFC card reader includes a protocol that does not select AID (for example, ISO14443-3 protocol);
- the card support protocol corresponding to SAK includes not selecting AID protocol (for example, ISO14443-3 protocol), and the protocol supported by the NFC card reader includes the protocol that does not select AID (for example, ISO14443-3 protocol), then the first protocol determined by the NFC card reader includes the protocol that does not select AID protocol (for example, ISO14443-3 protocol);
- the card support protocol corresponding to SAK includes a protocol that does not select AID (for example, ISO14443-3 protocol) and a protocol that selects AID (for example, ISO14443-4 protocol), and the N
- the card support protocol corresponding to the SAK includes the protocol for selecting the AID (for example, the ISO14443-4 protocol). Then, the NFC card reader can also determine the second protocol based on the protocols supported by the SAK and the NFC card reader, and execute the business process of the second protocol with the electronic device. When the NFC card reader reads the SAK from the electronic device again, it can determine the card support protocol corresponding to the SAK according to the SAK read again, and then determine the first card support protocol according to the card support protocol corresponding to the SAK and the protocol supported by the NFC card reader.
- the card support protocol corresponding to the SAK includes the protocol for selecting AID (for example, the ISO14443-4 protocol).
- the protocol supported by the NFC card reader includes the protocol for not selecting the AID (for example, the ISO14443-3 protocol)
- the second protocol determined by the NFC card reader includes a protocol that does not select AID (eg, ISO14443-3 protocol); if the protocol supported by the NFC card reader includes a protocol that does not select AID (eg, ISO14443-3 protocol) and select AID protocol (for example, ISO14443-4 protocol)
- the NFC card reader determines that the second protocol includes a non-AID-selected protocol (for example, ISO14443-3 protocol) and an AID-selected protocol (for example, ISO14443-4 protocol).
- the electronic device will generate the second NCI stream. If the second protocol includes a protocol that does not select AID (eg, ISO14443-3 protocol) and a protocol that selects AID (eg, ISO14443-4 protocol), the NFC card reader is in the process of executing the business process of the second protocol with the electronic device. , the AID will be sent to the electronic device, so the second NCI stream generated by the electronic device includes the AID, and then the electronic device determines that the second NCI stream includes the AID, and determines that the card replacement condition is met, and a card replacement operation is required.
- AID eg, ISO14443-3 protocol
- a protocol that selects AID eg, ISO14443-4 protocol
- the NFC card reader will not send the AID to the electronic device during the process of executing the business process of the second protocol with the electronic device, so the electronic device The generated second NCI stream does not include the AID, and if the electronic device determines that the second NCI stream does not include the AID, it determines that the card replacement condition is not met, and a card replacement operation is not required.
- AID for example, the ISO14443-3 protocol
- the NFC card reader determines that the first protocol includes a protocol that does not select AID (for example, ISO14443-3 protocol) and a protocol that selects AID (for example, ISO14443-4 protocol)
- the NFC card reader and the electronic device In the process of executing the business process of the first protocol, the NFC card reader and the electronic device first execute the business process of the protocol that does not select AID (for example, ISO14443-3 protocol), and then execute the protocol that selects AID (for example, ISO14443- 4 agreement) business process.
- the NFC card reader determines that the second protocol includes a protocol that does not select AID (for example, ISO14443-3 protocol) and a protocol that selects AID (for example, ISO14443-4 protocol)
- the NFC card reader and the electronic device In the process of executing the business process of the second protocol, the business process of the protocol that does not select AID (for example, ISO14443-3 protocol) is executed first, and then the business process of the protocol that selects AID (for example, ISO14443-4 protocol) is executed.
- the activation card is an access card.
- the user can set the default card as the access card on the electronic device, so that the activation card is the access card; or, as shown in Figure 6b, establish a geo-fence with the access card reader as the center, and the predetermined area of the geo-fence covers the bus gate.
- the user can set the default card as the bus card on the electronic device, and switch the default card bus card to the access control card based on the geofencing technology.
- Figure 6b For a detailed description, please refer to the description of Figure 6b.
- the user moves from the home in the cell to a bus stop outside the cell along the path S1, and performs a card swiping operation at the bus gate.
- the user places the back of the electronic device 100 close to the card reader of the bus gate.
- the electronic device 100 displays a prompt of “running the smart card” and a prompt of “please bring the back of the mobile phone to the card swiping area”.
- the card reader of the bus gate determines that the card support protocol corresponding to SAK is ISO14443-3 according to the read SAK (0x08).
- the card reader of the bus gate is based on the ISO14443-3 protocol corresponding to SAK and the ISO14443 supported by itself.
- -3 protocol and ISO14443-4 protocol determine that the first protocol includes the ISO14443-3 protocol, and execute the business process of the ISO14443-3 protocol.
- the electronic device 100 determines that the NCI stream generated when the business process of the ISO14443-3 protocol is executed does not include the AID, so the access control card cannot be switched to the bus card corresponding to the AID based on the AID.
- the card support protocol corresponding to the SAK is ISO14443-4 protocol
- the protocol supported by the card reader of the bus gate itself is the ISO14443-4 protocol
- the bus gate According to the ISO14443-3 protocol corresponding to SAK and the ISO14443-3 protocol and ISO14443-4 protocol supported by SAK, the card reader of the machine determines that the second protocol includes the ISO14443-3 protocol and the ISO14443-4 protocol, and implements the ISO14443-3 protocol and the ISO14443-4 protocol.
- the business process of the ISO14443-4 protocol is the ISO14443-4 protocol.
- the electronic device 100 determines that the NCI stream generated when the business process of the ISO14443-3 protocol and the ISO14443-4 protocol is executed includes the AID, determines to perform a card replacement operation, and then switches my home access control card to the bus corresponding to the AID based on the AID.
- Card Shenzhen Pass that is, the electronic device 100 deactivates my home access control card and activates "Shenzhen Pass". As shown in Figure 8b, the activated bus card "Shenzhen Pass" pops up on the electronic device 100, and the bus card “Shenzhen Pass” pops up. The bottom of the card shows the balance of the bus card is ⁇ 27.18 and the "recharge" button.
- the electronic device 100 completes the card swiping transaction with the bus gate through the bus card "Shenzhen Pass". As shown in Figure 8c, the electronic device 100 displays that the transaction amount is ⁇ 2.00 and the transaction time is 2020/9/14 17: 08, and the balance of the bus card is displayed as ⁇ 25.18.
- the user after getting off the bus, the user first moves from the bus stop to the location of the access control card reader of the community along the path S2, and swipes the card at the access control card reader. .
- the user brings the back of the electronic device close to the access card reader.
- the electronic device 100 displays a prompt of "running smart card” and a prompt of "please bring the back of the mobile phone to the card swiping area".
- the access control card reader obtains that the corresponding card supporting protocol of the SAK is ISO14443-4 protocol, while the protocol supported by the access control card reader itself is ISO14443-3 protocol, no matter what the value of SAK is, Which protocol is the card support protocol corresponding to SAK? Since the protocol supported by the access control card reader is the ISO14443-3 protocol, the access control card reader is based on the ISO14443-4 protocol corresponding to SAK and the ISO14443-3 protocol supported by itself.
- the second protocol is determined with the ISO14443-4 protocol
- the second protocol is finally determined as the ISO14443-3 protocol
- the business process of the ISO14443-3 protocol is executed with the electronic device.
- the electronic device 100 determines that the NCI stream generated when executing the business process of the ISO14443-3 protocol does not include AID, and cannot perform the AID-based card replacement operation, so the access control card will not be replaced.
- the access card "My Home” is popped up on the electronic device 100.
- the electronic device 100 completes the card swiping operation through the access control card and the access control card reader.
- the electronic device 100 displays "card swipe successfully", and then the door of the community is opened, and the user continues to move along the path S2 to the location of the home.
- FIG. 4 the schematic interface diagrams of the electronic device shown in FIG. 4 , FIG. 8 a to FIG. 8 c , and FIG. 9 a to FIG. 9 c are exemplary displays of the embodiments of the present application, and the schematic interface schematic diagrams of the electronic device may also be in other styles. The embodiment does not limit this.
- FIG. 10 is a flowchart of a method for switching an analog card in some embodiments
- FIG. 11 is a signaling flowchart of a method for switching an analog card in some embodiments. As shown in FIGS. 10 and 11 , the method includes:
- Step 102 the electronic device activates the first simulation card, so that the first simulation card is an activation card.
- the first simulated card is an access control card.
- the user can set the default card as the access card on the electronic device, and the access card is the activation card.
- the access card is the activation card.
- a geo-fence is established with the access card swiping device as the center, and when the electronic device enters the predetermined area of the geo-fence, the access card is activated, so that the access card is an active card.
- the first simulated card may also be a Shenzhen Tong bus card.
- the user can set the default card as the Shenzhen Tong bus card on the electronic device, and the Shenzhen Tong bus card is the activation card.
- the NFC controller of the electronic device activates the first analog card.
- Step 104 The electronic device receives the NFC field strength information sent by the NFC card reader.
- the electronic device is close to the NFC card reader, and the NFC controller of the electronic device receives the NFC field strength information sent by the NFC card reader, indicating that the NFC controller detects the NFC radio frequency field sent by the NFC card reader. Further, the NFC controller sends the field strength information to the NFC card reader and receives the response information.
- the NFC card reader performs information interaction with the electronic device in a polling manner.
- Step 106 the NFC card reader acquires the protocol information of the first analog card from the electronic device, where the protocol information of the first analog card includes the first information.
- the protocol information of the first emulated card includes SAK.
- the first information can be used to indicate that the AID protocol is not selected, and the card support protocol corresponding to the first information includes the protocol that does not select the AID.
- the first information may be used to indicate the protocol for selecting the AID, and the card support protocol corresponding to the first information includes the protocol for selecting the AID.
- the first simulated card may include a Shenzhen Tong bus card.
- This step can specifically include:
- Step 1062 the NFC card reader sends a protocol information read request.
- Step 1064 In response to the received protocol information read request, the electronic device sends the first information to the NFC card reader.
- the NFC controller of the electronic device sends the first information to the NFC card reader in response to the received request for reading the protocol information.
- Step 108 the NFC card reader determines the first protocol according to the first information and the protocol supported by the NFC card reader, and executes the business process of the first protocol with the electronic device.
- the NFC card reader determines the card support protocol corresponding to the first information according to the first information, and then determines the first protocol according to the card support protocol corresponding to the first information and the protocol supported by the NFC card reader, and communicates with the electronic device. Execute the business process of the first protocol.
- Step 110 The electronic device determines whether the protocol information adjustment conditions are met according to the first NCI flow generated when the NFC card reader executes the business process of the first protocol. If yes, go to step 112;
- the electronic device determines that the adjustment condition of the protocol information is satisfied, it indicates that the SAK needs to be adjusted; if the electronic device determines that the adjustment condition of the protocol information is not satisfied, it indicates that the SAK does not need to be adjusted.
- the electronic device determines that the first NCI stream does not include AID, it determines that the protocol information adjustment condition is satisfied; if the electronic device determines that the first NCI stream includes AID, it determines that the protocol information adjustment condition is not satisfied.
- the NFC controller may send the first NCI stream to the processor.
- this step may specifically include:
- Step 1102 Whether the processor receives the NFC radio frequency activation notification message in the first NCI stream sent by the NFC controller within the first set time period, if so, executes step 1104; if not, executes step 112.
- step 1104 If the processor receives the NFC radio frequency activation notification message in the first NCI stream within the first set time period, continue to perform step 1104; if the processor does not receive the NFC radio frequency in the first NCI stream within the first time period When the notification message is activated, there is no need to continue waiting to receive the AID notification message in the first NCI stream, it is directly determined that the protocol adjustment condition is satisfied, and step 112 is continued.
- Step 1104 whether the processor receives the AID notification message in the first NCI stream sent by the NFC controller within the second set time period, and the AID notification message in the first NCI stream includes the AID, if so, execute step 130 ; if not, go to step 112.
- the processor determines that the protocol adjustment condition is not met, and proceeds to step 130; if the processor does not receive the message within the second set time period The AID notification message in the first NCI stream determines that the protocol adjustment condition is satisfied, and proceeds to step 112 .
- Step 112 The electronic device configures the protocol information of the first analog card as the second information.
- the first information can be used to indicate the protocol for selecting the AID
- the card support protocol corresponding to the second information includes the protocol for selecting the AID.
- the electronic device modifies the SAK from 0x08 to 0x20 or 0x28.
- this step may specifically include:
- Step 1122 The processor sends a configuration control command (NFCC_CONFIG_CONTROL) to the NFC controller.
- NFCC_CONFIG_CONTROL a configuration control command
- the configuration control command is used to represent the standard protocol of NCI2.0, through which the configuration control command carries the specified parameter value, instructing the NFC controller to run the host (Host) on the electronic device side to configure the chip parameters.
- Step 1124 The NFC controller sends a configuration control command response message to the processor.
- Step 1126 The processor sends a parameter configuration command (CORE_SET_CONFIG_CMD) to the NFC controller, where the parameter configuration command includes the second information.
- CORE_SET_CONFIG_CMD a parameter configuration command
- the parameter configuration command is used to represent the standard protocol of NCI1.0, and the parameter configuration command carries the second information, informing the NFC controller to configure the SAK as the second information.
- Step 1128 The NFC controller sends a parameter configuration command response message to the processor.
- Step 1130 The NFC controller configures the protocol information of the first analog card as the second information.
- the NFC controller modifies the SAK from 0x08 to 0x20 or 0x28.
- Step 114 The electronic device receives the NFC field strength information sent by the NFC card reader.
- Step 116 the NFC card reader acquires the second information from the electronic device.
- This step can specifically include:
- Step 1162 the NFC card reader sends a protocol information read request to the electronic device.
- Step 1164 The electronic device sends the second information to the NFC card reader in response to the received request for reading the protocol information.
- the NFC controller of the electronic device sends the second information to the NFC card reader in response to the received request for reading the protocol information.
- Step 118 The NFC card reader determines the second protocol according to the second information and the protocol supported by the NFC card reader, and executes the business process of the second protocol with the electronic device.
- the NFC card reader determines the card support protocol corresponding to the second information according to the SAK, then determines the second protocol according to the card support protocol corresponding to the second information and the protocol supported by the NFC card reader, and executes the first protocol with the electronic device. II protocol business process.
- Step 120 The electronic device determines whether the card replacement condition is met according to the second NCI flow generated when the NFC card reader executes the business process of the second protocol. If so, execute step 122; if not, execute step 128.
- the electronic device determines that the card replacement condition is satisfied, it indicates that the first analog card needs to be replaced; if the electronic device determines that the card replacement condition is not satisfied, it indicates that the first analog card does not need to be replaced.
- the electronic device determines that the second NCI stream includes AID, it determines that the card replacement condition is satisfied; if the electronic device determines that the second NCI stream does not include AID, it determines that the card replacement condition is not satisfied.
- the NFC controller may send the second NCI stream to the processor.
- this step may specifically include:
- Step 1202 Whether the processor receives the NFC radio frequency activation notification message in the second NCI stream sent by the NFC controller within the first set time period, if so, executes step 1204; if not, executes step 128.
- step 1204 If the processor receives the NFC radio frequency activation notification message in the second NCI stream within the first set time period, proceed to step 1204; if the processor does not receive the NFC radio frequency in the second NCI stream within the first time period When the notification message is activated, there is no need to continue waiting to receive the AID notification message in the second NCI stream, it is directly determined that the card replacement condition is not satisfied, and step 128 is continued.
- Step 1204 whether the processor receives the AID notification message in the second NCI stream sent by the NFC controller within the second set time period, and the AID notification message in the second NCI stream includes the AID, if not, execute the step 128; if yes, go to step 122.
- the processor determines that the card replacement is satisfied, and proceeds to step 122; if the processor does not receive the second The AID notification message in the NCI stream determines that the card replacement condition is not met, and proceeds to step 128.
- Step 122 The electronic device configures the protocol information of the first analog card as the first information.
- the electronic device modifies the SAK from 0x20 or 0x28 to 0x08, so as to restore the SAK to 0x08.
- this step may specifically include:
- Step 1222 the processor sends a configuration control command to the NFC controller.
- Step 1224 The NFC controller sends a configuration control command response message to the processor.
- Step 1226 The processor sends a parameter configuration command to the NFC controller, where the parameter configuration command includes the first information.
- Step 1228 The NFC controller sends a parameter configuration command response message to the processor.
- Step 1230 The NFC controller configures the protocol information of the first analog card as the first information.
- the NFC controller restores the SAK from 0x20 or 0x28 to 0x08.
- Step 124 The electronic device switches the first analog card to the second analog card corresponding to the AID in the second NCI stream according to the AID in the second NCI stream.
- the second NCI stream may include one or more AIDs.
- the electronic device can switch the first analog card to the second analog card corresponding to the AID according to the AID.
- the electronic device may determine one AID according to the multiple AIDs, and switch the first analog card to the second analog card corresponding to the determined AID according to the determined AID.
- the simulated card is a bus card
- an AID can be determined according to user preference, card balance or setting rules, for example, the setting rule is that the local bus card is preferentially used.
- the electronic device will switch my home access control card to the Shenzhen Connect card.
- this step may specifically include:
- Step 1242 the electronic device deactivates the first analog card.
- the NFC controller deactivates the first emulated card.
- Step 1244 The electronic device activates the second analog card corresponding to the AID in the second NCI stream.
- the NFC controller activates the second analog card corresponding to the AID in the second NCI stream.
- Step 126 the electronic device completes the business processing flow based on the second analog card and the NFC card reader.
- Step 128 The electronic device configures the protocol information of the first analog card as the first information.
- this step may specifically include:
- Step 1282 The processor sends a configuration control command to the NFC controller.
- Step 1284 The NFC controller sends a configuration control command response message to the processor.
- Step 1286 The processor sends a parameter configuration command to the NFC controller, where the parameter configuration command includes the first protocol message.
- Step 1288 The NFC controller sends a parameter configuration command response message to the processor.
- Step 1230 The NFC controller configures the protocol information of the first analog card as the first information.
- Step 130 the electronic device completes the business processing flow based on the first analog card and the NFC card reader.
- the electronic device is based on my home access control card Complete the business process with the community access control card reader.
- the electronic device is based on the Shenzhen Tong bus card.
- the card and the card reader of the Shenzhen bus gate complete the business processing process.
- the electronic device is also used to display prompt information, and the prompt information is used to prompt the user to swipe the card successfully or fail to swipe the card.
- the prompt information may include prompt sound or text prompt.
- the electronic device is further configured to display the default card as the second analog card in response to the first operation input by the user.
- the first operation may include clicking on the icon of the wallet application, and the electronic device responds to the first operation to enter a page of the wallet application, and the page may display the default card, for example, the default card may include the first simulated card or the second simulated card Card.
- the electronic device does not perform the switching process of the emulated card, that is, when the first emulated card is an activated card, when the user inputs a first operation on the electronic device, the electronic device can show that the default card is the first emulated card, for example: Show the default card as my home access card.
- the electronic device may show that the default card is the second analog card.
- card for example: the default card displayed is Shenzhen Tong Bus Card.
- the electronic device can display the default card as the first simulation card , for example: the default card is displayed as my home access control card, at this time, the electronic device restores the default card to the first simulation card.
- SAK, AID, and protocol are all exemplary representations of the embodiments of the present application, and the SAK, AID, and protocols may all be other contents, which are not limited in the embodiments of the present application.
- the electronic device adjusts the protocol information of the first analog card of the activation card, so that the NFC card reader can communicate with the electronic device according to the adjusted protocol information and the protocol supported by itself.
- the electronic device obtains the AID when executing the business process of the agreement, and automatically switches the first analog card to the second analog card corresponding to the AID based on the AID, realizing automatic card replacement, thereby improving the efficiency of card swiping.
- the user performs a card swiping operation at the bus gate through a mobile phone.
- the activation card of the mobile phone is an access control card.
- the mobile phone is close to the bus gate, and the bus gate reads the SAK from the mobile phone.
- the SAK is 0x08
- the card support protocol corresponding to the SAK is the ISO14443-3 protocol that does not select AID.
- the bus gate and the mobile phone implement the business process of the ISO14443-3 protocol, and the bus gate will not return AID to the mobile phone during the business process of the ISO14443-3 protocol.
- the mobile phone cannot change the card based on AID, the current activation card is still the access control card, and the access control card is ejected.
- the card change operation includes clicking the Shenzhen Tong bus card (as shown in Figure 5b) to switch the access control card to the Shenzhen Tong bus card.
- the mobile phone completed the card transaction based on the Shenzhen Tong bus card and the bus gate, and the card was successfully swiped.
- the user performs a card swiping operation at the bus gate through a mobile phone.
- the activation card of the mobile phone is the access control card.
- the mobile phone is close to the bus gate, and the bus gate reads the SAK from the mobile phone.
- the SAK is 0x08.
- the mobile phone implements the business process of the ISO14443-3 protocol, and the bus gate will not return AID to the mobile phone during the business process of the ISO14443-3 protocol.
- the mobile phone changes the SAK to 0x20, and the bus gate reads the SAK from the mobile phone. At this time, the SAK is 0x20.
- the card support protocols corresponding to the SAK include the ISO14443-3 protocol for not selecting AID and the protocol ISO14443-4 for selecting AID.
- the bus gate and the mobile phone execute the business process of the ISO14443-3 protocol and the business process of the ISO14443-4 protocol.
- the bus gate will return the AID to the mobile phone.
- the mobile phone Based on AID, the mobile phone automatically switches the access control card to the Shenzhen Tong bus card corresponding to the AID.
- the mobile phone completed the card transaction based on the Shenzhen Tong bus card and the bus gate, and the card was successfully swiped.
- the solution of the related art needs to manually switch the access control card to the Shenzhen Tong bus card, while the solution of the embodiment of the present application can automatically switch the access control card to the Shenzhen Tong bus card, thereby realizing automatic switching of the access card to the Shenzhen Tong bus card. Change the card to improve the efficiency of card swiping.
- analog cards can be switched based on AID. If the activation card is the default card and the NFC card reader is the community access control card reader, you need to switch the default card to the target card.
- the protocol supported by the community access control card reader includes the protocol that does not select AID, and the corresponding card support protocol of the access control card includes the protocol that does not select AID, so the access control card has no corresponding AID.
- the user performs a card swipe operation at the community access control card reader through an electronic device, he needs to wait blindly for a preset period of time to determine whether the AID sent by the community access control card reader is obtained within the preset time.
- the exclusion method determines that the target card is the access control card, that is, the simulated card to be swiped by the community access control card reader is the access control card, and then the default card is switched to the access control card to realize the intelligent selection of the access control card.
- the electronic device swipes the card, it needs to enter the field strength of the NFC card reader, and it needs to wait for a preset time blindly, resulting in a slow switching speed of the analog card, resulting in a slow card swiping speed, thus reducing the card swiping efficiency.
- the wallet application on the electronic device immediately completes the automatic card change, so that the The default card is switched to the target card, and the community access control card reader will not re-read the card, resulting in a failure to swipe the card.
- the user needs to remove the electronic device from the community access control card reader, and then re-approach the community access control card reader to swipe the card successfully.
- This abnormality is caused by the behavior of the community access control card reader, but it is also a side effect caused by the switching operation of the analog card only within the field strength of the community access control card reader when the card is swiped. In this way, the switching speed of the analog card is slow, resulting in a slow card swiping speed, thereby reducing the card swiping efficiency.
- other embodiments of the present application further provide a method for switching an analog card.
- the current position fingerprint is collected, and the similarity between the current position fingerprint and the pre-collected card-swiping point fingerprint is calculated, and if the similarity is greater than the threshold value, the card switching will be activated.
- the present application can determine whether the electronic device is close to the card swiping point or far away from the card swiping point based on the change of similarity, so as to decide whether to switch to an analog card matching the fingerprint of the card swiping point.
- the electronic device if it is determined that the electronic device is close to the card swiping point, the card is pre-cut in advance, and when the user moves to the card swiping point, the electronic device can directly complete the card swiping process with the NFC card reader, thereby improving the card swiping efficiency.
- FIG. 16 is a flowchart of a method for switching an analog card in other embodiments of the present application. As shown in FIG. 16 , the method includes:
- Step 202 The electronic device collects the fingerprints of the card swiping points, and establishes a corresponding relationship between the fingerprints of the card swiping points and the target card.
- the swiping point is provided with an NFC card reader, for example, the NFC card reader is a community access control card reader.
- the electronic device collects the characteristics of the surrounding network devices at the card swiping point, and uses the characteristics of the surrounding network equipment at the card swiping point as the card swiping point fingerprint.
- the card swiping point fingerprint includes: surrounding network equipment ID and the signal parameter corresponding to the ID.
- the collected fingerprints of card swiping points include but are not limited to the following fingerprints of card swiping points:
- the surrounding network is a WiFi network
- the ID of the surrounding network equipment includes the BSSID
- the corresponding signal parameters include RSSI
- the collected fingerprints of the card swiping point include the BSSID and RSSI of the WiFi network, and each BSSID corresponds to an RSSI.
- the surrounding network is a BT network or a BLE network
- the ID of the surrounding network device includes the BSSID
- the corresponding signal parameters include RSSI
- the collected fingerprints of the card swiping point include the BSSID and RSSI of the BT network or BLE network, and each BSSID corresponds to in an RSSI.
- the surrounding network equipment is a Cell base station
- the ID of the surrounding network equipment includes the CID
- the corresponding signal parameter includes the signal value dBm
- the collected fingerprint of the card swiping point includes the CID of the Cell base station and the signal value dBm
- each CID corresponds to A signal value in dBm.
- the target card is an analog card that performs a card swiping operation at the NFC card reader at the card swiping point.
- Step 204 If the electronic device enters a specific area, collect the fingerprint of the current location.
- the electronic device after the electronic device enters a specific area, it can scan the surrounding network by means of screen-off scanning to collect the fingerprint of the current location.
- a card swipe point can be used as a center point to establish a geo-fence, and the area covered by the geo-fence is a specific area. After the electronic is ready to enter the geofence, it starts to periodically collect the current location fingerprint. After the electronic device leaves the geofence, it stops collecting fingerprints of the current location.
- the electronic device When the electronic device moves in the electronic fence, the electronic device periodically collects the characteristics of the surrounding network devices at the current location, and uses the characteristics of the surrounding network devices at the current location as the current location fingerprint, and the current location fingerprint includes: the ID of the surrounding network device and the current location fingerprint.
- the signal parameter corresponding to the ID is the signal parameter corresponding to the ID.
- the collected fingerprints of the current location include but are not limited to the following fingerprints:
- the surrounding network is a WiFi network
- the ID of the surrounding network equipment includes the BSSID
- the corresponding signal parameter includes the RSSI
- the collected current location fingerprint includes the BSSID and RSSI of the WiFi network
- each BSSID corresponds to an RSSI.
- the surrounding network is a BT network or a BLE network
- the ID of the surrounding network equipment includes the BSSID
- the corresponding signal parameters include RSSI
- the collected current location fingerprint includes the BSSID and RSSI of the BT network or BLE network
- each BSSID corresponds to in an RSSI.
- the surrounding network equipment is a Cell base station
- the ID of the surrounding network equipment includes the CID
- the corresponding signal parameter includes the signal value dBm
- the collected current location fingerprint includes the CID of the Cell base station and the signal value dBm
- each CID corresponds to A signal value in dBm.
- the current location fingerprints collected periodically keep changing.
- Step 206 the electronic device calculates the similarity between the fingerprint of the current location and the fingerprint of the swiping point. As the user moves around, the current location fingerprints collected at intervals change constantly, so the calculated similarity also changes constantly.
- This step can specifically include:
- Step 2062 Query the same ID in the fingerprint F1 of the card swiping point and the fingerprint F2 of the current location, and form the same device set [ID1, ID2..., IDn] according to the same ID, and the number of the same ID in F1 and F2 is n.
- Step 2064 Form the first signal parameter set [Q1, Q2..., Qn] of F1 according to the signal parameters corresponding to the ID of the same device set in F1; form the second signal of F2 according to the signal parameters corresponding to the ID of the same device set in F2 Parameter set [Q1',Q2'...,Qn'].
- Step 2066 Calculate the similarity.
- the similarity is calculated according to the first signal parameter set and the second signal parameter set.
- the Euclidean distance can be calculated by the Euclidean distance formula for [Q1, Q2..., Qn] and [Q1', Q2'..., Qn'] to generate d. The smaller d, the greater the calculated similarity.
- the value of the similarity calculated in this step is greater than 0 and less than or equal to 1.
- Step 208 switch the analog card based on the similarity.
- Similarity is used to indicate how close the current location is to the location of the swipe point. The greater the similarity, the closer the electronic device is to the card-swiping point; the smaller the similarity, the farther the electronic device is from the card-swiping point.
- the activation card is switched to the target card that matches the fingerprint of the swiping point.
- the activation card is a traffic card Shenzhen Pass
- the target card is an access card.
- the activation card is switched to the default card according to the established correspondence between the fingerprint of the card swiping point and the target card.
- the activation card is the access control card
- the default card is the traffic card Shenzhen Pass.
- the electronic device collects the fingerprints of the card swiping points and establishes the corresponding relationship between the fingerprints of the card swiping points and the target card. Similarity, based on the similarity to switch the analog card, realizes the operation of pre-switching the card automatically based on the similarity, and solves the problem of swiping the card twice and the card swiping slowly caused by the electronic device being close to the NFC card reader to switch the card. Improved card swiping efficiency.
- the solution of the embodiment of the present application is to automatically perform the card pre-switching operation based on the similarity, it solves the problem of automatically performing the card pre-switching when there are multiple access control cards installed on the electronic device, and does not require the user to manually change the card, thereby improving the card swiping efficiency. .
- An embodiment of the present application provides an electronic device, and the electronic device may be a terminal device or a circuit device built in the terminal device.
- the electronic device includes: a display screen; one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs It includes an instruction, when the instruction is executed by the device, so that the device can be used to execute each step in the above embodiment of the method for switching an analog card.
- An embodiment of the present application provides a computer-readable storage medium, where an instruction is stored in the computer-readable storage medium, and when the instruction is executed on a computer, the computer is made to execute the steps in the foregoing embodiments of the analog card switching method .
- the embodiment of the present application provides a computer program product including instructions, when the computer program product runs on a computer or any at least one processor, the computer is made to execute the above-mentioned embodiment of the analog card switching method. each step.
- “at least one” refers to one or more, and “multiple” refers to two or more.
- “And/or”, which describes the association relationship of the associated objects means that there can be three kinds of relationships, for example, A and/or B, which can indicate the existence of A alone, the existence of A and B at the same time, and the existence of B alone. where A and B can be singular or plural.
- the character “/” generally indicates that the associated objects are an “or” relationship.
- “At least one of the following” and similar expressions refer to any combination of these items, including any combination of single or plural items.
- At least one of a, b, and c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c may be single or multiple.
- any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
- the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution.
- the computer software product is stored in a storage medium, including Several instructions are used to cause 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 the various embodiments of the present application.
- the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes .
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Accounting & Taxation (AREA)
- General Business, Economics & Management (AREA)
- Strategic Management (AREA)
- Health & Medical Sciences (AREA)
- Toxicology (AREA)
- Microelectronics & Electronic Packaging (AREA)
- Finance (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computer Security & Cryptography (AREA)
- Artificial Intelligence (AREA)
- General Health & Medical Sciences (AREA)
- Signal Processing (AREA)
- Electromagnetism (AREA)
- Economics (AREA)
- Marketing (AREA)
- Development Economics (AREA)
- Technology Law (AREA)
- General Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Human Resources & Organizations (AREA)
- Primary Health Care (AREA)
- Tourism & Hospitality (AREA)
- Telephone Function (AREA)
- Telephonic Communication Services (AREA)
Abstract
一种模拟卡的切换方法、电子设备和通信系统。该方法包括:向NFC读卡器发送第一信息,以供NFC读卡器根据第一信息和自身支持的协议确定出第一协议,并与电子设备执行第一协议的业务流程;若与NFC读卡器执行第一协议的业务流程时未获取到标识信息,将第一模拟卡的协议信息从第一信息修改为第二信息;向NFC读卡器发送第二信息,以供NFC读卡器从电子设备获取第二信息,根据第二信息和自身支持的协议确定出第二协议,并与电子设备执行第二协议的业务流程;若与NFC读卡器执行第二协议的业务流程时获取到标识信息,根据标识信息将第一模拟卡切换为标识信息对应的第二模拟卡。该方法提高了刷卡效率。
Description
本申请要求于2020年10月21日提交中国专利局、申请号为202011133300.9、申请名称为“一种模拟卡的切换方法、电子设备和通信系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及近场通信(Near Field Communication,简称NFC)领域,具体地涉及一种模拟卡的切换方法、电子设备和通信系统。
NFC是一种短距离的高频无线通信技术,其允许NFC电子设备之间在10厘米距离内进行非接触式点对点数据传输。NFC技术己成为相关国际标准,并被广泛应用。
目前,电子设备无法实现基于应用标识符(Application Identifier,简称AID)自动将门禁卡切换为公交卡,需要用户手动换卡并在换卡之后再次进行刷卡操作,从而降低了刷卡效率。
发明内容
有鉴于此,本申请提供一种模拟卡的切换方法、设备和通信系统,用于提高刷卡效率。
第一方面,本申请实施例提供了一种通信系统,包括:近场通信NFC读卡器和具有NFC功能的电子设备,所述电子设备上设置有第一模拟卡和第二模拟卡,所述第一模拟卡为激活卡,所述第一模拟卡的卡支持协议为第一协议,所述第二模拟卡的卡支持协议为第二协议;
所述NFC读卡器,用于从所述电子设备获取第一模拟卡的第一信息,根据所述第一信息和自身支持的协议确定出第一协议,并与所述电子设备执行所述第一协议的业务流程;
所述电子设备,用于若执行所述第一协议的业务流程时未获取到标识信息,将所述第一模拟卡的协议信息从第一信息修改为第二信息;
所述NFC读卡器,还用于从所述电子设备获取所述第二信息,根据所述第二信息对应的卡支持协议和自身支持的协议确定出第二协议,并与所述电子设备执行所述第二协议的业务流程;
所述电子设备,还用于若执行所述第二协议的业务流程时获取到标识信息,根据所述标识信息将所述第一模拟卡切换为所述标识信息对应的第二模拟卡。
在一种可能的实现方式中,所述第一协议包括ISO14443-3协议,所述第二协议包括ISO14443-3协议和ISO14443-4协议。
在一种可能的实现方式中,所述电子设备还用于响应于用户输入的第一操作,展示默 认卡为第二模拟卡。
在一种可能的实现方式中,所述第一模拟卡为门禁卡,所述第二模拟卡为公交卡。
第二方面,本申请实施例提供了一种模拟卡的切换方法,应用于电子设备,所述电子设备上设置有第一模拟卡和第二模拟卡,所述第一模拟卡为激活卡,所述第一模拟卡的卡支持协议为第一协议,所述第二模拟卡的卡支持协议为第二协议;所述方法包括:
向NFC读卡器发送第一模拟卡的第一信息,以供所述NFC读卡器根据所述第一信息和自身支持的协议确定出第一协议,并与所述电子设备执行所述第一协议的业务流程;
若与所述NFC读卡器执行第一协议的业务流程时未获取到标识信息,将所述第一模拟卡的协议信息从第一信息修改为第二信息;
向所述NFC读卡器发送第二信息,以供NFC读卡器从所述电子设备获取所述第二信息,根据所述第二信息和自身支持的协议确定出第二协议,并与所述电子设备执行所述第二协议的业务流程;
若与所述NFC读卡器执行所述第二协议的业务流程时获取到标识信息,根据所述标识信息将所述第一模拟卡切换为所述标识信息对应的第二模拟卡。
在一种可能的实现方式中,所述第一协议包括不选择标识信息的协议,则执行所述第一协议的业务流程包括:执行不选择标识信息的协议的业务流程。
在一种可能的实现方式中,所述第二协议包括不选择标识信息的协议和选择标识信息的协议,则执行所述第二指定协议的业务流程包括:执行不选择标识信息的业务流程以及执行选择标识信息的协议的业务流程。
在一种可能的实现方式中,所述第一协议包括ISO14443-3协议,所述第二协议包括ISO14443-3协议和ISO14443-4协议。
在一种可能的实现方式中,所述标识信息包括应用标识符AID。
在一种可能的实现方式中,所述第一模拟卡的协议信息为选择确认SAK。
在一种可能的实现方式中,还包括:
响应于用户输入的第一操作,展示默认卡为第二模拟卡。
在一种可能的实现方式中,还包括:
展示提示信息,所述提示信息用于提示用户刷卡成功或者刷卡失败。
在一种可能的实现方式中,所述第一模拟卡为门禁卡,所述第二模拟卡为公交卡。
第三方面,本申请实施例提供了一种电子设备,所述电子设备包括处理器和NFC控制器,所述电子设备上设置有第一模拟卡和第二模拟卡,所述第一模拟卡为激活卡,所述第一模拟卡的卡支持协议为第一协议,所述第二模拟卡的卡支持协议为第二协议;
所述NFC控制器,用于向NFC读卡器发送所述第一模拟卡的第一信息,以供所述NFC读卡器根据所述第一信息和自身支持的协议确定出第一协议,并与所述电子设备执行所述第一协议的业务流程;
所述NFC控制器,还用于将所述NFC读卡器与所述电子设备执行所述第一协议的业务流程时产生的第一业务信息发送至所述处理器;
所述处理器,用于若所述第一业务信息未包括标识信息,与所述NFC控制器之间进行信息交互,以使所述NFC控制器将所述第一模拟卡的协议信息从第一信息修改为第二信息;
所述NFC控制器,还用于向所述NFC读卡器发送第二信息,以供NFC读卡器从所述 电子设备获取所述第二信息,根据所述第二信息和自身支持的协议确定出第二协议,并与所述电子设备执行所述第二协议的业务流程;
所述NFC控制器,还用于将所述NFC读卡器与所述电子设备执行所述第二协议的业务流程时产生的第二业务信息发送至所述处理器;
所述处理器,还用于若所述第二业务信息包括标识信息,触发所述第二NFC控制器;
所述NFC控制器,还用于根据所述标识信息将所述第一模拟卡切换为所述标识信息对应的第二模拟卡。
第四方面,本申请实施例提供了一种电子设备,包括:
显示屏;一个或多个处理器;存储器;以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述设备执行时,使得所述设备执行以下步骤:
显示屏;一个或多个处理器;存储器;以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述设备执行时,使得所述设备执行以下步骤:
向NFC读卡器发送第一模拟卡的第一信息,以供所述NFC读卡器根据所述第一信息和自身支持的协议确定出第一协议,并与所述电子设备执行所述第一协议的业务流程;
若与所述NFC读卡器执行第一协议的业务流程时未获取到标识信息,将第一模拟卡的协议信息从第一信息修改为第二信息;
向所述NFC读卡器发送第二信息,以供NFC读卡器从所述电子设备获取所述第二信息,根据所述第二信息和自身支持的协议确定出第二协议,并与所述电子设备执行所述第二协议的业务流程;
若与所述NFC读卡器执行所述第二协议的业务流程时获取到标识信息,根据所述标识信息将第一模拟卡切换为所述标识信息对应的第二模拟卡。
在一种可能的实现方式中,当所述指令被所述设备执行时,使得所述设备具体执行以下步骤:
所述第一协议包括不选择标识信息的协议,执行不选择标识信息的协议的业务流程。
在一种可能的实现方式中,当所述指令被所述设备执行时,使得所述设备具体执行以下步骤:
所述第二协议包括不选择标识信息的协议和选择标识信息的协议,执行不选择标识信息的业务流程以及执行选择标识信息的协议的业务流程。
在一种可能的实现方式中,所述第一协议包括ISO14443-3协议,所述第二协议包括ISO14443-3协议和ISO14443-4协议。
在一种可能的实现方式中,所述标识信息包括应用标识符AID。
在一种可能的实现方式中,所述第一模拟卡的协议信息包括选择确认SAK。
在一种可能的实现方式中,当所述指令被所述设备执行时,使得所述设备执行以下步骤:
响应于用户输入的第一操作,展示默认卡为第二模拟卡。
在一种可能的实现方式中,当所述指令被所述设备执行时,使得所述设备执行以下步骤:
展示提示信息,所述提示信息用于提示用户刷卡成功或者刷卡失败。
在一种可能的实现方式中,所述第一模拟卡为门禁卡,所述第二模拟卡为公交卡。
第五方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质包括存储的程序,其中,在所述程序运行时控制所述计算机可读存储介质所在设备执行第二方面或者第二方面的任一可能的实现方式中模拟卡的切换方法。
第六方面,本申请实施例提供了一种包含指令的计算机程序产品,当所述计算机程序产品在计算机或任一至少一种处理器上运行时,使得所述计算机执行第二方面或者第二方面的任一可能的实现方式中模拟卡的切换方法。
本申请实施例提供的技术方案中,电子设备通过调整激活卡第一模拟卡的协议信息,使得NFC读卡器能够根据调整后的协议信息和自身支持的协议与电子设备执行指定协议的业务流程,电子设备执行指定协议的业务流程时获取到标识信息,并基于标识信息自动将第一模拟卡切换为标识信息对应的第二模拟卡,实现了自动换卡,从而提高了刷卡效率。
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。
图1是一些实施例中NFC通信系统的结构示意图;
图2是一些实施例中电子设备的硬件结构示意图;
图3是一些实施例中电子设备的软件结构框图;
图4是一些实施例中钱包应用程序的卡包页面的示意图;
图5a至图5d是相关技术中手动换卡的示意图;
图6a至图6b是相关技术中基于位置切换模拟卡的示意图;
图7是一些实施例中模拟卡的切换方法的示意图;
图8a至图8c是一些实施例中公交卡刷卡操作的界面示意图;
图9a至图9c是一些实施例中门禁卡刷卡操作的界面示意图;
图10是一些实施例中模拟卡的切换方法的流程图;
图11是一些实施例中模拟卡的切换方法的信令流程图;
图12是一些实施例中判断是否调整协议信息的流程图;
图13是一些实施例中判断是否换卡的流程图;
图14是一些实施例中切换模块卡的流程图;
图15a是相关技术中手动换卡的方案示意图;
图15b是本申请实施例中自动换卡的方案示意图;
图16是本申请另一些实施例中模拟卡的切换方法的流程图。
为了更好的理解本申请的技术方案,下面结合附图对本申请实施例进行详细描述。
应当明确,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它 实施例,都属于本申请保护的范围。
在本申请实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。
应当理解,本文中使用的术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,甲和/或乙,可以表示:单独存在甲,同时存在甲和乙,单独存在乙这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
NFC是一种短距离的高频无线通信技术,其允许NFC电子设备之间在10厘米距离内进行非接触式点对点数据传输。NFC技术的传输速度包括106Kbit/s、212Kbit/s或者424Kbit/s。目前,NFC技术己成为相关国际标准,并被广泛应用。示例性地,如图1所示,提供了一种NFC通信系统,该NFC通信系统可包括:电子设备100和NFC读卡器101。在本申请实施例中,电子设备100是指具备NFC功能的电子设备,具备NFC功能的电子设备也可被称为NFC电子设备。电子设备100和NFC读卡器101之间可实现基于邻近(proximity-based)的非接触式通信。电子设备100和NFC读卡器101可在较低数据速率下进行NFC通信,并可遵守任何适当的标准,例如IS0/IEC 7816、IS0/IEC 18092、ECMA-340、IS0/IEC 21481、ECMA-352、IS0 1444或ISO 15693协议。电子设备100和NFC读卡器101也可在较高数据速率下进行NFC通信,并可遵守任何适当标准,例如Transfer JetTM协议。
在一些实施例中,电子设备100包括但不限于搭载
或者其他操作系统的设备。电子设备100包括但不限于手机、平板电脑、桌面型计算机、膝上型计算机、手持计算机、可穿戴设备、头戴式显示器、阅读器设备、便携式音乐播放器、便携式游戏机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,简称:UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,简称:PDA)、增强现实(augmented reality,简称:AR)或虚拟现实(virtual reality,简称:VR)设备。
在一些实施例中,NFC读卡器101包括但不限于门禁卡读卡器、配置在公交闸机的读卡器(公交车POS机)、配置在地铁闸机的读卡器、配置在门锁的读卡器、配置在交易场所的NFC支付终端(例如,银行卡POS机)、配置在汽车门把手的读卡器或配置在跑步机的读卡器。
需要说明的是:图1仅示出了电子设备100内部的部分部件,电子设备100中的其它部件可参见图2所示。示例性地,如图2所示,提供了一种图1中电子设备100的硬件结构图,如图2所示,电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器 (application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施 例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行指令以生成或改变显示信息。电子设备101可以通过ISP,一个或多个摄像头193,视频编解码器,GPU,一个或多个显示屏194以及应用处理器等实现拍摄功能。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存 储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。其中,触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
在一些实施例中,如图1所示,该电子设备100还包括:NFC控制器(NFC Controller,简称NFCC)102和NFC收发器103。其中,NFC控制器102与处理器110和NFC收发器103连接。
NFC控制器102主要用于对非接触通信信号进行调制解调,并与处理器110进行交互。在另一些实施例中,NFC控制器102也可以是实现上述功能的一种NFC芯片。
NFC收发器103主要用于实现射频信号的发送与接收,其可以包括电磁兼容性(electromagnetic compatibility,简称EMC)滤波电路、匹配电路、接收电路和NFC天线等。其中,NFC天线可以是环形天线,用于实现基于邻近的非接触式通信能力;在另一些实施例中,NFC天线也可以是图2中的天线2。
在一些实施例中,该NFC通信系统还包括安全单元(safe element,简称SE)。NFC控制器102通过耦合不同的安全单元来实现本申请实施例中的方法。安全单元可以多种形态存在。示例性地,安全单元SE 1可集成于电子设备100的印刷电路板(printed circuit board,简称PBC)上,此种情况下,安全单元SE 1可与电子设备100的其他软件及硬件相互独立,并支持加密协议以加强访问控制,只有经过认证的应用才能访问安全单元SE 1并发起NFC业务,从而保证了NFC业务的安全性。示例性地,安全单元SE2还可以集成于集成 电路卡(universal integrated circuit card,UICC)中,例如,安全单元SE2集成于SIM卡(eSIM卡)中,SIM卡由电信运营商制造并销售,这样就降低了电子设备制造商的成本。示例性地,安全单元inSE还可以耦合于处理器110中。示例性地,安全单元SE 3可以配置于服务器侧。示例性地,安全单元还可以集成在一块系统级芯片(System on Chip,简称SOC)上。在另一些实施例中,电子设备101可以包括一个或多个安全元件,这些安全元件可以相互独立运行。
安全单元的主要功能是应用和数据的安全存储,对外提供安全运算服务。安全单元还可以通过NFC控制器102与其他电子设备进行通信,实现数据存储及通信过程的安全性。可以理解的是,安全单元可以是用于提供安全性、机密性以及为了支持各种应用环境的防篡改部件。此外,安全单元还可以包括在安全单元的环境中(例如在安全单元的操作系统中/或在运行在安全单元上的Java运行环境中)执行的一个或多个应用。该一个或多个应用可包括存储在内部存储器121中的一个或多个用于NFC支付的应用(例如华为钱包
、支付宝
等)。安全单元还支持应用的数据的安全隔离,也即为了安全,安全单元可以不允许不同应用之间的访问;安全单元还提供各类移动支付业务所需要的对称、非对称加密算法和证书能力,提供安全交易应用访问的程序接口,支持和NFC控制器102或处理器110的双向通信。
示例性地,如图3所示,提供了一种电子设备100的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。如图3所示,应用程序包可以包括相机,图库,日历,通话,地图,WLAN,蓝牙,音乐,视频,短消息,钱包等应用程序。其中,钱包可包括NFC钱包,是电子设备100(例如手机)在出厂之前安装在电子设备100中的原生应用程序,NFC钱包可实现与NFC相关的功能。示例性地,该NFC钱包可以是例如Huawei
Samsung
银联钱包
等;并且,该NFC钱包可以根据该应用程序的服务提供商进行管理,例如更新该应用程序、添加银行卡等。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。如图3所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器,NFC管理器(Nfc Manager)等。NFC管理器可以用来管理电子设备100中指出的所有NFC适配器。示例性地,函数NfcAdapter可以用于表示电子设备100的NFC通信相关部件(例如NFC控制器102、NFC收发器103、安全单元等),NfcAdapter是应用访问NFC功能的入口,主要为获取一个NFC适配器的实例,可以使用getDefaultAapater()函数来获取系统支持的Adapter。另外,NFC管理器还用来处理来自NFC钱包等NFC相关应用的数据;或者,NFC管理器将从NFC读卡器101接收到的数据根据转发到NFC钱包等NFC相关应用。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),三维图形引擎(例如:SGL)等。
安卓运行时包括核心库和虚拟机。安卓运行时负责安卓系统的调度和管理。
内核层包括显示驱动,摄像头驱动,音频驱动,传感器驱动等。
示例性地,如图1所示,NFC射频场(RF field)一般是由NFC读卡器101发出的,可以选择106Kbit/s、212Kbit/s或者424Kbit/s其中一种作为传输速度与电子设备100进行通信。电子设备100可以感应到NFC读卡器101所发射出的射频场,具体地,电子设备100的NFC天线(或线圈)是NFC读卡器101发射天线(或线圈)的负载,这样,电子设备100通过改变天线回路的参数(例如谐振和失谐),使NFC读卡器101被调制,从而使得电子设备100可以相同的传输速度将数据传回到NFC读卡器101,实现了以微弱的能量从电子设备100到NFC读卡器101的数据传输。通过负载调制技术获得数据回传的能力,可以大幅降低电子设备100的功耗并延长电池续航能力。
通常,电子设备100可具有三种工作模式,即读卡器模式(Reader/Writer Mode)、点对点模式(P2P Mode)和卡模拟模式(Card Emulation Mode)。卡模拟模式下,电子设备100可通过卡模拟技术模拟出模拟卡,以便与NFC读卡器101进行数据交互。其中,模拟卡是指电子设备100通过NFC硬件模拟出的符合NFC相关标准的非接触式射频卡。卡模拟模式主要用于消费、交通、门禁等非接触场景中,例如,用户可以将电子设备100靠近NFC读卡器101,并输入密码确认交易或者直接接收交易即可,这使得在不改变现有设施的基础上就可以使用电子设备100进行非接触的NFC业务。本申请实施例提供的方案可基于卡模拟模式实现。
示例性地,如图4所示,提供了一种钱包应用程序的卡包页面的示意图,卡包页面包括状态栏10、卡包和页面切换栏20。
电子设备100可通过钱包应用程序模拟出多个模拟卡,例如,模拟卡可包括银行卡、公交卡、门禁卡、电子身份证或智能门锁卡等,本申请实施例中,银行卡、公交卡、门禁卡、电子身份证和智能门锁卡均为模拟卡的分类。其中,门禁卡的类型可包括唯一标识符(Unique Identifier,简称UID)类型或
类型。随着NFC业务的推广,电子设备100中的模拟卡会越来越多。用户可在钱包应用程序的卡包页面中查看添加的模拟卡,示例性地,图4中的卡包包括“银行卡”、“交通卡”和“钥匙”,其中,“银行卡”包括招商银行信用卡
和建设银行储蓄卡
,“交通卡”包括深圳通
,“钥匙”包括门禁卡和智能门锁卡,其中,门禁卡包括“我的家”,智能门锁卡包括青稞智能锁
。用户还可以在卡包中添加新的模拟卡。
页面切换栏20包括多个页面切换按钮,页面切换按钮用于实现钱包应用程序中多个页面的切换,示例性地,如图4所示,多个页面切换按钮包括“首页”按钮、“生活”按钮、“卡包”按钮和“我的”按钮,例如,当用户点击“卡包”按钮时,电子设备100显示卡包页面。
由于硬件技术的约束,虽然钱包应用程序中模拟出了多张模拟卡,但是一次只能激活一张模拟卡。用户可在钱包应用程序中设置默认卡,例如,如图4所示,用户设置门禁卡“我的家”为默认卡。激活卡为门禁卡“我的家”,NFC读卡器101为深圳公交闸机的读卡器,此时需要将默认卡门禁卡切换为目标卡公交卡,以完成刷卡操作。
一种相关技术中,示例性地,如图5a至图5d所示,门禁卡为默认卡,NFC读卡器101为公交闸机的读卡器。则用户通过电子设备100在公交闸机处刷卡时,电子设备100上会弹出默认卡门禁卡,如图5a所示,电子设备100上弹出门禁卡“我的家”;此时用户需要手动将门禁卡切换为公交卡,如图5b所示,用户在电子设备100上点击公交卡“深圳通”;如图5c所示,将门禁卡“我的家”切换为公交卡“深圳通”,电子设备100上弹出公交卡“深圳通”,并在公交卡的下方显示公交卡的余额为¥27.18以及“充值”按钮;而后,如图5d所示,电子设备100通过公交卡“深圳通”在公交闸机处完成刷卡交易,交易时间为2020/9/14 17:08,交易金额为¥2.00,公交卡余额为¥25.18。此种方案中,无论NFC读卡器101为哪种类型的读卡器,电子设备100在检测到NFC读卡器101的NFC射频场时,总是弹出默认卡,当默认卡为门禁卡,NFC读卡器101为公交闸机的读卡器,此时需要用户手动换卡,并在换卡之后再次进行刷卡操作,从而降低了刷卡效率。
另一种相关技术中,用户通过电子设备100在NFC读卡器101上进行刷卡操作时,电子设备100检测到NFC读卡器101的NFC射频场之后,接收到NFC读卡器101发送的NFC控制器接口(NFC Controller Interface,简称NCI)流。NCI是NFC控制器102与操作系统通信的标准协议。NCI的类型可包括命令类型、通知类型或数据类型。通知类型的NCI是NFC控制器102与NFC读卡器101通信后将通信状态通知到操作系统侧的NCI。电子设备100根据获取到的AID选择AID对应的模拟卡,而后将默认卡切换为AID对应的模拟卡。但是,当默认卡为门禁卡,NFC读卡器101为公交闸机的读卡器时,由于NFC读卡器101不会向电子设备发送AID,导致电子设备100无法基于AID识别出NFC读卡器101的读卡类型,电子设备100无法实现基于AID自动将门禁卡切换为公交卡,需要用户手动换卡(手动换卡的过程可参见图5a至图5d所示),并在换卡之后再次进行刷卡操作,从而降低了刷卡效率。
另一种相关技术中,示例性地,如图6a所示,提供了一种基于位置切换模拟卡的方案,以门禁刷卡点为中心建立地理围栏,地理围栏覆盖预定区域(图6a中圆圈所示的区域),门禁刷卡点设置有门禁卡读卡器。用户进入地理围栏的预定区域之前,即:用户的电子设备100的位置位于地理围栏的预定区域之外时,电子设备100的激活卡为默认卡公交卡;用户进入地理围栏的预定区域,即:用户的电子设备100的位置位于地理围栏的预定区域内时,电子设备100去激活默认卡公交卡并激活门禁卡,以实现基于位置将公交卡切换为门禁卡;用户离开地理围栏的预定区域,即:用户的电子设备100的位置位于地理围栏的预定区域之外时,电子设备100去激活门禁卡并激活默认卡公交卡,以实现还原默认卡公交卡。示例性地,如图6b所示,一般来说,地理围栏的围栏半径较大,则地理围栏的预定区域会覆盖到公交刷卡点(或地铁刷卡点),公交刷卡点设置有NFC读卡器101,在用户移动至公交刷卡点的过程中,一进入地理围栏的预定区域,电子设备100就会将默认卡公交卡切换为门禁卡;而后用户移动至公交刷卡点进行刷卡操作时,由于激活卡为门禁卡,且NFC读卡器101为公交闸机的读卡器时,由于NFC读卡器101不会向电子设备发送AID,导致电子设备100无法基于AID识别出NFC读卡器101的读卡类型,电子设备100无法实现基于AID自动将门禁卡切换为公交卡,需要用户手动换卡(手动换卡的过程可参见图5a至图5d所示),并在换卡之后再次进行刷卡操作,从而降低了刷卡效率。
为解决上述相关技术中存在的模拟卡切换过程中需要用户手动换卡而降低刷卡效率 的问题,本申请实施例提供了一种模拟卡的切换方法,该方法应用于电子设备,所述电子设备上设置有第一模拟卡和第二模拟卡,所述第一模拟卡为激活卡,所述第一模拟卡的卡支持协议为第一协议,所述第二模拟卡的卡支持协议为第二协议;所述方法包括:NFC读卡器从所述电子设备获取第一模拟卡的第一信息,根据所述第一信息和自身支持的协议确定出第一协议,并与所述电子设备执行所述第一协议的业务流程;电子设备若执行所述第一协议的业务流程时未获取到标识信息,将所述第一模拟卡的协议信息从第一信息修改为第二信息;NFC读卡器从所述电子设备获取所述第二信息,根据所述第二信息对应的卡支持协议和自身支持的协议确定出第二协议,并与所述电子设备执行所述第二协议的业务流程;电子设备若执行所述第二协议的业务流程时获取到标识信息,根据所述标识信息将所述第一模拟卡切换为所述标识信息对应的第二模拟卡。
本申请实施例中,所述第一协议包括不选择标识信息的协议,则执行所述第一协议的业务流程包括:执行不选择标识信息的协议的业务流程。
本申请实施例中,所述第二协议包括不选择标识信息的协议和选择标识信息的协议,则执行所述第二协议的业务流程包括:执行不选择标识信息的业务流程以及执行选择标识信息的协议的业务流程。
示例性地,标识信息包括AID;第一模拟卡的协议信息包括选择确认(Select AcKnowledge,简称SAK)。
本申请实施例中,电子设备包括处理器和NFC控制器。NFC控制器向NFC读卡器发送所述第一模拟卡的第一信息,以供所述NFC读卡器根据所述第一信息和自身支持的协议确定出第一协议,并与所述电子设备执行所述第一协议的业务流程。NFC控制器将所述NFC读卡器与所述电子设备执行所述第一协议的业务流程时产生的第一业务信息发送至所述处理器。所述处理器若所述第一业务信息未包括标识信息,与所述NFC控制器之间进行信息交互,以使所述NFC控制器将所述第一模拟卡的协议信息从第一信息修改为第二信息。NFC控制器向所述NFC读卡器发送第二信息,以供NFC读卡器从所述电子设备获取所述第二信息,根据所述第二信息和自身支持的协议确定出第二协议,并与所述电子设备执行所述第二协议的业务流程;NFC控制器将所述NFC读卡器与所述电子设备执行所述第二协议的业务流程时产生的第二业务信息发送至所述处理器。所述处理器若所述第二业务信息包括标识信息,触发所述第二NFC控制器。所述NFC控制器根据所述标识信息将所述第一模拟卡切换为所述标识信息对应的第二模拟卡。
本申请实施例中,所述第一业务信息包括第一NCI流。所述处理器具体用于在第一设定时间段内未接收到NFC控制器发送的第一NCI流中的NFC射频激活通知消息,则确定出所述第一业务信息未包括标识信息;或者,所述处理器具体用于在第一设定时间段内接收到NFC控制器发送的第一NCI流中的NFC射频激活通知消息,且在第二设定时间段内未接收到NFC控制器发送的第一NCI流中的AID通知消息,则确定出所述第一业务信息未包括标识信息。
本申请实施例中,所述第二业务信息包括第二NCI流。所述处理器具体用于在第一设定时间段内接收到NFC控制器发送的第二NCI流中的NFC射频激活通知消息,且在第二设定时间段内接收到NFC控制器发送的第二NCI流中的AID通知消息,则确定出所述第二业务信息包括标识信息。
本申请实施例中,所述处理器若所述第一业务信息未包括标识信息,与所述NFC控制器之间进行信息交互具体包括:所述处理器若所述第一业务信息未包括标识信息,向所述NFC控制器发送配置控制命令;所述NFC控制器向处理器发送配置控制命令应答消息;所述处理器向所述NFC控制器发送参数配置命令,所述参数配置命令包括第二信息;所述NFC控制器向所述处理器发送参数配置命令应答消息。
本申请实施例中,所述处理器用于若所述第二业务信息包括标识信息,与所述NFC控制器之间进行信息交互,以使所述NFC控制器将所述第一模拟卡的协议信息从第二信息修改为第一信息。其中,所述处理器若所述第一业务信息包括标识信息,与所述NFC控制器之间进行信息交互具体包括:所述处理器若所述第一业务信息包括标识信息,向所述NFC控制器发送配置控制命令;所述NFC控制器向处理器发送配置控制命令应答消息;所述处理器向所述NFC控制器发送参数配置命令,所述参数配置命令包括第一信息;所述NFC控制器向所述处理器发送参数配置命令应答消息。
本申请实施例中,电子设备通过调整激活卡第一模拟卡的协议信息,使得NFC读卡器能够根据调整后的协议信息和自身支持的协议与电子设备执行指定协议的业务流程,电子设备执行指定协议的业务流程时获取到标识信息,并基于标识信息自动将第一模拟卡切换为标识信息对应的第二模拟卡,实现了自动换卡,从而提高了刷卡效率。
电子设备上设置有第一模拟卡和第二模拟卡。第一模拟卡与第二模拟卡不同。示例性地,第一模拟卡为门禁卡,第二模拟卡为公交卡。例如,第一模拟卡为门禁卡“我的家”,第二模拟卡为公交卡“深圳通”。
电子设备通过卡模拟技术模拟出不同类型的模拟卡,例如,按照类型划分,模拟卡可包括本地公交卡、互联互通交通卡、我的家门禁卡、青稞智能锁卡。其中,不同的本地公交卡可具有不同的类型,例如,本地公交卡可包括深圳通、上海通等,而深圳通和上海通是不同类型的模拟卡。其中,不同的互联互通交通卡可具有相同的类型,例如,互联互通交通卡可包括深圳通互联互通卡、京津冀互联互通卡等,深圳通互联互通卡和京津冀互联互通卡是同一类型的模拟卡。
需要说明的是:上述列举的模拟卡为本申请实施例的示例性描述,模拟卡还可以包括其它类型的模拟卡,本申请实施例对此不作限定。
示例性地,表1中示出了不同类型的模拟卡所支持的协议:
表1
如上表1所示,SAK用于表示卡支持协议,卡支持协议即为模拟卡支持的协议。示例性地,一种类型的模拟卡可具备一个SAK,一个SAK可对应于一个或者多个卡支持协议。 例如:我的家门禁卡的SAK=0x08,则我的家门禁卡的卡支持协议包括ISO14443-3协议;深圳通和深圳通互联互通卡的SAK=0x20,则深圳通和深圳通互联互通卡的卡支持协议包括ISO14443-3协议和ISO14443-4协议;复合卡的SAK=0x28,则复合卡的卡支持协议包括ISO14443-3协议和ISO14443-4协议。其中,复合卡指的是同时支持ISO14443-3协议和ISO14443-4协议的模拟卡。
示例性地,NFC读卡器101可包括深圳公交闸机的读卡器、上海公交闸机的读卡器、小区门禁读卡器、公司门禁读卡器、青稞智能锁读卡器等多种类型的读卡器。需要说明的是:上述列举的NFC读卡器为本申请实施例的示例性描述,NFC读卡器还可以包括其它类型的读卡器,本申请实施例对此不作限定。
示例性地,表2中示出了不同类型的NFC读卡器所支持的协议和对应的AID:
表2
如上表2所示,示例性地,一种类型的读卡器可支持一个或者多个协议。例如:小区门禁读卡器支持的协议包括ISO14443-3协议;深圳公交闸机的读卡器支持的协议包括ISO14443-3协议和ISO14443-4协议;上海公交闸机的读卡器支持的协议包括ISO14443-3协议和ISO14443-4协议。
AID是存储在安全单元内的小程序(Application)或操作系统侧Application的ID。对于NFC应用场景而言,一个AID对应于一种类型的模拟卡。AID可用于表示NFC读卡器的读卡类型,因此,电子设备若获取到AID时,可根据AID识别出读卡器的读卡类型。电子设备可基于AID将激活卡切换为AID对应的模拟卡,从而实现了自动换卡,提高了刷卡效率。
示例性地,AID为535a542e57414c4c45542e454e56时,该AID对应的模拟卡为深圳通。
示例性地,AID为A000000632010105,该AID对应的模拟卡为深圳通互联互通卡。由于京津冀互联互通卡与深圳通互联互通卡为同一类型的模拟卡,因此京津冀互联互通卡对应的AID也为A000000632010105。
示例性地,小区门禁读卡器支持的协议为ISO14443-3协议,由于ISO14443-3协议为不选择AID的协议,因此,小区门禁读卡器不具备对应的AID。
NFC读卡器的读卡类型可包括电子设备能够读取的模拟卡的类型,如上表2所示,一个NFC读卡器可对应于一个或者多个AID,换言之,一个NFC读卡器能够读取一种或多种类型的模拟卡。例如,深圳公交闸机的读卡器对应于两个AID,则深圳公交闸机的读卡 器能够读取深圳通和深圳通互联互通卡两种类型的模拟卡;上海公交闸机的读卡器对应于一个AID,则上海公交闸机的读卡器能够读取上海通一种类型的模拟卡。
如上表1和表2所示,例如:不选择AID的协议包括ISO14443-3协议,选择AID的协议包括ISO14443-4协议。若SAK=0x08时,SAK对应的卡支持协议包括ISO14443-3协议;若SAK0x20或者SAK=0x28时,SAK对应的卡支持协议包括ISO14443-3协议和ISO14443-4协议。
示例性地,NFC读卡器从电子设备读取到SAK=0x08,SAK=0x08指明第一模拟卡只支持ISO14443-3协议,不支持ISO14443-4协议,NFC读卡器执行ISO14443-3协议的业务流程,不会执行ISO14443-4协议的业务流程,此时NFC读卡器执行不选择AID的业务流程,因此可将ISO14443-3协议称为不选择标识信息(AID)的协议。
示例性地,NFC读卡器从电子设备读取到SAK=0x20或者SAK=0x28,SAK=0x20或者SAK=0x28指明第一模拟卡支持ISO14443-3协议和ISO14443-4协议,NFC读卡器执行ISO14443-3协议的业务流程和ISO14443-4协议的业务流程,由于NFC读卡器支持执行ISO14443-4协议的业务流程,此时NFC读卡器可执行选择AID的业务流程,因此可将ISO14443-4协议称为选择标识信息(AID)的协议。
NFC读卡器可以基于SAK和NFC读卡器支持的协议确定出第一协议,并与电子设备执行第一协议的业务流程。当NFC读卡器从电子设备读取到SAK之后,可根据SAK确定出SAK对应的卡支持协议,再根据SAK对应的卡支持协议和NFC读卡器支持的协议确定出第一协议,并与电子设备执行第一协议的业务流程。例如:若SAK对应的卡支持协议包括不选择AID的协议(例如,ISO14443-3协议),且NFC读卡器支持的协议包括不选择AID的协议(例如,ISO14443-3协议)和选择AID的协议(例如,ISO14443-4协议),则NFC读卡器确定出的第一协议包括不选择AID的协议(例如,ISO14443-3协议);又例如:若SAK对应的卡支持协议包括不选择AID的协议(例如,ISO14443-3协议),且NFC读卡器支持的协议包括不选择AID的协议(例如,ISO14443-3协议),则NFC读卡器确定出的第一协议包括不选择AID的协议(例如,ISO14443-3协议);又例如:SAK对应的卡支持协议包括不选择AID的协议(例如,ISO14443-3协议)和选择AID的协议(例如,ISO14443-4协议),且NFC读卡器支持的协议包括不选择AID的协议(例如,ISO14443-3协议),则NFC读卡器确定出的第一协议包括不选择AID的协议(例如,ISO14443-3协议);又例如:SAK对应的卡支持协议包括不选择AID的协议(例如,ISO14443-3协议)和选择AID的协议(例如,ISO14443-4协议),NFC读卡器支持的协议包括不选择AID的协议(例如,ISO14443-3协议)和选择AID的协议(例如,ISO14443-4协议),则NFC读卡器确定出的第一协议包括不选择AID的协议(例如,ISO14443-3协议)和选择AID的协议(例如,ISO14443-4协议)。电子设备在与NFC读卡器执行第一协议的业务流程的过程中,会产生第一NCI流。而后,电子设备若判断出第一NCI流不包括AID,则判断出满足协议信息调整条件,需要对SAK进行修改,例如,将SAK=0x08修改为SAK=0x20,或者将SAK=0x08修改为SAK=0x28;电子设备若判断出第一NCI流包括AID,则判断出不满足协议信息调整条件,不需要对SAK进行修改,此时SAK对应的卡支持协议包括选择AID的协议,例如,ISO14443-4协议,SAK=0x20或者SAK=0x28。
电子设备在进行是否满足协议信息调整条件的判断操作以及修改SAK或不修改SAK 之后,SAK对应的卡支持协议均包括选择AID的协议(例如,ISO14443-4协议)。而后,NFC读卡器还可以基于SAK和NFC读卡器支持的协议确定出第二协议,并与电子设备执行第二协议的业务流程。当NFC读卡器再次从电子设备读取到SAK之后,可根据再次读取的SAK确定出SAK对应的卡支持协议,再根据SAK对应的卡支持协议和NFC读卡器支持的协议确定出第二协议,并与电子设备执行第二协议的业务流程。此时,SAK对应的卡支持协议包括选择AID的协议(例如,ISO14443-4协议),在此基础上,若NFC读卡器支持的协议包括不选择AID的协议(例如,ISO14443-3协议),NFC读卡器确定出的第二协议包括不选择AID的协议(例如,ISO14443-3协议);若NFC读卡器支持的协议包括不选择AID的协议(例如,ISO14443-3协议)和选择AID的协议(例如,ISO14443-4协议),NFC读卡器确定出第二协议包括不选择AID的协议(例如,ISO14443-3协议)和选择AID的协议(例如,ISO14443-4协议)。电子设备在与NFC读卡器执行第二协议的业务流程的过程中,会产生第二NCI流。若第二协议包括不选择AID的协议(例如,ISO14443-3协议)和选择AID的协议(例如,ISO14443-4协议),则NFC读卡器在与电子设备执行第二协议的业务流程的过程中,会向电子设备发送AID,因此电子设备生成的第二NCI流中包括AID,而后,电子设备判断出第二NCI流包括AID,则判断出满足换卡条件,需要进行换卡操作。若第二协议包括不选择AID的协议(例如,ISO14443-3协议),则NFC读卡器在与电子设备执行第二协议的业务流程的过程中,不会向电子设备发送AID,因此电子设备生成的第二NCI流中不包括AID,电子设备若判断出第二NCI流不包括AID,则判断出不满足换卡条件,无需进行换卡操作。
需要说明的是:若NFC读卡器确定出第一协议包括不选择AID的协议(例如,ISO14443-3协议)和选择AID的协议(例如,ISO14443-4协议),NFC读卡器与电子设备在执行第一协议的业务流程的过程中,NFC读卡器与电子设备先执行不选择AID的协议(例如,ISO14443-3协议)的业务流程,而后再执行选择AID的协议(例如,ISO14443-4协议)的业务流程。
需要说明的是:若NFC读卡器确定出第二协议包括不选择AID的协议(例如,ISO14443-3协议)和选择AID的协议(例如,ISO14443-4协议),NFC读卡器与电子设备在执行第二协议的业务流程的过程中,先执行不选择AID的协议(例如,ISO14443-3协议)的业务流程,而后再执行选择AID的协议(例如,ISO14443-4协议)的业务流程。
下面结合模拟卡的切换场景,通过一些具体的实施例对模拟卡的切换方法做出示例性说明。
在一些实施例中,激活卡为门禁卡。用户可在电子设备上设置默认卡为门禁卡,以使得激活卡为门禁卡;或者,如图6b所示,以门禁卡读卡器为中心建立地理围栏,地理围栏的预定区域覆盖到公交闸机,用户可在电子设备上设置默认卡为公交卡,基于地理围栏技术将默认卡公交卡切换为门禁卡,具体描述可参见对图6b的描述。
示例性地,如图7所示,用户从小区的家沿路径S1移动至小区外的公交车站,并在公交闸机处进行刷卡操作。用户将电子设备100的背面靠近公交闸机的读卡器,如图8a所示,电子设备100上显示“正在运行智闪卡”的提示,以及显示“请将手机背面靠近刷卡区域”的提示。公交闸机的读卡器从电子设备100读取SAK,由于激活卡为我的家门禁卡,因此读取的SAK=0x08。公交闸机的读卡器根据读取的SAK(0x08)确定出SAK对 应的卡支持协议为ISO14443-3协议,因此公交闸机的读卡器根据SAK对应的ISO14443-3协议以及自身支持的ISO14443-3协议和ISO14443-4协议,确定出第一协议包括ISO14443-3协议,并执行ISO14443-3协议的业务流程。而后,电子设备100判断出执行ISO14443-3协议的业务流程时产生的NCI流不包括AID,因此无法基于AID将门禁卡切换为AID对应的公交卡。为了实现切换为公交卡的目的,电子设备100将SAK配置为0x20,即将SAK=0x08修改为SAK=0x20。此时,公交闸机的读卡器再次从电子设备读取SAK,读取的SAK=0x20。公交闸机的读卡器根据读取的SAK(0x20)获取到SAK对应的卡支持协议为ISO14443-4协议,而公交闸机的读卡器自身支持的协议为ISO14443-4协议,因此公交闸机的读卡器根据SAK对应的ISO14443-3协议以及自身支持的ISO14443-3协议和ISO14443-4协议,确定出第二协议包括ISO14443-3协议和ISO14443-4协议,并执行ISO14443-3协议和ISO14443-4协议的业务流程。而后,电子设备100判断出执行ISO14443-3协议和ISO14443-4协议的业务流程时产生的NCI流包括AID,确定出进行换卡操作,进而基于AID将我的家门禁卡切换为AID对应的公交卡深圳通,即电子设备100去激活我的家门禁卡,激活“深圳通”,如图8b所示,电子设备100上弹出激活的公交卡“深圳通”,并在公交卡“深圳通”的下方显示公交卡的余额为¥27.18以及“充值”按钮。电子设备100通过公交卡“深圳通”与公交闸机完成刷卡交易,如图8c所示,电子设备100上显示本次交易金额为¥2.00,显示本次交易时间为2020/9/14 17:08,并显示公交卡的余额为¥25.18。
示例性地,如图7所示,用户在从公交车上下车后,沿路径S2先从公交车站移动至小区的门禁卡读卡器所在位置,并在门禁卡读卡器处进行刷卡操作。用户将电子设备的背面靠近门禁卡读卡器,如图9a所示,电子设备100上显示“正在运行智闪卡”的提示,以及显示“请将手机背面靠近刷卡区域”的提示。门禁卡读卡器从电子设备100读取SAK,由于激活卡为我的家门禁卡,因此读取的SAK=0x08。门禁卡读卡器根据读取的SAK(0x08)确定出SAK对应的卡支持协议为ISO14443-3协议,因此门禁卡读卡器根据SAK对应的ISO14443-3协议和以及自身支持的ISO14443-3协议和ISO14443-4协议,确定出第一协议包括ISO14443-3协议,并执行ISO14443-3协议的业务流程。而后,电子设备100判断出执行ISO14443-3协议的业务流程时产生的NCI流不包括AID,因此电子设备100将SAK配置为0x20,即将SAK=0x08修改为SAK=0x20。此时,门禁卡读卡器再次从电子设备读取SAK,读取的SAK=0x20。门禁卡读卡器根据读取的SAK(0x20)获取到SAK对应的卡支持协议为ISO14443-4协议,而门禁卡读卡器自身支持的协议为ISO14443-3协议,无论SAK的值是多少,SAK对应的卡支持协议是哪种协议,由于门禁卡读卡器自身支持的协议为ISO14443-3协议,因此门禁卡读卡器在根据SAK对应的ISO14443-4协议以及自身支持的ISO14443-3协议和ISO14443-4协议确定第二协议时最终都会确定出第二协议为ISO14443-3协议,并与电子设备执行ISO14443-3协议的业务流程。电子设备100判断出执行ISO14443-3协议的业务流程时产生的NCI流不包括AID,无法执行基于AID的换卡操作,因此不会对门禁卡进行换卡操作。如图9b所示,电子设备100上弹出门禁卡“我的家”。电子设备100通过门禁卡与门禁卡读卡器完成刷卡操作,如图9c所示,电子设备100上显示“刷卡成功”,而后小区的门打开,用户继续沿路径S2移动至家所在位置。
需要说明的是,图4、图8a至图8c以及图9a至图9c所示的电子设备的界面示意图 为本申请实施例的示例性展示,电子设备的界面示意图也可以为其它样式,本申请实施例对此不作限定。
下面通过一个具体的实施例,示例性说明模拟卡的切换方法的工作流程。本实施例的方案可应用于电子设备处于熄屏状态或者亮屏状态,例如,电子设备处于亮屏状态可包括电子设备的显示界面为主页或者任意应用程序的操作界面。图10是一些实施例中模拟卡的切换方法的流程图,图11是一些实施例中模拟卡的切换方法的信令流程图,如图10和图11所示,该方法包括:
步骤102、电子设备激活第一模拟卡,以使第一模拟卡为激活卡。
示例性地,第一模拟卡为门禁卡。用户可在电子设备上将默认卡设置为门禁卡,则门禁卡为激活卡。或者,以门禁卡刷卡器为中心建立地理围栏,电子设备进入地理围栏的预定区域内,则激活门禁卡,使得门禁卡为激活卡。
示例性地,第一模拟卡还可以为深圳通公交卡。用户可在电子设备上将默认卡设置为深圳通公交卡,则深圳通公交卡为激活卡。
如图11所示,电子设备的NFC控制器激活第一模拟卡。
步骤104、电子设备接收NFC读卡器发送的NFC场强信息。
如图11所示,电子设备靠近NFC读卡器,电子设备的NFC控制器接收到NFC读卡器发送的NFC场强信息,表明NFC控制器检测到NFC读卡器发出的NFC射频场。进而,NFC控制器向NFC读卡器发送场强信息接收应答信息。
本申请实施例中,NFC读卡器采用轮询方式与电子设备进行信息交互。
步骤106、NFC读卡器从电子设备获取第一模拟卡的协议信息,该第一模拟卡的协议信息包括第一信息。
第一模拟卡的协议信息包括SAK。
第一信息可用于表示不选择AID的协议,则第一信息对应的卡支持协议包括不选择AID的协议。例如,第一信息包括0x08,即SAK=0x08,第一模拟卡可包括我的家门禁卡。
或者,第一信息可用于表示选择AID的协议,则第一信息对应的卡支持协议包括选择AID的协议。例如,第一信息包括0x20或者0x28,即SAK=0x20或SAK=0x28,第一模拟卡可包括深圳通公交卡。
本步骤具体可包括:
步骤1062、NFC读卡器发送协议信息读取请求。
步骤1064、电子设备响应于接收到的协议信息读取请求,向NFC读卡器发送第一信息。
如图11所示,电子设备的NFC控制器响应于接收到的协议信息读取请求,向NFC读卡器发送第一信息。
步骤108、NFC读卡器根据第一信息和NFC读卡器支持的协议,确定出第一协议,并与电子设备执行第一协议的业务流程。
具体地,NFC读卡器根据第一信息确定出第一信息对应的卡支持协议,再根据第一信息对应的卡支持协议和NFC读卡器支持的协议确定出第一协议,并与电子设备执行第一协议的业务流程。
步骤110、电子设备根据与NFC读卡器执行第一协议的业务流程时产生的第一NCI 流判断是否满足协议信息调整条件,若是,则执行步骤112;若否,则执行步骤130。
本步骤中,电子设备若判断出满足协议信息调整条件,表明需要调整SAK;电子设备若判断出不满足协议信息调整条件,表明无需调整SAK。
本步骤中,电子设备若判断出第一NCI流不包括AID,则判断出满足协议信息调整条件;电子设备若判断出第一NCI流包括AID,则判断出不满足协议信息调整条件。
在电子设备与NFC读卡器执行第一协议的业务流程的过程中,NFC控制器可向处理器发送第一NCI流。
如图12所示,本步骤具体可包括:
步骤1102、处理器在第一设定时间段内是否接收到NFC控制器发送的第一NCI流中的NFC射频激活通知消息,若是,则执行步骤1104;若否,则执行步骤112。
处理器若在第一设定时间段内接收到第一NCI流中的NFC射频激活通知消息,继续执行步骤1104;处理器若在第一时间段内未接收到第一NCI流中的NFC射频激活通知消息,无需再继续等待接收第一NCI流中的AID通知消息,直接判断出满足协议调整条件,并继续执行步骤112。
步骤1104、处理器在第二设定时间段内是否接收到NFC控制器发送的第一NCI流中的AID通知消息,该第一NCI流中的AID通知消息包括AID,若是,则执行步骤130;若否,则执行步骤112。
处理器若在第二设定时间段内接收到第一NCI流中的AID通知消息,判断出不满足协议调整条件,继续执行步骤130;处理器若在第二设定时间段内未接收到第一NCI流中的AID通知消息,判断出满足协议调整条件,并继续执行步骤112。
步骤112、电子设备将第一模拟卡的协议信息配置为第二信息。
第一信息可用于表示选择AID的协议,则第二信息对应的卡支持协议包括选择AID的协议。例如,第二信息包括0x20或者0x28,即SAK=0x20或SAK=0x28。本步骤中,电子设备将SAK由0x08修改为0x20或者0x28。
如图11所示,本步骤具体可包括:
步骤1122、处理器向NFC控制器发送配置控制命令(NFCC_CONFIG_CONTROL)。
配置控制命令用于表示NCI2.0的标准协议,通过该配置控制命令带有指定的参数值,告知NFC控制器运行电子设备侧的主机(Host)以配置芯片参数。
步骤1124、NFC控制器向处理器发送配置控制命令应答消息。
步骤1126、处理器向NFC控制器发送参数配置命令(CORE_SET_CONFIG_CMD),该参数配置命令包括第二信息。
参数配置命令用于表示NCI1.0的标准协议,通过该参数配置命令带有第二信息,告知NFC控制器配置SAK为第二信息。
步骤1128、NFC控制器向处理器发送参数配置命令应答消息。
步骤1130、NFC控制器将第一模拟卡的协议信息配置为第二信息。
NFC控制器将SAK由0x08修改为0x20或者0x28。
步骤114、电子设备接收NFC读卡器发送的NFC场强信息。
步骤116、NFC读卡器从电子设备获取第二信息。
本步骤具体可包括:
步骤1162、NFC读卡器向电子设备发送协议信息读取请求。
步骤1164、电子设备响应于接收到的协议信息读取请求,向NFC读卡器发送第二信息。
如图11所示,电子设备的NFC控制器响应于接收到的协议信息读取请求,向NFC读卡器发送第二信息。
步骤118、NFC读卡器根据第二信息和NFC读卡器支持的协议,确定出第二协议,并与电子设备执行第二协议的业务流程。
具体地,NFC读卡器根据SAK确定出第二信息对应的卡支持协议,再根据第二信息对应的卡支持协议和NFC读卡器支持的协议确定出第二协议,并与电子设备执行第二协议的业务流程。
步骤120、电子设备根据与NFC读卡器执行第二协议的业务流程时产生的第二NCI流判断是否满足换卡条件,若是,则执行步骤122;若否,则执行步骤128。
本步骤中,电子设备若判断出满足换卡条件,表明需要对第一模拟卡进行换卡操作;电子设备若判断出不满足换卡条件,表明无需对第一模拟卡进行换卡操作。
本步骤中,电子设备若判断出第二NCI流包括AID,则判断出满足换卡条件;电子设备若判断出第二NCI流不包括AID,则判断出不满足换卡条件。
在电子设备与NFC读卡器执行第二协议的业务流程的过程中,NFC控制器可向处理器发送第二NCI流。
如图13所示,本步骤具体可包括:
步骤1202、处理器在第一设定时间段内是否接收到NFC控制器发送的第二NCI流中的NFC射频激活通知消息,若是,则执行步骤1204;若否,则执行步骤128。
处理器若在第一设定时间段内接收到第二NCI流中的NFC射频激活通知消息,继续执行步骤1204;处理器若在第一时间段内未接收到第二NCI流中的NFC射频激活通知消息,无需再继续等待接收第二NCI流中的AID通知消息,直接判断出不满足换卡条件,并继续执行步骤128。
步骤1204、处理器在第二设定时间段内是否接收到NFC控制器发送的第二NCI流中的AID通知消息,该第二NCI流中的AID通知消息包括AID,若否,则执行步骤128;若是,则执行步骤122。
处理器若在第二设定时间段内接收到第二NCI流中的AID通知消息,判断出满足换卡,继续执行步骤122;处理器若在第二设定时间段内未接收到第二NCI流中的AID通知消息,判断出不满足换卡条件,并继续执行步骤128。
步骤122、电子设备将第一模拟卡的协议信息配置为第一信息。
本步骤中,电子设备将SAK由0x20或者0x28修改为0x08,以将SAK还原为0x08。
如图11所示,本步骤具体可包括:
步骤1222、处理器向NFC控制器发送配置控制命令。
步骤1224、NFC控制器向处理器发送配置控制命令应答消息。
步骤1226、处理器向NFC控制器发送参数配置命令,该参数配置命令包括第一信息。
步骤1228、NFC控制器向处理器发送参数配置命令应答消息。
步骤1230、NFC控制器将第一模拟卡的协议信息配置为第一信息。
NFC控制器将SAK由0x20或者0x28还原为0x08。
步骤124、电子设备根据第二NCI流中的AID,将第一模拟卡切换为第二NCI流中的AID对应的第二模拟卡。
本申请实施例中,第二NCI流可包括一个或者多个AID。
若第二NCI流包括一个AID,则电子设备可根据该AID将第一模拟卡切换为该AID对应的第二模拟卡。
若第二NCI流包括多个AID,则电子设备可根据该多个AID确定出一个AID,并根据确定出的AID将第一模拟卡切换为该确定出的AID对应的第二模拟卡。例如:当模拟卡为公交卡时,可根据用户偏好、卡余额或设定规则确定出一个AID,例如,设定规则为优先选用本地公交卡。
例如:若确定出的AID为A000000632010105,该AID对应的第二模拟卡为深圳通互联互通卡。则电子设备将我的家门禁卡切换为深圳通互联互通卡。
如图14所示,本步骤具体可包括:
步骤1242、电子设备去激活第一模拟卡。
如图11所示,NFC控制器去激活第一模拟卡。
步骤1244、电子设备激活第二NCI流中的AID对应的第二模拟卡。
如图11所示,NFC控制器激活第二NCI流中的AID对应的第二模拟卡。
步骤126、电子设备基于第二模拟卡与NFC读卡器完成业务处理流程。
步骤128、电子设备将第一模拟卡的协议信息配置为第一信息。
如图11所示,本步骤具体可包括:
步骤1282、处理器向NFC控制器发送配置控制命令。
步骤1284、NFC控制器向处理器发送配置控制命令应答消息。
步骤1286、处理器向NFC控制器发送参数配置命令,该参数配置命令包括第一协议消息。
步骤1288、NFC控制器向处理器发送参数配置命令应答消息。
步骤1230、NFC控制器将第一模拟卡的协议信息配置为第一信息。
步骤130、电子设备基于第一模拟卡与NFC读卡器完成业务处理流程。
作为一种可选方案,若第一模拟卡为我的家门禁卡,NFC读卡器为小区门禁读卡器时,则在步骤128之后执行的步骤130中,电子设备基于我的家门禁卡与小区门禁读卡器完成业务处理流程。
作为另一种可选方案,若第一模拟卡为深圳通公交卡,NFC读卡器为深圳公交闸机的读卡器,则在步骤110之后执行的步骤130中,电子设备基于深圳通公交卡与深圳公交闸机的读卡器完成业务处理流程。
本申请实施例中,电子设备还用于展示提示信息,提示信息用于提示用户刷卡成功或者刷卡失败。例如:该提示信息可包括提示音或者文字提示。
本申请实施例中,电子设备还用于响应于用户输入的第一操作,展示默认卡为第二模拟卡。其中,第一操作可包括点击钱包应用程序的图标,电子设备响应于第一操作以进入钱包应用程序的页面,该页面可展示默认卡,例如:默认卡可包括第一模拟卡或者第二模拟卡。
示例性地,电子设备未执行模拟卡的切换过程,即第一模拟卡为激活卡时,当用户在电子设备上输入第一操作时,电子设备可展示默认卡为第一模拟卡,例如:展示默认卡为我的家门禁卡。
示例性地,在步骤126和步骤130之后,由于电子设备将第一模拟卡切换为第二模拟卡,则当用户在电子设备上输入第一操作时,电子设备可展示默认卡为第二模拟卡,例如:展示默认卡为深圳通公交卡。或者,在电子设备将第一模拟卡切换为第二模拟卡并基于第二模拟卡完成刷卡流程之后,当用户在电子设备上输入第一操作时,电子设备可展示默认卡为第一模拟卡,例如:展示默认卡为我的家门禁卡,此时,电子设备将默认卡还原为第一模拟卡。
需要说明的是,上述SAK、AID和协议均为本申请实施例的示例性展示,SAK、AID和协议均可以为其它内容,本申请实施例对此不作限定。
本申请实施例提供的模拟卡的切换方法的技术方案中,电子设备通过调整激活卡第一模拟卡的协议信息,使得NFC读卡器能够根据调整后的协议信息和自身支持的协议与电子设备执行指定协议的业务流程,电子设备执行协议的业务流程时获取到AID并基于AID自动将第一模拟卡切换为AID对应的第二模拟卡,实现了自动换卡,从而提高了刷卡效率。
下面通过与相关技术中自动换卡的方法进行对比,并且以电子设备包括手机以及NFC包括公交闸机的读卡器为例,对本申请实施例的技术方案进行详细描述。
如图15a所示,用户通过手机在公交闸机处进行刷卡操作。手机的激活卡为门禁卡,手机靠近公交闸机,公交闸机从手机读取SAK,此时SAK为0x08,SAK对应的卡支持协议为不选择AID的协议ISO14443-3协议。公交闸机与手机执行ISO14443-3协议的业务流程,在执行ISO14443-3协议的业务流程中公交闸机不会向手机返回AID。手机无法基于AID进行换卡,当前激活卡仍为门禁卡,弹出门禁卡。用户在手机上查看到弹出门禁卡,向手机输入换卡操作,例如,换卡操作包括点击深圳通公交卡(如图5b所示),将门禁卡切换为深圳通公交卡。手机基于深圳通公交卡与公交闸机完成刷卡交易,刷卡成功。
如图15b所示,用户通过手机在公交闸机处进行刷卡操作。手机的激活卡为门禁卡,手机靠近公交闸机,公交闸机从手机读取SAK,此时SAK为0x08,SAK对应的卡支持协议为不选择AID的协议ISO14443-3协议,公交闸机与手机执行ISO14443-3协议的业务流程,在执行ISO14443-3协议的业务流程中公交闸机不会向手机返回AID。手机将SAK修改为0x20,公交闸机从手机读取SAK,此时SAK为0x20,SAK对应的卡支持协议包括不选择AID的协议ISO14443-3协议和选择AID的协议ISO14443-4协议。公交闸机与手机执行ISO14443-3协议的业务流程和ISO14443-4协议的业务流程,在执行ISO14443-4协议的业务流程中公交闸机会向手机返回AID。手机基于AID自动将门禁卡切换为AID对应的深圳通公交卡。手机基于深圳通公交卡与公交闸机完成刷卡交易,刷卡成功。
从上述图15a和图15b所示,相关技术的方案需要手动将门禁卡切换为深圳通公交卡,而本申请实施例的方案可实现自动将门禁卡切换为深圳通公交卡,从而实现了自动换卡,提高了刷卡效率。
相关技术中可基于AID进行模拟卡的切换。若激活卡为默认卡,NFC读卡器为小区门禁读卡器时,需要将默认卡切换为目标卡。
小区门禁读卡器支持的协议包括不选择AID的协议,门禁卡对应的卡支持协议包括不 选择AID的协议,因此门禁卡没有对应的AID。当用户通过电子设备在小区门禁读卡器处进行刷卡操作时,需要盲等一段预设时间,在预设时间内判断是否获取到小区门禁读卡器发送的AID,若未获取到AID,通过排除法确定出目标卡为门禁卡,即小区门禁读卡器所要刷的模拟卡为门禁卡,而后将默认卡切换为门禁卡,以实现智选到门禁卡。电子设备刷卡时需要进入NFC读卡器的场强,且需要盲等一段预设时间,造成模拟卡的切换速度慢,导致刷卡速度慢,从而降低了刷卡效率。
用户通过电子设备在小区门禁读卡器处进行刷卡操作时,小区门禁读卡器先读取到电子设备上预设置的默认卡后,电子设备上的钱包应用即便立即完成自动换卡,以将默认卡切换到目标卡,小区门禁读卡器也不会重新进行读卡,从而造成刷卡失败。此时需要用户将电子设备从小区门禁读卡器处拿开,然后重新靠近小区门禁读卡器才能刷卡成功。此种异常是小区门禁读卡器的行为引起的,但也是刷卡时,在小区门禁读卡器的场强内才能进行模拟卡的切换操作引起的副作用。这样造成模拟卡的切换速度慢,导致刷卡速度慢,从而降低了刷卡效率。
在通过排除法选择出门禁卡的方案中,只能选择出一张门禁卡,此时若电子设备上设置有多张门禁卡时,而选择出的门禁卡无法完成刷卡时,需要用户将选择出的门禁卡切换到正确的门禁卡。这样造成模拟卡的切换速度慢,导致刷卡速度慢,从而降低了刷卡效率。
为解决上述技术问题,本申请另一些实施例还提供了一种模拟卡的切换方法。本申请实施例中,当电子设备进入预设区域内时采集当前位置指纹,计算当前位置指纹和预先采集的刷卡点指纹之间的相似度,若相似度大于门限值时,将激活卡切换为与刷卡点指纹匹配的模拟卡。本申请可基于相似度的变化,判断出电子设备是靠近刷卡点还是远离刷卡点,从而决定是否切换为与刷卡点指纹匹配的模拟卡。本申请实施例若判断出电子设备靠近刷卡点时,实现了提前预切卡,则当用户移动至刷卡点时电子设备可直接与NFC读卡器完成刷卡过程,从而提高了刷卡效率。
图16是本申请另一些实施例中模拟卡的切换方法的流程图,如图16所示,该方法包括:
步骤202、电子设备采集刷卡点的刷卡点指纹,并建立刷卡点指纹与目标卡的对应关系。
刷卡点设置有NFC读卡器,例如,NFC读卡器为小区门禁读卡器。
用户通过电子设备在刷卡点位置处首次进行刷卡时,电子设备采集刷卡点的周边网络设备的特征,并将刷卡点的周边网络设备的特征作为刷卡点指纹,该刷卡点指纹包括:周边网络设备的ID和该ID对应的信号参数。
采集的刷卡点指纹包括但不仅限于如下几种刷卡点指纹:
(1)若周边网络为WiFi网络时,周边网络设备的ID包括BSSID,对应的信号参数包括RSSI,则采集的刷卡点指纹包括WiFi网络的BSSID和RSSI,每个BSSID对应于一个RSSI。一般刷卡点的周边会存在多个WiFi网络设备,则可采集多个刷卡点指纹,即采集到多组BSSID和对应的RSSI。
(2)若周边网络为BT网络或者BLE网络时,周边网络设备的ID包括BSSID,对应的信号参数包括RSSI,则采集的刷卡点指纹包括BT网络或BLE网络的BSSID和RSSI,每个BSSID对应于一个RSSI。一般刷卡点的周边会存在多个BT网络或BLE网络,则可 采集多个刷卡点指纹,即采集到多组BSSID和对应的RSSI。
(3)若周边网络设备为Cell基站时,周边网络设备的ID包括CID,对应的信号参数包括信号值dBm,则采集的刷卡点指纹包括Cell基站的CID和信号值dBm,每个CID对应于一个信号值dBm。一般刷卡点的周边会存在多个Cell基站,则可采集多个刷卡点指纹,即采集到多组CID和对应的信号值dBm。
本步骤中,建立刷卡点指纹与目标卡的对应关系中,目标卡为在刷卡点的NFC读卡器进行刷卡操作的模拟卡。
步骤204、电子设备若进入特定区域,采集当前位置指纹。
本申请实施例,电子设备在进入特定区域后,可采用熄屏扫描的方式扫描周边网络,以采集到当前位置指纹。
本申请实施例中,可以刷卡点作为中心点建立地理围栏,地理围栏覆盖的区域为特定区域。电子准备进入地理围栏后,开始周期采集当前位置指纹。电子设备离开地理围栏后,停止采集当前位置指纹。
电子设备在电子围栏中移动时,电子设备周期性采集当前位置的周边网络设备的特征,并将当前位置的周边网络设备的特征作为当前位置指纹,该当前位置指纹包括:周边网络设备的ID和该ID对应的信号参数。
采集的当前位置指纹包括但不仅限于如下几种刷卡点指纹:
(1)若周边网络为WiFi网络时,周边网络设备的ID包括BSSID,对应的信号参数包括RSSI,则采集的当前位置指纹包括WiFi网络的BSSID和RSSI,每个BSSID对应于一个RSSI。一般刷卡点的周边会存在多个WiFi网络设备,则可采集多个刷卡点指纹,即采集到多组BSSID和对应的RSSI。
(2)若周边网络为BT网络或者BLE网络时,周边网络设备的ID包括BSSID,对应的信号参数包括RSSI,则采集的当前位置指纹包括BT网络或BLE网络的BSSID和RSSI,每个BSSID对应于一个RSSI。一般刷卡点的周边会存在多个BT网络或BLE网络,则可采集多个刷卡点指纹,即采集到多组BSSID和对应的RSSI。
(3)若周边网络设备为Cell基站时,周边网络设备的ID包括CID,对应的信号参数包括信号值dBm,则采集的当前位置指纹包括Cell基站的CID和信号值dBm,每个CID对应于一个信号值dBm。一般刷卡点的周边会存在多个Cell基站,则可采集多个刷卡点指纹,即采集到多组CID和对应的信号值dBm。
电子设备在电子围栏中移动时,周期性(即间隔时间)采集的当前位置指纹不停发生变化。
步骤206、电子设备计算当前位置指纹和刷卡点指纹之间的相似度。随着用户走动,间隔时间采集的当前位置指纹不停发生变化,因此计算所得的相似度也不停地变化。
把刷卡点指纹标记为F1,把标记为F2。
本步骤具体可包括:
步骤2062、查询出刷卡点指纹F1和当前位置指纹F2中相同的ID,并根据相同的ID形成相同设备集合[ID1,ID2…,IDn],F1和F2中相同ID的个数为n。
步骤2064、根据F1中相同设备集合的ID对应的信号参数形成F1的第一信号参数集合[Q1,Q2…,Qn];根据F2中相同设备集合的ID对应的信号参数形成F2的第二信号参数 集合[Q1’,Q2’…,Qn’]。
步骤2066、计算出相似度。
作为一种可选方案,根据相同设备集合的元素个数n和刷卡点指纹F1中的ID个数m,计算出相似度,其中,n<=m。例如,相似度S=1/(m-n+1)。n与m越接近,计算出的相似度越大。
作为另一种可选方案,根据第一信号参数集合和第二信号参数集合,计算出相似度。例如,相似度S=1/(d+1),d可以为第一信号参数集合[Q1,Q2…,Qn]和第二信号参数集合[Q1’,Q2’…,Qn’]之间的欧式距离,可通过欧氏距离公式对[Q1,Q2…,Qn]和[Q1’,Q2’…,Qn’]进行计算生成d。d越小,计算出的相似度越大。
作为另一种可选方案,根据相同设备集合的元素个数n、刷卡点指纹F1中的ID个数m、第一信号参数集合和第二信号参数集合计算出相似度。例如:相似度S=k1/(m-n+1)+k2/(d+1),其中,k1和k2为权重系数,k1+k2=1。
本步骤中计算出的相似度的取值大于0且小于或等于1。
步骤208、基于相似度进行模拟卡的切换。
相似度用于表示当前位置与刷卡点位置之间的接近程度。相似度越大,表明电子设备越靠近刷卡点;相似度越小,表明电子设备越远离刷卡点。
若判断出相似度大于或等于门限值时,表示电子设备已经很靠近刷卡点,根据建立的刷卡点指纹与目标卡的对应关系,将激活卡切换为与刷卡点指纹匹配的目标卡。例如,激活卡为交通卡深圳通,目标卡为门禁卡。而后当用户移动至刷卡点时,由于电子设备已经预先完成了切换卡的过程,因此可以直接在刷卡点的NFC读卡器上进行门禁卡的刷卡操作,从而提高了刷卡速度,提高了刷卡效率。
若判断出相似度小于门限值时,表示电子设备已经很远离刷卡点,根据建立的刷卡点指纹与目标卡的对应关系,将激活卡切换为默认卡。例如,激活卡为门禁卡,默认卡为交通卡深圳通。
本实施例提供的技术方案中,电子设备采集刷卡点的刷卡点指纹并建立刷卡点指纹与目标卡的对应关系,若进入特定区域采集当前位置指纹,计算当前位置指纹和刷卡点指纹之间的相似度,基于相似度进行模拟卡的切换,实现了基于相似度自动进行预切换卡的操作,解决电子设备靠近NFC读卡器才能切换卡而导致的刷两次卡以及刷卡慢的问题,从而提高了刷卡效率。本申请实施例的方案由于是基于相似度自动进行预切换卡的操作,解决了电子设备上设置有多张门禁卡时自动进行预切换卡的问题,无需用户手动换卡,从而提高了刷卡效率。
本申请实施例提供了一种电子设备,该电子设备可以是终端设备也可以是内置于所述终端设备的电路设备。该电子设备包括:显示屏;一个或多个处理器;存储器;以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述设备执行时,使得所述设备可以用于执行上述模拟卡的切换方法实施例中的各个步骤。
本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令在计算机上运行时,使得计算机执行如上述模拟卡的切换方法实施例中的各个步骤。
本申请实施例提供了一种包含指令的计算机程序产品,当所述计算机程序产品在计算机或任一至少一种处理器上运行时,使得所述计算机执行上述模拟卡的切换方法实施例中的各个步骤。
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示单独存在A、同时存在A和B、单独存在B的情况。其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项”及其类似表达,是指的这些项中的任意组合,包括单项或复数项的任意组合。例如,a,b和c中的至少一项可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。
本领域普通技术人员可以意识到,本文中公开的实施例中描述的各单元及算法步骤,能够以电子硬件、计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,任一功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。本申请的保护范围应以所述权利要求的保护范围为准。
Claims (25)
- 一种通信系统,其特征在于,包括:近场通信NFC读卡器和具有NFC功能的电子设备,所述电子设备上设置有第一模拟卡和第二模拟卡,所述第一模拟卡为激活卡,所述第一模拟卡的卡支持协议为第一协议,所述第二模拟卡的卡支持协议为第二协议;所述NFC读卡器,用于从所述电子设备获取第一模拟卡的第一信息,根据所述第一信息和自身支持的协议确定出第一协议,并与所述电子设备执行所述第一协议的业务流程;所述电子设备,用于若执行所述第一协议的业务流程时未获取到标识信息,将所述第一模拟卡的协议信息从第一信息修改为第二信息;所述NFC读卡器,还用于从所述电子设备获取所述第二信息,根据所述第二信息对应的卡支持协议和自身支持的协议确定出第二协议,并与所述电子设备执行所述第二协议的业务流程;所述电子设备,还用于若执行所述第二协议的业务流程时获取到标识信息,根据所述标识信息将所述第一模拟卡切换为所述标识信息对应的第二模拟卡。
- 根据权利要求1所述的系统,其特征在于,所述第一协议包括ISO14443-3协议,所述第二协议包括ISO14443-3协议和ISO14443-4协议。
- 根据权利要求1所述的系统,其特征在于,所述电子设备还用于响应于用户输入的第一操作,展示默认卡为第二模拟卡。
- 根据权利要求1至3任一所述的系统,其特征在于,所述第一模拟卡为门禁卡,所述第二模拟卡为公交卡。
- 一种模拟卡的切换方法,其特征在于,应用于电子设备,所述电子设备上设置有第一模拟卡和第二模拟卡,所述第一模拟卡为激活卡,所述第一模拟卡的卡支持协议为第一协议,所述第二模拟卡的卡支持协议为第二协议;所述方法包括:向NFC读卡器发送第一模拟卡的第一信息,以供所述NFC读卡器根据所述第一信息和自身支持的协议确定出第一协议,并与所述电子设备执行所述第一协议的业务流程;若与所述NFC读卡器执行第一协议的业务流程时未获取到标识信息,将所述第一模拟卡的协议信息从第一信息修改为第二信息;向所述NFC读卡器发送第二信息,以供NFC读卡器从所述电子设备获取所述第二信息,根据所述第二信息和自身支持的协议确定出第二协议,并与所述电子设备执行所述第二协议的业务流程;若与所述NFC读卡器执行所述第二协议的业务流程时获取到标识信息,根据所述标识信息将所述第一模拟卡切换为所述标识信息对应的第二模拟卡。
- 根据权利要求5所述的方法,其特征在于,所述第一协议包括不选择标识信息的协议,则执行所述第一协议的业务流程包括:执行不选择标识信息的协议的业务流程。
- 根据权利要求5所述的方法,其特征在于,所述第二协议包括不选择标识信息的协议和选择标识信息的协议,则执行所述第二指定协议的业务流程包括:执行不选择标识信息的业务流程以及执行选择标识信息的协议的业务流程。
- 根据权利要求5所述的方法,其特征在于,所述第一协议包括ISO14443-3协议,所述第二协议包括ISO14443-3协议和ISO14443-4协议。
- 根据权利要求5至8任一所述的方法,其特征在于,所述标识信息包括应用标识 符AID。
- 根据权利要求5至9任一所述的方法,其特征在于,所述第一模拟卡的协议信息为选择确认SAK。
- 根据权利要求5所述的方法,其特征在于,还包括:响应于用户输入的第一操作,展示默认卡为第二模拟卡。
- 根据权利要求5所述的方法,其特征在于,还包括:展示提示信息,所述提示信息用于提示用户刷卡成功或者刷卡失败。
- 根据权利要求5至12任一所述的方法,其特征在于,所述第一模拟卡为门禁卡,所述第二模拟卡为公交卡。
- 一种电子设备,其特征在于,所述电子设备包括处理器和NFC控制器,所述电子设备上设置有第一模拟卡和第二模拟卡,所述第一模拟卡为激活卡,所述第一模拟卡的卡支持协议为第一协议,所述第二模拟卡的卡支持协议为第二协议;所述NFC控制器,用于向NFC读卡器发送所述第一模拟卡的第一信息,以供所述NFC读卡器根据所述第一信息和自身支持的协议确定出第一协议,并与所述电子设备执行所述第一协议的业务流程;所述NFC控制器,还用于将所述NFC读卡器与所述电子设备执行所述第一协议的业务流程时产生的第一业务信息发送至所述处理器;所述处理器,用于若所述第一业务信息未包括标识信息,与所述NFC控制器之间进行信息交互,以使所述NFC控制器将所述第一模拟卡的协议信息从第一信息修改为第二信息;所述NFC控制器,还用于向所述NFC读卡器发送第二信息,以供NFC读卡器从所述电子设备获取所述第二信息,根据所述第二信息和自身支持的协议确定出第二协议,并与所述电子设备执行所述第二协议的业务流程;所述NFC控制器,还用于将所述NFC读卡器与所述电子设备执行所述第二协议的业务流程时产生的第二业务信息发送至所述处理器;所述处理器,还用于若所述第二业务信息包括标识信息,触发所述第二NFC控制器;所述NFC控制器,还用于根据所述标识信息将所述第一模拟卡切换为所述标识信息对应的第二模拟卡。
- 一种电子设备,其特征在于,包括:显示屏;一个或多个处理器;存储器;以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述设备执行时,使得所述设备执行以下步骤:向NFC读卡器发送第一模拟卡的第一信息,以供所述NFC读卡器根据所述第一信息和自身支持的协议确定出第一协议,并与所述电子设备执行所述第一协议的业务流程;若与所述NFC读卡器执行第一协议的业务流程时未获取到标识信息,将第一模拟卡的协议信息从第一信息修改为第二信息;向所述NFC读卡器发送第二信息,以供NFC读卡器从所述电子设备获取所述第二信息,根据所述第二信息和自身支持的协议确定出第二协议,并与所述电子设备执行所述第二协议的业务流程;若与所述NFC读卡器执行所述第二协议的业务流程时获取到标识信息,根据所述标识 信息将第一模拟卡切换为所述标识信息对应的第二模拟卡。
- 根据权利要求15所述的电子设备,其特征在于,当所述指令被所述设备执行时,使得所述设备具体执行以下步骤:所述第一协议包括不选择标识信息的协议,执行不选择标识信息的协议的业务流程。
- 根据权利要求15所述的电子设备,其特征在于,当所述指令被所述设备执行时,使得所述设备具体执行以下步骤:所述第二协议包括不选择标识信息的协议和选择标识信息的协议,执行不选择标识信息的业务流程以及执行选择标识信息的协议的业务流程。
- 根据权利要求15所述的电子设备,其特征在于,所述第一协议包括ISO14443-3协议,所述第二协议包括ISO14443-3协议和ISO14443-4协议。
- 根据权利要求15至18任一所述的电子设备,其特征在于,所述标识信息包括应用标识符AID。
- 根据权利要求15至19任一所述的电子设备,其特征在于,所述第一模拟卡的协议信息包括选择确认SAK。
- 根据权利要求15所述的电子设备,其特征在于,当所述指令被所述设备执行时,使得所述设备执行以下步骤:响应于用户输入的第一操作,展示默认卡为第二模拟卡。
- 根据权利要求15所述的电子设备,其特征在于,当所述指令被所述设备执行时,使得所述设备执行以下步骤:展示提示信息,所述提示信息用于提示用户刷卡成功或者刷卡失败。
- 根据权利要求15至22任一所述的电子设备,其特征在于,所述第一模拟卡为门禁卡,所述第二模拟卡为公交卡。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括存储的程序,其中,在所述程序运行时控制所述计算机可读存储介质所在设备执行权利要求5至13中任意一项所述的模拟卡的切换方法。
- 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在计算机或任一至少一种处理器上运行时,使得所述计算机执行如权利要求5至13中任意一项所述的模拟卡的切换方法。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP21881967.0A EP4209961A4 (en) | 2020-10-21 | 2021-10-18 | EMULATION CARD SWITCHING METHOD, ELECTRONIC DEVICE AND COMMUNICATION SYSTEM |
US18/249,921 US12131213B2 (en) | 2020-10-21 | 2021-10-18 | Emulated card switching method, electronic device, and communication system |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011133300.9 | 2020-10-21 | ||
CN202011133300.9A CN114462560B (zh) | 2020-10-21 | 2020-10-21 | 一种模拟卡的切换方法、电子设备和通信系统 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022083551A1 true WO2022083551A1 (zh) | 2022-04-28 |
Family
ID=81291564
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/124450 WO2022083551A1 (zh) | 2020-10-21 | 2021-10-18 | 一种模拟卡的切换方法、电子设备和通信系统 |
Country Status (3)
Country | Link |
---|---|
EP (1) | EP4209961A4 (zh) |
CN (2) | CN117494746A (zh) |
WO (1) | WO2022083551A1 (zh) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115175164A (zh) * | 2022-06-28 | 2022-10-11 | 南京欧珀软件科技有限公司 | 通信控制方法及相关装置 |
CN116055630A (zh) * | 2022-05-30 | 2023-05-02 | 荣耀终端有限公司 | 一种虚拟卡的弹出方法、电子设备及存储介质 |
CN116703391A (zh) * | 2022-09-23 | 2023-09-05 | 荣耀终端有限公司 | 电子卡片的激活方法及装置 |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117376880A (zh) * | 2022-06-30 | 2024-01-09 | 华为技术有限公司 | 安全业务的切换方法及终端 |
CN115278535A (zh) * | 2022-07-25 | 2022-11-01 | Oppo广东移动通信有限公司 | 模拟卡使用方法及装置、存储介质和电子设备 |
CN115796217B (zh) * | 2022-11-11 | 2023-05-23 | 芯电智联(北京)科技有限公司 | 一种nfc防伪标签的激活系统 |
CN115623118B (zh) * | 2022-11-22 | 2023-10-20 | 荣耀终端有限公司 | 一种近场通信控制方法及电子设备 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105491243A (zh) * | 2016-01-18 | 2016-04-13 | 努比亚技术有限公司 | 一种nfc移动终端及控制nfc模拟卡切换的方法 |
US20170235980A1 (en) * | 2014-07-24 | 2017-08-17 | Shanghai Freevision Technologies Co., Ltd. | Double-frequency multi-protocol multifunctional near field communication integrated system and application method |
CN110020569A (zh) * | 2019-03-11 | 2019-07-16 | 华为技术有限公司 | 自动选择nfc模拟卡的方法、电子设备及通信系统 |
CN110673896A (zh) * | 2019-09-29 | 2020-01-10 | 北京小米移动软件有限公司 | 近场通信卡片激活方法和装置 |
CN111543041A (zh) * | 2017-12-29 | 2020-08-14 | 华为技术有限公司 | 一种模拟卡的选择方法及移动设备 |
CN111784334A (zh) * | 2020-07-17 | 2020-10-16 | Oppo广东移动通信有限公司 | 模拟卡切换方法、终端设备及存储介质 |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10235839B2 (en) * | 2013-09-24 | 2019-03-19 | Jcm American Corporation | Electronic voucher ticket system |
CN105101480A (zh) * | 2015-07-13 | 2015-11-25 | 宇龙计算机通信科技(深圳)有限公司 | 双智能卡网络模式切换方法及装置 |
US20170255925A1 (en) * | 2016-03-01 | 2017-09-07 | Proton World International N.V. | Configuration of a transaction in a proximity circuit |
CN111241856B (zh) * | 2020-01-09 | 2024-03-29 | 广东小天才科技有限公司 | 一种选择nfc模拟卡的方法及手表 |
CN111432339A (zh) * | 2020-03-19 | 2020-07-17 | RealMe重庆移动通信有限公司 | 近场通信卡片的切换方法、装置、存储介质及电子设备 |
CN111698741B (zh) * | 2020-06-02 | 2022-04-26 | Oppo广东移动通信有限公司 | 射频切换方法及装置 |
CN111784335B (zh) * | 2020-07-17 | 2024-05-31 | Oppo广东移动通信有限公司 | 模拟卡管理方法、模拟卡管理装置、存储介质与电子设备 |
-
2020
- 2020-10-21 CN CN202311295991.6A patent/CN117494746A/zh active Pending
- 2020-10-21 CN CN202011133300.9A patent/CN114462560B/zh active Active
-
2021
- 2021-10-18 EP EP21881967.0A patent/EP4209961A4/en active Pending
- 2021-10-18 WO PCT/CN2021/124450 patent/WO2022083551A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170235980A1 (en) * | 2014-07-24 | 2017-08-17 | Shanghai Freevision Technologies Co., Ltd. | Double-frequency multi-protocol multifunctional near field communication integrated system and application method |
CN105491243A (zh) * | 2016-01-18 | 2016-04-13 | 努比亚技术有限公司 | 一种nfc移动终端及控制nfc模拟卡切换的方法 |
CN111543041A (zh) * | 2017-12-29 | 2020-08-14 | 华为技术有限公司 | 一种模拟卡的选择方法及移动设备 |
CN110020569A (zh) * | 2019-03-11 | 2019-07-16 | 华为技术有限公司 | 自动选择nfc模拟卡的方法、电子设备及通信系统 |
CN110673896A (zh) * | 2019-09-29 | 2020-01-10 | 北京小米移动软件有限公司 | 近场通信卡片激活方法和装置 |
CN111784334A (zh) * | 2020-07-17 | 2020-10-16 | Oppo广东移动通信有限公司 | 模拟卡切换方法、终端设备及存储介质 |
Non-Patent Citations (1)
Title |
---|
See also references of EP4209961A4 |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116055630A (zh) * | 2022-05-30 | 2023-05-02 | 荣耀终端有限公司 | 一种虚拟卡的弹出方法、电子设备及存储介质 |
CN115175164A (zh) * | 2022-06-28 | 2022-10-11 | 南京欧珀软件科技有限公司 | 通信控制方法及相关装置 |
CN115175164B (zh) * | 2022-06-28 | 2023-06-27 | 南京欧珀软件科技有限公司 | 通信控制方法及相关装置 |
CN116703391A (zh) * | 2022-09-23 | 2023-09-05 | 荣耀终端有限公司 | 电子卡片的激活方法及装置 |
CN116703391B (zh) * | 2022-09-23 | 2024-04-26 | 荣耀终端有限公司 | 电子卡片的激活方法及装置 |
Also Published As
Publication number | Publication date |
---|---|
US20230385565A1 (en) | 2023-11-30 |
CN114462560A (zh) | 2022-05-10 |
EP4209961A1 (en) | 2023-07-12 |
CN114462560B (zh) | 2023-11-03 |
CN117494746A (zh) | 2024-02-02 |
EP4209961A4 (en) | 2024-03-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110020569B (zh) | 自动选择nfc模拟卡的方法、电子设备及通信系统 | |
WO2022083551A1 (zh) | 一种模拟卡的切换方法、电子设备和通信系统 | |
US11979202B2 (en) | Emulated card selection method and mobile device | |
CN108604342B (zh) | 基于nfc进行数据传输的方法及移动设备 | |
CN112395894B (zh) | 基于nfc的通信方法及装置 | |
WO2021052421A1 (zh) | 近距离无线通信的方法和电子设备 | |
CN108353265B (zh) | 使用近场通信的无线通信方法以及电子设备 | |
US8811896B2 (en) | Non-volatile memory for contactless systems | |
WO2021185105A1 (zh) | SIM卡和eSIM卡的切换方法及电子设备 | |
WO2018218662A1 (zh) | 一种nfc业务处理方法、终端及nfc芯片 | |
CN111835903B (zh) | 对nfc标签中的数据进行快速分发的方法及电子设备 | |
CN107580359B (zh) | 无线热点共享方法、移动终端及计算机可读存储介质 | |
US20170154327A1 (en) | Mobile Payment Method and Apparatus and Near Field Communication Device | |
CN111124503A (zh) | 一种nfc应用的自动激活方法及终端 | |
US11398849B2 (en) | Continuous communication method and apparatus of contactless communication device | |
CN115348630B (zh) | 多设备协同方法及相关装置 | |
CN115442780A (zh) | 一种基于nfc的数据交互方法及设备 | |
EP4145875A1 (en) | Smart card sharing method, electronic device, and computer-readable storage medium | |
US12131213B2 (en) | Emulated card switching method, electronic device, and communication system | |
WO2020088318A1 (zh) | 一种nfc应用的自动激活方法及终端 | |
EP4346250A1 (en) | Method for switching security service, and terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21881967 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2021881967 Country of ref document: EP Effective date: 20230405 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 18249921 Country of ref document: US |
|
NENP | Non-entry into the national phase |
Ref country code: DE |