技术领域technical field
本发明涉及通信领域,尤其涉及一种NFC卡的访问方法和终端。The invention relates to the communication field, in particular to an NFC card access method and a terminal.
背景技术Background technique
近距离无线通讯(Near Field Communication,NFC)是一种非接触式识别和互联技术,可以在移动设备、消费类电子产品、个人计算机(personal computer,PC)和智能控件工具间进行近距离无线通信。NFC提供了一种简单、触控式的解决方案,可以让消费者简单直观地交换信息、访问内容与服务。NFC卡可以理解为将安全芯片(Secure Element,SE)预置在客户识别模块(Subscriber Identity Module,SIM)中的SIM卡,NFC终端是包含有NFC模块的终端,该NFC模块支持上述NFC功能,若NFC终端开启NFC功能时,可使得NFC终端中的第三方钱包客户端应用与NFC卡进行通信,例如具有NFC模块的手机中的第三方钱包客户端应用与NFC卡完成公交、地铁刷卡和超市餐饮等小额支付等。其中,该第三方钱包客户端应用为多应用开放平台对NFC卡的安全芯片资源及应用进行管理的智能管理软件。Near Field Communication (NFC) is a non-contact identification and interconnection technology that enables short-range wireless communication between mobile devices, consumer electronics, personal computers (PCs) and smart control tools . NFC provides a simple, touch-based solution that allows consumers to exchange information and access content and services simply and intuitively. The NFC card can be understood as a SIM card in which a security chip (Secure Element, SE) is preset in a subscriber identity module (Subscriber Identity Module, SIM). An NFC terminal is a terminal that includes an NFC module. The NFC module supports the above-mentioned NFC functions. If the NFC terminal enables the NFC function, the third-party wallet client application in the NFC terminal can communicate with the NFC card. For example, the third-party wallet client application in a mobile phone with an NFC module can complete bus, subway, and supermarket transactions with the NFC card. Meals and other micropayments, etc. Wherein, the third-party wallet client application is an intelligent management software for managing the security chip resources and applications of the NFC card on a multi-application open platform.
开放式移动应用程序编程接口(Open Mobile API,OMAPI)的目的为提供一种允许应用通过OAMPI的标准访问手机中的安全芯片SE。其中,OMAPI标准由一套操作系统的软件接口以及一套定义通用应用外设的硬件接口组成。上述过程中,NFC终端是经过OMAPI的适配开发得到NFC模块,才使得NFC终端中的第三方钱包客户端能够访问NFC卡并与NFC卡中的应用进行通信,但是,对于不包括NFC模块的非NFC终端来说,其未经过OMAPI的适配开发,第三方钱包客户端应用无法在不包含NFC模块的终端上访问NFC卡。The purpose of the Open Mobile Application Programming Interface (Open Mobile API, OMAPI) is to provide a standard that allows applications to access the security chip SE in the mobile phone through the OAMPI standard. Among them, the OMAPI standard consists of a set of software interfaces of the operating system and a set of hardware interfaces defining general application peripherals. In the above process, the NFC terminal obtains the NFC module through the adaptation and development of OMAPI, so that the third-party wallet client in the NFC terminal can access the NFC card and communicate with the application in the NFC card. However, for those that do not include the NFC module For non-NFC terminals, they have not been developed through OMAPI adaptation, and third-party wallet client applications cannot access NFC cards on terminals that do not contain NFC modules.
发明内容Contents of the invention
本发明实施例提供一种NFC卡的访问方法和终端,能够解决非NFC终端的第三方钱包客户端应用不能访问NFC卡的问题。Embodiments of the present invention provide an NFC card access method and terminal, which can solve the problem that third-party wallet client applications that are not NFC terminals cannot access the NFC card.
第一方面,提供一种NFC卡的访问方法,应用于终端,所述终端预先保存有存在访问权限的进程的进程标识,所述方法包括:In the first aspect, an access method of an NFC card is provided, which is applied to a terminal, and the terminal pre-stores a process identification of a process with access rights, and the method includes:
在终端智能卡服务初始化过程中,获取框架层的当前运行的进程的进程标识;In the terminal smart card service initialization process, obtain the process identification of the currently running process of the framework layer;
所述终端根据所述进程标识确定所述当前运行的进程中是否存在有权限运行的近距离无线通讯NFC终端的智能卡服务处理进程或非NFC终端的智能卡服务处理进程中的一个;The terminal determines, according to the process identifier, whether there is one of the smart card service processing process of the short-range wireless communication NFC terminal or the smart card service processing process of the non-NFC terminal that is authorized to run in the currently running process;
若是,则在所述终端安装有NFC卡时打开所述智能卡服务处理进程与所述NFC卡的逻辑通道,使得所述终端中的第三方钱包客户端应用通过所述逻辑通道访问所述NFC卡。If so, open the logical channel of the smart card service processing process and the NFC card when the terminal is equipped with the NFC card, so that the third-party wallet client application in the terminal accesses the NFC card by the logical channel .
结合第一方面,在第一方面的第一种可能实现的方式中,所述根据所述进程标识确定所述当前运行的进程中是否存在有权限运行的近距离无线通讯NFC终端的智能卡服务处理进程或非NFC终端的智能卡服务处理进程中的一个包括:With reference to the first aspect, in the first possible implementation manner of the first aspect, the smart card service process of determining whether there is a short-range wireless communication NFC terminal authorized to run in the currently running process according to the process identifier Process or one of the smart card service processing processes for non-NFC terminals includes:
确定所述进程标识中是否存在有访问权限的进程的进程标识,所述有访问权限的进程的进程标识为所述智能卡服务的可扩展标记语言XML文件中的共享用户权限名称的值,所述共享用户权限名称的值用于表征所述NFC终端具有智能卡服务的访问权限或所述非NFC终端用于智能卡服务的访问权限;Determine whether there is a process identifier of a process with access authority in the process identifier, the process identifier of the process with access authority is the value of the shared user authority name in the Extensible Markup Language XML file of the smart card service, the The value of the shared user authority name is used to represent that the NFC terminal has the access authority of the smart card service or the non-NFC terminal is used for the access authority of the smart card service;
若是,则确定所述当前运行的进程中存在有权限运行的NFC终端的智能卡服务处理进程或非NFC终端的智能卡服务处理进程中的一个。If so, it is determined that there is one of the smart card service processing process of the NFC terminal or the smart card service processing process of the non-NFC terminal that is authorized to run in the currently running process.
结合第一方面的或第一方面的第一种可能实现的方式,在第二种可能实现的方式中,在所述终端打开所述逻辑通道之前,所述方法还包括:With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner, before the terminal opens the logical channel, the method further includes:
所述终端获取本终端的多卡配置属性值,所述多卡配置属性值用于表征所述终端为多卡终端或单卡终端。The terminal obtains the multi-card configuration attribute value of the terminal, and the multi-card configuration attribute value is used to indicate that the terminal is a multi-card terminal or a single-card terminal.
结合第一方面的第二种可能实现的方式,在第三种可能实现的方式中,所述在所述终端安装有NFC卡时打开所述智能卡服务处理进程与所述NFC卡的逻辑通道包括:In combination with the second possible implementation manner of the first aspect, in a third possible implementation manner, the opening the logical channel between the smart card service processing process and the NFC card when the terminal is installed with an NFC card includes :
若所述终端为所述多卡终端,则根据所述终端中存在的每个客户识别模块SIM对应的卡槽值,依次打开所述SIM为NFC卡时所述智能卡服务处理进程与所述NFC卡的逻辑通道;If the terminal is the multi-card terminal, then according to the card slot value corresponding to each customer identification module SIM existing in the terminal, open the smart card service processing process and the NFC card service process when the SIM is an NFC card in turn. The logical channel of the card;
若所述当前终端为所述单卡终端,则打开所述SIM为所述NFC卡时所述智能卡服务处理进程与所述NFC卡的逻辑通道。If the current terminal is the single-card terminal, open a logical channel between the smart card service processing process and the NFC card when the SIM is the NFC card.
结合第一方面的第三种可能实现的方式,在第四种可能实现的方式中,所述终端中的第三方钱包客户端应用通过所述逻辑通道访问所述NFC卡包括:With reference to the third possible implementation manner of the first aspect, in a fourth possible implementation manner, accessing the NFC card by the third-party wallet client application in the terminal through the logical channel includes:
在所述终端接收到启动所述第三方钱包客户端应用的第一操作指令时,获取用于指示所述NFC卡的指示信息列表;When the terminal receives the first operation instruction for starting the third-party wallet client application, obtain a list of indication information for indicating the NFC card;
若所述第三方钱包客户端应用需要访问任一NFC卡,且所述列表包括至少两个所述指示信息,则所述终端接收用户从所述列表中选取访问第一NFC卡的第二操作指令,并根据所述第二操作指令建立所述第一NFC卡与所述第三方钱包客户端应用之间的通信连接。If the third-party wallet client application needs to access any NFC card, and the list includes at least two instructions, the terminal receives the second operation that the user chooses to access the first NFC card from the list instruction, and establish a communication connection between the first NFC card and the third-party wallet client application according to the second operation instruction.
第二方面,提供一种终端,包括:In a second aspect, a terminal is provided, including:
所述终端预先保存有存在访问权限的进程的进程标识,包括:The terminal pre-stores process identifiers of processes with access rights, including:
获取单元,用于在终端智能卡服务初始化过程中,获取框架层的当前运行的进程的进程标识;The obtaining unit is used to obtain the process identification of the currently running process of the framework layer during the initialization process of the terminal smart card service;
确定单元,用于根据所述进程标识确定所述当前运行的进程中是否存在有权限运行的近距离无线通讯NFC终端的智能卡服务处理进程或非NFC终端的智能卡服务处理进程中的一个;A determining unit, configured to determine, according to the process identifier, whether there is one of the smart card service processing process of the short-range wireless communication NFC terminal or the smart card service processing process of the non-NFC terminal that is authorized to run in the currently running process;
处理单元,用于若是,则在所述终端安装有NFC卡时打开所述智能卡服务处理进程与所述NFC卡的逻辑通道,使得所述终端中的第三方钱包客户端应用通过所述逻辑通道访问所述NFC卡。The processing unit is configured to, if so, open the logical channel between the smart card service processing process and the NFC card when the terminal is equipped with an NFC card, so that the third-party wallet client application in the terminal passes through the logical channel Access said NFC card.
结合第二方面,在第二方面的第一种可能实现的方式中,所述确定单元具体用于:With reference to the second aspect, in a first possible implementation manner of the second aspect, the determining unit is specifically configured to:
确定所述进程标识中是否存在有访问权限的进程的进程标识,所述有访问权限的进程的进程标识为所述智能卡服务的可扩展标记语言XML文件中的共享用户权限名称的值,所述共享用户权限名称的值用于表征所述NFC终端具有智能卡服务的访问权限或所述非NFC终端用于智能卡服务的访问权限;Determine whether there is a process identifier of a process with access authority in the process identifier, the process identifier of the process with access authority is the value of the shared user authority name in the Extensible Markup Language XML file of the smart card service, the The value of the shared user authority name is used to represent that the NFC terminal has the access authority of the smart card service or the non-NFC terminal is used for the access authority of the smart card service;
若是,则确定所述当前运行的进程中存在有权限运行的NFC终端的智能卡服务处理进程或非NFC终端的智能卡服务处理进程中的一个。If so, it is determined that there is one of the smart card service processing process of the NFC terminal or the smart card service processing process of the non-NFC terminal that is authorized to run in the currently running process.
结合第二方面或第二方面的第一种可能实现的方式,在第二方面的第二种可能实现的方式中,所述获取单元,还用于获取本终端的多卡配置属性值,所述多卡配置属性值用于表征所述终端为多卡终端或单卡终端。With reference to the second aspect or the first possible implementation manner of the second aspect, in the second possible implementation manner of the second aspect, the acquiring unit is further configured to acquire the multi-card configuration attribute value of the terminal, so The multi-card configuration attribute value is used to indicate that the terminal is a multi-card terminal or a single-card terminal.
结合第二方面的第二种可能实现的方式,在第二方面的第三种可能实现的方式中,所述处理单元具体用于:With reference to the second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the processing unit is specifically configured to:
若所述终端为所述多卡终端,则根据所述终端中每个客户识别模块SIM对应的卡槽值依次打开所述SIM为NFC卡时所述智能卡服务处理进程与所述NFC卡的逻辑通道;If the terminal is the multi-card terminal, then open the logic of the smart card service processing process and the NFC card when the SIM is an NFC card according to the card slot value corresponding to each customer identification module SIM in the terminal aisle;
若所述当前终端为所述单卡终端,则打开所述SIM为所述NFC卡时所述智能卡服务处理进程与所述NFC卡的逻辑通道。If the current terminal is the single-card terminal, open a logical channel between the smart card service processing process and the NFC card when the SIM is the NFC card.
结合第二方面的第三种可能实现的方式,在第四种可能实现的方式中,所述获取单元,具体用于在接收到启动所述第三方钱包客户端应用的第一操作指令时,获取用于指示所述NFC卡的指示信息列表;With reference to the third possible implementation manner of the second aspect, in a fourth possible implementation manner, the acquiring unit is specifically configured to, when receiving the first operation instruction for starting the third-party wallet client application, Obtain a list of indication information used to indicate the NFC card;
还包括:接收单元,用于若所述第三方钱包客户端应用需要访问任一NFC卡,且所述列表包括至少两个所述指示信息,则接收用户从所述列表中选取访问第一NFC卡的第二操作指令;Also comprising: a receiving unit, for if the third-party wallet client application needs to access any NFC card, and the list includes at least two of the indication information, then the receiving user selects the first NFC card to access from the list The second operation instruction of the card;
所述处理单元,具体用于根据所述第二操作指令建立所述第一NFC卡与所述第三方钱包客户端应用之间的通信连接。The processing unit is specifically configured to establish a communication connection between the first NFC card and the third-party wallet client application according to the second operation instruction.
本发明实施例提供一种NFC卡的访问方法和终端,终端预先保存有存在访问权限的进程的进程标识,在终端智能卡服务初始化过程中,获取框架层的当前运行的进程的进程标识;根据进程标识确定当前运行的进程中是否存在有权限运行的近距离无线通讯NFC终端的智能卡服务处理进程或非NFC终端的智能卡服务处理进程中的一个;若是,则在终端安装有NFC卡时打开智能卡服务处理进程与NFC卡的逻辑通道,使得终端中的第三方钱包客户端应用通过逻辑通道访问NFC卡。这样一来,当终端的框架层的运行的进程的进程标识中包括用于标识非NFC终端的智能卡服务处理进程的进程标识时,对于非NFC终端来说,表征该非NFC终端也支持OMAPI,即也有权限运行智能卡服务,这样在终端安装有NFC卡时打开智能卡服务处理进程与NFC卡的逻辑通道,使得终端中的第三方钱包客户端应用通过逻辑通道与NFC卡进行通信,相当于增加了非NFC终端访问NFC卡的权限,能够解决非NFC终端的第三方钱包客户端应用不能访问NFC卡的问题。Embodiments of the present invention provide an access method of an NFC card and a terminal. The terminal stores process identifiers of processes with access rights in advance, and obtains the process identifier of the currently running process of the framework layer during the initialization process of the terminal smart card service; according to the process Identify and determine whether there is one of the smart card service processing process of the short-range wireless communication NFC terminal or the smart card service processing process of the non-NFC terminal that is authorized to run in the currently running process; if so, open the smart card service when the terminal is equipped with an NFC card The logical channel between the processing process and the NFC card enables the third-party wallet client application in the terminal to access the NFC card through the logical channel. In this way, when the process identifier of the running process of the framework layer of the terminal includes the process identifier used to identify the smart card service processing process of the non-NFC terminal, for the non-NFC terminal, it means that the non-NFC terminal also supports OMAPI, That is to say, it also has the authority to run the smart card service, so that when the terminal is equipped with an NFC card, the logical channel between the smart card service process and the NFC card is opened, so that the third-party wallet client application in the terminal communicates with the NFC card through the logical channel, which is equivalent to adding The permission of non-NFC terminals to access NFC cards can solve the problem that third-party wallet client applications of non-NFC terminals cannot access NFC cards.
附图说明Description of drawings
为了更清楚地说明本发明实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some of the present invention. Embodiments, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1为本发明实施例提供的一种NFC卡的访问方法的流程示意图;Fig. 1 is the schematic flow chart of the access method of a kind of NFC card that the embodiment of the present invention provides;
图2为本发明又一实施例提供的一种NFC卡的访问方法的流程示意图;Fig. 2 is the schematic flow chart of the access method of a kind of NFC card that another embodiment of the present invention provides;
图3为本发明实施例提供的一种终端的结构示意图。FIG. 3 is a schematic structural diagram of a terminal provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
为了解决非NFC终端不能访问NFC卡的问题,本发明实施例中,在执行本发明实施例的方法步骤之前,可先对非NFC终端的NFC卡的底层定义、对框架(framework)层定义以及智能卡服务(Smartcard Service)的原始可扩展标记语言(Extensible Markup Language,xml)文件进行添加或修改,完成对于非NFC终端实现支持OMAPI的开发过程。In order to solve the problem that the non-NFC terminal cannot access the NFC card, in the embodiment of the present invention, before performing the method steps of the embodiment of the present invention, the bottom layer definition of the NFC card of the non-NFC terminal, the framework (framework) layer definition and The original extensible markup language (Extensible Markup Language, xml) file of the smart card service (Smartcard Service) is added or modified, and the development process of realizing support for OMAPI for the non-NFC terminal is completed.
a)添加底层定义,即定义并添加一个应用标识(application identifier,AID)为1039的智能卡服务的共享用户权限,当然也可以为其它值,本申请不做限定。例如对于安卓系统的非NFC终端来说,该底层定义可以为:在android_filesystem_config.h中:a) Adding the underlying definition, that is, defining and adding a shared user authority for smart card services with an application identifier (AID) of 1039. Of course, it can also be other values, which are not limited in this application. For example, for non-NFC terminals of the Android system, the underlying definition can be: in android_filesystem_config.h:
#define AID_SMARTCARD 1039#define AID_SMARTCARD 1039
“smcard”,AID_SMARTCARD"smcard", AID_SMARTCARD
b)添加framework层定义,即定义非NFC终端的智能卡服务处理进程的进程标识为“android.uid.smcard”,并将“android.uid.smcard”加入到SMARTCARD_UID组,其中,SMARTCARD_UID组可包括多种智能卡服务的进程标识。b) Add the framework layer definition, that is, define the process identification of the smart card service processing process of the non-NFC terminal as "android.uid.smcard", and add "android.uid.smcard" to the SMARTCARD_UID group, where the SMARTCARD_UID group can include multiple The process ID of a smart card service.
c)修改智能卡服务的原始xml文件c) Modify the original xml file of the smart card service
这里的xml文件指的智能卡服务对应的布局文件,涉及与该智能卡服务相关的监听事件、应用报名等。对于NFC终端来说,其NFC模块中的xml文件中的共享用户权限名称(SharedUserld)的值为android.uid.nfc,即当前处理进程中包括android.uid.nfc的进程标识时,该NFC终端有权限运行该智能卡服务。其智能卡服务的xml文件可以为:The xml file here refers to the layout file corresponding to the smart card service, which involves monitoring events, application registration, etc. related to the smart card service. For the NFC terminal, the value of the shared user authority name (SharedUserld) in the xml file in the NFC module is android.uid.nfc, that is, when the process identification of android.uid.nfc is included in the current processing process, the NFC terminal have permission to run the smart card service. The xml file of its smart card service can be:
Package=“org.simalliance.openmobileapil.service”Package = "org.simalliance.openmobileapil.service"
SharedUserld=“android.uid.nfc”SharedUserld="android.uid.nfc"
将NFC终端的xml文件视为原始xml文件,由于非NFC终端没有NFC模块,也没有相应的NFC进程,将会导致智能卡服务无法正常运行,因此,可以通过overlay机制修改原始xml文件,以使得非NFC终端也能够共享上述添加的AID为1039的共享用户权限从而运行智能卡服务的进程。其中,overlay机制允许在不修改软件包(Package)中安装包的情况下,来自定义framework和package中的资源文件,实现资源的定制。修改后的xml文件可以为:The xml file of the NFC terminal is regarded as the original xml file. Since the non-NFC terminal has no NFC module and no corresponding NFC process, the smart card service will not work normally. Therefore, the original xml file can be modified through the overlay mechanism so that non-NFC The NFC terminal can also share the above-mentioned shared user authority with an AID of 1039 to run the process of the smart card service. Among them, the overlay mechanism allows resource files in the custom framework and package to be customized without modifying the installation package in the package (Package). The modified xml file can be:
Package=“org.simalliance.openmobileapil.service”Package = "org.simalliance.openmobileapil.service"
SharedUserld=“android.uid.smcard”SharedUserld="android.uid.smcard"
这样,当非NFC终端开机运行智能卡服务时,非NFC的智能卡服务处理进程的进程标识由于为“android.uid.smcard”,使得智能卡服务可以共享“android.uid.smcard”权限,因此,也使得非NFC终端支持OMAPI,以便于在非终端安装有NFC卡时打开NFC卡的逻辑通道,使得非NFC终端中的第三方钱包客户端应用能够访问NFC卡。In this way, when the non-NFC terminal starts to run the smart card service, the process identifier of the non-NFC smart card service processing process is "android.uid.smcard", so that the smart card service can share the "android.uid.smcard" permission The non-NFC terminal supports OMAPI, so as to open the logical channel of the NFC card when the non-terminal is installed with the NFC card, so that the third-party wallet client application in the non-NFC terminal can access the NFC card.
上述过程中可以以芯片的形式,将非NFC终端支持OMAPI的开发安装在非NFC终端上。In the above process, the development of the non-NFC terminal supporting OMAPI can be installed on the non-NFC terminal in the form of a chip.
当完成上述开发过程后,对于任意一终端,本发明实施例提供一种NFC卡的访问方法,应用于终端,终端预先保存有存在访问权限的进程的进程标识,如图1所示,包括:After the above-mentioned development process is completed, for any terminal, the embodiment of the present invention provides an access method of an NFC card, which is applied to the terminal, and the terminal pre-stores the process identification of the process with access rights, as shown in Figure 1, including:
101、在终端智能卡服务初始化过程中,获取框架层的当前运行的进程的进程标识。101. During the initialization process of the terminal smart card service, acquire the process identifier of the currently running process of the framework layer.
当终端开机时,非NFC终端中的智能卡服务的模块或NFC终端的NFC模块中的智能卡服务就会进行初始化运行,framework层可能由于其他的服务也在运行从而存在多个进程,每个进程包括其对应的进程标识。When the terminal is turned on, the smart card service module in the non-NFC terminal or the smart card service in the NFC module of the NFC terminal will be initialized and run. The framework layer may have multiple processes because other services are also running. Each process includes Its corresponding process ID.
102、终端根据进程标识确定当前运行的进程是否存在有权限运行的近距离无线通讯NFC终端的智能卡服务处理进程或非NFC终端的智能卡服务处理进程中的一个。102. The terminal determines, according to the process identifier, whether the currently running process has one of the smart card service processing process of the short-range wireless communication NFC terminal or the smart card service processing process of the non-NFC terminal that is authorized to run.
终端可以根据从framework层获取的进程标识,确定该进程标识中是否存在有访问权限的进程的进程标识,该有访问权限的进程的进程标识为智能卡服务的可扩展标记语言XML文件中的共享用户权限名称的值,共享用户权限名称的值(android.uid.nfc或android.uid.smcard)用于表征NFC终端用于智能卡服务的系统访问权限或非NFC终端具有智能卡服务的系统访问权限,若是,则确定当前运行的进程中包括有权限运行的NFC终端的智能卡服务处理进程或非NFC终端的智能卡服务处理进程中的一个,即当NFC终端的智能卡服务处理进程的进程标识为android.uid.nfc,或非NFC终端的智能卡服务处理进程的进程标识为android.uid.smcard时,才有权限继续运行智能卡服务。The terminal can determine whether there is a process ID of a process with access rights in the process ID according to the process ID obtained from the framework layer. The process ID of the process with access rights is a shared user in the Extensible Markup Language XML file of the smart card service The value of the authority name, the value of the shared user authority name (android.uid.nfc or android.uid.smcard) is used to represent the system access authority of the NFC terminal for the smart card service or the system access authority of the non-NFC terminal with the smart card service, if , it is determined that the currently running process includes one of the smart card service processing process of the NFC terminal with permission to run or the smart card service processing process of the non-NFC terminal, that is, when the process identifier of the smart card service processing process of the NFC terminal is android.uid. Only when the process identifier of the nfc or non-NFC terminal smart card service processing process is android.uid.smcard, can the smart card service continue to run.
103、若是,则终端在终端安装有NFC卡时打开智能卡服务处理进程与NFC卡的逻辑通道,使得终端中的第三方钱包客户端应用通过逻辑通道访问NFC卡。103. If yes, the terminal opens the logical channel between the smart card service processing process and the NFC card when the terminal is installed with the NFC card, so that the third-party wallet client application in the terminal accesses the NFC card through the logical channel.
这样在根据进程的进程标识确定是否需要打开智能卡服务处理进程与NFC卡的逻辑通道的情况下,可以防止其他恶意应用随意调用NFC卡的逻辑通道发送恶意数据给NFC卡。In this way, in the case of determining whether to open the logical channel between the smart card service processing process and the NFC card according to the process identification of the process, other malicious applications can be prevented from arbitrarily calling the logical channel of the NFC card to send malicious data to the NFC card.
本发明实施例提供一种NFC卡的访问方法和终端,终端预先保存有存在访问权限的进程的进程标识,在终端智能卡服务初始化过程中,获取框架层的当前运行的进程的进程标识;根据进程标识确定当前运行的进程中是否存在有权限运行的近距离无线通讯NFC终端的智能卡服务处理进程或非NFC终端的智能卡服务处理进程中的一个;若是,则在终端安装有NFC卡时打开智能卡服务处理进程与NFC卡的逻辑通道,使得终端中的第三方钱包客户端应用通过逻辑通道访问NFC卡。这样一来,当终端的框架层的运行的进程的进程标识中包括用于标识非NFC终端的智能卡服务处理进程的进程标识时,对于非NFC终端来说,表征该非NFC终端也支持OMAPI,即也有权限运行智能卡服务,这样在终端安装有NFC卡时打开智能卡服务处理进程与NFC卡的逻辑通道,使得终端中的第三方钱包客户端应用通过逻辑通道与NFC卡进行通信,相当于增加了非NFC终端访问NFC卡的权限,能够解决非NFC终端的第三方钱包客户端应用不能访问NFC卡的问题。Embodiments of the present invention provide an access method of an NFC card and a terminal. The terminal stores process identifiers of processes with access rights in advance, and obtains the process identifier of the currently running process of the framework layer during the initialization process of the terminal smart card service; according to the process Identify and determine whether there is one of the smart card service processing process of the short-range wireless communication NFC terminal or the smart card service processing process of the non-NFC terminal that is authorized to run in the currently running process; if so, open the smart card service when the terminal is equipped with an NFC card The logical channel between the processing process and the NFC card enables the third-party wallet client application in the terminal to access the NFC card through the logical channel. In this way, when the process identifier of the running process of the framework layer of the terminal includes the process identifier used to identify the smart card service processing process of the non-NFC terminal, for the non-NFC terminal, it means that the non-NFC terminal also supports OMAPI, That is to say, it also has the authority to run the smart card service, so that when the terminal is equipped with an NFC card, the logical channel between the smart card service process and the NFC card is opened, so that the third-party wallet client application in the terminal communicates with the NFC card through the logical channel, which is equivalent to adding The permission of non-NFC terminals to access NFC cards can solve the problem that third-party wallet client applications of non-NFC terminals cannot access NFC cards.
目前,运营商的NFC项目的钱包客户端都指定其中一NFC卡1支持OMAPI,来访问NFC卡1,例如进行公交卡信息查询、充值等,而该终端中的另一NFC卡2无法支持OMAPI,这样会导致一部分消费者想通过NFC卡2实现NFC的需求就会得不到满足。At present, the wallet client of the operator's NFC project specifies that one of the NFC cards 1 supports OMAPI to access the NFC card 1, such as querying bus card information, recharging, etc., while the other NFC card 2 in the terminal cannot support OMAPI , This will lead to the unsatisfied needs of some consumers who want to realize NFC through the NFC card 2 .
因此,进一步的,无论对于NFC终端或非NFC终端来说,当其都支持OMAPI时,本发明实施例还提供一种方法,可以在终端的多个卡槽上有多个NFC卡存在时,可以让终端的多个NFC卡都可以支持OMAPI,使得第三方应用也可以访问NFC卡2,如图2所示,包括:Therefore, further, no matter for an NFC terminal or a non-NFC terminal, when they all support OMAPI, the embodiment of the present invention also provides a method, when there are multiple NFC cards in multiple card slots of the terminal, Multiple NFC cards of the terminal can support OMAPI, so that third-party applications can also access NFC card 2, as shown in Figure 2, including:
201、在终端智能卡服务初始化过程中,获取本终端的多卡配置属性值,多卡配置属性值用于表征终端为多卡终端或单卡终端。201. During the initialization process of the terminal smart card service, acquire the multi-card configuration attribute value of the terminal, where the multi-card configuration attribute value is used to indicate that the terminal is a multi-card terminal or a single-card terminal.
当终端开机后,在终端智能卡服务初始化过程中,可先获取本终端的多卡配置属性值(例如定义以变量mIsMultiSimEnable表示),多卡配置属性值用于表征终端为多卡终端或单卡终端。例如当手机为多卡终端时,该终端可以为双卡双待(dual sim dualstandby,dsds)手机,表示该手机可以插入两张手机卡,而且能同时待机,但是其中一张卡正在通话时另一张卡不能打进电话;还可以为双卡双通(dual sim dual active,dsda)手机,表示有两张手机卡的手机,当其中一张卡正在通话,另一张卡也能打进电话,但是处于离线状态,会提示正在通话中;还可以为三卡三待(triple sim triple standby,tsts)手机,表示手机可以插入三张手机卡,而且能同时待机,其中当一张卡通话时,另外两张卡无法打进电话,会提示暂时无法接通。即当手机为双卡双待、双卡双通或三卡三待时,可以确定终端为多卡终端,变量mIsMultiSimEnable的值为ture;当终端为单卡终端时,变量mIsMultiSimEnable的值为false。;After the terminal is turned on, during the initialization process of the terminal smart card service, the multi-card configuration attribute value of the terminal can be obtained first (for example, the definition is represented by the variable mIsMultiSimEnable). The multi-card configuration attribute value is used to indicate that the terminal is a multi-card terminal or a single-card terminal . For example, when the mobile phone is a multi-card terminal, the terminal can be a dual-card dual-standby (dual sim dualstandby, dsds) mobile phone, which means that the mobile phone can be inserted into two mobile phone cards, and can be on standby at the same time, but one of the cards is in use when the other card is talking. One card cannot make incoming calls; it can also be a dual sim dual active (dsda) mobile phone, which means that a mobile phone with two mobile phone cards, when one card is in a call, the other card can also call in. Phone, but it is offline, it will prompt that it is in a call; it can also be a triple sim triple standby (tsts) mobile phone, which means that the mobile phone can insert three mobile phone cards and can be on standby at the same time, one of which can be used as a call When the other two cards cannot make incoming calls, it will prompt that the connection is temporarily unavailable. That is, when the mobile phone is dual-card dual-standby, dual-card dual-pass or triple-card triple-standby, it can be determined that the terminal is a multi-card terminal, and the value of the variable mIsMultiSimEnable is true; when the terminal is a single-card terminal, the value of the variable mIsMultiSimEnable is false. ;
当确定了终端的多卡配置属性后,再确定本终端是不是可运行智能卡服务,即是否要打开NFC卡的逻辑通道,具体可通过步骤202-205可实现,其实现方式与上述步骤101-103的实现方式类似,此处不再赘述。After determining the multi-card configuration attribute of the terminal, determine whether the terminal can run the smart card service, that is, whether to open the logical channel of the NFC card, which can be realized through steps 202-205, and its implementation method is the same as that of the above-mentioned steps 101-205. The implementation of 103 is similar, and will not be repeated here.
202、终端获取框架层的当前运行的进程的进程标识。202. The terminal obtains the process identifier of the currently running process of the framework layer.
203、终端根据进程标识确定当前运行的进程中是否存在有权限运行的近距离无线通讯NFC终端的智能卡服务处理进程或非NFC终端的智能卡服务处理进程中的一个。203. The terminal determines, according to the process identifier, whether there is one of the smart card service processing process of the short-range wireless communication NFC terminal or the smart card service processing process of the non-NFC terminal that is authorized to run in the currently running process.
204、若是,则若终端为多卡终端,则根据终端中存在的每个SIM对应的卡槽值依次打开SIM为NFC卡时智能卡服务处理进程与该NFC卡的逻辑通道。204. If yes, if the terminal is a multi-card terminal, sequentially open the logical channel between the smart card service processing process and the NFC card when the SIM is an NFC card according to the card slot value corresponding to each SIM existing in the terminal.
如果智能卡服务可继续运行,那么如果终端上有多个NFC卡,可根据多卡配置属性值依次打开该多个NFC卡的逻辑通道,以支持OMAPI,以便第三方应用都能访问该多个NFC卡,具体可以如下:If the smart card service can continue to run, if there are multiple NFC cards on the terminal, the logical channels of the multiple NFC cards can be opened in sequence according to the multi-card configuration attribute value to support OMAPI, so that third-party applications can access the multiple NFC cards card, as follows:
若mIsMultiSimEnable的值为ture,则可以调用打开逻辑通道的应用程序openIccLogicalChannel,依次按照终端中存在的SIM的卡槽值(mUiccSolt),向该卡槽值对应的SIM发送用于打开NFC卡的逻辑通道的信息,以便SIM为NFC卡时根据该信息打开逻辑通道。If the value of mIsMultiSimEnable is true, the application program openIccLogicalChannel that opens the logical channel can be called, and the logical channel for opening the NFC card is sent to the SIM corresponding to the card slot value according to the card slot value (mUiccSolt) of the SIM in the terminal. Information, so that when the SIM is an NFC card, the logical channel can be opened according to the information.
示例性的,对于卡槽中未插入SIM时当然不需要发送信息,因此,对于存在SIM的卡槽,可根据卡槽值(mUiccSolt)的大小,调用打开逻辑通道的应用程序(openIccLogicalChannel)依次向卡槽上的卡SIM发送信息,该信息可包括卡槽值和用于打开逻辑通道的应用标识aid。Exemplary, certainly do not need to send information when not inserting SIM in the card slot, therefore, for the card slot that has SIM, can call the application program (openIccLogicalChannel) that opens logical channel according to the size of card slot value (mUiccSolt) The card SIM on the card slot sends information, which may include the value of the card slot and the application identifier aid for opening the logical channel.
由于用户卡访问控制遵循全球平台组织(Global Platform)可信任框架的全球平台接入控制(Global Platform Access Control,GPAC)机制,对于终端来说,需要支持两种获取访问控制规则:支持访问控制应用存储方式(Access Rule Application Master,ARA_M)和文件存储方式(Access Rule Files,ARF),当终端需要打开卡的逻辑通道时,可先选取基于应用的方式ARA_M向SIM传递第一aid,当SIM为NFC卡时,会根据该第一aid确定该NFC卡是否存在ARA_M应用,若存在则返回基于ARA_M应用的访问控制规则,如果不存在,则可以尝试以基于文件存储的方式ARF,向SIM传递第二aid,当SIM为NFC卡时,会根据该第二aid确定该NFC卡是否支持文件存储的访问控制规则,若是,则返回基于ARF的访问控制规则,以便第三方钱包客户端端应用根据该规则访问NFC卡。通常来说,如果SIM为NFC卡时,会支持以ARA_M方式或ARF方式打开逻辑通道,因此,当NFC支持这两种方式中的一种时,会返回打开逻辑通道成功的响应和控制规则。那么对于SIM不支持NFC的情况,SIM可返回打开逻辑通道失败的响应。Since the user card access control follows the Global Platform Access Control (GPAC) mechanism of the Global Platform Organization (Global Platform) trust framework, for the terminal, it is necessary to support two access control rules: support for access control applications Storage method (Access Rule Application Master, ARA_M) and file storage method (Access Rule Files, ARF). When the terminal needs to open the logical channel of the card, it can first select the application-based method ARA_M to transmit the first aid to the SIM. When the SIM is When using an NFC card, it will determine whether the NFC card has an ARA_M application based on the first aid, and if it exists, return the access control rule based on the ARA_M application. Second aid, when the SIM is an NFC card, it will determine whether the NFC card supports the access control rules for file storage according to the second aid, and if so, return the access control rules based on ARF, so that the third-party wallet client application can use this Rules for accessing NFC cards. Generally speaking, if the SIM is an NFC card, it will support opening the logical channel in ARA_M mode or ARF mode. Therefore, when NFC supports one of these two modes, it will return a response and control rules that successfully open the logical channel. Then, for the case that the SIM does not support NFC, the SIM may return a response of failure to open the logical channel.
这样,例如对于双卡双待、双卡双通或三卡三待的手机而言,当SIM都为NFC卡时,可实现多个NFC都打开逻辑通道,都支持OMAPI,第三方应用可与多个NFC卡进行通信。In this way, for example, for dual-card dual-standby, dual-card dual-pass or three-card three-standby mobile phones, when the SIMs are all NFC cards, multiple NFCs can open logical channels and support OMAPI, and third-party applications can communicate with Multiple NFC cards communicate.
205、若当前终端为单卡终端,则打开SIM为NFC卡时智能卡服务处理进程与该NFC卡的逻辑通道。205. If the current terminal is a single-card terminal, open a logical channel between the smart card service processing process and the NFC card when the SIM is an NFC card.
若mIsMultiSimEnable的值为false,说明终端为单卡终端,则可以调用打开逻辑通道的应用程序openIccLogicalChannel并采用默认值Soltld向SIM发送信息,该信息中包括该默认值Soltld和打开逻辑通道的应用标识aid,其方式可与步骤205中的类似,以便当SIM为NFC卡时打开逻辑通道。If the value of mIsMultiSimEnable is false, indicating that the terminal is a single-card terminal, you can call the application program openIccLogicalChannel to open the logical channel and use the default value Soltld to send information to the SIM. The information includes the default value Soltld and the application identifier aid for opening the logical channel , and its manner may be similar to that in step 205, so as to open a logical channel when the SIM is an NFC card.
因此,本发明实施例通过在终端为多卡终端时,若有至少两个卡为NFC卡时,都可以打开逻辑通道,以支持OMAPI,这样方便第三方应用可以访问NFC卡1,也可以访问NFC卡1以外的NFC卡2,例如使得用户可以通过NFC卡1进行NFC钱包支付或NFC卡2进行NFC钱包支付。Therefore, in the embodiment of the present invention, when the terminal is a multi-card terminal, if at least two cards are NFC cards, logical channels can be opened to support OMAPI, so that third-party applications can access the NFC card 1 and can also access The NFC card 2 other than the NFC card 1, for example, enables the user to use the NFC card 1 to perform NFC wallet payment or the NFC card 2 to perform NFC wallet payment.
虽然上述过程可以打开NFC卡2的逻辑通道,以支持OMAPI,但是用户在进行NFC的需求时,第三方应用也只能指定其中一个NFC卡实现用户的NFC需求,因此,再进一步的,本发明实施例在都打开终端中的多个NFC卡的逻辑通道后,该方法还可以包括:Although the above process can open the logical channel of the NFC card 2 to support OMAPI, when the user needs NFC, the third-party application can only specify one of the NFC cards to realize the user's NFC needs. Therefore, further, the present invention After the embodiments all open the logical channels of a plurality of NFC cards in the terminal, the method may also include:
206、在终端接收到启动第三方应用的第一操作指令时,获取用于指示NFC卡的指示信息列表,第三方应用为多应用开放平台对NFC卡安全芯片资源及应用进行管理的智能管理软件。206. When the terminal receives the first operation instruction for starting a third-party application, obtain a list of instruction information for indicating the NFC card. The third-party application is an intelligent management software for managing NFC card security chip resources and applications on a multi-application open platform .
示例性的,当支持OMAPI的NFC手机或非NFC手机第三方应用,例如NFC钱包客户端接收到用处触发的第一操作指令从而启动运行时,可以检测获取已经打开逻辑通道的NFC卡的指示信息列表,譬如手机中会显示NFC卡1的移动用户号码(Mobile DirectoryNumber,MDN),和NFC卡2的MDN,以供用户选择某一NFC卡与第三方应用通信,当然这里的指示信息不限于MDN,也可以为其他信息,本申请不做限定。Exemplarily, when an NFC mobile phone supporting OMAPI or a third-party application of a non-NFC mobile phone, such as an NFC wallet client, receives the first operation command triggered by the user to start running, it can detect and obtain the indication information of the NFC card that has opened the logical channel For example, the mobile phone will display the mobile user number (Mobile Directory Number, MDN) of NFC card 1 and the MDN of NFC card 2, so that the user can choose an NFC card to communicate with third-party applications. Of course, the instruction information here is not limited to MDN , can also be other information, which is not limited in this application.
207、若第三方应用需要访问任一NFC卡,且列表包括至少两个指示信息,则终端接收用户从列表中选取访问第一NFC卡的第二操作指令,并根据第二操作指令建立第一NFC卡与第三方应用之间的通信连接。207. If the third-party application needs to access any NFC card, and the list includes at least two indications, the terminal receives a second operation instruction from the user to select and access the first NFC card from the list, and establishes the first NFC card according to the second operation instruction. The communication connection between the NFC card and the third-party application.
在获取上述列表后,在第三方应用需要访问某一NFC卡,且列表中包括至少两个指示信息的情况下,例如需要进行公交卡余额查询需要访问NFC卡1时,则可以在该列表中选择NFC卡1的指示信息,即手机会接收到访问NFC卡1的第二操作指令,第三方应用便向NFC卡1发送命令,NFC卡1在接收到命令时与第三方应用建立通信连接;当需要进行钱包支付时,可以从该列表中选取NFC卡2的指示信息,即手机会接收到访问NFC卡2的另一操作指令,第三方应用便向NFC卡2发送命令,NFC卡2在接收到命令时与第三方应用建立通信连接。这样,用户可以自由切换访问NFC卡1还是NFC卡2。After obtaining the above list, when the third-party application needs to access a certain NFC card, and the list includes at least two indications, for example, when the bus card balance needs to be checked and NFC card 1 needs to be accessed, it can be in the list Select the instruction information of the NFC card 1, that is, the mobile phone will receive the second operation instruction to access the NFC card 1, and the third-party application will send a command to the NFC card 1, and the NFC card 1 will establish a communication connection with the third-party application when receiving the command; When wallet payment is required, the instruction information of the NFC card 2 can be selected from the list, that is, the mobile phone will receive another operation instruction to access the NFC card 2, and the third-party application will send a command to the NFC card 2, and the NFC card 2 will A communication connection is established with a third-party application when a command is received. In this way, the user can freely switch between accessing the NFC card 1 and the NFC card 2 .
因此,本发明实施例还可以通过获取NFC卡的指示信息的列表,使得用户根据该列表自由切换访问NFC卡1或NFC卡2。Therefore, the embodiment of the present invention can also obtain the list of indication information of the NFC card, so that the user can freely switch and access the NFC card 1 or the NFC card 2 according to the list.
本发明实施例还提供一种终端03,终端预先保存有存在访问权限的进程的进程标识,如图3所示,包括:The embodiment of the present invention also provides a terminal 03, the terminal pre-saves the process identification of the process with access rights, as shown in Figure 3, including:
获取单元301,用于在终端智能卡服务初始化过程中,获取框架层的当前运行的进程的进程标识;The obtaining unit 301 is used to obtain the process identification of the currently running process of the framework layer during the initialization process of the terminal smart card service;
确定单元302,用于根据进程标识确定当前运行的进程中是否存在有权限运行的近距离无线通讯NFC终端的智能卡服务处理进程或非NFC终端的智能卡服务处理进程中的一个;The determining unit 302 is configured to determine, according to the process identifier, whether there is one of the smart card service processing process of the short-range wireless communication NFC terminal or the smart card service processing process of the non-NFC terminal that is authorized to run in the currently running process;
处理单元303,用于若是,则终端在终端安装有NFC卡时打开智能卡服务处理进程与NFC卡的逻辑通道,使得终端中的第三方钱包客户端应用通过逻辑通道访问NFC卡。The processing unit 303 is configured to, if so, open a logical channel between the smart card service processing process and the NFC card when the terminal is installed with the NFC card, so that the third-party wallet client application in the terminal accesses the NFC card through the logical channel.
可选的,确定单元302可以具体用于:Optionally, the determining unit 302 may be specifically configured to:
确定所述进程标识中是否存在有访问权限的进程的进程标识,所述有访问权限的进程的进程标识为所述智能卡服务的可扩展标记语言XML文件中的共享用户权限名称的值,所述共享用户权限名称的值用于表征所述NFC终端具有智能卡服务的系统访问权限或所述非NFC终端用于智能卡服务的系统访问权限;Determine whether there is a process identifier of a process with access authority in the process identifier, the process identifier of the process with access authority is the value of the shared user authority name in the Extensible Markup Language XML file of the smart card service, the The value of the shared user authority name is used to represent that the NFC terminal has the system access authority of the smart card service or the non-NFC terminal is used for the system access authority of the smart card service;
若是,则确定所述当前运行的进程中存在有权限运行的NFC终端的智能卡服务处理进程或非NFC终端的智能卡服务处理进程中的一个。If so, it is determined that there is one of the smart card service processing process of the NFC terminal or the smart card service processing process of the non-NFC terminal that is authorized to run in the currently running process.
可选的,获取单元301,还用于获取本终端的多卡配置属性值,多卡配置属性值用于表征终端为多卡终端或单卡终端;Optionally, the obtaining unit 301 is also used to obtain the multi-card configuration attribute value of the terminal, and the multi-card configuration attribute value is used to indicate that the terminal is a multi-card terminal or a single-card terminal;
处理单元303可以具体用于:The processing unit 303 may be specifically used for:
若终端为多卡终端,则根据终端中每个客户识别模块SIM对应的卡槽值依次打开SIM为NFC卡时智能卡服务处理进程与所述NFC卡的逻辑通道;If the terminal is a multi-card terminal, then according to the card slot value corresponding to each customer identification module SIM in the terminal, open the logical channel of the smart card service process and the NFC card when the SIM is an NFC card;
若当前终端为单卡终端,则打开SIM为NFC卡时智能卡服务处理进程与所述NFC卡的逻辑通道。If the current terminal is a single-card terminal, open a logical channel between the smart card service processing process and the NFC card when the SIM is an NFC card.
可选的,获取单元301,具体用于在接收到启动第三方钱包客户端应用的第一操作指令时,获取用于指示NFC卡的指示信息列表,第三方钱包客户端应用为多应用开放平台对NFC卡安全芯片资源及应用进行管理的智能管理软件;Optionally, the obtaining unit 301 is specifically configured to obtain a list of indication information for indicating the NFC card when receiving the first operation instruction to start the third-party wallet client application, and the third-party wallet client application is a multi-application open platform Intelligent management software for managing NFC card security chip resources and applications;
还包括:接收单元304,用于若第三方钱包客户端应用需要访问任一NFC卡,且列表包括至少两个指示信息,则接收用户从列表中选取访问第一NFC卡的第二操作指令;Also includes: a receiving unit 304, for if the third-party wallet client application needs to access any NFC card, and the list includes at least two indication information, then receive the second operation instruction that the user chooses to access the first NFC card from the list;
处理单元303,用于根据第二操作指令建立第一NFC卡与第三方钱包客户端应用之间的通信连接。The processing unit 303 is configured to establish a communication connection between the first NFC card and the third-party wallet client application according to the second operation instruction.
本发明实施例提供一种终端,终端预先保存有存在访问权限的进程的进程标识,在终端智能卡服务初始化过程中,获取框架层的当前运行的进程的进程标识;根据进程标识确定当前运行的进程中是否存在有权限运行的近距离无线通讯NFC终端的智能卡服务处理进程或非NFC终端的智能卡服务处理进程中的一个;若是,则在终端安装有NFC卡时打开智能卡服务处理进程与NFC卡的逻辑通道,使得终端中的第三方钱包客户端应用通过逻辑通道访问NFC卡。这样一来,当终端的框架层的运行的进程的进程标识中包括用于标识非NFC终端的智能卡服务处理进程的进程标识时,对于非NFC终端来说,表征该非NFC终端也支持OMAPI,即也有权限运行智能卡服务,这样在终端安装有NFC卡时打开智能卡服务处理进程与NFC卡的逻辑通道,使得终端中的第三方钱包客户端应用通过逻辑通道与NFC卡进行通信,相当于增加了非NFC终端访问NFC卡的权限,能够解决非NFC终端的第三方钱包客户端应用不能访问NFC卡的问题。An embodiment of the present invention provides a terminal. The terminal stores process IDs of processes with access rights in advance. During the initialization process of the terminal smart card service, the process ID of the currently running process of the framework layer is obtained; and the currently running process is determined according to the process ID. Whether there is one of the smart card service processing process of the short-distance wireless communication NFC terminal or the smart card service processing process of the non-NFC terminal that has the authority to run; if so, open the smart card service processing process and the NFC card when the terminal is equipped with an NFC card The logical channel enables the third-party wallet client application in the terminal to access the NFC card through the logical channel. In this way, when the process identifier of the running process of the framework layer of the terminal includes the process identifier used to identify the smart card service processing process of the non-NFC terminal, for the non-NFC terminal, it means that the non-NFC terminal also supports OMAPI, That is to say, it also has the authority to run the smart card service, so that when the terminal is equipped with an NFC card, the logical channel between the smart card service process and the NFC card is opened, so that the third-party wallet client application in the terminal communicates with the NFC card through the logical channel, which is equivalent to adding The permission of non-NFC terminals to access NFC cards can solve the problem that third-party wallet client applications of non-NFC terminals cannot access NFC cards.
在本申请所提供的几个实施例中,应该理解到,所揭露的终端和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed terminal and method may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理包括,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or in the form of hardware plus software functional units.
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The above-mentioned integrated units implemented in the form of software functional units may be stored in a computer-readable storage medium. The above-mentioned software functional units are stored in a storage medium, and include several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) to execute some steps of the methods described in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM for short), random access memory (Random Access Memory, RAM for short), magnetic disk or optical disk, etc., which can store program codes. medium.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510571069.4ACN106529942B (en) | 2015-09-09 | 2015-09-09 | The access method and terminal of a kind of nfc card |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510571069.4ACN106529942B (en) | 2015-09-09 | 2015-09-09 | The access method and terminal of a kind of nfc card |
| Publication Number | Publication Date |
|---|---|
| CN106529942A CN106529942A (en) | 2017-03-22 |
| CN106529942Btrue CN106529942B (en) | 2018-07-03 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510571069.4AActiveCN106529942B (en) | 2015-09-09 | 2015-09-09 | The access method and terminal of a kind of nfc card |
| Country | Link |
|---|---|
| CN (1) | CN106529942B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106201573B (en)* | 2016-06-23 | 2019-07-30 | 青岛海信移动通信技术股份有限公司 | A kind of method and terminal for realizing OMAPI function |
| CN107491706B (en)* | 2017-08-16 | 2020-11-13 | 惠州Tcl移动通信有限公司 | NFC pressure testing method and system based on mobile terminal and storage device |
| CN113950036B (en)* | 2021-10-15 | 2023-06-09 | 中国联合网络通信集团有限公司 | NFC capability synchronization method, UICC, terminal, equipment and medium |
| CN114330396B (en)* | 2021-12-31 | 2023-10-13 | 福建新大陆支付技术有限公司 | External password keyboard and identity card information interaction method based on Android platform |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102938659A (en)* | 2012-10-19 | 2013-02-20 | 深圳桑菲消费通信有限公司 | NFC (Near Field Communication) external member and realization method thereof |
| CN103345603A (en)* | 2011-12-28 | 2013-10-09 | 北京奇虎科技有限公司 | Webpage browsing method and device based on sandbox technology |
| CN103378880A (en)* | 2012-04-11 | 2013-10-30 | 阿里巴巴集团控股有限公司 | Service terminal, NFC equipment and near field communication method |
| CN104253840A (en)* | 2013-06-28 | 2014-12-31 | 中国银联股份有限公司 | Device for implementing communication among varieties of security carriers and communication method thereof |
| CN104954358A (en)* | 2014-03-28 | 2015-09-30 | 恩智浦有限公司 | NFC-based authorization of access to data from a third party device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2014517379A (en)* | 2011-04-28 | 2014-07-17 | ソニーエリクソンモバイルコミュニケーションズ, エービー | Payment processing |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103345603A (en)* | 2011-12-28 | 2013-10-09 | 北京奇虎科技有限公司 | Webpage browsing method and device based on sandbox technology |
| CN103378880A (en)* | 2012-04-11 | 2013-10-30 | 阿里巴巴集团控股有限公司 | Service terminal, NFC equipment and near field communication method |
| CN102938659A (en)* | 2012-10-19 | 2013-02-20 | 深圳桑菲消费通信有限公司 | NFC (Near Field Communication) external member and realization method thereof |
| CN104253840A (en)* | 2013-06-28 | 2014-12-31 | 中国银联股份有限公司 | Device for implementing communication among varieties of security carriers and communication method thereof |
| CN104954358A (en)* | 2014-03-28 | 2015-09-30 | 恩智浦有限公司 | NFC-based authorization of access to data from a third party device |
| Publication number | Publication date |
|---|---|
| CN106529942A (en) | 2017-03-22 |
| Publication | Publication Date | Title |
|---|---|---|
| US11595820B2 (en) | Secure elements broker (SEB) for application communication channel selector optimization | |
| US11039301B2 (en) | Apparatuses, methods and systems for implementing a system-on-chip with integrated reprogrammable cellular network connectivity | |
| EP3116161B1 (en) | Security unit management method and terminal | |
| US8596534B2 (en) | Interface system between a terminal and a smart card, method for same, and smart card applied to same | |
| CN102088691B (en) | Mobile phone mobile Internet user application certification recognition system and method | |
| US20150334111A1 (en) | Methods and apparatus to support globalplatform usage on an embedded uicc | |
| US20180041893A1 (en) | Method and system of multi-terminal mapping to a virtual sim card | |
| JP2012248202A (en) | Storage medium | |
| US20160086159A1 (en) | Application identifier (aid) prioritization of security module applications | |
| US20160366541A1 (en) | Electronic device and method for providing function in electronic device | |
| KR102045662B1 (en) | System and method for managing logical channels for accessing several virtual profiles within a secure element | |
| CN106529942B (en) | The access method and terminal of a kind of nfc card | |
| CN112491885B (en) | Electronic certificate transmission method, device and equipment | |
| US11051160B2 (en) | Apparatuses, methods and systems for implementing a system-on-chip with integrated reprogrammable cellular network connectivity | |
| US8776251B2 (en) | Data exchange between a secure element and a terminal | |
| US10387219B2 (en) | Enabling multiple secure elements in a card computing device | |
| US20140310606A1 (en) | Method and device for providing plugin in contact list | |
| CN106576329B (en) | Context-based resource access mediation | |
| CN112367661B (en) | USAT application matching implementation method, USIM, terminal, device and medium | |
| US6811077B2 (en) | Method for making secure access to a resident application on a user card co-operating with communication system terminal, and corresponding terminal | |
| CN104077155B (en) | The startup of application program in mobile device | |
| WO2017076258A1 (en) | Smart card and application downloading method thereof | |
| CN113950036B (en) | NFC capability synchronization method, UICC, terminal, equipment and medium | |
| CN104348952A (en) | Control method of card application management system | |
| HK40047900B (en) | Electronic certificate transmission method, apparatus and device |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CP03 | Change of name, title or address | ||
| CP03 | Change of name, title or address | Address after:No.11, Jiangxi Road, Shinan District, Qingdao, Shandong 266000 Patentee after:Qingdao Hisense Mobile Communication Technology Co.,Ltd. Country or region after:China Address before:Shandong City, Qingdao Province, Jiangxi City Road No. 11 Patentee before:HISENSE MOBILE COMMUNICATIONS TECHNOLOGY Co.,Ltd. Country or region before:China |