WO2022099563A1 - Card selection method for nfc card simulation mode, chip, terminal, and storage medium - Google Patents

Card selection method for nfc card simulation mode, chip, terminal, and storage medium Download PDF

Info

Publication number
WO2022099563A1
WO2022099563A1 PCT/CN2020/128477 CN2020128477W WO2022099563A1 WO 2022099563 A1 WO2022099563 A1 WO 2022099563A1 CN 2020128477 W CN2020128477 W CN 2020128477W WO 2022099563 A1 WO2022099563 A1 WO 2022099563A1
Authority
WO
WIPO (PCT)
Prior art keywords
card
smart card
candidate
smart
nfc
Prior art date
Application number
PCT/CN2020/128477
Other languages
French (fr)
Chinese (zh)
Inventor
曹岚健
胡继云
Original Assignee
深圳市汇顶科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市汇顶科技股份有限公司 filed Critical 深圳市汇顶科技股份有限公司
Priority to PCT/CN2020/128477 priority Critical patent/WO2022099563A1/en
Publication of WO2022099563A1 publication Critical patent/WO2022099563A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light

Abstract

Provided in some embodiments of the present application are a card selection method for an NFC card simulation mode, a chip, an electronic device, and a storage medium. The card selection method comprises: after it is detected that a terminal enters a radio frequency range of a card reader, acquiring several candidate smart card groups obtained by grouping all candidate smart cards (101); acquiring all smart card groups to be selected that satisfy a filter condition (102); determining a priority of each smart card group to be selected (103); traversing all the smart card groups, to be selected, according to the priorities of all the smart card groups to be selected, and according to information of smart card groups to be selected that have been traversed, trying to establish a communication connection with the card reader (104); and if the communication connection is successfully established with the card reader according to the information of the smart card groups to be selected that have been traversed, determining a target smart card according to the smart card groups to be selected that have been traversed, and performing a card swiping operation with the card reader by means of the target smart card (105). Therefore, user operations can be reduced, and the convenience of card swiping can be improved.

Description

用于NFC卡模拟模式的选卡方法、芯片、终端和存储介质Card selection method, chip, terminal and storage medium for NFC card emulation mode 技术领域technical field
本申请实施例涉及近场通信技术领域,特别涉及一种用于NFC卡模拟模式的选卡方法、芯片、终端和存储介质。The embodiments of the present application relate to the technical field of near field communication, and in particular, to a card selection method, a chip, a terminal, and a storage medium for an NFC card emulation mode.
背景技术Background technique
近场通信(Near Field Communication,简称:NFC)技术,允许设备之间进行非接触式点对点数据传输。由于NFC具有较高的安全性,因此,近年来越来越被大众欢迎和接受。其中具备NFC功能的终端的发展尤为迅速。目前,具备NFC功能的终端一般可以工作于三种模式:读卡器模式,卡模拟模式,点对点模式。其中,卡模拟模式即终端可以模拟为一张非接触集成电路(Integrated Circuit,IC)卡,用户手持终端便可与读卡器进行交互,以完成刷银行卡、刷公交卡或刷门禁卡等操作,给生活带来很多便利。目前,使用手持终端(比如手机)模拟智能卡的刷卡业务过程中,需要使用者在刷卡之前进行一系列操作,这些操作如下:首先,点亮手机屏幕,并进入选卡程序;然后,选择一张卡进行接下来的刷卡;最后,将手机靠近刷卡设备,利用选择的卡进行刷卡。Near Field Communication (NFC) technology allows contactless point-to-point data transmission between devices. Due to its high security, NFC has become more and more popular and accepted by the public in recent years. Among them, the development of terminals with NFC function is particularly rapid. At present, a terminal with NFC function can generally work in three modes: a card reader mode, a card emulation mode, and a peer-to-peer mode. Among them, the card simulation mode means that the terminal can be simulated as a non-contact integrated circuit (Integrated Circuit, IC) card, and the user can interact with the card reader by holding the terminal to complete the swiping of bank cards, bus cards or access control cards, etc. Operation brings a lot of convenience to life. At present, in the process of swiping a smart card using a handheld terminal (such as a mobile phone) to simulate a smart card, the user needs to perform a series of operations before swiping the card. These operations are as follows: first, light the screen of the mobile phone and enter the card selection program; then, select a card card for the next swipe; finally, hold the phone close to the card swipe device and use the selected card to swipe.
然而,发明人发现相关技术中至少存在如下问题:使用者在刷卡之前进行的上述一系列的操作,为用户使用模拟的智能卡进行刷卡产生了一些不便利,刷卡的便捷性较低。However, the inventor found that the related art has at least the following problems: the above-mentioned series of operations performed by the user before swiping the card cause some inconvenience for the user to swipe the card using the simulated smart card, and the convenience of swiping the card is low.
发明内容SUMMARY OF THE INVENTION
本申请实施方式的目的在于提供一种用于NFC卡模拟模式的选卡方法、芯片、终端和存储介质,使得可以减少用户操作,提高刷卡的便捷性。The purpose of the embodiments of the present application is to provide a card selection method, chip, terminal and storage medium for NFC card emulation mode, so that user operations can be reduced and the convenience of card swiping can be improved.
为解决上述技术问题,本申请的实施方式提供了一种用于NFC卡模拟模式的选卡方法,包括:在检测到终端进入读卡器的射频范围后,获取对所述终端内的各个候选智能卡进行分组得到的若干候选智能卡组;对所述若干候选智能卡组进行是否满足过滤条件的判断,获取符合所述过滤条件的各个待选智能卡组;确定所述各个待选智能卡组的优先级;根据所述各个待选智能卡组的优先级从高到低的顺序,依次遍历所述各个待选智能卡组,并根据当前遍历到的待选智能卡组的信息,尝试与所述读卡器建立通信连接;若根据当前遍历到的待选智能卡组的信息,与所述读卡器成功建立通信连接,根据所述当前遍历到的待选智能卡组确定目标智能卡,并通过所述目标智能卡与所述读卡器进行刷卡操作。In order to solve the above technical problems, embodiments of the present application provide a card selection method for an NFC card emulation mode, including: after detecting that the terminal has entered the radio frequency range of the card reader, obtain the information about each candidate in the terminal. Several candidate smart card groups obtained by grouping the smart cards; judging whether the several candidate smart card groups meet the filtering conditions, and obtaining each candidate smart card group that meets the filtering conditions; determining the priority of each candidate smart card group; According to the priority order of each candidate smart card group from high to low, traverse each candidate smart card group in turn, and try to establish communication with the card reader according to the information of the currently traversed candidate smart card group connection; if a communication connection is successfully established with the card reader according to the information of the currently traversed candidate smart card group, a target smart card is determined according to the currently traversed candidate smart card group, and the target smart card communicates with the The card reader performs the card swiping operation.
本申请的实施方式还提供了一种用于NFC卡模拟模式的选卡方法,包括:在检测到终端进入读卡器的射频范围后,对所述终端内的各个候选智能卡进行是否满足过滤条件的判断,获取符合所述过滤条件的各个待选智能卡;确定所述各个待选智能卡的优先级;根据所述各个待选智能卡的优先级从高到低的顺序,依次遍历所述各个待选智能卡,并根据当前遍历到的待选智能卡的信息,尝试与所述读卡器建立通信连接;若根据当前遍历到的待选智能卡的信息,与所述读卡器成功建立通信连接,通过所述当前遍历到的待选智能卡与所述读卡器进行刷卡操作。Embodiments of the present application also provide a card selection method for an NFC card emulation mode, including: after detecting that the terminal has entered the radio frequency range of the card reader, checking whether each candidate smart card in the terminal meets the filtering conditions , obtain each candidate smart card that meets the filtering conditions; determine the priority of each candidate smart card; according to the order of the priority of each candidate smart card from high to low, traverse each candidate smart card in turn smart card, and try to establish a communication connection with the card reader according to the currently traversed information of the candidate smart card; The currently traversed candidate smart card is swiped with the card reader.
本申请的实施方式还提供了一种芯片,所述芯片位于终端内且与所述终端内的存储器连接,所述存储器存储有可被所述芯片执行的指令,所述指令被所述芯片执行,以使所述芯片能够执行上述的用于NFC卡模拟模式的选卡方法。An embodiment of the present application further provides a chip, the chip is located in a terminal and connected to a memory in the terminal, the memory stores an instruction that can be executed by the chip, and the instruction is executed by the chip , so that the chip can execute the above-mentioned card selection method for the NFC card emulation mode.
本申请的实施方式还提供了一种终端,包括:上述的芯片,以及与所述芯片连接的存储器。Embodiments of the present application further provide a terminal, including: the above-mentioned chip, and a memory connected to the chip.
本申请的实施方式还提供了一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现上述的用于NFC卡模拟模式的选卡方法。Embodiments of the present application further provide a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above-mentioned card selection method for an NFC card emulation mode is implemented.
本申请的实施方式中,在检测到终端进入读卡器的射频范围后,即用户接近读卡器后,无需点亮终端的屏幕,进入选卡程序,人工选择智能卡进行刷卡,有利于减少用户操作,提高刷卡的便捷性。而且,对若干候选智能卡组进行是否满足过滤条件的判断,即以组为单位进行过滤,有利于提高过滤的速度,得到符合过滤条件的各个待选智能卡组,有利于缩小遍历范围,提高遍历速度,从而提高选卡速度。通过各个待选智能卡组的优先级从高到低的顺序依次遍历各个待选智能卡组,有利于以合理的顺序依次根据各个待选智能卡组的信息,尝试与读卡器建立通信连接,有利于减小尝试的次数,快速的成功与读卡器建立通信连接,从而进一步提高选卡的速度。In the embodiment of the present application, after it is detected that the terminal enters the radio frequency range of the card reader, that is, after the user approaches the card reader, there is no need to light up the screen of the terminal, enter the card selection program, and manually select the smart card to swipe the card, which is beneficial to reduce the number of users operation to improve the convenience of swiping cards. Moreover, it is helpful to judge whether several candidate smart card groups meet the filtering conditions, that is, to filter by group, which is beneficial to improve the filtering speed and obtain each candidate smart card group that meets the filtering conditions, which is beneficial to narrow the traversal range and improve the traversal speed. , thereby increasing the card selection speed. The priority of each candidate smart card group is traversed in order from high to low, which is beneficial to try to establish a communication connection with the card reader according to the information of each candidate smart card group in a reasonable order, which is beneficial to Reduce the number of attempts and quickly establish a communication connection with the card reader, thereby further improving the speed of card selection.
另外,所述获取对所述终端内的各个候选智能卡进行分组得到的若干候选智能卡组,包括:根据所述终端内的各个候选智能卡的用于建立通信连接的参数,对所述各个候选智能卡进行分组,得到若干候选智能卡组;其中,同一所述候选智能卡组内的候选智能卡的用于建立通信连接的参数不存在冲突。也就是说,根据各候选智能卡的用于建立通信连接的参数是否存在冲突,对各候 选智能卡进行分组,将用于建立通信连接的参数不存在冲突的候选智能卡分为一组,有利于提高分组的合理性。In addition, the acquiring several candidate smart card groups obtained by grouping each candidate smart card in the terminal includes: according to parameters used for establishing a communication connection of each candidate smart card in the terminal, performing a grouping to obtain several candidate smart card groups; wherein, the parameters used for establishing the communication connection of the candidate smart cards in the same candidate smart card group do not conflict. That is to say, according to whether the parameters used to establish the communication connection of each candidate smart card conflict, the candidate smart cards are grouped, and the candidate smart cards for which the parameters used to establish the communication connection do not conflict are grouped into a group, which is beneficial to improve the grouping. rationality.
另外,所述筛选条件包括:所述终端的地理位置满足所述候选智能卡的地理位置需求,和/或,所述候选智能卡所属的安全单元允许被激活。也就是说,本申请的实施方式中筛选出地理位置需求可以被满足的智能卡和/或所属的安全单元允许被激活的智能卡,过滤掉地理位置需求不被满足的智能卡和/或所属的安全单元不允许被激活的智能卡,有利于将候选智能卡的数量控制在合理的范围内,在不影响与读卡器建立通信连接的成功率的同时提高与读卡器成功建立通信连接的速度。In addition, the screening conditions include: the geographic location of the terminal meets the geographic location requirement of the candidate smart card, and/or the security unit to which the candidate smart card belongs is allowed to be activated. That is to say, in the embodiments of the present application, the smart cards whose geographical location requirements can be satisfied and/or the smart cards to which the security unit to which they belong is allowed to be activated are filtered, and the smart cards and/or the security units to which the geographical location requirements are not satisfied are filtered out. The smart cards that are not allowed to be activated are beneficial to control the number of candidate smart cards within a reasonable range, and improve the speed of successfully establishing a communication connection with the card reader without affecting the success rate of establishing a communication connection with the card reader.
另外,所述过滤条件包括:所述候选智能卡组中至少存在一个候选智能卡的NFC技术类型属于所述读卡器支持的NFC技术类型,和/或,所述候选智能卡组中至少存在一个候选智能卡的卡类型属于所述读卡器支持的卡类型。也就是说,过滤掉不包含读卡器支持的NFC技术类型的候选智能卡的候选智能卡组,和/或,不包含读卡器支持的卡类型的候选智能卡的候选智能卡组,有利于合理的对候选智能卡组进行过滤,提高了过滤后得到的待选智能卡组与读卡器能够成功建立通信连接的可能性。In addition, the filtering conditions include: the NFC technology type of at least one candidate smart card in the candidate smart card group belongs to the NFC technology type supported by the card reader, and/or, there is at least one candidate smart card in the candidate smart card group The card type belongs to the card type supported by the card reader. That is to say, filtering out candidate smart card groups that do not include candidate smart cards of the NFC technology type supported by the card reader, and/or candidate smart card groups that do not include candidate smart cards of the card type supported by the card reader, is conducive to reasonable matching The candidate smart card group is filtered, which improves the possibility that the candidate smart card group obtained after filtering can successfully establish a communication connection with the card reader.
另外,所述待选智能卡组的信息包括:所述待选智能卡组的用于建立通信连接的参数,所述待选智能卡组的用于建立通信连接的参数为:对所述待选智能卡组中的各待选智能卡的用于建立通信连接的参数进行合并后得到的合并参数。也就是说,将同一待选智能卡组中的待选智能卡的用于建立通信连接的参数进行合并,得到待选智能卡组对应的用于建立通信连接的参数,然后,根据待选智能卡组对应的用于建立通信连接的参数即合并参数,尝试与读卡器建 立通信连接,在一定程度上有利于减少尝试建立通信连接的次数,无需基于待选智能卡组中的每个待选智能卡的用于建立通信连接的参数均进行一次尝试建立通信连接的过程,有利于提高与读卡器成功建立通信连接的速度。In addition, the information of the smart card group to be selected includes: the parameters of the smart card group to be selected for establishing a communication connection, and the parameters of the smart card group to be selected for establishing a communication connection are: The merged parameters obtained by merging the parameters used to establish the communication connection of each candidate smart card in . That is to say, the parameters for establishing a communication connection of the smart cards to be selected in the same smart card group to be selected are combined to obtain the parameters corresponding to the smart card group to be selected for establishing a communication connection, and then, according to the parameters corresponding to the smart card group to be selected The parameters used to establish a communication connection are merged parameters. Trying to establish a communication connection with the card reader is beneficial to reduce the number of attempts to establish a communication connection to a certain extent. The parameters of establishing a communication connection are all performed a process of trying to establish a communication connection, which is beneficial to improve the speed of successfully establishing a communication connection with the card reader.
另外,若遍历完所述各个待选智能卡组后,仍未与所述读卡器成功建立通信连接,所述方法还包括:发出选卡失败的通知信息;和/或,弹出预设的用于供用户选择智能卡的选卡界面。也就是说,如果自动选卡失败,可以发出通知信息以通知用户,方便用户得知当前选卡失败的结果,和/或,弹出预设的用于供用户选择智能卡的选卡界面,有利于提升用户的使用体验。In addition, if the communication connection with the card reader has not been successfully established after traversing the smart card groups to be selected, the method further includes: sending out notification information of card selection failure; and/or popping up a preset user interface. In the tab interface for users to select smart cards. That is to say, if the automatic card selection fails, a notification message can be sent to notify the user, so that the user can know the result of the current card selection failure, and/or a preset card selection interface for the user to select a smart card is popped up, which is beneficial to the user. Improve user experience.
附图说明Description of drawings
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定。One or more embodiments are exemplified by the pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments.
图1是根据本申请第一实施例中的用于NFC卡模拟模式的选卡方法的流程图;1 is a flowchart of a card selection method for an NFC card emulation mode according to a first embodiment of the present application;
图2是根据本申请第二实施例中的用于NFC卡模拟模式的选卡方法的流程图;2 is a flowchart of a card selection method for an NFC card emulation mode according to a second embodiment of the present application;
图3是根据本申请第二实施例中的实现用于NFC卡模拟模式的选卡方法的模块示意图;3 is a schematic diagram of a module for implementing a card selection method for an NFC card emulation mode according to a second embodiment of the present application;
图4是根据本申请第三实施例中的用于NFC卡模拟模式的选卡方法的流程图;4 is a flowchart of a card selection method for an NFC card emulation mode according to a third embodiment of the present application;
图5是根据本申请第四实施例中的用于NFC卡模拟模式的选卡方法的流程图;5 is a flowchart of a card selection method for an NFC card emulation mode according to a fourth embodiment of the present application;
图6是根据本申请第五实施例中的终端的结构示意图。FIG. 6 is a schematic structural diagram of a terminal according to a fifth embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请部分实施例进行进一步详细说明。本领域的普通技术人员可以理解,在各实施例中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施例的种种变化和修改,也可以实现本申请所要求保护的技术方案。以下各个实施例的划分是为了描述方便,不应对本申请的具体实现方式构成任何限定,各个实施例在不矛盾的前提下可以相互结合相互引用。In order to make the objectives, technical solutions and advantages of the present application clearer, some embodiments of the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood by those of ordinary skill in the art that, in each embodiment, many technical details are set forth in order for the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present application can be realized. The following divisions of the various embodiments are for the convenience of description, and should not constitute any limitation on the specific implementation of the present application, and the various embodiments may be combined with each other and referred to each other on the premise of not contradicting each other.
本申请的第一实施例涉及一种用于NFC卡模拟模式的选卡方法,应用于非接触式近距离通信芯片,该芯片比如可以为NFC芯片。在具体实现中,NFC芯片可以设置在终端内,终端可以为智能手机、智能手环、智能手表等电子设备。本申请实施例的应用场景可以为:用户使用终端模拟智能卡的刷卡业务,该刷卡业务包括但不限于:刷银行卡、刷公交卡、刷门禁卡。下面对本实施方式的用于NFC卡模拟模式的选卡方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。The first embodiment of the present application relates to a card selection method for an NFC card emulation mode, which is applied to a contactless short-range communication chip, for example, the chip may be an NFC chip. In a specific implementation, the NFC chip may be set in a terminal, and the terminal may be an electronic device such as a smart phone, a smart bracelet, and a smart watch. The application scenarios of the embodiments of the present application may be: a user uses a terminal to simulate a smart card swiping business, and the card swiping business includes but is not limited to: swiping a bank card, swiping a bus card, and swiping an access control card. The implementation details of the card selection method for the NFC card emulation mode in this embodiment will be specifically described below. The following contents are only implementation details provided for the convenience of understanding, and are not necessary for implementing this solution.
在介绍本发明实施例之前,对于手机智能终端模拟卡进行简单介绍:Before introducing the embodiments of the present invention, a brief introduction to the mobile phone smart terminal simulation card is given:
传统的各种智能卡,比如公交卡、银行卡、医保卡等,因为卡内含有芯片而能被各种读卡器读取数据进行刷卡,而常见的用于智能卡的芯片有两大类,一类是接触式刷卡,比如常见的插卡POS机,另一类是非接触式刷卡,其内含有类似NFC一类的非接触式数据传输控制芯片(含配套天线),比如常见的靠 近读卡机刷卡的公交卡。将这些常见的实体卡片功能,通过手机终端来模拟,就称为手机模拟卡,这时候并没有实实在在的卡片存在,只是通过手机终端内添加卡片的相关信息或程序以“模拟”一张智能卡,这样同一个手机终端可以通过NFC芯片和安全元件的配合实现多种卡、多张卡的模拟,相当于在手机上安装了多张智能卡,可以在不同场合使用同一个手机终端你实现不同的刷卡认证、刷卡消费等行为。另外,为简化起见,本文中用NFC芯片表示能实现NFC通信的完整芯片模块,具体的一种实现方式可以包括NFC控制芯片和NFC天线的组合。Various traditional smart cards, such as bus cards, bank cards, medical insurance cards, etc., can be swiped by various card readers because the cards contain chips. There are two types of chips commonly used in smart cards. One is contact card swiping, such as a common card POS machine, and the other is contactless card swiping, which contains a non-contact data transmission control chip like NFC (including supporting antenna), such as a common near card reader. Swipe bus card. These common physical card functions are simulated through the mobile phone terminal, which is called mobile phone simulation card. At this time, there is no real card, but the relevant information or program of the card is added in the mobile phone terminal to "simulate" a card. Smart card, so that the same mobile terminal can realize the simulation of multiple cards and multiple cards through the cooperation of NFC chip and secure element, which is equivalent to installing multiple smart cards on the mobile phone. You can use the same mobile terminal in different occasions to achieve different card-swiping authentication, card-swiping consumption and other behaviors. In addition, for the sake of simplicity, an NFC chip is used herein to represent a complete chip module capable of implementing NFC communication, and a specific implementation manner may include a combination of an NFC control chip and an NFC antenna.
本实施例的用于NFC卡模拟模式的选卡方法的流程图可以如图1所示,包括:The flowchart of the card selection method for the NFC card emulation mode in this embodiment may be as shown in FIG. 1 , including:
步骤101:在检测到终端进入读卡器的射频范围后,获取对终端内的各个候选智能卡进行分组得到的若干候选智能卡组。Step 101: After detecting that the terminal enters the radio frequency range of the card reader, acquire several candidate smart card groups obtained by grouping each candidate smart card in the terminal.
其中,读卡器和终端均具有NFC功能,读卡器可以发出NFC射频场,终端在进入读卡器的射频范围后可以感应到读卡器所发射出的射频场。也就是说,如果终端感应到读卡器所发射出的射频场,则可以确定终端进入该读卡器的射频范围。Among them, both the card reader and the terminal have NFC function, the card reader can emit NFC radio frequency field, and the terminal can sense the radio frequency field emitted by the card reader after entering the radio frequency range of the card reader. That is, if the terminal senses the radio frequency field emitted by the card reader, it can be determined that the terminal enters the radio frequency range of the card reader.
在一个例子中,终端为手机,用户乘坐公交车,拿起手机靠近配置在公交车上的读卡器,手机可以检测到该读卡器的NFC射频场,从而确定手机进入读卡器的射频范围。在具体实现中,可以是手机中的NFC芯片检测到该读卡器的NFC射频场,从而确定手机进入读卡器的射频范围。In an example, the terminal is a mobile phone, the user takes a bus, picks up the mobile phone and approaches the card reader configured on the bus, the mobile phone can detect the NFC radio frequency field of the card reader, so as to determine the radio frequency of the mobile phone entering the card reader scope. In a specific implementation, the NFC chip in the mobile phone may detect the NFC radio frequency field of the card reader, so as to determine the radio frequency range of the mobile phone entering the card reader.
在具体实现中,用户可以根据实际需要预先在终端中安装可能会使用到的智能卡,该智能卡可以理解为虚拟的电子卡,比如,公交卡、门禁卡、银行 卡等。不同的智能卡可以对应有不同的应用,智能卡对应的应用,可以理解为用于实现近距离通信的应用程序,其具备用于模拟非接触IC卡的仿真功能,即具备模拟智能卡的功能。根据应用场景的不同,智能卡对应的应用可以分为不同类型,比如公交卡、门禁卡、银行卡分别对应有公交卡应用、门禁卡应用、银行卡应用。终端中安装的智能卡也可以理解为终端中安装的智能卡对应的应用。In a specific implementation, the user can pre-install a smart card that may be used in the terminal according to actual needs. The smart card can be understood as a virtual electronic card, such as a bus card, an access control card, and a bank card. Different smart cards can correspond to different applications. The application corresponding to the smart card can be understood as the application program used to realize short-range communication, which has the simulation function for simulating the contactless IC card, that is, it has the function of simulating the smart card. According to different application scenarios, the applications corresponding to smart cards can be divided into different types, such as bus cards, access control cards, and bank cards, respectively, corresponding to bus card applications, access control card applications, and bank card applications. The smart card installed in the terminal can also be understood as an application corresponding to the smart card installed in the terminal.
在实际应用中,智能卡实际可以被安装在终端中的安全单元(Secure Element,SE)中;其中,SE可以为智能卡的运行提供安全的执行环境(如认证、授权等),为其敏感数据提供安全的存储环境。SE中可以通过存储分区等手段同时安装多个智能卡,SE可以是与NFC芯片一起封装的SE。当然,SE可以以不同的形式存在,例如,以用户标识模块(subscriber identificationmodule,SIM)卡形式存在的SE,即SIM卡上设置有SE、与NFC芯片一起封装的SE、集成在终端的印刷电路板(printed circuit board,PCB)上的SE、集成在安全数字(secure digital,SD)存储卡中的SE,即SD存储卡上设置有SE。在本实施例中,SE还可以以其他形式存在于终端,本实施例对此不做具体限定。需要说明的是,SE以不同形式存在于终端,即SE可能设置在终端中的不同位置,不同位置的SE可以具有相似的功能。In practical applications, the smart card can actually be installed in a secure element (Secure Element, SE) in the terminal; wherein, the SE can provide a secure execution environment (such as authentication, authorization, etc.) for the operation of the smart card, and provide its sensitive data with Safe storage environment. Multiple smart cards can be installed simultaneously in the SE by means of storage partitions and the like, and the SE can be an SE packaged together with an NFC chip. Of course, the SE can exist in different forms, for example, the SE in the form of a subscriber identification module (SIM) card, that is, the SIM card is provided with the SE, the SE packaged with the NFC chip, and the printed circuit integrated in the terminal. The SE on the printed circuit board (PCB) and the SE integrated in the secure digital (SD) memory card, that is, the SD memory card is provided with the SE. In this embodiment, the SE may also exist in the terminal in other forms, which is not specifically limited in this embodiment. It should be noted that the SEs exist in the terminal in different forms, that is, the SEs may be set in different positions in the terminal, and the SEs in different positions may have similar functions.
在一个例子中,各个候选智能卡可以为终端内的所有智能卡,即各个候选智能卡包括终端内的所有SE上安装的智能卡。In one example, each candidate smart card may be all smart cards in the terminal, that is, each candidate smart card includes the smart cards installed on all SEs in the terminal.
在另一个例子中,各个候选智能卡可以为用户在终端内的所有智能卡中选择的部分智能卡。比如,用户可以根据实际需要在终端内的所有智能卡中选择出使用频率较高的部分智能卡作为各个候选智能卡。In another example, each candidate smart card may be a part of smart cards selected by the user among all smart cards in the terminal. For example, the user may select some smart cards with higher frequency of use among all the smart cards in the terminal as the candidate smart cards according to actual needs.
在一个例子中,NFC芯片获取的对终端内的各个候选智能卡进行分组得到的若干候选智能卡组的实现方式可以为:NFC芯片直接对终端内的各个候选智能卡进行分组得到的若干候选智能卡组。可选的,终端内的主控芯片可以对终端内的各个候选智能卡进行分组得到的若干候选智能卡组,然后主控芯片将分组的结果发送给NFC芯片,使得NFC芯片可以获取分组后的若干候选智能卡组。也就是说,NFC芯片只需接收主控芯片发送的分组结果,无需为了实现分组的功能在NFC芯片中嵌入更多的代码,有利于节省NFC芯片的存储空间,降低NFC芯片的生产成本。In an example, several candidate smart card groups obtained by grouping each candidate smart card in the terminal obtained by the NFC chip may be implemented as: several candidate smart card groups obtained by the NFC chip directly grouping each candidate smart card in the terminal. Optionally, the main control chip in the terminal can group each candidate smart card in the terminal to obtain several candidate smart card groups, and then the main control chip sends the grouping result to the NFC chip, so that the NFC chip can obtain several candidate smart card groups after the grouping. Smart card group. That is to say, the NFC chip only needs to receive the grouping result sent by the main control chip, and there is no need to embed more codes in the NFC chip in order to realize the function of grouping, which is beneficial to save the storage space of the NFC chip and reduce the production cost of the NFC chip.
在具体实现中,可以获取各个候选智能卡的信息,并根据各个候选智能卡的信息对终端内的各个候选智能卡进行分组,得到的若干候选智能卡组。In a specific implementation, the information of each candidate smart card can be obtained, and each candidate smart card in the terminal is grouped according to the information of each candidate smart card to obtain several candidate smart card groups.
下面对本实施例中各个候选智能卡的信息的获取方式进行举例说明:Hereinafter, the manner of obtaining the information of each candidate smart card in this embodiment will be illustrated with an example:
在一个例子中,NFC芯片可以向终端内的所有SE发送符合全球平台国际标准组织(Global Platform,GP)规范或符合国际标准化组织(International Standard Organization,ISO)7816规范的命令,请求获取所有SE上安装的智能卡的信息。SE在收到NFC芯片发送的上述命令后,向NFC芯片返回SE上安装的智能卡的信息。NFC芯片根据SE返回的信息,获取各个候选智能卡的信息。In one example, the NFC chip can send a command conforming to the Global Platform International Standards Organization (GP) specification or the International Standard Organization (ISO) 7816 specification to all SEs in the terminal, requesting to obtain all SEs Information about installed smart cards. After receiving the above command sent by the NFC chip, the SE returns the information of the smart card installed on the SE to the NFC chip. The NFC chip obtains the information of each candidate smart card according to the information returned by the SE.
在另一个例子中,终端内的主控芯片可以向终端内的所有SE发送符合GP规范或ISO7816规范的命令,请求获取所有SE上安装的智能卡的信息,即SE在收到主控芯片发送的上述命令后,向主控芯片返回SE上安装的智能卡的信息。主控芯片根据SE返回的信息获取各个候选智能卡的信息,然后将各个候选智能卡的信息,发送至NFC芯片。也就是说,NFC芯片只需接收主控芯片发 送的各个候选智能卡的信息,无需为了实现更多的功能在NFC芯片中嵌入更多的代码,有利于节省NFC芯片的存储空间,降低NFC芯片的生产成本。In another example, the main control chip in the terminal can send a command that conforms to the GP specification or ISO7816 specification to all SEs in the terminal, requesting to obtain the information of the smart cards installed on all SEs, that is, the SE receives the information sent by the main control chip. After the above command, the information of the smart card installed on the SE is returned to the main control chip. The main control chip obtains the information of each candidate smart card according to the information returned by the SE, and then sends the information of each candidate smart card to the NFC chip. That is to say, the NFC chip only needs to receive the information of each candidate smart card sent by the main control chip, and there is no need to embed more codes in the NFC chip in order to realize more functions, which is conducive to saving the storage space of the NFC chip and reducing the cost of the NFC chip. Cost of production.
在具体实现中,智能卡的信息可以包括但不限于:智能卡对应的应用标识符(Application Identifier,AID)、智能卡的非接触参数、智能卡的生命周期、智能卡的地理位置需求、智能卡的NFC技术类型、智能卡所属的安全单元的信息、智能卡的卡类型。地理位置需求也可以称为:全球定位系统(Global Positioning System,GPS)需求。其中,NFC技术类型可以为:NFC-A技术、NFC-B技术、NFC-F技术等,智能卡的卡类型可以为公交类、门禁类、银行卡类等。In specific implementation, the information of the smart card may include, but is not limited to: the application identifier (Application Identifier, AID) corresponding to the smart card, the contactless parameters of the smart card, the life cycle of the smart card, the geographic location requirements of the smart card, the NFC technology type of the smart card, Information about the security unit to which the smart card belongs, and the card type of the smart card. Geographic location requirements can also be referred to as: Global Positioning System (Global Positioning System, GPS) requirements. The NFC technology type may be: NFC-A technology, NFC-B technology, NFC-F technology, etc., and the card type of the smart card may be bus type, access control type, bank card type, and the like.
其中,上述的非接触参数可以理解为:NFC芯片模拟智能卡时,与读卡器之间建立空中接口连接所需使用的通信参数,也就是说,智能卡的非接触参数为用于与读卡器建立通信连接的参数。在具体实现中,非接触参数可以包括但不限于:用户身份证明(User Identification,UID)、请求应答(Answer to Request,ATQ)、选择确认指令(Select Acknowledge,SAK)以及选择应答(Answer To Select,ATS)等。Among them, the above non-contact parameters can be understood as: when the NFC chip simulates a smart card, the communication parameters used to establish an air interface connection with the card reader, that is, the non-contact parameters of the smart card are used to communicate with the card reader. Parameters for establishing a communication connection. In a specific implementation, the contactless parameters may include but are not limited to: User Identification (UID), Answer to Request (ATQ), Select Acknowledge (SAK), and Answer To Select (Answer To Select) , ATS) etc.
在一个例子中,可以根据终端内的各个候选智能卡的卡类型,对各个候选智能卡进行分组,比如将具有相同卡类型的候选智能卡分到同一个候选智能卡组。或者,还可以根据终端内的各个候选智能卡所支持的NFC技术类型,对各个候选智能卡进行分组,比如将支持相同NFC技术类型的候选智能卡分到同一个候选智能卡组。In one example, each candidate smart card may be grouped according to the card type of each candidate smart card in the terminal, for example, the candidate smart cards with the same card type are grouped into the same candidate smart card group. Alternatively, each candidate smart card may be grouped according to the NFC technology type supported by each candidate smart card in the terminal, for example, the candidate smart cards supporting the same NFC technology type are grouped into the same candidate smart card group.
在另一个例子中,可以根据终端内的各个候选智能卡的用于建立通信连接的参数,对各个候选智能卡进行分组,得到若干候选智能卡组;其中,同一 候选智能卡组内的候选智能卡的用于建立通信连接的参数不存在冲突,用于建立通信的参数即为非接触参数。也就是说,可以根据各候选智能卡的非接触参数是否存在冲突,将非接触参数不存在冲突的候选智能卡分为一组,得到若干候选智能卡组,方便了后续直接对同一个组内的各候选智能卡的非接触参数进行不存在冲突的合并。In another example, each candidate smart card may be grouped according to the parameters for establishing a communication connection of each candidate smart card in the terminal to obtain several candidate smart card groups; wherein, the candidate smart cards in the same candidate smart card group are used for establishing There is no conflict between the parameters of the communication connection, and the parameters used to establish communication are the non-contact parameters. That is to say, according to whether the contactless parameters of the candidate smart cards are in conflict, the candidate smart cards whose contactless parameters do not have conflicting parameters can be grouped into a group, and several candidate smart card groups can be obtained, which facilitates the subsequent direct comparison of the candidate smart cards in the same group. The contactless parameters of the smart card are merged without conflict.
在具体实现中,可以对各候选智能卡的非接触参数进行两两比较,确定任意两个候选智能卡的非接触参数是否冲突,得到每张候选智能卡的冲突列表,根据每张候选智能卡的冲突列表对各候选智能卡进行分组,得到若干候选智能卡组。比如,候选智能卡1的冲突列表有候选智能卡2、3、4,代表候选智能卡2、3、4的非接触参数和候选智能卡1的非接触参数冲突,不能分为一组。下面对如何确定任意两个候选智能卡的非接触参数是否冲突的方式进行说明:In a specific implementation, the contactless parameters of each candidate smart card can be compared pair-wise to determine whether the contactless parameters of any two candidate smart cards conflict, and a conflict list of each candidate smart card can be obtained. The candidate smart cards are grouped to obtain several candidate smart card groups. For example, the conflict list of candidate smart card 1 includes candidate smart cards 2, 3, and 4, indicating that the contactless parameters of candidate smart cards 2, 3, and 4 conflict with the contactless parameters of candidate smart card 1, and cannot be grouped into one group. The following describes how to determine whether the contactless parameters of any two candidate smart cards conflict:
在一个例子中,NFC芯片可以使用GP规范规定的非接触参数冲突检测算法,检测任意两个候选智能卡的非接触参数是否存在冲突。In one example, the NFC chip can use the contactless parameter conflict detection algorithm specified in the GP specification to detect whether there is a conflict between the contactless parameters of any two candidate smart cards.
在另一个例子中,NFC芯片可以先将候选智能卡1激活,再尝试将候选智能卡2激活,如果候选智能卡2被激活成功,说明候选智能卡2和候选智能卡1的非接触参数之间不存在冲突;如果候选智能卡2被激活失败,说明候选智能卡2和候选智能卡1的非接触参数之间存在冲突。In another example, the NFC chip can activate the candidate smart card 1 first, and then try to activate the candidate smart card 2. If the candidate smart card 2 is successfully activated, it means that there is no conflict between the contactless parameters of the candidate smart card 2 and the candidate smart card 1; If the activation of the candidate smart card 2 fails, it means that there is a conflict between the contactless parameters of the candidate smart card 2 and the candidate smart card 1.
在一个例子中,对各个候选智能卡进行分组的方式可以为:根据各候选智能卡的优先级从高到底的顺序,依次遍历各候选智能卡,如果遍历到的候选智能卡的非接触参数和候选智能卡组内的每一个智能卡的非接触参数都不冲突,则将遍历到的候选智能卡放置在候选智能卡组内。其中,各候选智能卡的优先级的确定方式可以参考第一实施例中提到的优先级的确定方式,未避免重复, 在此不再赘述。In an example, the method of grouping each candidate smart card may be: according to the priority of each candidate smart card from high to bottom, traverse each candidate smart card in turn, if the contactless parameters of the traversed candidate smart card and the candidate smart card group The non-contact parameters of each smart card in the traversal do not conflict, and the traversed candidate smart cards are placed in the candidate smart card group. The method for determining the priority of each candidate smart card may refer to the method for determining the priority mentioned in the first embodiment, which does not avoid repetition and will not be repeated here.
步骤102:对若干候选智能卡组进行是否满足过滤条件的判断,获取符合过滤条件的各个待选智能卡组。Step 102: Judging whether several candidate smart card groups meet the filtering conditions, and acquiring each candidate smart card group that meets the filtering conditions.
具体的说,在检测到终端进入读卡器的射频范围后,NFC芯片可以根据每个候选智能卡组中的候选智能卡的用于进行过滤的参数和读卡器的信息,对若干候选智能卡组分别进行是否满足过滤条件的判断,获取符合过滤条件的各个待选智能卡组。也可以理解为,将若干候选智能卡组中满足过滤条件的候选智能卡组称为待选智能卡组。其中,第二过滤条件可以根据实际需要进行设置。Specifically, after detecting that the terminal has entered the radio frequency range of the card reader, the NFC chip can, according to the parameters used for filtering of the candidate smart cards in each candidate smart card group and the information of the card reader, separate the several candidate smart card groups. It is judged whether the filter conditions are met, and each candidate smart card group that meets the filter conditions is obtained. It can also be understood that a candidate smart card group that satisfies the filtering conditions among several candidate smart card groups is called a candidate smart card group. The second filter condition can be set according to actual needs.
在一个例子中,上述的候选智能卡的用于进行过滤的参数包括:候选智能卡的近场通讯NFC技术类型、候选智能卡的卡类型,读卡器的信息包括:读卡器支持的NFC技术类型、读卡器支持的卡类型。所述过滤条件可以包括:候选智能卡组中至少存在一个候选智能卡的NFC技术类型属于读卡器支持的NFC技术类型,和/或,候选智能卡组中至少存在一个候选智能卡的卡类型属于读卡器支持的卡类型。也就是说,过滤掉不包含读卡器支持的NFC技术类型的候选智能卡的候选智能卡组,和/或,不包含读卡器支持的卡类型的候选智能卡的候选智能卡组,有利于合理的对候选智能卡组进行过滤,提高了过滤后得到的候选智能卡组与读卡器能够成功建立通信连接的可能性。In one example, the above-mentioned parameters for filtering the candidate smart card include: the near field communication NFC technology type of the candidate smart card, the card type of the candidate smart card, and the information of the card reader includes: the NFC technology type supported by the card reader, Card types supported by the card reader. The filtering conditions may include: the NFC technology type of at least one candidate smart card in the candidate smart card group belongs to the NFC technology type supported by the card reader, and/or the card type of at least one candidate smart card in the candidate smart card group belongs to the card reader Supported card types. That is to say, filtering out candidate smart card groups that do not include candidate smart cards of the NFC technology type supported by the card reader, and/or candidate smart card groups that do not include candidate smart cards of the card type supported by the card reader, is conducive to reasonable matching The candidate smart card group is filtered, which improves the possibility that the candidate smart card group obtained after filtering can successfully establish a communication connection with the card reader.
在具体实现中,一个候选智能卡组中的所有候选智能卡的NFC技术类型可以组成NFC技术列表,该候选智能卡组中的所有候选智能卡的卡类型可以组成卡类型列表。候选智能卡组的NFC技术列表由候选智能卡组内所有候选智能卡共同决定,比如候选智能卡组内有一个NFC-A技术的候选智能卡,则该候选智能卡组就具有NFC-A技术。NFC芯片可以在检测到来自于读卡器的RF帧之后, 根据RF帧确定读卡器的NFC技术类型和卡类型,然后过滤掉不包含读卡器支持的NFC技术类型,和/或,不包含读卡器支持的卡类型的候选智能卡组,得到过滤后的符合过滤条件的各个待选智能卡组。In a specific implementation, the NFC technology types of all candidate smart cards in a candidate smart card group may form an NFC technology list, and the card types of all candidate smart cards in the candidate smart card group may form a card type list. The NFC technology list of the candidate smart card group is jointly determined by all the candidate smart cards in the candidate smart card group. For example, if there is a candidate smart card with NFC-A technology in the candidate smart card group, the candidate smart card group has NFC-A technology. The NFC chip can determine the NFC technology type and card type of the card reader according to the RF frame after detecting the RF frame from the card reader, and then filter out the NFC technology type that does not include the NFC technology type supported by the card reader, and/or does not The candidate smart card groups containing the card types supported by the card reader are filtered to obtain each candidate smart card group that meets the filtering conditions.
步骤103:确定各个待选智能卡组的优先级。Step 103: Determine the priority of each candidate smart card group.
在一个例子中,可以确定各个待选智能卡组中各待选智能卡的优先级,然后,根据各个待选智能卡组中各待选智能卡的优先级,确定各个待选智能卡组的优先级。比如,可以将各个待选智能卡组中具有最高优先级的待选智能卡的优先级,作为各个待选智能卡组的优先级。也就是说,一个待选智能卡组的优先级可以根据该待选智能卡组内的待选智能卡的优先级确定。然而,本实施方式并不以此为限。In one example, the priority of each candidate smart card in each candidate smart card group may be determined, and then, according to the priority of each candidate smart card group in each candidate smart card group, the priority of each candidate smart card group is determined. For example, the priority of the candidate smart card with the highest priority in each candidate smart card group may be used as the priority of each candidate smart card group. That is to say, the priority of a smart card group to be selected can be determined according to the priorities of the smart cards to be selected in the smart card group to be selected. However, the present embodiment is not limited to this.
在一个例子中,各个候选智能卡的信息还可以包括针对各候选智能卡预设的优先级,从而NFC芯片可以确定各个待选智能卡组中的各个待选智能卡的优先级。其中,针对各候选智能卡预设的优先级可以由用户根据实际需要进行设置,比如,用户可以对经常使用的候选智能卡设置较高的优先级,对使用频率较低的候选智能卡设置较低的优先级。In one example, the information of each candidate smart card may further include a preset priority for each candidate smart card, so that the NFC chip can determine the priority of each candidate smart card in each candidate smart card group. The preset priority for each candidate smart card can be set by the user according to actual needs. For example, the user can set a higher priority for candidate smart cards that are frequently used, and a lower priority for candidate smart cards that are used less frequently. class.
在另一个例子中,确定各个待选智能卡组中各待选智能卡的优先级的方式为:根据各个待选智能卡组中各待选智能卡的信息,确定各待选智能卡对应的排序权重;根据各待选智能卡对应的排序权重,确定各待选智能卡的优先级。In another example, the method of determining the priority of each smart card to be selected in each smart card group to be selected is: according to the information of each smart card to be selected in each smart card group to be selected, determine the sorting weight corresponding to each smart card to be selected; The sorting weight corresponding to the smart cards to be selected determines the priority of each smart card to be selected.
其中,如果待选智能卡对应的排序权重为1个,则可以将该待选智能卡对应的排序权重作为优先级。如果待选智能卡对应的排序权重为多个,则可以结合该多个排序权重确定待选智能卡的优先级,比如,将该待选智能卡的多个排序权重的和作为该待选智能卡的优先级,或者对该待选智能卡的多个排序权 重求平均值,将平均值作为该待选智能卡的优先级,然并不以此为限。下面主要对根据各待选智能卡的信息,确定各个待选智能卡对应的排序权重的实现方式进行说明:Wherein, if the sorting weight corresponding to the smart card to be selected is one, the sorting weight corresponding to the smart card to be selected may be used as the priority. If there are multiple sorting weights corresponding to the smart cards to be selected, the priority of the smart cards to be selected may be determined in combination with the multiple sorting weights. For example, the sum of the multiple sorting weights of the smart cards to be selected is used as the priority of the smart cards to be selected. , or average multiple sorting weights of the smart card to be selected, and use the average value as the priority of the smart card to be selected, but it is not limited thereto. The following mainly describes the implementation manner of determining the sorting weight corresponding to each candidate smart card according to the information of each candidate smart card:
在一个例子中,各待选智能卡的信息可以包括针对各待选智能卡预设的排序权重,从而NFC芯片可以根据各待选智能卡的信息,确定各待选智能卡对应的排序权重。其中,针对各待选智能卡预设的排序权重可以由用户根据实际需要进行设置。In one example, the information of each smart card to be selected may include a preset sorting weight for each smart card to be selected, so that the NFC chip can determine the sorting weight corresponding to each smart card to be selected according to the information of each smart card to be selected. The sorting weight preset for each smart card to be selected can be set by the user according to actual needs.
在另一个例子中,可以根据各待选智能卡的信息,确定各待选智能卡对应的权重因子,根据各待选智能卡对应的权重因子,确定各待选智能卡对应的排序权重。其中,待选智能卡的信息包括待选智能卡对应的应用时,权重因子包括:基于待选智能卡对应的应用是否为终端运行的前台应用确定的第一权重因子,和/或,基于待选智能卡对应的应用是否为终端默认的付款应用确定的第二权重因子。待选智能卡的信息包括待选智能卡的地理位置需求时,权重因子包括:基于终端的地理位置是否满足待选智能卡的地理位置需求确定的第三权重因子。待选智能卡的信息包括待选智能卡被激活的历史次数时,权重因子包括:基于待选智能卡被激活的历史次数确定的第四权重因子。在具体实现中,权重因子可以包括但不限于上述四种权重因子中的一个或多个。最终可以将待选智能卡对应的所有权重因子相加,得到待选智能卡对应的排序权重,或者对待选智能卡对应的所有权重因子求平均值,得到待选智能卡对应的排序权重。通过基于待选智能卡的信息(比如:待选智能卡对应的应用、待选智能卡的地理位置需求、待选智能卡被激活的历史次数等),确定的权重因子,有利于合理的确定待选智能卡对应的排序权重,从而有利于根据排序权重合理的确定待 选智能卡的优先级。In another example, the weight factor corresponding to each candidate smart card may be determined according to the information of each candidate smart card, and the sorting weight corresponding to each candidate smart card may be determined according to the weight factor corresponding to each candidate smart card. Wherein, when the information of the smart card to be selected includes the application corresponding to the smart card to be selected, the weighting factor includes: a first weighting factor determined based on whether the application corresponding to the smart card to be selected is a foreground application running on the terminal, and/or, based on the corresponding application of the smart card to be selected Whether the application is the second weighting factor determined by the terminal's default payment application. When the information of the smart card to be selected includes the geographic location requirement of the smart card to be selected, the weighting factor includes: a third weighting factor determined based on whether the geographic location of the terminal satisfies the geographic location requirement of the smart card to be selected. When the information of the smart card to be selected includes the historical times of activation of the smart card to be selected, the weighting factor includes: a fourth weighting factor determined based on the historical times of activation of the smart card to be selected. In a specific implementation, the weighting factors may include, but are not limited to, one or more of the above four weighting factors. Finally, all the weighting factors corresponding to the smart cards to be selected can be added to obtain the sorting weights corresponding to the smart cards to be selected, or an average value of all the weighting factors corresponding to the smart cards to be selected can be obtained to obtain the sorting weights corresponding to the smart cards to be selected. By determining the weight factor based on the information of the smart card to be selected (for example, the application corresponding to the smart card to be selected, the geographical location requirements of the smart card to be selected, the historical number of activations of the smart card to be selected, etc.) Therefore, it is helpful to reasonably determine the priority of the smart card to be selected according to the sorting weight.
在一个例子中,在权重因子包括上述第三权重因子的情况下,若终端的地理位置同时满足多个待选智能卡的地理位置需求,则多个待选智能卡中,地理位置需求范围越小的待选智能卡对应的第三权重因子越大。比如,终端的地理位置为成都市公司A大楼内,多个待选智能卡中包括:成都市的交通智能卡(简称智能卡1)、成都市公司A大楼的门禁智能卡(简称智能卡2)。由此可见,终端的地理位置同时满足智能卡1和智能卡2的地理位置需求,由于智能卡2相对于智能卡1的地理位置需求范围更小,因此智能卡2相比于智能卡1具有更高的第三权重因子,也就是说,地理位置需求范围更小的候选智能卡会产生更大的排序权重,有利于更加合理的确定第三权重因子。In an example, in the case where the weighting factor includes the above-mentioned third weighting factor, if the geographic location of the terminal simultaneously meets the geographic location requirements of multiple candidate smart cards, then among the multiple candidate smart cards, the smaller the geographic location requirement range is. The larger the third weighting factor corresponding to the smart card to be selected is. For example, the geographical location of the terminal is in Building A of Chengdu Company, and the multiple smart cards to be selected include: a traffic smart card in Chengdu (referred to as smart card 1), and an access control smart card in Building A of Chengdu Company (referred to as smart card 2). It can be seen that the geographical location of the terminal meets the geographical location requirements of smart card 1 and smart card 2 at the same time. Since smart card 2 has a smaller geographical location requirement range than smart card 1, smart card 2 has a higher third weight than smart card 1. factor, that is to say, a candidate smart card with a smaller geographical location requirement range will generate a larger sorting weight, which is conducive to a more reasonable determination of the third weighting factor.
为便于理解,下面以一个具体示例对确定权重因子的实现过程,以及根据权重因子确定排序权重的实现过程进行说明:For ease of understanding, the implementation process of determining the weight factor and the implementation process of determining the sorting weight according to the weight factor are described below with a specific example:
第一权重因子的确定方式:如果待选智能卡对应的应用为终端正在使用的前台应用中,则待选智能卡的第一权重因子为MaxIntValue/10;如果待选智能卡对应的应用不是终端正在使用的前台应用,则待选智能卡的第一权重因子为0。其中,MaxIntValue可以为根据实际需要设置的数值。The method for determining the first weighting factor: if the application corresponding to the smart card to be selected is a foreground application being used by the terminal, the first weighting factor of the smart card to be selected is MaxIntValue/10; if the application corresponding to the smart card to be selected is not being used by the terminal For foreground applications, the first weighting factor of the smart card to be selected is 0. Among them, MaxIntValue can be a value set according to actual needs.
第二权重因子的确定方式:如果待选智能卡对应的应用为终端默认的付款应用,则待选智能卡的第二权重因子为MaxIntValue/100;如果待选智能卡对应的应用不是终端默认的付款应用,则待选智能卡的第二权重因子为0。其中,终端默认的付款应用可以为用户根据实际需要选择的应用。The method of determining the second weighting factor: if the application corresponding to the smart card to be selected is the default payment application of the terminal, the second weighting factor of the smart card to be selected is MaxIntValue/100; if the application corresponding to the smart card to be selected is not the default payment application of the terminal, Then the second weighting factor of the smart card to be selected is 0. The default payment application of the terminal may be an application selected by the user according to actual needs.
第三权重因子的确定方式:如果终端当前的地理位置即GPS位置信息,位于待选智能卡的GPS需求范围内,则该待选智能卡的第三权重因子为 MaxIntValue/100;如果终端当前的GPS位置信息,不位于待选智能卡的GPS需求范围内,则该待选智能卡的第三权重因子为0。在具体实现中,如果终端当前的GPS位置信息,位于多个待选智能卡的GPS需求范围内,还可以通过如下方式确定多个待选智能卡分别对应的第三权重因子:The method of determining the third weighting factor: if the current geographic location of the terminal, that is, the GPS location information, is within the GPS requirement range of the smart card to be selected, then the third weighting factor of the smart card to be selected is MaxIntValue/100; if the current GPS location of the terminal If the information is not within the GPS requirement range of the smart card to be selected, the third weighting factor of the smart card to be selected is 0. In a specific implementation, if the current GPS location information of the terminal is within the GPS requirement range of multiple smart cards to be selected, the third weighting factor corresponding to the multiple smart cards to be selected can also be determined in the following manner:
第三权重因子为MaxIntValue/100/GPS_rank;其中,GPS_rank用于终端当前的GPS位置信息同时满足多个待选智能卡的GPS需求的场景,比如终端当前的GPS位置信息为成都市公司A大楼内,同时满足两个待选智能卡的GPS需求,这两个待选智能卡可以为成都市的交通智能卡(简称智能卡1)、成都市公司A大楼的门禁智能卡(简称智能卡2)。智能卡2的GPS需求范围更小,智能卡1的GPS需求范围更大,那么这两个智能卡的GPS_rank可以分别为,智能卡2的GPS_rank=1,智能卡1的GPS_rank=2。也就是说,更小的GPS需求会产生更大的第三权重因子。The third weighting factor is MaxIntValue/100/GPS_rank; among them, GPS_rank is used in the scenario where the current GPS location information of the terminal meets the GPS requirements of multiple smart cards to be selected at the same time. For example, the current GPS location information of the terminal is in Building A of Chengdu Company, At the same time, it can meet the GPS requirements of two candidate smart cards. These two candidate smart cards can be traffic smart cards in Chengdu (referred to as smart card 1) and access control smart cards in Building A of Chengdu Company (referred to as smart card 2). The GPS demand range of smart card 2 is smaller, and the GPS demand range of smart card 1 is larger, then the GPS_ranks of the two smart cards can be respectively, GPS_rank=1 of smart card 2 and GPS_rank=2 of smart card 1. That is, a smaller GPS requirement results in a larger third weighting factor.
第四权重因子的确定方式:获取待选智能卡历史上被激活的次数比如为x次,则该待选智能卡的第四权重因子可以为x。The method for determining the fourth weighting factor: the number of times the smart card to be selected is activated in the history is, for example, x times, and the fourth weighting factor of the smart card to be selected may be x.
在具体实现中,在得到上述四种权重因子后,可以将待选智能卡的第一权重因子、第二权重因子、第三权重因子、第四权重因子相加的和作为该待选智能卡的排序权重。需要说明的是,上述示例中只是以权重因子同时包括上述四种权重因子为例,在具体实现中并不以此为限。可以理解的是,根据每个待选智能卡的权重因子,可以确定每个待选智能卡的排序权重,从而进一步根据排序权重确定每个待选智能卡的优先级,且排序权重越大,优先级越高。In a specific implementation, after the above four weighting factors are obtained, the sum of the first weighting factor, the second weighting factor, the third weighting factor, and the fourth weighting factor of the smart card to be selected can be used as the order of the smart card to be selected. Weights. It should be noted that, in the above example, the weight factor includes the above four weight factors at the same time as an example, and the specific implementation is not limited to this. It can be understood that, according to the weight factor of each smart card to be selected, the sorting weight of each smart card to be selected can be determined, so as to further determine the priority of each smart card to be selected according to the sorting weight, and the greater the sorting weight, the higher the priority. high.
步骤104:根据各个待选智能卡组的优先级从高到低的顺序,依次遍历各个待选智能卡组,并根据当前遍历到的待选智能卡组的信息,尝试与读卡器 建立通信连接。Step 104: according to the order of priority of each candidate smart card group from high to low, traverse each candidate smart card group in turn, and try to establish a communication connection with the card reader according to the information of the currently traversed candidate smart card group.
在一个例子中,NFC芯片可以根据各个待选智能卡组的优先级从高到低的顺序,依次遍历各个待选智能卡组,并根据当前遍历到的待选智能卡组中的各待选智能卡的非接触参数,分别尝试与读卡器建立通信连接。In one example, the NFC chip can traverse each smart card group to be selected in order according to the priority of each smart card group to be selected from high to low, and according to the current traversal of the smart card group to be selected in the smart card group to be selected Contact parameters and try to establish a communication connection with the card reader respectively.
在另一个例子中,各个待选智能卡组为根据各候选智能卡的非接触参数是否存在冲突得到的分组。当前遍历到的待选智能卡组的信息包括:对待选智能卡组中的各待选智能卡的用于建立通信连接的参数进行合并后得到的合并参数,该合并参数可以理解为对待选智能卡组中的各待选智能卡的非接触参数进行合并后得到参数。也就是说,将分在同一个待选智能卡组中的各待选智能卡的非接触参数进行合并,得到该待选智能卡组的合并的非接触参数。In another example, each candidate smart card group is a group obtained according to whether the contactless parameters of each candidate smart card conflict. The information of the smart card group to be selected currently traversed includes: a combined parameter obtained by merging the parameters for establishing a communication connection of each smart card to be selected in the smart card group to be selected, and the combined parameter can be understood as the smart card group to be selected The contactless parameters of the smart cards to be selected are combined to obtain the parameters. That is, the contactless parameters of the smart cards to be selected in the same smart card group to be selected are combined to obtain the combined contactless parameters of the smart card group to be selected.
在一个例子中,可以使用GP规范规定的非接触参数合并算法,对同一个待选智能卡组中的待选智能卡的非接触参数进行合并,得到该待选智能卡组对应的合并的非接触参数。比如,一个待选智能卡组中的3个待选智能卡的非接触参数分别为:参数1、参数2、参数3,则将参数1、参数2、参数3合并后得到的该待选智能卡组对应的合并的非接触参数可以为新的参数4。In one example, the contactless parameter combination algorithm specified in the GP specification can be used to combine the contactless parameters of the smart cards to be selected in the same smart card group to be selected to obtain the combined contactless parameters corresponding to the smart card group to be selected. For example, the non-contact parameters of the three smart cards to be selected in a smart card group to be selected are: parameter 1, parameter 2, parameter 3, then the smart card group to be selected obtained by combining parameters 1, parameter 2, and parameter 3 corresponds to The merged contactless parameter can be the new parameter 4.
也就是说,NFC芯片可以根据各个待选智能卡组的优先级从高到低的顺序,依次遍历各个待选智能卡组,并根据当前遍历到的待选智能卡组的合并参数,尝试与读卡器建立通信连接。可以理解的是,本实施例中根据当前遍历到的待选智能卡组的合并参数,尝试与读卡器建立通信连接,在一定程度上有利于减少尝试建立通信连接的次数,无需基于每个待选智能卡的非接触参数均进行一次尝试建立通信连接的过程,有利于减少尝试建立通信连接的次数,提高与读卡器成功建立通信连接的速度。比如,一个待选智能卡组内的3个待选智 能卡的非接触参数分别为:参数1、参数2、参数3,则将参数1、参数2、参数3合并后得到新的参数4,本实施例中无需基于3个待选智能卡的非接触参数即参数1、参数2、参数3均进行一次尝试建立通信连接的过程,而是基于合并后得到的参数4尝试与读卡器建立通信连接。That is to say, the NFC chip can traverse each candidate smart card group in order according to the priority of each candidate smart card group from high to low, and try to communicate with the card reader according to the combination parameters of the currently traversed candidate smart card group. Establish a communication connection. It can be understood that in this embodiment, an attempt is made to establish a communication connection with the card reader according to the currently traversed merging parameters of the candidate smart card group, which is beneficial to reduce the number of attempts to establish a communication connection to a certain extent. The non-contact parameters of the smart card are selected to perform a process of trying to establish a communication connection, which is beneficial to reduce the number of attempts to establish a communication connection and improve the speed of successfully establishing a communication connection with the card reader. For example, the non-contact parameters of the three smart cards to be selected in a smart card group to be selected are: parameter 1, parameter 2, parameter 3, then parameter 1, parameter 2, and parameter 3 are combined to obtain a new parameter 4. This implementation In the example, it is not necessary to perform a process of trying to establish a communication connection based on the contactless parameters of the three candidate smart cards, that is, parameter 1, parameter 2, and parameter 3, but try to establish a communication connection with the card reader based on the parameter 4 obtained after the combination.
其中,根据当前遍历到的待选智能卡组的非接触参数(即合并后的非接触参数),尝试与读卡器建立通信连接,可以理解为:NFC芯片使用遍历到的待选智能卡组的非接触参数和读卡器进行符合NFC论坛标准协议的射频(Radio Frequency,RF)指令交换,当前遍历到的待选智能卡组的非接触参数会填充在RF指令中和读卡器进行交互,相互认证并尝试建立通信。如果RF指令交换成功,则可以认为NFC芯片可以通过当前遍历到的待选智能卡组的非接触参数成功和读卡器建立通信连接,即NFC芯片可以使用该遍历到的待选智能卡组的非接触参数和读卡器进行通信。Among them, trying to establish a communication connection with the card reader according to the non-contact parameters of the currently traversed candidate smart card group (that is, the merged non-contact parameters), which can be understood as: the NFC chip uses the traversed non-contact parameters of the candidate smart card group to be selected. The contact parameters and the card reader exchange radio frequency (RF) commands that conform to the NFC Forum standard protocol. The contactless parameters of the currently traversed candidate smart card group will be filled in the RF commands to interact with the card reader and authenticate each other. and try to establish communication. If the RF command exchange is successful, it can be considered that the NFC chip can successfully establish a communication connection with the card reader through the contactless parameters of the currently traversed candidate smart card group. parameters communicate with the card reader.
在具体实现中,上述的RF指令可以是应用协议数据单元(Application Protocol Data Unit,APDU)帧格式、单字节短帧格式、长帧格式等帧格式的指令。又如,RF指令可以是14443TYPE A,14443TYPE B,ISO18092,ISO15693等类型的指令。RF指令可以具体为:NFC论坛标准协议规定的ALL_REQ Command、SENS_REQ Command、SENS_RES Response、SDD_REQ Command、SEL_REQ Command、SLP_REQ Command等。In a specific implementation, the above-mentioned RF instruction may be an instruction in a frame format such as an Application Protocol Data Unit (Application Protocol Data Unit, APDU) frame format, a single-byte short frame format, a long frame format, or the like. For another example, the RF instruction may be a 14443TYPE A, 14443TYPE B, ISO18092, ISO15693 and other type of instruction. The RF command can be specifically: ALL_REQ Command, SENS_REQ Command, SENS_RES Response, SDD_REQ Command, SEL_REQ Command, SLP_REQ Command, etc. specified in the NFC Forum standard protocol.
步骤105:若根据当前遍历到的待选智能卡组的信息,与读卡器成功建立通信连接,根据当前遍历到的待选智能卡组确定目标智能卡,并通过目标智能卡与读卡器进行刷卡操作。Step 105: If a communication connection is successfully established with the card reader according to the information of the currently traversed candidate smart card group, the target smart card is determined according to the currently traversed candidate smart card group, and the target smart card and the card reader are swiped.
在一个例子中,若根据当前遍历到的待选智能卡组的信息,与读卡器成 功建立通信连接,NFC芯片可以激活当前遍历到的待选智能卡组中的所有待选智能卡;然后,NFC芯片可以基于与读卡器成功建立的通信连接,接收到来自读卡器的选卡指令,从而在被激活的待选智能卡中选择与选卡指令对应的待选智能卡作为目标智能卡,通过目标智能卡进行与读卡器的刷卡操作。其中,选卡指令可以携带AID,NFC芯片可以根据选卡指令中携带的AID确定与选卡指令对应的待选智能卡。In one example, if a communication connection is successfully established with the card reader according to the information of the currently traversed candidate smart card group, the NFC chip can activate all candidate smart cards in the currently traversed candidate smart card group; then, the NFC chip can activate all candidate smart cards in the currently traversed candidate smart card group; Based on the successfully established communication connection with the card reader, the card selection command from the card reader can be received, so that the candidate smart card corresponding to the card selection command is selected from the activated candidate smart cards as the target smart card, and the target smart card is used to carry out Swipe operation with card reader. The card selection instruction may carry an AID, and the NFC chip may determine the smart card to be selected corresponding to the card selection instruction according to the AID carried in the card selection instruction.
在另一个例子中,若遍历完所有待选智能卡组后,仍未与读卡器成功建立通信连接,则NFC芯片可以发出选卡失败的通知信息;和/或,弹出预设的用于供用户选择智能卡的选卡界面。比如,NFC芯片可以控制终端的屏幕,使得屏幕上显示选卡失败的通知信息,还可以控制终端开始震动以提醒用户。NFC芯片还可以控制终端的屏幕,使得屏幕上弹出预设用于供用户选择智能卡的选卡界面,方便用户进行选择。也就是说,如果自动选卡失败,可以发出通知信息以通知用户,方便用户得知当前选卡失败的结果,和/或,弹出预设的用于供用户选择智能卡的选卡界面,有利于提升用户的使用体验。In another example, if the communication connection with the card reader has not been successfully established after traversing all the smart card groups to be selected, the NFC chip can send out notification information of card selection failure; The user selects a tabbed interface for a smart card. For example, the NFC chip can control the screen of the terminal, so that the notification information of card selection failure is displayed on the screen, and it can also control the terminal to vibrate to remind the user. The NFC chip can also control the screen of the terminal, so that a card selection interface preset for the user to select a smart card pops up on the screen, which is convenient for the user to select. That is to say, if the automatic card selection fails, a notification message can be sent to notify the user, so that the user can know the result of the current card selection failure, and/or a preset card selection interface for the user to select a smart card is popped up, which is beneficial to the user. Improve user experience.
在一个例子中,遍历完所有待选智能卡组后,仍未与读卡器成功建立通信连接,可能的原因为:终端内的各个候选智能卡为终端内的所有智能卡中的一部分,比如用户选择的一部分智能卡为候选智能卡,参与本实施方式中的选卡方法,而终端当前进入的读卡器的射频范围后,能够与该读卡器成功建立通信连接的是除候选智能卡之外的其他智能卡的信息。比如,终端内安装有成都市和西安市的公交卡,用户的常住地是成都市,用户将成都市公交卡添加在候选智能卡列表中。当用户前往西安市出差需要乘坐公交时,由于西安市的公交卡不在候选智能卡列表中,因此,NFC芯片遍历完各个待选智能卡组后,也不 会与读卡器成功建立通信连接。此时,NFC芯片可以控制终端弹出预设的用于供用户选择智能卡的选卡界面,使得用户可以选择西安市公交卡,从而完成刷卡操作。In an example, after traversing all the smart card groups to be selected, the communication connection with the card reader has not been successfully established. The possible reason is that each candidate smart card in the terminal is a part of all smart cards in the terminal, such as the one selected by the user. Some smart cards are candidate smart cards and participate in the card selection method in this embodiment. After the terminal currently enters the radio frequency range of the card reader, it is the smart cards of other smart cards other than the candidate smart card that can successfully establish a communication connection with the card reader. information. For example, bus cards of Chengdu and Xi'an are installed in the terminal, the user's permanent residence is Chengdu, and the user adds the Chengdu bus card to the list of candidate smart cards. When the user goes to Xi'an for business and needs to take a bus, because the bus card in Xi'an is not in the list of candidate smart cards, the NFC chip will not successfully establish a communication connection with the card reader after traversing each candidate smart card group. At this time, the NFC chip can control the terminal to pop up a preset card selection interface for the user to select a smart card, so that the user can select the Xi'an bus card, thereby completing the card swiping operation.
在另一个例子中,遍历完各个待选智能卡组后,仍未与读卡器成功建立通信连接,可能的原因为:终端内未安装能够在读卡器上完成刷卡操作的智能卡,此时NFC芯片可以控制终端发出选卡失败的通知信息,以提醒用户安装能够在该读卡器上刷卡的智能卡。In another example, after traversing all the smart card groups to be selected, the communication connection with the card reader has not been successfully established. The possible reason is: the smart card that can complete the card swiping operation on the card reader is not installed in the terminal. At this time, the NFC chip The terminal can be controlled to send out notification information of card selection failure to remind the user to install a smart card that can be swiped on the card reader.
需要说明的是,本实施方式中的上述各示例均为为方便理解进行的举例说明,并不对本申请的技术方案构成限定。It should be noted that, the above examples in this embodiment are all examples for the convenience of understanding, and do not limit the technical solutions of the present application.
本实施方式中,在检测到终端进入读卡器的射频范围后,即用户接近读卡器后,无需点亮终端的屏幕,进入选卡程序,人工选择智能卡进行刷卡,有利于减少用户操作,提高刷卡的便捷性。而且,对若干候选智能卡组进行是否满足过滤条件的判断,即以组为单位进行过滤,有利于提高过滤的速度,得到符合过滤条件的各个待选智能卡组,有利于缩小遍历范围,提高遍历速度,从而提高选卡速度。通过各个待选智能卡组的优先级从高到低的顺序依次遍历各个待选智能卡组,有利于以合理的顺序依次根据各个待选智能卡组的信息,尝试与读卡器建立通信连接,有利于减小尝试的次数,快速的成功与读卡器建立通信连接,从而进一步提高选卡的速度。In this embodiment, after it is detected that the terminal enters the radio frequency range of the card reader, that is, after the user approaches the card reader, there is no need to light up the screen of the terminal, enter the card selection program, and manually select the smart card to swipe the card, which is beneficial to reduce user operations. Improve the convenience of swiping cards. Moreover, it is helpful to judge whether several candidate smart card groups meet the filtering conditions, that is, to filter by group, which is beneficial to improve the filtering speed and obtain each candidate smart card group that meets the filtering conditions, which is beneficial to narrow the traversal range and improve the traversal speed. , thereby increasing the card selection speed. The priority of each candidate smart card group is traversed in order from high to low, which is beneficial to try to establish a communication connection with the card reader according to the information of each candidate smart card group in a reasonable order, which is beneficial to Reduce the number of attempts and quickly establish a communication connection with the card reader, thereby further improving the speed of card selection.
本申请的第二实施方式涉及一种用于NFC卡模拟模式的选卡方法。下面对本实施方式的用于NFC卡模拟模式的选卡方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。The second embodiment of the present application relates to a card selection method for an NFC card emulation mode. The implementation details of the card selection method for the NFC card emulation mode in this embodiment will be specifically described below. The following contents are only implementation details provided for the convenience of understanding, and are not necessary for implementing this solution.
本实施例的用于NFC卡模拟模式的选卡方法的流程图可以如图2所示, 包括:The flowchart of the card selection method for the NFC card emulation mode in this embodiment may be as shown in FIG. 2 , including:
步骤201:获取终端内满足预设的筛选条件的各个候选智能卡。Step 201: Acquire each candidate smart card in the terminal that meets preset screening conditions.
具体的说,可以对终端内的各智能卡进行是否满足预设的筛选条件的判断,得到满足预设的筛选条件的各个候选智能卡。其中,筛选条件可以根据实际需要进行设置。即本实施例中的各候选智能卡是指对终端内所有智能卡进行是否满足预设的筛选条件的判断后,淘汰了不满足筛选条件的智能卡,保留了满足筛选条件的智能卡,满足筛选条件的智能卡即为候选智能卡。Specifically, it is possible to judge whether each smart card in the terminal satisfies the preset screening condition, and obtain each candidate smart card that satisfies the preset screening condition. Among them, the filter conditions can be set according to actual needs. That is to say, each candidate smart card in this embodiment refers to that after judging whether all smart cards in the terminal meet the preset screening conditions, the smart cards that do not meet the screening conditions are eliminated, the smart cards that meet the screening conditions are retained, and the smart cards that meet the screening conditions are retained. It is the candidate smart card.
在一个例子中,NFC芯片可以在确定终端的位置与读卡器的位置之间的距离小于预设距离时,开始获取终端内满足预设的筛选条件的各个候选智能卡。其中,预设距离可以根据实际需要进行设置,用于表征终端与读卡器的位置接近。也就是说,在终端与读卡器的位置接近时,获取终端内满足预设的筛选条件的各个候选智能卡。考虑到,终端与读卡器的位置接近时,用户前往设置有读卡器的位置进行刷卡的可能性较大,因此,在终端与读卡器的位置接近时,获取终端内满足预设的筛选条件的各个候选智能卡更加合理,更加符合用户的刷卡习惯,为用户刷卡提供方便。In one example, the NFC chip may start acquiring each candidate smart card in the terminal that meets the preset screening conditions when it is determined that the distance between the location of the terminal and the location of the card reader is less than a preset distance. The preset distance can be set according to actual needs, and is used to represent the proximity of the terminal and the card reader. That is, when the positions of the terminal and the card reader are close to each other, each candidate smart card in the terminal that meets the preset screening conditions is acquired. Considering that when the positions of the terminal and the card reader are close, the user is more likely to swipe the card at the position where the card reader is installed. Therefore, when the positions of the terminal and the card reader are close to Each candidate smart card of the screening conditions is more reasonable, more in line with the user's card swiping habits, and provides convenience for the user to swipe the card.
在一个例子中,终端的主控芯片可以实时或周期性的获取所处的地理位置,并判断终端的位置与读卡器的位置之间的距离小于预设距离,即判断在终端所处的地理位置附近是否设置有读卡器,若判定终端所处的地理位置附近设置有读卡器,说明用户前往设置有读卡器的位置进行刷卡的可能性较大,此时主控芯片可以通知NFC芯片,使得NFC芯片开始对终端内所有智能卡进行是否满足预设的筛选条件的判断,得到满足预设的筛选条件的各个候选智能卡。或者,主控芯片可以对终端内所有智能卡进行是否满足预设的筛选条件的判断, 得到满足预设的筛选条件的各个候选智能卡,然后主控芯片将满足预设的筛选条件的各个候选智能卡的信息发送给NFC芯片。也就是说,NFC芯片只需接收主控芯片发送的满足预设的筛选条件的各个候选智能卡的信息,无需为了实现更多的功能在NFC芯片中嵌入更多的代码,有利于节省NFC芯片的存储空间,降低NFC芯片的生产成本。In one example, the main control chip of the terminal can obtain the geographic location in real time or periodically, and determine that the distance between the location of the terminal and the location of the card reader is less than a preset distance, that is, determine the location where the terminal is located. Whether a card reader is installed near the geographical location, if it is determined that a card reader is installed near the geographical location of the terminal, it means that the user is more likely to swipe the card at the location where the card reader is installed. At this time, the main control chip can notify The NFC chip enables the NFC chip to start judging whether all smart cards in the terminal meet the preset screening conditions, and obtain each candidate smart card that meets the preset screening conditions. Alternatively, the main control chip may judge whether all smart cards in the terminal meet the preset screening conditions, and obtain each candidate smart card that meets the preset screening conditions, and then the main control chip will determine whether the candidate smart cards meet the preset screening conditions. The information is sent to the NFC chip. That is to say, the NFC chip only needs to receive the information of each candidate smart card that meets the preset screening conditions sent by the main control chip, and does not need to embed more codes in the NFC chip in order to realize more functions, which is beneficial to save the NFC chip. Storage space, reducing the production cost of NFC chips.
在一个例子中,判断终端的位置与读卡器的位置之间的距离是否小于预设距离方式可以为:在设置有读卡器的位置可以预先设置标识,使得终端可以根据当前所处的地理位置确定预设地理范围内是否存在预设有标识的位置,从而判断在终端所处的地理位置附近是否设置有读卡器,即终端的位置与读卡器的位置之间的距离是否小于预设距离。其中,预设地理范围可以为以终端所处的地理位置为圆心,以r为预设半径的圆形区域范围,预设半径的大小可以根据实际需要进行设置。需要说明的是,本实施例中的预设地理范围只是以上述的圆形区域为例,在具体实现中并不以此为限。In one example, the method of judging whether the distance between the position of the terminal and the position of the card reader is less than the preset distance may be: an identifier may be preset at the position where the card reader is installed, so that the terminal can be based on the current geographical location. The location determines whether there is a preset location within the preset geographic range, so as to determine whether a card reader is set near the geographic location of the terminal, that is, whether the distance between the location of the terminal and the location of the card reader is smaller than the preset location. Set distance. The preset geographic range may be a circular area with the geographic location of the terminal as the center and r as the preset radius, and the size of the preset radius may be set according to actual needs. It should be noted that, the preset geographic range in this embodiment only takes the above-mentioned circular area as an example, which is not limited in specific implementation.
在另一个例子中,当检测终端上用于表征开启选卡功能的按键被按压时,可以开始对终端内的各智能卡进行是否满足预设的筛选条件的判断,得到满足预设的筛选条件的各个候选智能卡。其中,用于表征开启选卡功能的按键可以为预先设置的虚拟按键。考虑到,当检测终端上用于表征开启选卡功能的按键被按压时,表明用户希望开始自动选卡,此时开始获取终端内满足预设的筛选条件的各个候选智能卡,更加容易满足用户的实际需求,提高用户的使用体验。In another example, when it is detected that the button on the terminal that is used to indicate that the card selection function is turned on is pressed, it may start to judge whether each smart card in the terminal meets the preset screening conditions, and obtain a card that meets the preset screening conditions. Each candidate smart card. Wherein, the key used to represent the opening of the card selection function may be a preset virtual key. Considering that, when the button on the detection terminal that is used to indicate that the card selection function is turned on is pressed, it indicates that the user wants to start automatic card selection. At this time, each candidate smart card that meets the preset screening conditions in the terminal is obtained, which is easier to meet the user's requirements. Actual needs, improve user experience.
在一个例子中,筛选条件包括:终端的地理位置满足候选智能卡的地理位置需求,和/或,候选智能卡所属的安全单元允许被激活。也就是说,根据终端当前的地理位置淘汰掉地理位置需求不能被满足的智能卡,和/或,淘汰掉所 属的安全单元不允许被激活的智能卡,有利于合理的对终端中的所有智能卡进行筛选。为便于对上述筛选条件的理解,下面进行举例说明:In one example, the screening conditions include: the geographic location of the terminal meets the geographic location requirement of the candidate smart card, and/or the security unit to which the candidate smart card belongs is allowed to be activated. That is to say, according to the current geographical location of the terminal, the smart cards whose geographical location requirements cannot be satisfied are eliminated, and/or the smart cards whose security units are not allowed to be activated are eliminated, which is conducive to rationally screening all smart cards in the terminal. . In order to facilitate the understanding of the above filtering conditions, the following examples are given:
候选智能卡以成都市的交通智能卡为例,则该交通智能卡的GPS需求即为位于成都市的地理范围内。如果终端当前的地理位置处于成都市地理范围内,则可以确定终端的地理位置满足该交通智能卡的地理位置需求。如果终端当前的地理位置处于西安市地理范围内,则可以确定终端的地理位置不满足该交通智能卡的地理位置需求,从而直接将成都交通智能卡滤除掉不作为候选智能卡。The candidate smart card takes a traffic smart card in Chengdu as an example, and the GPS requirement of the traffic smart card is located within the geographic range of Chengdu. If the current geographic location of the terminal is within the geographic range of Chengdu, it can be determined that the geographic location of the terminal meets the geographic location requirement of the traffic smart card. If the current geographic location of the terminal is within the geographic range of Xi'an, it can be determined that the geographic location of the terminal does not meet the geographic location requirement of the traffic smart card, so that the Chengdu traffic smart card is directly filtered out and not used as a candidate smart card.
候选智能卡所属的安全单元是否允许被激活,可以根据实际需要进行设置。比如,终端在出厂时已经设定好终端中的哪些安全单元允许被激活,哪些安全单元不允许被激活。或者,终端在出厂时预留了可供用户设置的接口,用户可以根据该接口自行设置哪些安全单元允许被激活,哪些安全单元不允许被激活。在具体实现中,还可以设置安全单元允许被激活的时间和地点,即终端中的安全单元在特定的时间和地点才允许被激活。Whether the security unit to which the candidate smart card belongs is allowed to be activated can be set according to actual needs. For example, when the terminal leaves the factory, it has been set which security units in the terminal are allowed to be activated and which security units are not allowed to be activated. Alternatively, the terminal has reserved an interface for the user to set when leaving the factory, and the user can set which security units are allowed to be activated and which security units are not allowed to be activated according to the interface. In a specific implementation, the time and place where the security unit is allowed to be activated can also be set, that is, the security unit in the terminal is allowed to be activated only at a specific time and place.
步骤202:在检测到终端进入读卡器的射频范围后,获取对终端内的各个候选智能卡进行分组得到的若干候选智能卡组。Step 202: After detecting that the terminal enters the radio frequency range of the card reader, acquire several candidate smart card groups obtained by grouping each candidate smart card in the terminal.
步骤203:对若干候选智能卡组进行是否满足过滤条件的判断,获取符合过滤条件的各个待选智能卡组。Step 203: Judging whether several candidate smart card groups meet the filtering conditions, and acquiring each candidate smart card group that meets the filtering conditions.
步骤204:确定各个待选智能卡组的优先级。Step 204: Determine the priority of each candidate smart card group.
步骤205:根据各个待选智能卡组的优先级从高到低的顺序,依次遍历各个待选智能卡组,并根据当前遍历到的待选智能卡组的信息,尝试与读卡器建立通信连接。Step 205: According to the priority of each candidate smart card group from high to low, traverse each candidate smart card group in turn, and try to establish a communication connection with the card reader according to the information of the currently traversed candidate smart card group.
步骤206:若根据当前遍历到的待选智能卡组的信息,与读卡器成功建 立通信连接,根据当前遍历到的待选智能卡组确定目标智能卡,并通过目标智能卡与读卡器进行刷卡操作。Step 206: if according to the information of the currently traversed candidate smart card group, a communication connection is successfully established with the card reader, the target smart card is determined according to the currently traversed candidate smart card group, and the card swiping operation is performed by the target smart card and the card reader.
其中,步骤202至步骤206与第一实施方式中步骤101至步骤105大致相同,为避免重复,在此不再赘述。Among them, steps 202 to 206 are substantially the same as steps 101 to 105 in the first embodiment, and are not repeated here to avoid repetition.
可以理解的是,本实施例中,在终端进入读卡器的射频范围之前,先在无需结合读卡器的信息的情况下,对终端内的各智能卡进行筛选,得到满足筛选条件的各个候选智能卡。在终端进入读卡器的射频范围之后,可以根据终端内的各候选智能卡的信息和读卡器的信息,得到过滤后的符合过滤条件的各个待选智能卡组。It can be understood that, in this embodiment, before the terminal enters the radio frequency range of the card reader, each smart card in the terminal is screened without combining the information of the card reader, and each candidate that meets the screening conditions is obtained. smart card. After the terminal enters the radio frequency range of the card reader, each candidate smart card group that meets the filtering conditions can be obtained according to the information of each candidate smart card in the terminal and the information of the card reader.
在一个例子中,本实施例中的用于NFC卡模拟模式的选卡方法可以基于如图3所示的模块图实现,包括:In an example, the card selection method for the NFC card emulation mode in this embodiment can be implemented based on the module diagram shown in FIG. 3 , including:
智能卡信息获取模块301,用于获取终端内各智能卡的信息The smart card information acquisition module 301 is used to acquire the information of each smart card in the terminal
非接触参数冲突检测模块302,用于对各智能卡的非接触参数是否存在冲突进行检测。其中,非接触参数也可以称为:非接参数、RF参数、用于建立通信连接的参数。The non-contact parameter conflict detection module 302 is configured to detect whether there is a conflict between the non-contact parameters of each smart card. The contactless parameters may also be referred to as contactless parameters, RF parameters, and parameters for establishing a communication connection.
智能卡筛选模块303,用于对终端内的各智能卡进行筛选,得到满足筛选条件的各个候选智能卡。The smart card screening module 303 is configured to screen each smart card in the terminal to obtain each candidate smart card that meets the screening conditions.
智能卡优先级确定模块304,用于确定各个候选智能卡的优先级,可选的还可以对各个候选智能卡按照优先级进行排序。The smart card priority determination module 304 is configured to determine the priority of each candidate smart card, and optionally, the candidate smart cards may also be sorted according to the priority.
智能卡分组和参数合并模块305,用于将所有的候选智能卡分为若干个组,确保每个组内的候选智能卡的非接触参数之间是没有冲突的,并且将组内的所有候选智能卡的非接触参数合并成一组新的非接触参数。The smart card grouping and parameter merging module 305 is used to divide all the candidate smart cards into several groups, to ensure that there is no conflict between the contactless parameters of the candidate smart cards in each group, and to combine the non-contact parameters of all the candidate smart cards in the group. Contact parameters are merged into a new set of non-contact parameters.
智能卡组信息下发模块306,用于将分组后的候选智能卡组的信息下发到NFC芯片,具体的可以下发至NFC芯片中的NFC控制器。其中,候选智能卡组的信息包括但不限于以下信息:The smart card group information delivery module 306 is configured to deliver the information of the grouped candidate smart card groups to the NFC chip, and specifically to the NFC controller in the NFC chip. The information of the candidate smart card group includes but is not limited to the following information:
候选智能卡组的标识及优先级;其中,候选智能卡组的优先级可以由候选智能卡组内最高优先级的候选智能卡决定。The identification and priority of the candidate smart card group; wherein, the priority of the candidate smart card group can be determined by the candidate smart card with the highest priority in the candidate smart card group.
候选智能卡组的NFC技术列表,候选智能卡组的NFC技术列表可以由候选智能卡组内所有候选智能卡共同决定,比如候选智能卡组内有一个具有NFC-A技术的候选智能卡,则候选智能卡组就拥有NFC-A技术,即候选智能卡组的NFC技术列表中包括NFC-A技术。The NFC technology list of the candidate smart card group. The NFC technology list of the candidate smart card group can be jointly determined by all the candidate smart cards in the candidate smart card group. For example, if there is a candidate smart card with NFC-A technology in the candidate smart card group, the candidate smart card group has NFC -A technology, that is, the NFC-A technology is included in the NFC technology list of the candidate smart card group.
合并后的NFC-A技术的非接触参数、合并后的NFC-B技术的非接触参数、合并后的NFC-F技术的非接触参数。The contactless parameters of the combined NFC-A technology, the contactless parameters of the combined NFC-B technology, and the contactless parameters of the combined NFC-F technology.
智能卡组过滤模块307,用于对若干候选智能卡组进行过滤,得到满足过滤条件的各个待选智能卡组。The smart card group filtering module 307 is configured to filter several candidate smart card groups to obtain each candidate smart card group that satisfies the filtering conditions.
非接触参数选择模块308,用于从高优先级到低优先级遍历上述满足过滤条件的各个待选智能卡组,使用当前遍历到的待选智能卡组的合并的非接触参数和读卡器进行符合NFC论坛标准的协议的RF指令交换,如果RF指令交换成功,则选择当前遍历到的待选智能卡组为目标智能卡组,该目标智能卡组对应的非接触参数即为非接触参数选择模块308的选择结果。The non-contact parameter selection module 308 is used to traverse the above-mentioned various candidate smart card groups that meet the filter conditions from high priority to low priority, and use the merged non-contact parameters of the currently traversed candidate smart card group and the card reader to meet the requirements. The RF command exchange of the NFC Forum standard protocol, if the RF command exchange is successful, select the currently traversed candidate smart card group as the target smart card group, and the non-contact parameter corresponding to the target smart card group is the selection of the non-contact parameter selection module 308 result.
智能卡激活模块309,用于激活目标智能卡组内的所有智能卡。The smart card activation module 309 is used to activate all smart cards in the target smart card group.
智能路由模块310,用于在NFC芯片和读卡器之间建立起通信连接后,并且目标智能卡组内的智能卡全部被激活后,NFC芯片可以将来自于读卡器的数据路由给正确的安全芯片,具体的,NFC芯片可以接收读卡器的选卡指令, 从而根据选卡指令在被激活的智能卡中选择目标智能卡,该目标智能卡所安装的安全芯片即为上述正确的安全芯片。The intelligent routing module 310 is used to establish a communication connection between the NFC chip and the card reader, and after all the smart cards in the target smart card group are activated, the NFC chip can route the data from the card reader to the correct security The chip, specifically, the NFC chip can receive the card selection instruction of the card reader, so as to select the target smart card among the activated smart cards according to the card selection instruction, and the security chip installed on the target smart card is the correct security chip mentioned above.
智能选卡失败处理模块311,用于在确定遍历所有的待选智能卡组后,仍然不能和读卡器正确交换RF指令,则通知终端智能选卡失败。可选的,终端可以通知用户智能选卡失败,并弹出预设的选卡界面让用户手动选择一张智能卡。The smart card selection failure processing module 311 is configured to notify the terminal that the smart card selection fails after it is determined that the RF command cannot be correctly exchanged with the card reader after traversing all the candidate smart card groups. Optionally, the terminal may notify the user that the smart card selection fails, and pop up a preset card selection interface for the user to manually select a smart card.
在一个例子中,上述的模块301至模块305均设置在独立于NFC芯片的终端内的主控芯片中,则该主控芯片还会设置智能卡组信息下发模块306,从而通过该智能卡组信息下发模块306将候选智能卡组的信息发送至NFC芯片中,比如智能卡组信息下发模块306将候选智能卡组的信息发送至NFC芯片中的智能卡组过滤模块307。也就是说,上述的模块301至模块306均设置在主控芯片中,上述模块307至模块311均设置在NFC芯片中,主控芯片和NFC芯片连接。In one example, the above modules 301 to 305 are all set in the main control chip in the terminal independent of the NFC chip, then the main control chip will also be set with a smart card group information issuing module 306, so that the smart card group information can be passed through the smart card group information distribution module 306. The issuing module 306 sends the information of the candidate smart card group to the NFC chip, for example, the smart card group information issuing module 306 sends the information of the candidate smart card group to the smart card group filtering module 307 in the NFC chip. That is to say, the above-mentioned modules 301 to 306 are all disposed in the main control chip, and the above-mentioned modules 307 to 311 are all disposed in the NFC chip, and the main control chip is connected to the NFC chip.
在另一个例子中,上述的模块301至模块305均设置在NFC芯片中,则NFC芯片中不需要上述的智能卡组信息下发模块306。也就是说,NFC芯片中可以设置有模块301至模块305以及模块307至模块311。In another example, the above-mentioned modules 301 to 305 are all disposed in the NFC chip, and the above-mentioned smart card group information issuing module 306 is not required in the NFC chip. That is, the modules 301 to 305 and the modules 307 to 311 may be provided in the NFC chip.
值得一提的是,本实施方式中所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本申请的创新部分,本实施方式中并没有将与解决本申请所提出的技术问题关系不太密切的单元引入,但这并不表明本实施方式中不存在其它的单元。It is worth mentioning that each module involved in this embodiment is a logical module. In practical applications, a logical unit may be a physical unit, a part of a physical unit, or multiple physical units. A composite implementation of the unit. In addition, in order to highlight the innovative part of the present application, this embodiment does not introduce units that are not closely related to solving the technical problem raised by the present application, but this does not mean that there are no other units in this embodiment.
本实施方式中,终端在还未进入读卡器的射频范围时,先合理的筛选出 满足筛选条件的各个候选智能卡,有利于将候选智能卡的数量控制在合理的范围内,在不影响与读卡器建立通信连接的成功率的同时提高与读卡器成功建立通信连接的速度。另外,终端进入射频范围后过,再过滤掉部分候选智能卡组,得到符合过滤条件的各个待选智能卡组,有利于进一步缩小遍历范围,提高遍历速度,从而提高选卡速度。In this embodiment, before the terminal has entered the radio frequency range of the card reader, it first reasonably filters out each candidate smart card that meets the screening conditions, which is beneficial to control the number of candidate smart cards within a reasonable range, without affecting and reading The success rate of establishing a communication connection with the card reader increases the speed of successfully establishing a communication connection with the card reader. In addition, after the terminal enters the radio frequency range, some candidate smart card groups are filtered out, and each candidate smart card group that meets the filtering conditions is obtained, which is conducive to further narrowing the traversal range, improving the traversing speed, and thus improving the card selection speed.
本申请的第三实施方式涉及一种用于NFC卡模拟模式的选卡方法。下面对本实施方式的用于NFC卡模拟模式的选卡方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。The third embodiment of the present application relates to a card selection method for an NFC card emulation mode. The implementation details of the card selection method for the NFC card emulation mode in this embodiment will be specifically described below. The following contents are only implementation details provided for the convenience of understanding, and are not necessary for implementing this solution.
本实施例的用于NFC卡模拟模式的选卡方法的流程图可以如图4所示,包括:The flowchart of the card selection method for the NFC card emulation mode in this embodiment may be shown in FIG. 4 , including:
步骤401:在检测到终端进入读卡器的射频范围后,对终端内的各个候选智能卡进行是否满足过滤条件的判断,获取符合过滤条件的各个待选智能卡。Step 401: After detecting that the terminal enters the radio frequency range of the card reader, judge whether each candidate smart card in the terminal satisfies the filter condition, and obtain each candidate smart card that meets the filter condition.
其中,读卡器和终端均具有NFC功能,读卡器可以发出NFC射频场,终端在进入读卡器的射频范围后可以感应到读卡器所发射出的射频场。也就是说,如果终端感应到读卡器所发射出的射频场,则可以确定终端进入该读卡器的射频范围。Among them, both the card reader and the terminal have NFC function, the card reader can emit NFC radio frequency field, and the terminal can sense the radio frequency field emitted by the card reader after entering the radio frequency range of the card reader. That is, if the terminal senses the radio frequency field emitted by the card reader, it can be determined that the terminal enters the radio frequency range of the card reader.
在一个例子中,终端为手机,用户乘坐公交车,拿起手机靠近配置在公交车上的读卡器,手机可以检测到该读卡器的NFC射频场,从而确定手机进入读卡器的射频范围。在具体实现中,可以是手机中的NFC芯片检测到该读卡器的NFC射频场,从而确定手机进入读卡器的射频范围。In an example, the terminal is a mobile phone, the user takes a bus, picks up the mobile phone and approaches the card reader configured on the bus, the mobile phone can detect the NFC radio frequency field of the card reader, so as to determine the radio frequency of the mobile phone entering the card reader scope. In a specific implementation, the NFC chip in the mobile phone may detect the NFC radio frequency field of the card reader, so as to determine the radio frequency range of the mobile phone entering the card reader.
在具体实现中,用户可以根据实际需要预先在终端中安装可能会使用到的智能卡,该智能卡可以理解为虚拟的电子卡,比如,公交卡、门禁卡、银行 卡等。不同的智能卡可以对应有不同的应用,智能卡对应的应用,可以理解为用于实现近距离通信的应用程序,其具备用于模拟非接触IC卡的仿真功能,即具备模拟智能卡的功能。根据应用场景的不同,智能卡对应的应用可以分为不同类型,比如公交卡、门禁卡、银行卡分别对应有公交卡应用、门禁卡应用、银行卡应用。终端中安装的智能卡也可以理解为终端中安装的智能卡对应的应用。In a specific implementation, the user can pre-install a smart card that may be used in the terminal according to actual needs. The smart card can be understood as a virtual electronic card, such as a bus card, an access control card, and a bank card. Different smart cards can correspond to different applications. The application corresponding to the smart card can be understood as the application program used to realize short-range communication, which has the simulation function for simulating the contactless IC card, that is, it has the function of simulating the smart card. According to different application scenarios, the applications corresponding to smart cards can be divided into different types, such as bus cards, access control cards, and bank cards, respectively, corresponding to bus card applications, access control card applications, and bank card applications. The smart card installed in the terminal can also be understood as an application corresponding to the smart card installed in the terminal.
在实际应用中,智能卡实际可以被安装在终端中的安全单元(Secure Element,SE)中;其中,SE可以为智能卡的运行提供安全的执行环境(如认证、授权等),为其敏感数据提供安全的存储环境。SE中可以通过存储分区等手段同时安装多个智能卡,SE可以是与NFC芯片一起封装的SE。当然,SE可以以不同的形式存在,例如,以用户标识模块(subscriber identification module,SIM)卡形式存在的SE,即SIM卡上设置有SE、与NFC芯片一起封装的SE、集成在终端的印刷电路板(printed circuit board,PCB)上的SE、集成在安全数字(secure digital,SD)存储卡中的SE,即SD存储卡上设置有SE。在本实施例中,SE还可以以其他形式存在于终端,本实施例对此不做具体限定。需要说明的是,SE以不同形式存在于终端,即SE可能设置在终端中的不同位置,不同位置的SE可以具有相似的功能。In practical applications, the smart card can actually be installed in a secure element (Secure Element, SE) in the terminal; wherein, the SE can provide a secure execution environment (such as authentication, authorization, etc.) for the operation of the smart card, and provide its sensitive data with Safe storage environment. Multiple smart cards can be installed simultaneously in the SE by means of storage partitions and the like, and the SE can be an SE packaged together with an NFC chip. Of course, the SE can exist in different forms, for example, the SE in the form of a subscriber identification module (SIM) card, that is, the SIM card is provided with the SE, the SE packaged with the NFC chip, and the printing integrated in the terminal. The SE on the printed circuit board (PCB) and the SE integrated in the secure digital (SD) memory card, that is, the SD memory card is provided with the SE. In this embodiment, the SE may also exist in the terminal in other forms, which is not specifically limited in this embodiment. It should be noted that the SEs exist in the terminal in different forms, that is, the SEs may be set in different positions in the terminal, and the SEs in different positions may have similar functions.
在一个例子中,各个候选智能卡可以为终端内的所有智能卡,即各个候选智能卡包括终端内的所有SE上安装的智能卡。In one example, each candidate smart card may be all smart cards in the terminal, that is, each candidate smart card includes the smart cards installed on all SEs in the terminal.
在另一个例子中,各个候选智能卡可以为用户在终端内的所有智能卡中选择的部分智能卡。比如,用户可以根据实际需要在终端内的所有智能卡中选择出使用频率较高的部分智能卡作为各个候选智能卡。In another example, each candidate smart card may be a part of smart cards selected by the user among all smart cards in the terminal. For example, the user may select some smart cards with higher frequency of use among all the smart cards in the terminal as the candidate smart cards according to actual needs.
在一个例子中,NFC芯片可以根据终端内的各个候选智能卡的信息和读卡器的信息,对终端内的各个候选智能卡分别进行是否满足过滤条件的判断,得到符合过滤条件的各个待选智能卡。其中,候选智能卡的信息和读卡器的信息的获取方式,以及候选智能卡的信息和读卡器的信息中包括的内容可以参考第一实施方式中的相关描述,为避免重复,在此不再赘述。In one example, the NFC chip can judge whether each candidate smart card in the terminal satisfies the filtering conditions according to the information of each candidate smart card in the terminal and the information of the card reader, and obtain each candidate smart card that meets the filtering conditions. Wherein, for the acquisition method of the information of the candidate smart card and the information of the card reader, as well as the content included in the information of the candidate smart card and the card reader, reference may be made to the relevant description in the first embodiment. Repeat.
在一个例子中,过滤条件包括:候选智能卡的NFC技术类型属于读卡器支持的NFC技术类型,和/或,候选智能卡的卡类型属于读卡器支持的卡类型。也就是说,在各个候选智能卡中淘汰掉不属于读卡器支持的NFC技术类型的候选智能卡,和/或,淘汰掉不属于读卡器支持的卡类型的候选智能卡,有利于合理的对终端中的各个候选智能卡进行是否满足过滤条件的判断。In one example, the filtering conditions include: the NFC technology type of the candidate smart card belongs to the NFC technology type supported by the card reader, and/or the card type of the candidate smart card belongs to the card type supported by the card reader. That is to say, eliminating candidate smart cards that do not belong to the NFC technology type supported by the card reader among the candidate smart cards, and/or eliminating candidate smart cards that do not belong to the card type supported by the card reader, is conducive to a reasonable understanding of the terminal. Each candidate smart card in is judged whether it satisfies the filter condition.
步骤402:确定各个待选智能卡的优先级。Step 402: Determine the priority of each candidate smart card.
其中,本步骤中确定各个待选智能卡的优先级的方式,可以参考第一实施方式中的各个待选智能卡优先级的确定方式,为避免重复,此处不再赘述。Wherein, for the method of determining the priority of each candidate smart card in this step, reference may be made to the method for determining the priority of each candidate smart card in the first embodiment, and to avoid repetition, it will not be repeated here.
步骤403:根据各个待选智能卡的优先级从高到低的顺序,依次遍历各个待选智能卡,并根据当前遍历到的待选智能卡的信息,尝试与读卡器建立通信连接。Step 403: According to the priority of each candidate smart card from high to low, traverse each candidate smart card in turn, and try to establish a communication connection with the card reader according to the currently traversed information of the candidate smart card.
其中,当前遍历到的待选智能卡的信息为待选智能卡的用于建立通信连接的参数,即待选智能卡的非接触参数。即NFC芯片根据各个待选智能卡的优先级从高到低的顺序遍历各个待选智能卡,根据当前遍历到的待选智能卡的非接触参数,尝试与读卡器建立通信连接,直至遍历到能够与读卡器成功建立通信连接的待选智能卡,停止遍历。也可以理解为,NFC芯片依次模拟各待选智能卡,尝试在模拟各待选智能卡时和读卡器建立通信连接。The information of the currently traversed smart card to be selected is a parameter of the smart card to be selected for establishing a communication connection, that is, a contactless parameter of the smart card to be selected. That is, the NFC chip traverses each candidate smart card in order from high to low according to the priority of each candidate smart card, and tries to establish a communication connection with the card reader according to the non-contact parameters of the currently traversed candidate smart card until it can communicate with the card reader. The candidate smart card for which the card reader successfully establishes a communication connection stops traversing. It can also be understood that the NFC chip simulates the smart cards to be selected in sequence, and attempts to establish a communication connection with the card reader when simulating the smart cards to be selected.
在一个例子中,根据当前遍历到的待选智能卡的非接触参数,尝试与读卡器建立通信连接,可以理解为:NFC芯片使用遍历到的待选智能卡的非接触参数和读卡器进行符合NFC论坛标准协议的射频(Radio Frequency,RF)指令交换,当前遍历到的待选智能卡的非接触参数会填充在RF指令中和读卡器进行交互,相互认证并尝试建立通信。如果RF指令交换成功,则可以认为NFC芯片可以通过当前遍历到的待选智能卡的非接触参数成功和读卡器建立通信连接,即NFC芯片可以使用该遍历到的待选智能卡的非接触参数和读卡器进行通信。In an example, an attempt is made to establish a communication connection with the card reader according to the currently traversed contactless parameters of the candidate smart card. The radio frequency (RF) command exchange of the NFC Forum standard protocol, the contactless parameters of the currently traversed candidate smart card will be filled in the RF command to interact with the card reader, authenticate each other and try to establish communication. If the RF command exchange is successful, it can be considered that the NFC chip can successfully establish a communication connection with the card reader through the contactless parameters of the currently traversed candidate smart card, that is, the NFC chip can use the traversed contactless parameters of the candidate smart card and card reader to communicate.
在具体实现中,上述的RF指令可以是应用协议数据单元(Application Protocol Data Unit,APDU)帧格式、单字节短帧格式、长帧格式等帧格式的指令。又如,RF指令可以是14443TYPE A,14443TYPE B,ISO18092,ISO15693等类型的指令。RF指令可以具体为:NFC论坛标准协议规定的ALL_REQ Command、SENS_REQ Command、SENS_RES Response、SDD_REQ Command、SEL_REQ Command、SLP_REQ Command等。In a specific implementation, the above-mentioned RF instruction may be an instruction in a frame format such as an Application Protocol Data Unit (Application Protocol Data Unit, APDU) frame format, a single-byte short frame format, a long frame format, or the like. For another example, the RF instruction may be a 14443TYPE A, 14443TYPE B, ISO18092, ISO15693 and other type of instruction. The RF command can be specifically: ALL_REQ Command, SENS_REQ Command, SENS_RES Response, SDD_REQ Command, SEL_REQ Command, SLP_REQ Command, etc. specified in the NFC Forum standard protocol.
步骤404:若根据当前遍历到的待选智能卡的信息,与读卡器成功建立通信连接,通过当前遍历到的待选智能卡与读卡器进行刷卡操作。Step 404: If a communication connection is successfully established with the card reader according to the information of the currently traversed candidate smart card, and the card reader is swiped through the currently traversed candidate smart card.
在一个例子中,若根据当前遍历到的待选智能卡的信息,与读卡器成功建立通信连接,将当前遍历到的待选智能卡记为目标智能卡。通过目标智能卡与读卡器进行刷卡操作的方式可以如下:激活目标智能卡,NFC芯片将来自读卡器的数据,发送至安装目标智能卡的SE,由SE处理该数据,以完成刷卡操作。比如,在终端靠近刷银行卡的读卡器时,读卡器与终端内的NFC芯片通过目标智能卡(比如银行卡)的非接触参数成功建立通信连接后,NFC芯片可以激活该目标智能卡。然后,NFC芯片接收到来自读卡器发送的交易指令后,可 以将该交易指令发送至安装目标智能卡的SE上,利用SE提供的安全的执行环境完成交易,即进行刷银行卡的操作。In one example, if a communication connection is successfully established with the card reader according to the information of the currently traversed candidate smart card, the currently traversed candidate smart card is marked as the target smart card. The card swiping operation through the target smart card and the card reader can be as follows: activating the target smart card, the NFC chip sends the data from the card reader to the SE where the target smart card is installed, and the SE processes the data to complete the card swiping operation. For example, when the terminal is close to a card reader for swiping a bank card, after the card reader and the NFC chip in the terminal successfully establish a communication connection through the contactless parameters of the target smart card (such as a bank card), the NFC chip can activate the target smart card. Then, after the NFC chip receives the transaction instruction sent from the card reader, it can send the transaction instruction to the SE where the target smart card is installed, and use the secure execution environment provided by the SE to complete the transaction, that is, to swipe the bank card.
在一个例子中,激活目标智能卡的方式可以为:NFC芯片向安装所述目标智能卡的SE发送指令,以使得安装所述目标智能卡的SE激活目标智能卡。在另一个例子中,激活目标智能卡的方式可以为:NFC芯片将目标智能卡对应的AID发送至终端中的应用处理器(application processor,AP),由终端中的AP向SE发起目标智能卡的激活指令,从而激活目标智能卡。In one example, the manner of activating the target smart card may be: the NFC chip sends an instruction to the SE installed with the target smart card, so that the SE installed with the target smart card activates the target smart card. In another example, the method of activating the target smart card may be: the NFC chip sends the AID corresponding to the target smart card to an application processor (application processor, AP) in the terminal, and the AP in the terminal initiates an activation instruction of the target smart card to the SE , thereby activating the target smart card.
在一个例子中,若遍历完各个待选智能卡后,仍未与读卡器成功建立通信连接,NFC芯片可以发出选卡失败的通知信息;和/或,弹出预设的用于供用户选择智能卡的选卡界面。其中,若遍历完各个待选智能卡后,仍未与读卡器成功建立通信连接后的处理方式与第一实施方式中若遍历完各个待选智能卡组后,仍未与读卡器成功建立通信连接的处理方式类似,可以参考第一实施方式中的相关描述,为避免重复,在此不再赘述。In one example, if the communication connection with the card reader is not successfully established after traversing all the smart cards to be selected, the NFC chip can send a notification message that the card selection fails; and/or, pop up a preset for the user to select the smart card tab interface. Among them, if after traversing all the smart cards to be selected, the communication connection with the card reader has not been successfully established, the processing method is the same as in the first embodiment, if after traversing the smart card groups to be selected, the communication with the card reader has not been successfully established. The connection processing method is similar, and reference may be made to the relevant description in the first embodiment, which is not repeated here in order to avoid repetition.
需要说明的是,本实施方式中的上述各示例均为为方便理解进行的举例说明,并不对本申请的技术方案构成限定。It should be noted that, the above examples in this embodiment are all examples for the convenience of understanding, and do not limit the technical solutions of the present application.
本实施方式中,在检测到终端进入读卡器的射频范围后,即用户接近读卡器后,无需点亮终端的屏幕,进入选卡程序,人工选择智能卡进行刷卡,有利于减少用户操作,提高刷卡的便捷性。而且,对终端内的各个候选智能卡进行是否满足过滤条件的判断,获取符合过滤条件的各个待选智能卡,有利于得到符合过滤条件的各个待选智能卡,从而缩小遍历范围,提高遍历速度,以提高选卡速度。通过各个待选智能卡的优先级从高到低的顺序依次遍历各个待选智能卡,有利于以合理的顺序依次根据各个待选智能卡的信息,尝试与读卡器 建立通信连接,有利于减小尝试的次数,快速的成功与读卡器建立通信连接,从而进一步提高选卡的速度。In this embodiment, after it is detected that the terminal enters the radio frequency range of the card reader, that is, after the user approaches the card reader, there is no need to light up the screen of the terminal, enter the card selection program, and manually select the smart card to swipe the card, which is beneficial to reduce user operations. Improve the convenience of swiping cards. Moreover, it is helpful to obtain each candidate smart card that meets the filter condition by judging whether each candidate smart card in the terminal satisfies the filter condition, and obtaining each candidate smart card that meets the filter condition, thereby reducing the traversal range and improving the traversal speed, so as to improve the Card selection speed. The priority of each candidate smart card is traversed in order from high to low, which is beneficial to try to establish a communication connection with the card reader according to the information of each candidate smart card in a reasonable order, which is conducive to reducing the number of attempts The number of times, quickly and successfully establish a communication connection with the card reader, thereby further improving the speed of card selection.
本申请的第四实施方式涉及一种用于NFC卡模拟模式的选卡方法。下面对本实施方式的用于NFC卡模拟模式的选卡方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。The fourth embodiment of the present application relates to a card selection method for an NFC card emulation mode. The implementation details of the card selection method for the NFC card emulation mode in this embodiment will be specifically described below. The following contents are only implementation details provided for the convenience of understanding, and are not necessary for implementing this solution.
本实施例的用于NFC卡模拟模式的选卡方法的流程图可以如图5所示,包括:The flowchart of the card selection method for the NFC card emulation mode in this embodiment may be as shown in FIG. 5 , including:
步骤501:获取终端内满足预设的筛选条件的各个候选智能卡。Step 501: Acquire each candidate smart card in the terminal that meets preset screening conditions.
其中,步骤501与第二实施方式中步骤201大致相同,为避免重复此处不再赘述。Wherein, step 501 is substantially the same as step 201 in the second embodiment, and is not repeated here to avoid repetition.
步骤502:在检测到终端进入读卡器的射频范围后,对终端内的各个候选智能卡进行是否满足过滤条件的判断,获取符合过滤条件的各个待选智能卡。Step 502: After detecting that the terminal has entered the radio frequency range of the card reader, judge whether each candidate smart card in the terminal satisfies the filter condition, and obtain each candidate smart card that meets the filter condition.
步骤503:确定各个待选智能卡的优先级。Step 503: Determine the priority of each candidate smart card.
步骤504:根据各个待选智能卡的优先级从高到低的顺序,依次遍历各个待选智能卡,并根据当前遍历到的待选智能卡的信息,尝试与读卡器建立通信连接。Step 504: According to the priority of each candidate smart card from high to low, traverse each candidate smart card in turn, and try to establish a communication connection with the card reader according to the currently traversed information of the candidate smart card.
步骤505:若根据当前遍历到的待选智能卡的信息,与读卡器成功建立通信连接,通过当前遍历到的待选智能卡与读卡器进行刷卡操作。Step 505: If a communication connection is successfully established with the card reader according to the information of the currently traversed candidate smart card, and the card reader is swiped through the currently traversed candidate smart card.
可以理解的是,本实施例中,在终端进入读卡器的射频范围之前,先在无需结合读卡器的信息的情况下,对终端内的各智能卡进行筛选,得到满足筛选条件的各个候选智能卡。在终端进入读卡器的射频范围之后,可以根据终端内的各候选智能卡的信息和读卡器的信息,得到过滤后的符合过滤条件的各个 待选智能卡。It can be understood that, in this embodiment, before the terminal enters the radio frequency range of the card reader, each smart card in the terminal is screened without combining the information of the card reader, and each candidate that meets the screening conditions is obtained. smart card. After the terminal enters the radio frequency range of the card reader, each candidate smart card that meets the filtering conditions can be obtained after filtering according to the information of each candidate smart card in the terminal and the information of the card reader.
本实施方式中,终端在还未进入读卡器的射频范围时,先合理的筛选出满足筛选条件的各个候选智能卡,有利于将候选智能卡的数量控制在合理的范围内,在不影响与读卡器建立通信连接的成功率的同时提高与读卡器成功建立通信连接的速度。另外,终端进入射频范围后过,再过滤掉部分候选智能卡,得到符合过滤条件的各个待选智能卡,有利于进一步缩小遍历范围,提高遍历速度,从而提高选卡速度。In this embodiment, before the terminal has entered the radio frequency range of the card reader, it first reasonably filters out each candidate smart card that meets the screening conditions, which is beneficial to control the number of candidate smart cards within a reasonable range, without affecting and reading The success rate of establishing a communication connection with the card reader increases the speed of successfully establishing a communication connection with the card reader. In addition, after the terminal enters the radio frequency range, some candidate smart cards are filtered out, and each candidate smart card that meets the filtering conditions is obtained, which is conducive to further narrowing the traversing range, improving the traversing speed, and thus improving the card selection speed.
上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。The steps of the above various methods are divided only for the purpose of describing clearly. During implementation, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as the same logical relationship is included, they are all within the protection scope of this patent. ;Adding insignificant modifications to the algorithm or process or introducing insignificant designs, but not changing the core design of the algorithm and process are all within the scope of protection of this patent.
本申请第五实施例涉及一种芯片,可参考图6,芯片601位于终端内且与终端内的存储器602连接,存储器602存储有可被芯片601执行的指令,指令被芯片601执行,以使芯片601能够执行上述任一实施例所述的用于NFC卡模拟模式的选卡方法。The fifth embodiment of the present application relates to a chip. Referring to FIG. 6 , the chip 601 is located in the terminal and is connected to a memory 602 in the terminal. The memory 602 stores instructions that can be executed by the chip 601 , and the instructions are executed by the chip 601 to make The chip 601 can execute the card selection method for the NFC card emulation mode described in any of the above embodiments.
不难发现,本实施方式为与第一至第四实施方式相对应的装置实施例,本实施方式可与第一至第四实施方式中任一实施方式互相配合实施。第一至第四实施方式中任一实施方式提到的相关技术细节在本实施方式中依然有效,为了减少重复,这里不再赘述。相应地,本实施方式中提到的相关技术细节也可应用在第一至第四实施方式中。It is not difficult to find that this embodiment is a device example corresponding to the first to fourth embodiments, and this embodiment can be implemented in cooperation with any of the first to fourth embodiments. The relevant technical details mentioned in any one of the first to fourth embodiments are still valid in this embodiment, and are not repeated here in order to reduce repetition. Correspondingly, the related technical details mentioned in this embodiment can also be applied to the first to fourth embodiments.
本申请第六实施例涉及一种终端,参考图6,包括:芯片601,以及与芯片601连接的存储器602。The sixth embodiment of the present application relates to a terminal. Referring to FIG. 6 , the terminal includes a chip 601 and a memory 602 connected to the chip 601 .
其中,存储器和芯片采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个芯片和存储器的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经芯片处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给芯片。The memory and the chip are connected by a bus, and the bus may include any number of interconnected buses and bridges, and the bus connects one or more chips and various circuits of the memory. The bus may also connect together various other circuits, such as peripherals, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides the interface between the bus and the transceiver. A transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing a means for communicating with various other devices over a transmission medium. The data processed by the chip is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the chip.
芯片负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器可以被用于存储芯片在执行操作时所使用的数据。The chip is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. And memory can be used to store data that the chip uses when performing operations.
本申请第七实施例涉及一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现上述方法实施例。The seventh embodiment of the present application relates to a computer-readable storage medium storing a computer program. The above method embodiments are implemented when the computer program is executed by the processor.
即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。That is, those skilled in the art can understand that all or part of the steps in the method for implementing the above embodiments can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium and includes several instructions to make a device ( It may be a single chip microcomputer, a chip, etc.) or a processor (processor) 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, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .
本领域的普通技术人员可以理解,上述各实施方式是实现本申请的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。Those of ordinary skill in the art can understand that the above-mentioned embodiments are specific examples for realizing the present application, and in practical applications, various changes can be made in form and details without departing from the spirit and the spirit of the present application. scope.

Claims (23)

  1. 一种用于NFC卡模拟模式的选卡方法,其特征在于,包括:A method for selecting a card in an NFC card emulation mode, comprising:
    在检测到终端进入读卡器的射频范围后,获取对所述终端内的各个候选智能卡进行分组得到的若干候选智能卡组;After detecting that the terminal enters the radio frequency range of the card reader, obtain several candidate smart card groups obtained by grouping each candidate smart card in the terminal;
    对所述若干候选智能卡组进行是否满足过滤条件的判断,获取符合所述过滤条件的各个待选智能卡组;Judging whether the several candidate smart card groups meet the filtering conditions, and acquiring each candidate smart card group that meets the filtering conditions;
    确定所述各个待选智能卡组的优先级;determining the priority of each candidate smart card group;
    根据所述各个待选智能卡组的优先级从高到低的顺序,依次遍历所述各个待选智能卡组,并根据当前遍历到的待选智能卡组的信息,尝试与所述读卡器建立通信连接;According to the priority order of each candidate smart card group from high to low, traverse each candidate smart card group in turn, and try to establish communication with the card reader according to the information of the currently traversed candidate smart card group connect;
    若根据当前遍历到的待选智能卡组的信息,与所述读卡器成功建立通信连接,根据所述当前遍历到的待选智能卡组确定目标智能卡,并通过所述目标智能卡与所述读卡器进行刷卡操作。If a communication connection is successfully established with the card reader according to the information of the currently traversed candidate smart card group, a target smart card is determined according to the currently traversed candidate smart card group, and the target smart card is communicated with the card reader through the target smart card. to perform a card swipe operation.
  2. 如权利要求1所述的用于NFC卡模拟模式的选卡方法,其特征在于,所述获取对所述终端内的各个候选智能卡进行分组得到的若干候选智能卡组,包括:The card selection method for an NFC card emulation mode according to claim 1, wherein the acquiring several candidate smart card groups obtained by grouping each candidate smart card in the terminal comprises:
    根据所述终端内的各个候选智能卡的用于建立通信连接的参数,对所述各个候选智能卡进行分组,得到若干候选智能卡组;其中,同一所述候选智能卡组内的候选智能卡的用于建立通信连接的参数不存在冲突。According to the parameters of each candidate smart card in the terminal for establishing a communication connection, the candidate smart cards are grouped to obtain several candidate smart card groups; wherein, the candidate smart cards in the same candidate smart card group are used for establishing communication There are no conflicting parameters for the connection.
  3. 如权利要求1所述的用于NFC卡模拟模式的选卡方法,其特征在于,所述过滤条件包括:所述候选智能卡组中至少存在一个候选智能卡的NFC技术类 型属于所述读卡器支持的NFC技术类型,和/或,所述候选智能卡组中至少存在一个候选智能卡的卡类型属于所述读卡器支持的卡类型。The card selection method for an NFC card emulation mode according to claim 1, wherein the filtering conditions include: the NFC technology type of at least one candidate smart card in the candidate smart card group belongs to the card reader support and/or, the card type of at least one candidate smart card in the candidate smart card group belongs to the card type supported by the card reader.
  4. 如权利要求1所述的用于NFC卡模拟模式的选卡方法,其特征在于,所述确定所述各个待选智能卡组的优先级,包括:The card selection method for NFC card emulation mode according to claim 1, wherein the determining the priority of each smart card group to be selected comprises:
    确定所述各个待选智能卡组中各待选智能卡的优先级;determining the priority of each candidate smart card in each candidate smart card group;
    根据所述各个待选智能卡组中各待选智能卡的优先级,确定所述各个待选智能卡组的优先级。The priority of each smart card group to be selected is determined according to the priority of each smart card to be selected in the smart card group to be selected.
  5. 如权利要求4所述的用于NFC卡模拟模式的选卡方法,其特征在于,所述确定所述各个待选智能卡组中各待选智能卡的优先级,包括:The card selection method for NFC card emulation mode according to claim 4, wherein the determining the priority of each candidate smart card in each candidate smart card group comprises:
    根据所述各个待选智能卡组中各待选智能卡的信息,确定所述各待选智能卡对应的排序权重;According to the information of the smart cards to be selected in the smart card groups to be selected, determine the sorting weight corresponding to the smart cards to be selected;
    根据所述各待选智能卡对应的排序权重,确定所述各待选智能卡的优先级。According to the sorting weights corresponding to the smart cards to be selected, the priority of the smart cards to be selected is determined.
  6. 如权利要求5所述的用于NFC卡模拟模式的选卡方法,其特征在于,所述根据所述各个待选智能卡组中各待选智能卡的信息,确定所述各待选智能卡对应的排序权重,包括:The card selection method for an NFC card simulation mode according to claim 5, wherein the order corresponding to the smart cards to be selected is determined according to the information of the smart cards to be selected in the smart card groups to be selected weights, including:
    根据所述各待选智能卡的信息,确定所述各待选智能卡对应的权重因子;According to the information of the smart cards to be selected, determine the weighting factors corresponding to the smart cards to be selected;
    根据所述各待选智能卡对应的权重因子,确定所述各待选智能卡对应的排序权重;According to the weight factors corresponding to the smart cards to be selected, determine the sorting weights corresponding to the smart cards to be selected;
    其中,所述待选智能卡的信息包括所述待选智能卡对应的应用时,所述权重因子包括:基于所述待选智能卡对应的应用是否为所述终端运行的前台应用确定的第一权重因子,和/或,基于所述待选智能卡对应的应用是否为所述终端默认的付款应用确定的第二权重因子;Wherein, when the information of the smart card to be selected includes the application corresponding to the smart card to be selected, the weighting factor includes: a first weighting factor determined based on whether the application corresponding to the smart card to be selected is a foreground application running on the terminal , and/or, a second weighting factor determined based on whether the application corresponding to the smart card to be selected is the default payment application of the terminal;
    所述待选智能卡的信息包括所述待选智能卡的地理位置需求时,所述权重因子包括:基于所述终端的地理位置是否满足所述待选智能卡的地理位置需求确定的第三权重因子;When the information of the smart card to be selected includes the geographic location requirement of the smart card to be selected, the weighting factor includes: a third weighting factor determined based on whether the geographic location of the terminal satisfies the geographic location requirement of the smart card to be selected;
    所述待选智能卡的信息包括所述待选智能卡被激活的历史次数时,所述权重因子包括:基于所述待选智能卡被激活的历史次数确定的第四权重因子。When the information of the smart card to be selected includes the historical times of activation of the smart card to be selected, the weighting factor includes: a fourth weighting factor determined based on the historical times of activation of the smart card to be selected.
  7. 如权利要求6所述的用于NFC卡模拟模式的选卡方法,其特征在于,在所述权重因子包括所述第三权重因子的情况下,若所述终端的地理位置同时满足多个待选智能卡的地理位置需求,则所述多个待选智能卡中,地理位置需求范围越小的待选智能卡对应的第三权重因子越大。The card selection method for NFC card simulation mode according to claim 6, characterized in that, in the case that the weighting factor includes the third weighting factor, if the geographical location of the terminal satisfies a plurality of requirements at the same time If the geographic location requirement of the selected smart card is selected, among the plurality of candidate smart cards, the smaller the geographic location requirement range is, the larger the third weighting factor corresponding to the candidate smart card is.
  8. 如权利要求1所述的用于NFC卡模拟模式的选卡方法,其特征在于,所述待选智能卡组的信息包括:所述待选智能卡组的用于建立通信连接的参数,所述待选智能卡组的用于建立通信连接的参数为:对所述待选智能卡组中的各待选智能卡的用于建立通信连接的参数进行合并后得到的合并参数。The card selection method for an NFC card emulation mode according to claim 1, wherein the information of the smart card group to be selected comprises: parameters of the smart card group to be selected for establishing a communication connection, the smart card group to be selected The parameters used for establishing the communication connection in the selected smart card group are: combined parameters obtained by merging the parameters used for establishing the communication connection of the smart cards to be selected in the smart card group to be selected.
  9. 如权利要求1至8任一项所述的用于NFC卡模拟模式的选卡方法,其特征在于,所述各个候选智能卡满足预设的筛选条件。The card selection method for an NFC card emulation mode according to any one of claims 1 to 8, wherein each candidate smart card meets a preset screening condition.
  10. 如权利要求9所述的用于NFC卡模拟模式的选卡方法,其特征在于,所述筛选条件包括:所述终端的地理位置满足所述候选智能卡的地理位置需求,和/或,所述候选智能卡所属的安全单元允许被激活。The card selection method for an NFC card simulation mode according to claim 9, wherein the screening conditions include: the geographic location of the terminal meets the geographic location requirement of the candidate smart card, and/or the The security unit to which the candidate smart card belongs is allowed to be activated.
  11. 如权利要求1至8任一项所述的用于NFC卡模拟模式的选卡方法,其特征在于,所述根据所述当前遍历到的待选智能卡组确定目标智能卡,包括:The card selection method for an NFC card emulation mode according to any one of claims 1 to 8, wherein the determining the target smart card according to the currently traversed smart card group to be selected comprises:
    激活所述当前遍历到的待选智能卡组中的各待选智能卡;activating each candidate smart card in the currently traversed candidate smart card group;
    接收来自所述读卡器的选卡指令;receiving a card selection instruction from the card reader;
    根据所述选卡指令,在被激活的待选智能卡中确定目标智能卡。According to the card selection instruction, the target smart card is determined among the activated candidate smart cards.
  12. 如权利要求1至8任一项所述的用于NFC卡模拟模式的选卡方法,其特征在于,若遍历完所述各个待选智能卡后,仍未与所述读卡器成功建立通信连接,所述方法还包括:The card selection method for an NFC card emulation mode according to any one of claims 1 to 8, wherein, after traversing the smart cards to be selected, a communication connection with the card reader has not been successfully established , the method also includes:
    发出选卡失败的通知信息;和/或,send a notification message of failed selection; and/or,
    弹出预设的用于供用户选择智能卡的选卡界面。A preset tab interface for the user to select a smart card is popped up.
  13. 一种用于NFC卡模拟模式的选卡方法,其特征在于,包括:A method for selecting a card in an NFC card emulation mode, comprising:
    在检测到终端进入读卡器的射频范围后,对所述终端内的各个候选智能卡进行是否满足过滤条件的判断,获取符合所述过滤条件的各个待选智能卡;After detecting that the terminal has entered the radio frequency range of the card reader, judge whether each candidate smart card in the terminal satisfies the filter condition, and obtain each candidate smart card that meets the filter condition;
    确定所述各个待选智能卡的优先级;determining the priority of each candidate smart card;
    根据所述各个待选智能卡的优先级从高到低的顺序,依次遍历所述各个待选智能卡,并根据当前遍历到的待选智能卡的信息,尝试与所述读卡器建立通信连接;According to the priority of each candidate smart card from high to low, traverse each candidate smart card in turn, and try to establish a communication connection with the card reader according to the information of the currently traversed candidate smart card;
    若根据当前遍历到的待选智能卡的信息,与所述读卡器成功建立通信连接,通过所述当前遍历到的待选智能卡与所述读卡器进行刷卡操作。If a communication connection is successfully established with the card reader according to the information of the currently traversed candidate smart card, a card swiping operation is performed with the card reader through the currently traversed candidate smart card.
  14. 如权利要求13所述的用于NFC卡模拟模式的选卡方法,其特征在于,所述过滤条件包括:所述候选智能卡的NFC技术类型属于所述读卡器支持的NFC技术类型,和/或,所述候选智能卡的卡类型属于所述读卡器支持的卡类型。The card selection method for an NFC card emulation mode according to claim 13, wherein the filtering conditions include: the NFC technology type of the candidate smart card belongs to the NFC technology type supported by the card reader, and/ Or, the card type of the candidate smart card belongs to the card type supported by the card reader.
  15. 如权利要求13所述的用于NFC卡模拟模式的选卡方法,其特征在于,所述确定所述各个待选智能卡的优先级,包括:The card selection method for an NFC card emulation mode according to claim 13, wherein the determining the priority of each smart card to be selected comprises:
    根据所述各个待选智能卡的信息,确定所述各个待选智能卡对应的排序权重;According to the information of the smart cards to be selected, the sorting weights corresponding to the smart cards to be selected are determined;
    根据所述各个待选智能卡对应的排序权重,确定所述各个待选智能卡的优先级。The priority of each candidate smart card is determined according to the sorting weight corresponding to each candidate smart card.
  16. 如权利要求15所述的用于NFC卡模拟模式的选卡方法,其特征在于,所述根据所述各个待选智能卡的信息,确定所述各个待选智能卡对应的排序权重,包括:The card selection method for an NFC card simulation mode according to claim 15, wherein the determining the sorting weight corresponding to the smart cards to be selected according to the information of the smart cards to be selected comprises:
    根据所述各个待选智能卡的信息,确定所述各个待选智能卡对应的权重因子;According to the information of the smart cards to be selected, determine the weighting factors corresponding to the smart cards to be selected;
    根据所述各个待选智能卡对应的权重因子,确定所述各个待选智能卡对应的排序权重;According to the weight factors corresponding to the smart cards to be selected, determine the sorting weights corresponding to the smart cards to be selected;
    其中,所述待选智能卡的信息包括所述待选智能卡对应的应用时,所述权重因子包括:基于所述待选智能卡对应的应用是否为所述终端运行的前台应用确定的第一权重因子,和/或,基于所述待选智能卡对应的应用是否为所述终端默认的付款应用确定的第二权重因子;Wherein, when the information of the smart card to be selected includes the application corresponding to the smart card to be selected, the weighting factor includes: a first weighting factor determined based on whether the application corresponding to the smart card to be selected is a foreground application running on the terminal , and/or, a second weighting factor determined based on whether the application corresponding to the smart card to be selected is the default payment application of the terminal;
    所述待选智能卡的信息包括所述待选智能卡的地理位置需求时,所述权重因子包括:基于所述终端的地理位置是否满足所述待选智能卡的地理位置需求确定的第三权重因子;When the information of the smart card to be selected includes the geographic location requirement of the smart card to be selected, the weighting factor includes: a third weighting factor determined based on whether the geographic location of the terminal satisfies the geographic location requirement of the smart card to be selected;
    所述待选智能卡的信息包括所述待选智能卡被激活的历史次数时,所述权重因子包括:基于所述待选智能卡被激活的历史次数确定的第四权重因子。When the information of the smart card to be selected includes the historical times of activation of the smart card to be selected, the weighting factor includes: a fourth weighting factor determined based on the historical times of activation of the smart card to be selected.
  17. 如权利要求16所述的用于NFC卡模拟模式的选卡方法,其特征在于,在所述权重因子包括所述第三权重因子的情况下,若所述终端的地理位置同时满足多个待选智能卡的地理位置需求,则所述多个待选智能卡中,地理位置需求范围越小的待选智能卡对应的第三权重因子越大。The card selection method for NFC card simulation mode according to claim 16, characterized in that, in the case that the weighting factor includes the third weighting factor, if the geographical location of the terminal satisfies a plurality of requirements at the same time If the geographic location requirement of the selected smart card is selected, among the plurality of candidate smart cards, the smaller the geographic location requirement range is, the larger the third weighting factor corresponding to the candidate smart card is.
  18. 如权利要求13至17任一项所述的用于NFC卡模拟模式的选卡方法,其特征在于,所述各个候选智能卡满足预设的筛选条件。The card selection method for an NFC card emulation mode according to any one of claims 13 to 17, wherein each candidate smart card meets a preset screening condition.
  19. 如权利要求18所述的用于NFC卡模拟模式的选卡方法,其特征在于,所述筛选条件包括:所述终端的地理位置满足所述候选智能卡的地理位置需求,和/或,所述候选智能卡所属的安全单元允许被激活。The card selection method for an NFC card simulation mode according to claim 18, wherein the screening condition comprises: the geographical location of the terminal meets the geographical location requirement of the candidate smart card, and/or the The security unit to which the candidate smart card belongs is allowed to be activated.
  20. 如权利要求13至17任一项所述的用于NFC卡模拟模式的选卡方法,其特征在于,若遍历完所述各个待选智能卡后,仍未与所述读卡器成功建立通信连接,所述方法还包括:The card selection method for an NFC card emulation mode according to any one of claims 13 to 17, wherein, after traversing the smart cards to be selected, a communication connection with the card reader has not been successfully established , the method also includes:
    发出选卡失败的通知信息;和/或,send a notification message of failed selection; and/or,
    弹出预设的用于供用户选择智能卡的选卡界面。A preset tab interface for the user to select a smart card is popped up.
  21. 一种芯片,其特征在于,所述芯片位于终端内且与所述终端内的存储器连接,所述存储器存储有可被所述芯片执行的指令,所述指令被所述芯片执行,以使所述芯片能够执行如权利要求1至12中任一所述的用于NFC卡模拟模式的选卡方法,或者,执行如权利要求13至20中任一所述的用于NFC卡模拟模式的选卡方法。A chip, characterized in that the chip is located in a terminal and is connected to a memory in the terminal, the memory stores instructions that can be executed by the chip, and the instructions are executed by the chip to make all the The chip can execute the card selection method for the NFC card emulation mode as described in any one of claims 1 to 12, or perform the selection method for the NFC card emulation mode as described in any one of claims 13 to 20. card method.
  22. 一种终端,其特征在于,包括:如权利要求21所述的芯片,以及与所述芯片连接的存储器。A terminal, comprising: the chip according to claim 21, and a memory connected to the chip.
  23. 一种计算机可读存储介质,存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至12中任一所述的用于NFC卡模拟模式的选卡方法,或者,实现如权利要求13至20中任一所述的用于NFC卡模拟模式的选卡方法。A computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, the card selection method for an NFC card emulation mode according to any one of claims 1 to 12 is implemented, or , to implement the card selection method for the NFC card emulation mode according to any one of claims 13 to 20.
PCT/CN2020/128477 2020-11-12 2020-11-12 Card selection method for nfc card simulation mode, chip, terminal, and storage medium WO2022099563A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/128477 WO2022099563A1 (en) 2020-11-12 2020-11-12 Card selection method for nfc card simulation mode, chip, terminal, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/128477 WO2022099563A1 (en) 2020-11-12 2020-11-12 Card selection method for nfc card simulation mode, chip, terminal, and storage medium

Publications (1)

Publication Number Publication Date
WO2022099563A1 true WO2022099563A1 (en) 2022-05-19

Family

ID=81601950

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/128477 WO2022099563A1 (en) 2020-11-12 2020-11-12 Card selection method for nfc card simulation mode, chip, terminal, and storage medium

Country Status (1)

Country Link
WO (1) WO2022099563A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11907931B2 (en) * 2021-02-05 2024-02-20 Shenzhen GOODIX Technology Co., Ltd. Method and system for managing virtual electronic card, secure chip, terminal and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120310760A1 (en) * 2011-06-03 2012-12-06 Simon Phillips Mobile device automatic card account selection for a transaction
CN103632264A (en) * 2012-08-24 2014-03-12 三星电子株式会社 Method and apparatus for determining item based on interaction environment
CN110020569A (en) * 2019-03-11 2019-07-16 华为技术有限公司 Automatically select method, electronic equipment and the communication system of NFC analog card
CN110035180A (en) * 2019-04-11 2019-07-19 Oppo广东移动通信有限公司 Card display methods, device, terminal and storage medium
EP3719727A1 (en) * 2019-04-04 2020-10-07 Mastercard International Incorporated Transaction selection mechanism

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120310760A1 (en) * 2011-06-03 2012-12-06 Simon Phillips Mobile device automatic card account selection for a transaction
CN103632264A (en) * 2012-08-24 2014-03-12 三星电子株式会社 Method and apparatus for determining item based on interaction environment
CN110020569A (en) * 2019-03-11 2019-07-16 华为技术有限公司 Automatically select method, electronic equipment and the communication system of NFC analog card
EP3719727A1 (en) * 2019-04-04 2020-10-07 Mastercard International Incorporated Transaction selection mechanism
CN110035180A (en) * 2019-04-11 2019-07-19 Oppo广东移动通信有限公司 Card display methods, device, terminal and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11907931B2 (en) * 2021-02-05 2024-02-20 Shenzhen GOODIX Technology Co., Ltd. Method and system for managing virtual electronic card, secure chip, terminal and storage medium

Similar Documents

Publication Publication Date Title
CN112069848B (en) Card selection method, chip, terminal and storage medium for NFC card simulation mode
CN109844789B (en) Terminal transaction method and terminal
RU2481617C2 (en) Method and device of automatic selection of application of communication of near radius of coverage in electronic device
CN111543041B (en) Selection method of analog card and mobile device
KR100768154B1 (en) Wireless communication device providing a contactless interface for a smart card reader
US11088724B2 (en) Communication device, control method, program and front end
CN104393895B (en) Communicator, data processing equipment and communication means and program
US8606943B2 (en) Method for processing application commands from physical channels using a portable electronic device and corresponding device and system
CN114781415A (en) Method for automatically selecting NFC analog card, electronic equipment and communication system
CN101149782B (en) Information processing apparatus and method for mediating applications
KR20110000666A (en) Method and apparatus for automatic application selection in an electronic device using multiple discovery managers
US9008575B2 (en) Portable mobile communication device and method of controlling near field communication
US20220038899A1 (en) Method for duplicating near field communication card and electronic device therefor
WO2022252561A1 (en) Card swiping method, card controller, electronic device and storage medium
KR101455155B1 (en) Method for Mobile Payment Card Priority Auto-Setting in Multi-SE and Mobile Device using the same
JP2023524538A (en) Near Field Communication NFC Communication Method, Apparatus and Electronic Equipment
WO2022099563A1 (en) Card selection method for nfc card simulation mode, chip, terminal, and storage medium
US9824246B2 (en) Radio frequency identification tag having input device
US10552826B2 (en) Selecting an application on a card
CN113098566B (en) Method for configuring non-contact communication equipment and non-contact communication electronic equipment
WO2018161224A1 (en) Data processing method and related device
WO2023050900A1 (en) Data processing method and system, and terminal and computer-readable storage medium
CN113098567A (en) Configuration of transactions in contactless electronic devices
CN104077155A (en) Method for starting application program on mobile device
CN105809078A (en) Method for preventing conflicts between different-frequency cards and bi-frequency card reader

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: 20961120

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20961120

Country of ref document: EP

Kind code of ref document: A1