WO2017128182A1 - Near field communication payment method and terminal - Google Patents

Near field communication payment method and terminal Download PDF

Info

Publication number
WO2017128182A1
WO2017128182A1 PCT/CN2016/072527 CN2016072527W WO2017128182A1 WO 2017128182 A1 WO2017128182 A1 WO 2017128182A1 CN 2016072527 W CN2016072527 W CN 2016072527W WO 2017128182 A1 WO2017128182 A1 WO 2017128182A1
Authority
WO
WIPO (PCT)
Prior art keywords
payment
application
terminal
payment application
priority
Prior art date
Application number
PCT/CN2016/072527
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 CN201680003886.2A priority Critical patent/CN107251069B/en
Priority to PCT/CN2016/072527 priority patent/WO2017128182A1/en
Publication of WO2017128182A1 publication Critical patent/WO2017128182A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/32Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
    • G06Q20/327Short range or proximity payments by means of M-devices
    • G06Q20/3278RFID or NFC payments by means of M-devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/20Point-of-sale [POS] network systems
    • G06Q20/204Point-of-sale [POS] network systems comprising interface for record bearing medium or carrier for electronic funds transfer or payment credit

Definitions

  • the embodiments of the present invention relate to the field of mobile payment, and in particular, to a near field communication payment method and a terminal.
  • near field communication (English name: Near Field Communication, abbreviation: NFC) payment is a trend of the times.
  • NFC Near Field Communication
  • the card application technology enables the payment application installed on the NFC terminal to communicate with the card reader or the sales terminal (English name: point of sale, abbreviation: POS) to complete the payment transaction, and the payment application can be a card application or Host card emulation (English full name: Host Card Emulation or Host-based Card Emulation, abbreviation: HCE) application.
  • Host card emulation English full name: Host Card Emulation or Host-based Card Emulation, abbreviation: HCE
  • the traditional card simulation technology is implemented by the security unit (English name: Secure Element, SE: N) in the NFC terminal.
  • SE Secure Element
  • the card application that communicates with the POS machine is installed and operated in the SE, in the NFC.
  • the terminal is close to the NFC card reader (ie, the receiving terminal in the contactless POS system)
  • the card application in the SE can interact with the NFC card reader through the NFC controller.
  • the HCE application software framework shown in Figure 2 opens up a new communication channel, enabling HCE applications running on the host CPU of the NFC terminal to interact with the NFC reader through the NFC controller.
  • Each HCE application includes multiple application identifiers (English full name: Application Identifier, AID).
  • AID Application Identifier
  • POS payment environment English name: Proximity Payment System Environment, PPSE
  • SELECT PPSE selection command
  • the POS machine can only identify the AID included in the HCE application, that is, only the bank card corresponding to the HCE application may be used for payment; when the user wishes to use the corresponding bank card of the other HCE application to pay,
  • the HCE application that you want to use can be manually switched to the default HCE application to complete the payment transaction, which is inconvenient for the user.
  • An object of the present invention is to provide a near field communication payment method and terminal, which are used to solve the prior art. Only the default HCE application can respond to the deficiencies of the PPSE selection instruction.
  • the first aspect provides an NFC payment method, where the method is applied to a first terminal that supports NFC, where the first terminal includes M payment applications, and M is greater than 1, the method includes: receiving, by the first terminal, the first The first terminal sends a response message for answering the first instruction to the second terminal, where the response message includes N application identifiers AID, and the N AIDs are all included in the M payment applications.
  • the AID, each payment application includes at least one AID, wherein the M payment applications include a host card emulation HCE application or the M payment applications include an HCE application and a card application.
  • some of the first terminals include only HCE applications, and some of the first terminals include HCE applications and card applications, wherein the HCE application can run in a trusted execution environment (English name: trusted execution environment, abbreviation: TEE) can also run in the rich execution environment (English full name: rich execution environment, abbreviation: REE), and the card application generally runs in the SE of the first terminal; in general, a card application in the SE has only one An AID, and an HCE application can have an AID or multiple AIDs.
  • the HCE application is an NFC interface and a card reader or POS machine that can run on the host CPU and can utilize the first terminal. Special applications for contactless transactions.
  • the HCE application is installed and running in the operating system of the first terminal (English name: Operating System, abbreviation: OS), for example: Android, windows 10 for mobile or blackberry, etc.
  • OS Operating System
  • the OS uses the application identifier (App ID) of the HCE application to perform it. Management, the APP ID may vary depending on the operating system.
  • An HCE application can simulate one or more card applications (Applets), each card application implements a business logic, each card application has a separate AID, not only the HCE application, the card application installed in the SE and the physical card Has an AID.
  • the HCE application needs to declare to the OS of the first terminal (ie, register in the NFC application framework) the AID of the card application that it can simulate.
  • the purpose of declaring the AID is to facilitate the NFC application framework in the OS to record the AID that each HCE application can process.
  • the NFC application framework forwards the received application protocol data unit (English protocol: application protocol data unit, abbreviation: APDU) to the HCE application.
  • APDU application protocol data unit
  • the first terminal before the first terminal sends a response message for answering the first instruction to the second terminal, acquires the N AIDs and the first information of the M payment applications; The first terminal configures the N AIDs into a queue according to the first information of the M payment applications, and the queue is used to generate the response message; the first terminal uses the queue to generate the response message.
  • the M terminals are installed on the first terminal, and the M is greater than 1.
  • the first terminal After the first terminal receives the first command sent by the second terminal, the first terminal acquires the N AIDs and the first information of the M payment applications, and The N AIDs are configured into a queue according to the first information of the M payment applications, and the queue is used to generate a response message responsive to the first instruction. Further, the first terminal sends a response message to the second terminal in response to the first instruction, where the response message includes N AIDs, where the N AIDs are all AIDs included in the M payment applications, and each payment application has at least An AID, the M payment applications include a host card emulation HCE application or the M payment applications include an HCE application and a card application.
  • the response message for answering the first instruction includes multiple HCE applications and the AID of the card application, and the second terminal can obtain multiple HCE applications and cards.
  • the AID of the application that is, providing the second terminal with multiple AIDs belonging to different HCE applications or multiple AIDs belonging to different HCE applications and different card applications to answer the first instruction, without manually modifying the default HCE application settings,
  • the second terminal is selected to select a specific AID response command, which reduces user operations and effectively improves the user experience.
  • the payment application installed on the first terminal is not limited to the card application in the SE, it may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
  • the first terminal before the first terminal acquires the N AIDs, the first terminal is configured according to at least one of a payment application whitelist, a payment application blacklist, and a first information of a payment application.
  • the M payment applications are determined in all payment applications on the terminal.
  • the first terminal determines, according to at least one of a payment application whitelist, a payment application blacklist, and a first information of a payment application, the M notifications from all payment applications on the first terminal.
  • the payment application includes: determining, by the payment application, all the payment applications in the whitelist of the payment application as the M payment applications; or determining, on the first terminal, other payment applications other than the payment application blacklist as The M payment application; or the first information of the payment application is the current running state of the payment application, and the current running state of the payment application includes the foreground running and the background running, all the payment of the foreground running and the background running
  • the application is determined to be the M payment application; or the first information of the payment application is an operating environment of the payment application, and the operating environment of the payment application includes the first operating environment and the second operating environment, and the first operating environment is And all in the second operating environment Determining, by the payment application, the M payment applications or determining all payment applications in the first operating environment as the M payment applications, wherein the
  • the first terminal determines the M payment applications from all the payment applications on the first terminal according to one or any combination of the payment application white list, the payment application blacklist, and the payment application first information.
  • the first terminal configures a PPSE route, where the PPSE route includes a near field communication NFC application framework.
  • the PPSE route includes a near field communication NFC application framework.
  • the first program is configured to respond to the first instruction by using the response message. It can be seen that by configuring the route in the NFC application framework, the first instruction is routed to the first program, thereby ensuring that the response message answers the PPSE selection instruction.
  • the first terminal configures a PPSE route, where the PPSE route includes a near field communication controller ( English full name: near field communication controller, abbreviation: NFCC) routing and routing in the NFC application framework.
  • NFCC near field communication controller
  • the first terminal configuring the PPSE route includes: when the NFCC route does not include the first routing entry, configuring the second routing entry in the NFCC route; or, when the NFCC route includes the third routing entry, Clearing the third routing entry in the NFCC route and configuring the second routing entry, where the first routing entry is a routing entry including a PPSE AID, the second routing entry is a PPSE AID, and the routing target is a host NFC execution environment.
  • the third routing item is a routing item containing a PPSE AID but the routing destination is not the host NFC execution environment; or, when the NFCC routing does not include the first
  • the fourth routing entry is configured in the NFCC route.
  • the NFCC route includes the third routing entry and does not include the fourth routing entry, the third routing entry is cleared and configured in the NFCC routing.
  • the fourth routing entry wherein the fourth routing entry is a routing entry for routing the AID selection instruction to the host NFC execution environment.
  • the above configuration of the NFCC routing process can be simplified to configure the protocol routing in the NFCC, and route all ISO-DEP protocol data to the host CPU (ie, the host NFC execution environment, DH NFCEE). Therefore, the AID selection instruction (where the AID selection instruction includes the PPSE selection instruction) is routed to the host NFC execution environment, that is, the host CPU; when the first terminal includes the HCE application and the card application, the above-mentioned setting of the NFCC route may also be adopted.
  • the second routing entry or the fourth routing entry is configured in the NFCC route and the third routing entry is cleared.
  • a correspondence between the first program and the PPSE AID is configured, and the first program is configured to respond to the PPSE selection instruction by using the response message.
  • the second routing entry or the fourth routing entry is configured in the NFCC route, that is, the second routing entry is a routing entry that includes the PPSE AID and the routing destination is the host NFC execution environment, and the fourth routing entry is used to The AID selection command is routed to the routing entry of the host NFC operating environment.
  • the correspondence between the first program (ie, the PPSE configuration program) and the PPSE AID is configured, that is, the configuration PPSE AID corresponds to the first A program that uses the queue to generate a response message responsive to the PPSE selection instruction.
  • a unique routing information including the PPSE AID is reserved, and the PPSE AID information declared by all other programs is blocked, and the PPSE selection instruction is only routed to the PPSE configuration program on the first terminal, and the PPSE configuration program uses the PPSE configuration program.
  • the queue generates a program that responds to the response message of the PPSE selection instruction.
  • the routing format in the NFC application framework can be provided by the OS or by the HCE application framework.
  • the queue is an ordered data structure for storing the AID of the payment application.
  • the queue has a header and a tail. When the queue is traversed, the node at the head of the queue is obtained first, and then the node at the end of the queue is obtained.
  • a queue node can be inserted at the end of the queue, and the queue node can be deleted at the head of the queue.
  • nodes can be inserted and deleted at the head of the queue, or nodes can be inserted and deleted at the end of the queue.
  • Each node can save other relevant information of the payment application in addition to the AID.
  • the first information of the payment application includes at least one of a current running state of the payment application, an operating environment of the payment application, a priority of the payment application, and a usage record of the payment application. It can be seen that the first information can be one of or any combination of multiple, not here. Make specific limits.
  • the first information of the payment application is a current running state of the payment application
  • the first terminal configuring the N AIDs into the queue according to the first information of the M payment applications includes:
  • the current running status of the M payment applications includes the foreground running and the background running, configuring all the AIDs of the payment application running in the foreground to the first position of the queue and setting the first priority, and configuring all AIDs of the payment application running in the background. Go to the second location of the queue and set a second priority, wherein the first priority is higher than the second priority.
  • all the AIDs of the payment application running in the foreground are configured to the head of the queue and set a high priority
  • all AIDs of the payment application running in the background are configured to the end of the queue and set with a low priority.
  • the first terminal configures the AIDs of the multiple HCE applications and the card application into the queue and sets the priority, thereby generating a response message of the first instruction, so that the second terminal can obtain the AIDs of the multiple HCE applications and the card application.
  • the second terminal can select a specific AID without manually modifying the default HCE application settings.
  • the specific AID can be preferentially selected by the priority order of the AID, thereby reducing user operations and effectively improving the user experience.
  • the payment application installed on the first terminal is not limited to the card application in the SE, and may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
  • the first information of the payment application is an operating environment of the payment application
  • the operating environment of the payment application includes a first operating environment and a second operating environment, where the first operating environment is a rich execution environment REE or The trusted execution environment TEE runs the HCE application; the second operating environment is the security unit SE, which runs the card application, and the first terminal configures the N AIDs into the queue according to the first information of the M payment applications.
  • the M payment application includes the HCE application and the card application, all the AIDs of the HCE application are configured to the first position of the queue and the first priority is set, and all the AIDs of the card application are configured to the second position of the queue.
  • the first terminal configures all the AIDs of the HCE application and the card application to the corresponding positions of the queue and sets corresponding priorities according to the actual requirements, thereby generating a response message of the first instruction, so that the second terminal can simultaneously Get multiple AIDs for HCE applications and card applications without manual modification
  • the HCE application settings can be used to select a specific AID for the second terminal.
  • the specific AID can be preferentially selected through the priority order of the AID, thereby reducing user operations and effectively improving the user experience.
  • the payment application installed on the first terminal is not limited to the card application in the SE, and may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
  • the first information of the payment application is a priority of the payment application
  • the first terminal configuring the N AIDs into the queue according to the first information of the M payment applications includes: when the M When the payment application includes the default payment application of the first terminal and the payment application specified by the user, all the AIDs of the payment application specified by the user are configured to the first position of the queue and the first priority is set, and the first terminal is set.
  • the default AID of the default payment application is configured to the second location of the queue and the second priority is set; or, the entire AID of the default payment application of the first terminal is configured to the first location of the queue and the first priority is set.
  • all the AIDs of the default payment application of the terminal and the user-specified payment application are configured into the corresponding positions of the queue and the corresponding priorities are set, thereby generating a response message of the first instruction so that the second terminal can simultaneously obtain
  • the AID of multiple HCE applications and card applications can be used to select a specific AID without manually modifying the default HCE application settings.
  • the AID priority order can be used to preferentially select a specific AID, which reduces user operations. Effectively improve the user experience.
  • the payment application installed on the first terminal is not limited to the card application in the SE, and may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
  • the first information of the payment application includes a usage record of the payment application
  • the first terminal configuring the N AIDs into the queue according to the first information of the M payment applications includes:
  • the first terminal sets a priority according to the frequency of use of the payment application, and configures the AID of the payment application into a response message for answering the first instruction according to the set priority order, so that the second terminal can Obtaining the AIDs of multiple HCE applications and card applications at the same time, the second terminal can select a specific AID without manually modifying the default HCE application settings.
  • the AID priority order can be used to preferentially select a specific AID, thereby reducing the number of users. Operation to effectively improve the user experience.
  • the payment application installed on the first terminal is not limited to the card application in the SE, and may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
  • the PPSE control interface is generated on the first terminal interface, where the PPSE control interface is used for manually modifying the priority order of the payment application, thereby effectively improving the user experience.
  • the at least one payment application when at least one of the M payment applications is in a non-operational state, the at least one payment application is activated.
  • acquiring the N AIDs on the first terminal includes: acquiring, by the payment application management module on the first terminal, the N AIDs on the first terminal; or by parsing the M The N AIDs are obtained by applying a resource file saved in the first terminal.
  • the first program on the first terminal sends a query message to the payment application management module in the NFC application framework, and queries the AID registered by each payment application in the NFC service (including all AIDs of static registration and dynamic registration). Or, the first program on the first terminal may obtain the N AIDs by parsing the resource files saved by the M payment applications in the first terminal.
  • the second aspect provides a first terminal, where the first terminal is a terminal that supports NFC, the first terminal includes M payment applications, and M is greater than 1.
  • the first terminal includes: a receiving module, configured to receive the first The first instruction of the short-distance payment environment sent by the second terminal;
  • a sending module configured to send, to the second terminal, a response message for answering the first instruction, where the response message includes N application identifiers AID, where the N AIDs are all AIDs included in the M payment applications,
  • Each payment application includes at least one AID, wherein the M payment applications include a host card emulation HCE application or the M payment applications include an HCE application and a card application.
  • the M terminal when the M terminal is installed on the first terminal, the M is greater than 1, the receiving module of the first terminal receives the first instruction of the short-range payment environment sent by the second terminal, and the sending module of the first terminal sends the second terminal to the second terminal.
  • the M payment applications include host card emulation HCE applications or the M payment applications include HCE applications and card applications. Therefore, it is not limited to providing only one default payment application to answer the first instruction.
  • the response message for answering the first instruction includes multiple ACEs of the HCE application and the card application, thereby enabling the second terminal to Obtaining the AIDs of the multiple HCE applications and the card application, that is, providing the second terminal with multiple AIDs belonging to different HCE applications or multiple AIDs belonging to different HCE applications and different card applications, without manually modifying the default HCE application settings,
  • the second terminal can select a specific AID, which reduces user operations and effectively improves the user experience.
  • the payment application installed on the first terminal is not limited to the card application in the SE, it may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
  • a third aspect provides a first terminal, comprising: one or more processors, a memory, a bus system, and a transceiver, wherein the one or more processors, the memory, and the transceiver are connected by the bus system; wherein Storing one or more programs in the memory, the one or more programs comprising instructions that, when executed by the first terminal, cause the first terminal to perform any one of the possible implementations of the first aspect or the first aspect The method described in the above.
  • the M terminals are installed on the first terminal, and the M is greater than 1.
  • the first terminal receives the first command sent by the second terminal, and the first terminal sends a response message to the second terminal that responds to the first command, where the The response message includes N AIDs, which are all AIDs included in the M payment applications, each payment application has at least one AID, and the M payment applications include a host card emulation HCE application or The M payment applications include HCE applications and card applications. Therefore, it is not limited to providing only one default payment application to answer the first instruction.
  • the response message for answering the first instruction includes multiple HCE applications and the AID of the card application, thereby enabling the second terminal to obtain more
  • the AID of the HCE application and the card application can realize the specific AID of the second terminal without manually modifying the default HCE application setting, thereby reducing the user operation and effectively improving the user experience.
  • the payment application installed on the first terminal is not limited to the card application in the SE, it may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
  • FIG. 1 is a structural diagram of a card application in the prior art
  • FIG. 3 is a schematic structural diagram of a first terminal according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of an embodiment of an application scenario of an NFC payment method according to an embodiment of the present disclosure
  • FIG. 5 is a schematic flowchart diagram of an NFC payment method according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of an implementation manner of an NFCC route according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of an implementation manner of a route of an NFC application framework according to an embodiment of the present invention.
  • FIG. 8 is another schematic structural diagram of a first terminal according to an embodiment of the present invention.
  • FIG. 9 is another schematic structural diagram of a first terminal according to an embodiment of the present invention.
  • the first terminal 300 includes a communication unit 301, an input unit 302, an output unit 303, a processor 304, a storage unit 305, and peripheral devices. Interface 306, each unit is connected by one or more buses.
  • the communication unit 301 is configured to establish a communication channel, so that the first terminal performs voice communication, text communication, data communication, and the like with the remote electronic device or server through the communication channel; the input unit 302 is configured to implement interaction between the user and the terminal.
  • the processor 304 is a control center of the electronic device, and connects various parts of the entire first terminal by using various interfaces and lines, by running or executing a software program stored in the storage unit and/or a module, and calling data stored in the storage unit to perform various functions and/or processing data of the first terminal;
  • the output unit 303 includes but is not limited to a sound output unit for using the audio signal output by the processor from the digital The format is converted to an analog format; the storage unit 305 can be used to store software programs and modules; the peripheral interface 306 is used to connect to remote electronic devices or servers.
  • the first terminal may also comprise a security unit (SE).
  • SE can access the first terminal through a customer identification module (English name: Subscriber Identity Module, abbreviation: SIM) card slot or a SD card (Secure Digital Memory Card) card slot.
  • SIM Subscriber Identity Module
  • SD card Secure Digital Memory Card
  • the SE can be soldered as a chip on the motherboard of the first terminal, and the SE communicates with the processor of the terminal and the NFC controller (NFCC) through the serial port.
  • NFCC NFC controller
  • the communication unit 301 may include an NFC controller and an NFC antenna, and the payment application in the first terminal may utilize the NFC signal and the second terminal of the remote end (for example, an NFC card reader or a non-NFC antenna) Contacting the POS machine for communication;
  • the processor 304 may be the first terminal host CPU, the processor 304 may run the HCE application, and the HCE application may communicate with the NFC card reader or the contactless POS machine through the communication unit 301;
  • the storage unit 305 may be The first terminal's read-only memory (English full name: read-only memory, abbreviation: ROM), random access memory (English full name: Ramdom Access Memory, abbreviation: RAM), the code of the HCE application running on the processor 304 and The data is stored in the storage unit 305.
  • the processor 304 can configure the NFCC route in the communication unit 301 to configure the NFCC routing table, and can also be used to configure the route stored in the NFC application framework in the storage unit 305.
  • the processor 304 also uses The first information of the HCE application and the card application is obtained, and the first information is used to configure an AID queue, and the queue is applied to generate a response message of the first instruction.
  • the first terminal in the embodiment of the present invention includes but is not limited to a mobile phone, a mobile computer, a tablet computer, a personal digital assistant (English full name: Personal Digital Assistant, abbreviation: PDA), a media player, a smart TV, and a wearable device ( For example, a smart watch or smart glasses, etc.), a combination of two or more of the above, and the like.
  • PDA Personal Digital Assistant
  • FIG. 4 is an example of an application scenario provided by an embodiment of the present invention.
  • Common NFC terminals support multiple payment applications. For example, there are multiple payment applications on the NFC terminal, and each payment application has at least one AID.
  • POS machines can generally read a variety of payment applications. The POS machine cannot predict the AID of all payment applications. Therefore, between the POS machine and the NFC terminal, which card application is selected for transaction, an interaction process is required, so that the POS machine selects one of the plurality of payment applications for transaction.
  • the International Bank Card Standards Organization EMVCo stipulates that POS machines use the PPSE selection command to obtain payment application information.
  • the POS device sends a PPSE selection command to the NFC terminal, and the NFC terminal needs to send a response message to the POS machine.
  • the POS machine obtains the AID of a group of activated payment applications by receiving the response message, and then selects an activated payment application to perform subsequent transactions.
  • the PBOC 3.0 standard developed by China also requires NFC terminals and POS machines to support the PPSE mechanism. Any NFC terminal that communicates with the POS must support the PPSE mechanism.
  • the current NFC terminal (that is, the first terminal mentioned above) supports the installation of HCE applications, and multiple HCE applications are often installed on the terminal.
  • the NFC terminal can be equipped with an embedded chip security unit eSE on the motherboard of the SE chip, that is, the NFC terminal, or through a secure digital card (English full name: Secure Digital Memory Card, abbreviation: SD) interface or a customer identification module (English full name: Subscriber Identity Module, abbreviation: SIM)
  • SD Secure Digital Memory Card
  • SIM Subscriber Identity Module
  • the card interface is connected to the SE. In this way, there may be multiple HCE applications and multiple card applications in the SE.
  • the NFC card reader needs to communicate with a variety of terminals of different configurations.
  • the NFC card reader cannot predict the AID of the card application in all terminals and the AID of the HCE application, so the NFC card reader needs to send the first to the terminal first.
  • the instruction for example, the first instruction is a PPSE selection instruction, and obtains the card application activated in the terminal and the AID of the HCE application from the response message, and then selects the card application or the HCE application to perform the transaction.
  • IC cards In practical applications, such as card readers deployed in shopping malls or supermarkets, it needs to face a variety of integrated circuits issued by different banks (English full name: integrated circuit, abbreviation: IC) cards, these IC cards
  • the AID of the payment application is different, therefore, these cards must support the PPSE program, and the card reader needs to pass the first
  • the response of the instruction obtains the AID of the payment application in the card to select one of them.
  • a mobile phone can simulate multiple cards by installing an HCE application or installing an SE (for example, using a mobile operator's NFC-SIM), which is equivalent to having multiple card applications inside a card facing the card reader.
  • the phone can be modeled as a super card with multiple payment applications installed.
  • the HCE application in the mobile phone is an application installed on the mobile phone, and each HCE application can be bound with multiple bank cards, wherein each bank card includes an AID.
  • the mobile phone notifies the card reader of the AID of the bank card by responding to the first instruction, so that the card reader selects the corresponding bank card for transaction.
  • an embodiment of a near field communication NFC payment method in an embodiment of the present invention is applied to a first terminal supporting NFC;
  • the first terminal may include a processor (host CPU), NFCC, and SE, where
  • the SE may be a chip in the first terminal, or may be a hardware entity that accesses the first terminal through a peripheral interface (such as a SIM card slot or an SD card slot).
  • a peripheral interface such as a SIM card slot or an SD card slot.
  • Step 501 The first terminal determines, according to at least one of the payment application whitelist, the payment application blacklist, and the first information of the payment application, the M payment applications from all the payment applications on the first terminal.
  • the M payment applications include M HCE applications or the M payment applications include an HCE application and a card application, and the card application is included in a security unit of the first terminal.
  • all payment applications in the whitelist of payment applications on the first terminal are determined as the M payment applications; or, the payment application black on the first terminal is Other payment applications outside the list are determined as the M payment applications.
  • the first terminal needs to determine M payment applications from all payment applications installed on the first terminal according to the payment application white list and/or the payment application blacklist.
  • the payment application installed on the first terminal may be a host card emulating an HCE application or a card application running in the SE.
  • the HCE application may use an identifier to identify itself. For example, a string or a service name may be used as the identifier.
  • Each HCE application has a unique identifier or service name, which is the difference between the HCE applications.
  • the identifier of the other application in the first terminal is convenient for the first terminal operating system to manage the installed application; in the SE of the first terminal, the card application uses the application identifier AID to identify itself, and the AID is defined by the international standard organization ISO.
  • the first terminal includes a preset payment application white list and/or a payment application blacklist, and the whitelist or the blacklist includes the service name or application identifier (APP ID) of the HCE application and the AID of the card application, and the identifier of the HCE application is used.
  • APP ID service name or application identifier
  • the payment application blacklist is pre-configured in the first terminal, all the payment applications that have been installed on the first terminal are obtained first, and a payment application identifier set is obtained. From the set, all payment applications included in the blacklist are removed. The last remaining payment application in the collection is used as the M payment application; when the whitelist of the payment application is pre-configured in the first terminal, the application identifier set corresponding to the whitelist is associated with the identifier of all the payment applications already installed on the first terminal. The collection is done as an intersection, and all payment applications corresponding to the identifiers in the intersection are used as M payment applications.
  • the first information of the payment application includes at least one of the following: a current running state of the payment application, an operating environment of the payment application, a priority of the payment application, and a usage record of the payment application.
  • the first terminal may determine the M payment applications according to the first information of the payment application.
  • the first information of the payment application is a current running state of the payment application
  • the current running state of the payment application includes a foreground running and a background running, the foreground running and the All payment applications running in the background are determined as the M payment applications.
  • the payment application in the running state can process the POS machine to send an instruction, and the non-operating payment application must be started to process the instruction sent by the POS machine. Therefore, the first terminal acquires the payment of the foreground operation and the background operation. Applying, and determining the payment application running in the foreground and the background as the M payment applications, it can be seen that all payment applications in the running state on the first terminal are determined as the M payment applications.
  • the first information of the payment application is the running environment of the payment application
  • the operating environment of the payment application includes the first running environment and the second running environment, and the first running environment and the second running are performed. All payment applications in the environment are determined as the M payment applications or all payment applications in the first operating environment are determined as the M payment applications, wherein the first running environment is REE or TEE, running The HCE application, the second operating environment is SE, running a card application.
  • the card application and the HCE application on the first terminal are determined as the M payment applications.
  • the M payment applications are determined as the M payment applications.
  • some mobile phones do not support the card application, and directly on the first terminal
  • the HCE application is determined to be the M payment applications.
  • the first information of the payment application is a priority of the payment application, and the first terminal is silent.
  • the recognized payment application and all payment applications specified by the user are determined as the M payment applications.
  • the priority of the default payment application and the user-specified payment application of the first terminal is higher than the priority of other payment applications on the first terminal.
  • the user tends to use the HCE application of a certain bank or some payment applications commonly used by the user by default on the mobile phone. It can be seen that the default payment application on the first terminal and all payment applications specified by the user can be determined as The M payment applications are effectively close to the user experience.
  • the first information of the payment application is a usage record of the payment application, and all payment applications in the usage record are determined as the M payment applications.
  • all the payment applications used in the NFC payment are determined as the M payment applications, for example, the first terminal acquires the payment application used in the NFC payment, and uses the used payment application. All payment applications are determined as the M payment applications to facilitate the card reader to select one of the payment applications for the transaction.
  • the first terminal may download all payment applications that are downloaded through the trusted application market (for example, the terminal pre-installed application market) or All the payment applications with the trusted digital signatures are used as the M payment applications, and all the payment applications that have been installed in the first terminal are also used as the M payment applications, which are not specifically limited herein.
  • the trusted application market for example, the terminal pre-installed application market
  • All the payment applications with the trusted digital signatures are used as the M payment applications, and all the payment applications that have been installed in the first terminal are also used as the M payment applications, which are not specifically limited herein.
  • Step 502 The first terminal receives the first instruction sent by the second terminal.
  • the second terminal sends the first instruction to the first terminal, and the first terminal receives the first instruction.
  • the first instruction may be a PPSE selection instruction, that is, a SELECT PPSE instruction, wherein the second terminal is a card reading device or a POS machine, and is not specifically limited herein.
  • step 501 and step 502 are not specifically limited, and step 501 and step 502 may occur simultaneously or sequentially.
  • Step 503 The first terminal acquires first information of the N AIDs and the M payment applications.
  • the N AIDs are all AIDs included in the M payment applications, and each payment application includes at least one AID.
  • the payment application is an HCE application
  • the payment application may include one or more AIDs.
  • the payment application is a card application in the SE
  • the payment application includes an AID, that is, the payment application corresponds to one AID.
  • the first information of the payment application includes at least one of the following: a current running state of the payment application, The operating environment of the payment application, the priority of the payment application, and the usage record of the payment application.
  • the N application AIDs on the first terminal are obtained by the payment application management module on the first terminal; or the resource file acquired in the first terminal is obtained by parsing the M payment applications.
  • the N AIDs For example, the PPSE configuration program of the first terminal sends a query message to the payment application management module in the NFC application framework, and queries the AID (including all AIDs of static registration and dynamic registration) registered by each payment application in the NFC service, or The PPSE configuration program of the first terminal may obtain the N AIDs by parsing the resource files saved by the M payment applications in the first terminal.
  • Step 504 The first terminal configures the N AIDs into the queue according to the first information of the M payment applications, and uses the queue to generate a response message.
  • the first information of the payment application is a current running state of the payment application
  • the step 504 may specifically include: when the current running states of the M payment applications include a foreground running and a background running All the AIDs of the payment application running in the foreground are configured to the first position of the queue and set a first priority, and all AIDs of the payment application running in the background are configured to the second position of the queue and the second priority is set. Wherein the first priority is higher than the second priority.
  • all AIDs of the payment application running in the foreground are configured to the head of the queue and set to a high priority
  • all AIDs of the payment application running in the background are configured to the end of the queue and set to a low priority.
  • payment applications that are not in the foreground or background running state can have their AIDs configured to other locations in the queue and set low priority. It can be seen that multiple AIDs in the running state are configured into the queue and set priorities, thereby generating a response message of the first instruction, so that the second terminal can obtain multiple AIDs, and the first HCE application setting can be manually modified. The second terminal selects a specific AID.
  • the specific AID can be preferentially selected through the priority order of the AID, thereby reducing user operations and effectively improving the user experience.
  • the payment application installed on the first terminal is not limited to the card application in the SE, and may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
  • the first information of the payment application is an operating environment of the payment application
  • the step 504 may specifically include: the operating environment of the payment application includes a first running environment and a second running environment, Running the HCE application in the first operating environment, in the second operating environment Running a card application; when the M payment applications include an HCE application and a card application, configuring all AIDs of the HCE application to a first location of the queue and setting a first priority, and applying all of the cards Configuring an AID to a second location of the queue and setting a second priority; or configuring all AIDs of the card application to a first location of the queue and setting a first priority, applying the HCE All AIDs are configured to a second location of the queue and a second priority is set, wherein the first priority is higher than the second priority.
  • the first information of the payment application is a priority of the payment application
  • the step 504 may specifically include: when the M payment applications include the first terminal default payment application and When the user specifies the payment application, all the AIDs of the payment application specified by the user are configured to the first location of the queue and the first priority is set, and all the AIDs of the default payment application of the first terminal are configured to the Determining a second location of the queue and setting a second priority; or configuring all AIDs of the default payment application of the first terminal to a first location of the queue and setting a first priority, the user-specified All the AIDs of the payment application are configured to the second location of the queue and set a second priority, wherein the default payment application of the first terminal and the payment application specified by the user are different payment applications, a priority is higher than the second priority, and the default payment application of the first terminal and the payment application specified by the user are higher than other payment on the first terminal. Priority.
  • all AIDs of the payment application specified by the user are configured to the head of the queue and a high priority is set, and all AIDs of the default payment application of the first terminal are configured to the end of the queue and a low priority is set.
  • configure all the AIDs of the default payment application of the first terminal to the head of the queue and set a high priority configure all AIDs of the payment application specified by the user to the end of the queue and set a low priority Level, wherein the default payment application of the first terminal and the payment application specified by the user are different payment applications.
  • the first terminal configures all the AIDs of the default payment application of the first terminal and the user-specified payment application into corresponding positions of the queue and sets corresponding priorities, thereby generating a response message of the first instruction.
  • the first information of the payment application includes a usage record of the payment application
  • the step 504 may specifically include: configuring all AIDs of the payment application used when the NFC payment was last performed to the queue. And setting a first priority; or, according to the frequency of use of the M payment applications, sequentially configuring all AIDs of each payment application into the queue and setting priorities, wherein The first priority is higher than the priorities other than the first priority.
  • all the AIDs of the payment application used in the last NFC payment are configured to the head of the queue and set to a high priority; or, according to the frequency of use of the M payment applications, each of them is sequentially All AIDs of the payment application are configured into the queue and prioritized.
  • the first terminal can obtain the payment application used when the contactless payment is last executed, or obtain the usage frequency information of the payment application, and then configure the AID of the payment application according to the above information and set the priority.
  • the AID of the default payment application running in the foreground is set to a high priority, and the background is running and defaults.
  • the AID of the payment application sets the second highest priority, and sets the AID of the remaining payment applications in the M payment applications (ie, except the default payment application running in the foreground and the default payment application running in the background), and
  • the AID is configured into the queue according to the above priority.
  • the AID of the default payment application is set to a high priority
  • the last used payment application is obtained from the M payment applications
  • the payment application of the last use is used.
  • the AID sets the second highest priority, and according to the historical usage records of the payment applications other than the default payment application and the last used payment application, the usage frequency information of the payment applications is obtained according to the usage frequency. The priority of these payment applications, and finally the AID is configured into the queue.
  • the first information of the payment application includes at least one of a current running state of the payment application, an operating environment of the payment application, a priority of the payment application, and a usage record of the payment application, Determining, according to the free combination of at least one of the first information, a location relationship and a priority order of the AIDs of the M payment applications to the queue, and generating a response message acknowledging the first instruction by using the queue, where No specific restrictions.
  • the at least one payment application when at least one of the M payment applications is a payment application When in the non-operational state, the at least one payment application is activated.
  • the M payment applications when the M payment applications are currently in a non-operation state, a part of the payment applications or all payment applications in the M payment applications are activated; and some or all of the M payment applications are activated. All AIDs of the application are configured into the queue and prioritized.
  • the PPSE configuration program activates the part or all of the payment application to enable the part or all of the payment application to be in a running state, that is, to start the application of the part or all of the payment application, and execute the related configuration process. Therefore, it is avoided that the M payment applications are not in the running state, and the response message acknowledging the first instruction cannot be configured, and the interaction process between the payment application and the card reader or the POS machine cannot be completed.
  • Step 505 The first terminal configures a PPSE route.
  • the PPSE route is used to ensure that the first terminal responds to the first instruction by using the response message, wherein the PPSE route includes a route in an NFC application framework or the PPSE route includes an NFCC route and an NFC application framework Routing.
  • the PPSE route is configured to ensure that the first command, ie, the PPSE select command, is replied to using the reply message generated in step 504.
  • the format of the NFCC route is as shown in FIG. 6.
  • the NFCC routes are organized in the form of a table, each of which acts as a routing item, and each routing item includes an AID and a routing target corresponding to the AID, that is, an execution environment in which the payment application is located ( English full name: Near Field Communication Execution Environment, abbreviation: NFCEE), because the payment application can be a card application or host card simulation application in the SE, so the routing target in the NFCC route can be the SE identifier, or the host NFC execution environment. That is, the identity of the host CPU.
  • NFCEE Near Field Communication Execution Environment
  • the PPSE route includes a route in the NFC application framework
  • the first terminal configures the PPSE route to include: In the routing of the NFC application framework, configuring a correspondence between the first program and the PPSE AID, the first program is configured to respond to the PPSE selection instruction by using the response message, where the PPSE AID is included in the PPSE selection instruction.
  • the PPSE route includes a route in a near field communication controller NFCC routing and a near field communication NFC application framework
  • the first terminal configures PPSE routes including:
  • the third routing entry is configured to configure the second routing entry, where the first routing entry is a routing entry that includes a PPSE AID, and the second routing entry is a PPSE AID and the routing target is a host NFC execution environment.
  • the fourth routing entry is a routing entry for routing the AID selection instruction to the host NFC execution environment, wherein the AID selection instruction (ie, SELECT AID) includes a PPSE selection instruction, which is an APDU instruction defined by ISO/IEC 7816-4.
  • the card reader is used to select a payment application.
  • the fourth routing item may be a protocol routing item whose routing target is the host NFC execution environment (DH NFCEE), and is used to route the ISO-DEP protocol data to the host NFC execution environment.
  • DH NFCEE host NFC execution environment
  • the first program is configured to respond to the PPSE selection instruction by using the response message.
  • the NFC application framework that is, the NFC Framework implemented in the first terminal operating system, provides an application programming interface (English full name: Application Programming Interface, API) for the application developer, and is also on the first terminal.
  • the AID of the HCE application processing needs to be declared to the OS, that is, the service name (the identifier of the HCE application) of the AID and its corresponding HCE application is registered in the NFC application framework, so that the first terminal
  • the host NFC Execution Environment (English name: Device Host NFC Execution Environment, abbreviation: DH-NFCEE) forwards the APDU to the corresponding HCE application when the APDU command is received.
  • the APDU is a smart card defined by the ISO/IEC7816-4 standard.
  • configuring the PPSE AID corresponds to the first program, where the first program is a module or a system application in the first terminal operating system, and the first program may be a PPSE configuration program, and the first program is used.
  • the queue in step 504 generates a reply message in response to the PPSE selection command.
  • the response message may be generated in advance by a program other than the first program, and then the first program acquires the pre-generated response message and responds to the PPSE selection instruction by using the acquired response message, or the first program may execute the above.
  • Step 501 to step 504 which are not specifically limited herein.
  • the routes in the NFC application framework can also be organized in the form of a table. Each row identifies a routing entry, including an AID and an HCE application identifier, that is, the HCE service name. One row associates an AID with an HCE application.
  • step 505 and step 504 are not specifically limited, and steps 505 and 504 may occur simultaneously or sequentially.
  • the sequence of step 505 and step 502 is not specifically limited. Steps 505 and 502 may occur simultaneously or sequentially.
  • Step 506 The first terminal sends a response message for answering the first instruction to the second terminal.
  • the first terminal configures the PPSE route to ensure that the first instruction is answered using the response message generated in the queue.
  • step 501, step 503, step 504, and step 505 need not be completely performed in some embodiments, that is, in some embodiments, the first terminal does not need to perform the process of determining the M payment applications each time. After the M payment application is determined for the first time, the step 501 is not required to be performed. In some embodiments, the first terminal may generate the response message in advance. Therefore, the response message may be directly obtained, and step 503 and step 504 need not be performed. In some embodiments, the first terminal may pre-configure the PPSE route, so step 505 need not be performed. For the necessary technical features of the present invention, in some embodiments, step 502 and step 506 are directly performed, and are not specifically limited herein.
  • the first terminal 800 is a terminal supporting near field communication, and the first terminal includes M payment applications, where M is greater than 1, the first terminal
  • the 800 includes a receiving module 801 and a sending module 802.
  • the first terminal 800 further includes a processing module 803.
  • the receiving module 801 is configured to receive a first instruction sent by the second terminal;
  • the sending module 802 is configured to send, to the second terminal, a response for answering the first instruction.
  • the response message includes N application identifiers AID, the N AIDs are all AIDs included in the M payment applications, and each payment application includes at least one AID, wherein the M payments
  • the application includes a host card emulation HCE application or the M payment applications include an HCE application and a card application, the card application being included in a security unit of the first terminal.
  • the first terminal 800 further includes:
  • the processing module 803 is configured to acquire the first information of the N AIDs and the M payment applications before the sending module 802 sends a response message for responding to the first instruction to the second terminal; And configuring the N AIDs into a queue according to the first information of the M payment applications, where the queue is used to generate the response message; and the response message is generated by using the queue.
  • the processing module 803 is further configured to: before the sending module 802 sends a response message for answering the first instruction to the second terminal, configure PPSE routing, where the PPSE route includes an NFC application framework.
  • the routing or the PPSE routing includes routing in a near field communication controller NFCC routing and a near field communication NFC application framework, wherein the first instruction is a PPSE selection instruction.
  • the processing module 803 is configured to configure the first in the route of the NFC application framework when configuring the PPSE route.
  • the first program is configured to respond to the PPSE selection instruction by using the response message, wherein the PPSE AID is included in the PPSE selection instruction;
  • the processing module 803 is configured to: when the PPSE route is configured, specifically, when the NFCC route does not include the first When a routing entry is configured, the second routing entry is configured in the NFCC route; or, when the NFCC routing includes the third routing entry, the third routing entry is cleared in the NFCC routing and configured The second routing entry, wherein the first routing entry is a routing entry that includes a PPSE AID, and the second routing entry is a routing entry that includes a PPSE AID and the routing destination is a host NFC execution environment, and the third routing entry is included a PPSE AID but the routing destination is not a routing entry of the host NFC execution environment; or, when the NFCC route does not include the fourth routing entry, configuring the fourth routing entry in the NFCC routing; when the NFCC routing includes When the third routing entry does not include the fourth routing entry, the third routing entry
  • the first information of the payment application includes at least one of a current running state of the payment application, an operating environment of the payment application, a priority of the payment application, and a usage record of the payment application.
  • the processing module 803 is further configured to: according to at least one of a payment application whitelist, a payment application blacklist, and a first information of a payment application, before acquiring the N AIDs, The M payment applications are determined from all payment applications on the first terminal.
  • the processing module 803 according to at least one of the payment application whitelist, the payment application blacklist, and the first information of the payment application, all payment from the first terminal
  • the processing module 803 is specifically configured to determine, as the M payment applications, all payment applications in the whitelist of payment applications on the first terminal;
  • the first information of the payment application is a current running state of the payment application
  • the current running state of the payment application includes a foreground running and a background running, and determining, by the foreground running, all the payment applications running in the background For the M payment applications;
  • the first information of the payment application is the running environment of the payment application, and the operating environment of the payment application includes the first running environment and the second running environment, and the first running environment and the second running are performed. All payment applications in the environment are determined as the M payment applications or all payment applications in the first operating environment are determined as the M payment applications, wherein the HCE application is run in the first operating environment, Running the card application in the second operating environment;
  • the first information of the payment application is a priority of the payment application, and the default payment application of the first terminal and all payment applications specified by the user are determined as the M payment applications, wherein the first terminal The default payment application and the user-specified payment application have higher priority than other payment applications on the first terminal;
  • the first information of the payment application is a usage record of the payment application, and all payment applications in the usage record are determined as the M payment applications.
  • the first information of the payment application is a current payment application.
  • An operating state where the current running state includes a foreground running and a background running, and the processing module 803 is configured to run the foreground when the N AIDs are configured in the queue according to the first information of the M payment applications.
  • All AIDs of the payment application are configured to the first location of the queue and set a first priority
  • all AIDs of the payment application running in the background are configured to the second location of the queue and set a second priority, wherein The first priority is higher than the second priority.
  • the first information of the payment application is an operating environment of a payment application
  • the operating environment of the payment application includes a first running environment and a second running environment, where the first running environment runs.
  • the card application is run in the second running environment
  • the processing module 803 is configured to configure the N AIDs into the queue according to the first information of the M payment applications, specifically, when the M When the payment application includes the HCE application and the card application, configuring all AIDs of the HCE application to the first location of the queue and setting a first priority, and configuring all AIDs of the card application to the second of the queue Positioning and setting a second priority; or configuring all AIDs of the card application to a first location of the queue and setting a first priority, configuring all AIDs of the HCE application to the queue
  • the second location is set and the second priority is set, wherein the first priority is higher than the second priority.
  • the first information of the payment application is a priority of a payment application
  • the M payment applications include a default payment application of the first terminal and a payment application specified by a user
  • the processing When the module 803 configures the N AIDs into the queue according to the first information of the M payment applications, specifically configured to configure all AIDs of the payment application specified by the user to the first location of the queue and set First priority, configuring all AIDs of the default payment application of the first terminal to the second location of the queue and setting a second priority; or configuring all AIDs of the default payment application of the first terminal Go to a first location of the queue and set a first priority, configure all AIDs of the user-specified payment application to a second location of the queue and set a second priority, wherein the first terminal
  • the default payment application and the user-specified payment application are different payment applications, the first priority is higher than the second priority, and the first terminal default payment application and user finger Payment application priority higher than the priority of other payment application on the first terminal.
  • the first information of the payment application includes a usage record of the payment application
  • the processing module 803 the N AIDs according to the first information of the M payment applications.
  • the processing module 803 When configured in the queue, specifically configured to configure all AIDs of the payment application used in the last NFC payment to the first location of the queue and set the first priority; or, according to the use of the M payment applications The frequency is set, and the entire AID of each payment application is sequentially configured into the queue and the priority is set, wherein the first priority is higher than the priority other than the first priority.
  • the processing module 803 is further configured to activate the at least one payment application when at least one of the M payment applications is in a non-operation state.
  • the M terminal when the M terminal is installed on the first terminal, the M is greater than 1, the receiving module of the first terminal receives the first instruction of the short-range payment environment sent by the second terminal, and the sending module of the first terminal sends the second terminal to the second terminal.
  • the M payment applications include host card emulation HCE applications or the M payment applications include HCE applications and card applications.
  • the response message for answering the first instruction includes the AIDs of the plurality of HCE applications and the card application, thereby enabling the second terminal to obtain the AIDs of the M payment applications.
  • the second terminal selects one of the M payment applications to perform the transaction, and the second terminal may select a specific AID without manually modifying the default payment application setting.
  • the priority may be preferentially selected by the AID priority order.
  • the AID effectively improves the user experience.
  • the payment application installed on the first terminal is not limited to the card application in the SE, it may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
  • the first terminal 800 does not include the processing module 803, and may be determined according to actual conditions, and is not specifically limited herein.
  • the processing module 803 can be a software module, can be executed in a processor of the computer system, or can be a specific integrated circuit, and obtain corresponding technical effects, which are not specifically limited herein.
  • FIG. 8 illustrates the specific structure of the first terminal from the perspective of the function module.
  • the specific structure of the first terminal is described from the hardware point of view with reference to the embodiment of FIG. 9 : a first terminal 900, Included: one or more processors 901, a memory 902, a bus system 903, and a transceiver 904, the one or more processors 901, the memory 902, and the transceiver 903 being connected by the bus system 904;
  • One or more programs 905 are stored in the memory 902, and the one or more programs 905 include instructions that, when executed by the first terminal, cause the first terminal to perform as shown in FIG. Methods.
  • the function of the first terminal in the present invention may be specifically implemented according to the method in the embodiment shown in FIG. 5, and the specific implementation process may refer to the related description in the method embodiment shown in FIG. It is to be noted that the first terminal performs the method of the embodiment shown in FIG. 5 to obtain the technical effects that can be obtained by the method embodiment.
  • the M payment application is installed on the first, the M is greater than 1, the first terminal receives the first command sent by the second terminal, and the first terminal sends a response message to the second terminal that responds to the first command, where the response
  • the message includes N AIDs, which are all AIDs included in the M payment applications, each payment application has at least one AID, the M payment applications include a host card emulation HCE application or the M payment applications include an HCE application And card applications. Therefore, it is not limited to only the default payment application to respond to the first instruction, and the response message for answering the first instruction includes multiple ACEs of the HCE application and the card application, that is, providing the POS machine with multiple AIDs belonging to different HCE applications.
  • the second terminal can obtain the AIDs of the M payment applications, and then select one of the M payment applications to perform the transaction, without manually modifying the default payment application settings.
  • the second terminal can select a specific AID.
  • the specific AID can be preferentially selected through the priority order of the AID, thereby reducing user operations and effectively improving the user experience.
  • the payment application installed on the first terminal is not limited to the card application in the SE, it may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of cells is only a logical function division.
  • multiple units or components may be combined or integrated. Go to another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • An integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, can be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present invention.
  • the foregoing storage medium includes: a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. The medium of the code.
  • the present invention provides a detailed description of the near field communication payment method and the terminal provided by the present invention.
  • the principles and embodiments of the present invention are described herein. The description of the above embodiments is only for helping to understand the present invention.
  • the content of the present specification should not be construed as the present invention. limits.

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Engineering & Computer Science (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Finance (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

Disclosed are a near field communication method and terminal, used for solving the defect existing in the prior art that only a default HCE application can respond to a PPSE selection instruction. The method is applied to a first terminal supporting near field communication (NFC), wherein the first terminal comprises M payment applications, and M is greater than 1. The method comprises: the first terminal receiving a first instruction sent by a second terminal; and the first terminal sending to the second terminal a response message for responding to the first instruction, wherein the response message comprises N application identifiers (AIDs), the N AIDs are all the AIDs comprised by the M payment applications, each of the payment applications comprises at least one AID, and the M payment applications comprise a host card emulation (HCE) application or the M payment applications comprise the HCE application and a card application.

Description

一种近场通信支付方法及终端Near field communication payment method and terminal 技术领域Technical field
本发明实施例涉及移动支付领域,具体涉及一种近场通信支付方法及终端。The embodiments of the present invention relate to the field of mobile payment, and in particular, to a near field communication payment method and a terminal.
背景技术Background technique
目前,近场通信(英文全称:Near Field Communication,缩写:NFC)支付是一种时代潮流。例如:通过卡模拟技术使得安装在NFC终端上的支付应用与读卡器或者销售终端(英文全称:point of sale,缩写:POS)机进行通信并完成支付交易,该支付应用可以是卡应用或者主机卡模拟(英文全称:Host Card Emulation或Host-based Card Emulation,缩写:HCE)应用。At present, near field communication (English name: Near Field Communication, abbreviation: NFC) payment is a trend of the times. For example, the card application technology enables the payment application installed on the NFC terminal to communicate with the card reader or the sales terminal (English name: point of sale, abbreviation: POS) to complete the payment transaction, and the payment application can be a card application or Host card emulation (English full name: Host Card Emulation or Host-based Card Emulation, abbreviation: HCE) application.
如图1所示,传统的卡模拟技术是通过NFC终端中的安全单元(英文全称:Secure Element,缩写:SE)来实现的,与POS机通信的卡应用安装和运行在SE中,在NFC终端靠近NFC读卡器(即非接触POS机系统中的受理终端)时,SE中的卡应用可以通过NFC控制器与NFC读卡器进行交互。而图2所示的HCE应用软件框架开辟了一条新的通信通道,使得运行在NFC终端的主机CPU上的HCE应用也可以通过NFC控制器与NFC读卡器进行交互。As shown in Figure 1, the traditional card simulation technology is implemented by the security unit (English name: Secure Element, SE: N) in the NFC terminal. The card application that communicates with the POS machine is installed and operated in the SE, in the NFC. When the terminal is close to the NFC card reader (ie, the receiving terminal in the contactless POS system), the card application in the SE can interact with the NFC card reader through the NFC controller. The HCE application software framework shown in Figure 2 opens up a new communication channel, enabling HCE applications running on the host CPU of the NFC terminal to interact with the NFC reader through the NFC controller.
目前,NFC终端中可以安装多个HCE应用,每个HCE应用中包括多个应用标识符(英文全称:Application Identifier,缩写:AID),当NFC终端与POS机进行通信时,NFC终端中只有被设为默认的一个HCE应用会应答POS机发送的近距离支付环境(英文全称:Proximity Payment System Environment,缩写:PPSE)选择指令(SELECT PPSE),即只有该HCE应用中包括的AID被发送给了POS机。由此,POS机只能识别该HCE应用包括的AID,也就是说只有该HCE应用对应的银行卡才有可能被用来支付;当用户希望使用其它HCE应用对应的银行卡来支付时,只能手动的将希望使用的HCE应用切换为默认HCE应用,才能完成支付交易,给用户带来不便。Currently, multiple HCE applications can be installed in an NFC terminal. Each HCE application includes multiple application identifiers (English full name: Application Identifier, AID). When the NFC terminal communicates with the POS device, only the NFC terminal is The default HCE application will respond to the POS payment environment (English name: Proximity Payment System Environment, PPSE) selection command (SELECT PPSE), that is, only the AID included in the HCE application is sent to POS machine. Therefore, the POS machine can only identify the AID included in the HCE application, that is, only the bank card corresponding to the HCE application may be used for payment; when the user wishes to use the corresponding bank card of the other HCE application to pay, The HCE application that you want to use can be manually switched to the default HCE application to complete the payment transaction, which is inconvenient for the user.
发明内容Summary of the invention
本发明的目的在于提供一种近场通信支付方法及终端,用于解决现有技术 中只有默认HCE应用才能应答PPSE选择指令所存在的缺陷性。An object of the present invention is to provide a near field communication payment method and terminal, which are used to solve the prior art. Only the default HCE application can respond to the deficiencies of the PPSE selection instruction.
第一方面提供一种NFC支付方法,该方法应用于支持NFC的第一终端,该第一终端包括M个支付应用,M大于1,该方法包括:第一终端接收第二终端发送的第一指令;该第一终端向该第二终端发送用于应答该第一指令的应答消息;其中,该应答消息包括N个应用标识符AID,该N个AID为所述M个支付应用包括的全部AID,每个支付应用包括至少一个AID,其中,该M个支付应用包括主机卡模拟HCE应用或者所述M个支付应用包括HCE应用和卡应用。The first aspect provides an NFC payment method, where the method is applied to a first terminal that supports NFC, where the first terminal includes M payment applications, and M is greater than 1, the method includes: receiving, by the first terminal, the first The first terminal sends a response message for answering the first instruction to the second terminal, where the response message includes N application identifiers AID, and the N AIDs are all included in the M payment applications. The AID, each payment application includes at least one AID, wherein the M payment applications include a host card emulation HCE application or the M payment applications include an HCE application and a card application.
在实际应用中,一些第一终端中只包括HCE应用,而一些第一终端中包括HCE应用和卡应用,其中,HCE应用可以运行在可信执行环境(英文全称:trusted execution environment,,缩写:TEE)中也可以运行在富执行环境(英文全称:rich execution environment,缩写:REE)中,而卡应用一般运行在第一终端的SE中;一般而言,SE中的一个卡应用只有唯一的一个AID,而一个HCE应用中可以有一个AID或者多个AID,其中,HCE应用是一种运行在主机CPU(Host CPU)上的、可以利用第一终端的NFC接口与读卡装置或者POS机进行非接触交易的特殊应用。HCE应用安装和运行在第一终端的操作系统(英文全称:Operating System,缩写:OS)中,例如:安卓、windows 10for mobile或blackberry等,OS使用HCE应用的应用标识(App ID)对它进行管理,该APP ID依据不同的操作系统可能有所差异。一个HCE应用可以模拟一个或多个卡应用(Applet),每个卡应用实现一个业务逻辑,每个卡应用具有一个独立的AID,不仅HCE应用,安装在SE中以及实体卡片中的卡应用都具有AID。HCE应用需要向第一终端的OS声明(即在NFC应用框架中注册)它能够模拟的卡应用的AID,声明AID的目的是便于OS中的NFC应用框架记录每个HCE应用能够处理的AID,以实现NFC应用框架中的路由,即NFC应用框架将收到的应用协议数据单元(英文全称:application protocol data unit,缩写:APDU)转发给HCE应用。In practical applications, some of the first terminals include only HCE applications, and some of the first terminals include HCE applications and card applications, wherein the HCE application can run in a trusted execution environment (English name: trusted execution environment, abbreviation: TEE) can also run in the rich execution environment (English full name: rich execution environment, abbreviation: REE), and the card application generally runs in the SE of the first terminal; in general, a card application in the SE has only one An AID, and an HCE application can have an AID or multiple AIDs. The HCE application is an NFC interface and a card reader or POS machine that can run on the host CPU and can utilize the first terminal. Special applications for contactless transactions. The HCE application is installed and running in the operating system of the first terminal (English name: Operating System, abbreviation: OS), for example: Android, windows 10 for mobile or blackberry, etc., the OS uses the application identifier (App ID) of the HCE application to perform it. Management, the APP ID may vary depending on the operating system. An HCE application can simulate one or more card applications (Applets), each card application implements a business logic, each card application has a separate AID, not only the HCE application, the card application installed in the SE and the physical card Has an AID. The HCE application needs to declare to the OS of the first terminal (ie, register in the NFC application framework) the AID of the card application that it can simulate. The purpose of declaring the AID is to facilitate the NFC application framework in the OS to record the AID that each HCE application can process. To implement routing in the NFC application framework, the NFC application framework forwards the received application protocol data unit (English protocol: application protocol data unit, abbreviation: APDU) to the HCE application.
在一些可能的实现方式中,该第一终端向该第二终端发送用于应答该第一指令的应答消息之前,该第一终端获取该N个AID和该M个支付应用的第一信息;该第一终端根据该M个支付应用的第一信息将该N个AID配置到队列中,该队列用于生成该应答消息;该第一终端使用该队列生成该应答消息。 In some possible implementations, before the first terminal sends a response message for answering the first instruction to the second terminal, the first terminal acquires the N AIDs and the first information of the M payment applications; The first terminal configures the N AIDs into a queue according to the first information of the M payment applications, and the queue is used to generate the response message; the first terminal uses the queue to generate the response message.
可见,第一终端上安装M个支付应用,M大于1,第一终端接收第二终端发送的第一指令后,第一终端获取该N个AID和该M个支付应用的第一信息,并根据该M个支付应用的第一信息将N个AID配置到队列中,该队列用于生成应答第一指令的应答消息。进一步,第一终端向第二终端发送应答该第一指令的应答消息,其中,该应答消息包括N个AID,该N个AID为该M个支付应用包括的全部AID,每个支付应用有至少一个AID,该M个支付应用包括主机卡模拟HCE应用或者该M个支付应用包括HCE应用和卡应用。因此,不限于只有默认的支付应用才能应答第一指令(即:现有技术中,只提供默认的一个HCE应用的AID去应答第一指令,当需要换成另一个HCE应用的AID去应答第一指令时,需要手动修改默认的HCE应用),在本发明中,用于应答第一指令的应答消息包括多个HCE应用和卡应用的AID,进而第二终端可以获得多个HCE应用和卡应用的AID,即:给第二终端提供多个归属于不同HCE应用的AID或者多个归属于不同HCE应用和不同卡应用的AID来应答第一指令,无需手动修改默认HCE应用设置,即可实现第二终端选中特定的AID应答指令,减少了用户操作,有效提高用户体验。另外,由于第一终端上安装的支付应用不限于SE中的卡应用,还可以是HCE应用,因此,不会存在不支持物理SE的第一终端就无法完成读卡的问题。It can be seen that the M terminals are installed on the first terminal, and the M is greater than 1. After the first terminal receives the first command sent by the second terminal, the first terminal acquires the N AIDs and the first information of the M payment applications, and The N AIDs are configured into a queue according to the first information of the M payment applications, and the queue is used to generate a response message responsive to the first instruction. Further, the first terminal sends a response message to the second terminal in response to the first instruction, where the response message includes N AIDs, where the N AIDs are all AIDs included in the M payment applications, and each payment application has at least An AID, the M payment applications include a host card emulation HCE application or the M payment applications include an HCE application and a card application. Therefore, it is not limited to only the default payment application to respond to the first instruction (ie, in the prior art, only the default AID of the HCE application is provided to answer the first instruction, and when the AID of another HCE application needs to be replaced, the response is required. In an instruction, the default HCE application needs to be manually modified. In the present invention, the response message for answering the first instruction includes multiple HCE applications and the AID of the card application, and the second terminal can obtain multiple HCE applications and cards. The AID of the application, that is, providing the second terminal with multiple AIDs belonging to different HCE applications or multiple AIDs belonging to different HCE applications and different card applications to answer the first instruction, without manually modifying the default HCE application settings, The second terminal is selected to select a specific AID response command, which reduces user operations and effectively improves the user experience. In addition, since the payment application installed on the first terminal is not limited to the card application in the SE, it may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
在一些可能的实现方式中,该第一终端获取该N个AID之前,该第一终端根据支付应用白名单、支付应用黑名单和支付应用的第一信息中的至少一种,从该第一终端上的全部支付应用中确定该M个支付应用。In some possible implementations, before the first terminal acquires the N AIDs, the first terminal is configured according to at least one of a payment application whitelist, a payment application blacklist, and a first information of a payment application. The M payment applications are determined in all payment applications on the terminal.
在一些可能的实现方式中,该第一终端根据支付应用白名单、支付应用黑名单和支付应用的第一信息中的至少一种,从该第一终端上的全部支付应用中确定该M个支付应用包括:将该第一终端上的支付应用白名单中的全部支付应用确定为该M个支付应用;或者,将该第一终端上的除该支付应用黑名单以外的其他支付应用确定为该M个支付应用;或者,该支付应用的第一信息为支付应用的当前运行状态,且该支付应用的当前运行状态包括前台运行和后台运行时,将该前台运行和该后台运行的全部支付应用确定为该M个支付应用;或者,该支付应用的第一信息为支付应用的运行环境,且该支付应用的运行环境包括第一运行环境和第二运行环境时,将该第一运行环境和该第二运行环境中的全 部支付应用确定为该M个支付应用或者将该第一运行环境中的全部支付应用确定为该M个支付应用,其中,该第一运行环境中运行HCE应用,该第二运行环境中运行卡应用;或者,该支付应用的第一信息为支付应用的优先级,将该第一终端默认的支付应用和用户指定的全部支付应用确定为该M个支付应用,其中,该第一终端默认的支付应用和用户指定的支付应用的优先级高于该第一终端上的其他支付应用的优先级;或者,该支付应用的第一信息为支付应用的使用记录,将该使用记录中的全部支付应用确定为该M个支付应用。In some possible implementations, the first terminal determines, according to at least one of a payment application whitelist, a payment application blacklist, and a first information of a payment application, the M notifications from all payment applications on the first terminal. The payment application includes: determining, by the payment application, all the payment applications in the whitelist of the payment application as the M payment applications; or determining, on the first terminal, other payment applications other than the payment application blacklist as The M payment application; or the first information of the payment application is the current running state of the payment application, and the current running state of the payment application includes the foreground running and the background running, all the payment of the foreground running and the background running The application is determined to be the M payment application; or the first information of the payment application is an operating environment of the payment application, and the operating environment of the payment application includes the first operating environment and the second operating environment, and the first operating environment is And all in the second operating environment Determining, by the payment application, the M payment applications or determining all payment applications in the first operating environment as the M payment applications, wherein the first operating environment runs an HCE application, and the second operating environment runs the card The first information of the payment application is the priority of the payment application, and the default payment application of the first terminal and all payment applications specified by the user are determined as the M payment applications, wherein the first terminal defaults The payment application and the user-specified payment application have a higher priority than the other payment applications on the first terminal; or the first information of the payment application is a usage record of the payment application, and all the payment in the usage record is The application is determined to be the M payment applications.
可见,第一终端根据支付应用白名单、支付应用黑名单和支付应用的第一信息中的其中一种或者任意组合,从该第一终端上的全部支付应用中确定该M个支付应用。It can be seen that the first terminal determines the M payment applications from all the payment applications on the first terminal according to one or any combination of the payment application white list, the payment application blacklist, and the payment application first information.
在一些可能的实现方式中,该第一终端向该第二终端发送用于应答该第一指令的应答消息之前,该第一终端配置PPSE路由,其中,该PPSE路由包括近场通信NFC应用框架中的路由。在该NFC应用框架的路由中,配置第一程序和该PPSE AID的对应关系,该第一程序用于使用该应答消息应答该第一指令。可见,通过配置NFC应用框架中的路由,实现将第一指令路由到第一程序,从而确保应答消息应答PPSE选择指令。In some possible implementation manners, before the first terminal sends a response message for answering the first instruction to the second terminal, the first terminal configures a PPSE route, where the PPSE route includes a near field communication NFC application framework. In the route. In the routing of the NFC application framework, a correspondence between the first program and the PPSE AID is configured, and the first program is configured to respond to the first instruction by using the response message. It can be seen that by configuring the route in the NFC application framework, the first instruction is routed to the first program, thereby ensuring that the response message answers the PPSE selection instruction.
在一些可能的实现方式中,该第一终端向该第二终端发送用于应答该第一指令的应答消息之前,该第一终端配置PPSE路由,其中,该PPSE路由包括近场通信控制器(英文全称:near field communication controller,缩写:NFCC)路由和NFC应用框架中的路由。可见,通过配置NFCC路由和NFC应用框架中的路由,实现将第一指令路由到第一程序,从而确保应答消息应答PPSE选择指令。In some possible implementation manners, before the first terminal sends a response message for answering the first instruction to the second terminal, the first terminal configures a PPSE route, where the PPSE route includes a near field communication controller ( English full name: near field communication controller, abbreviation: NFCC) routing and routing in the NFC application framework. It can be seen that by configuring the routing in the NFCC routing and the NFC application framework, the first instruction is routed to the first program, thereby ensuring that the response message answers the PPSE selection instruction.
其中,该第一终端配置PPSE路由包括:当该NFCC路由中不包含第一路由项时,在该NFCC路由中配置第二路由项;或者,当该NFCC路由中包含第三路由项时,在该NFCC路由中清除该第三路由项并配置该第二路由项,其中,该第一路由项为包含PPSE AID的路由项,该第二路由项为包含PPSE AID且路由目标是主机NFC执行环境(英文全称:Device Host NFC Execution Environment,缩写:DH NFCEE)的路由项,该第三路由项为包含PPSE AID但路由目标不是主机NFC执行环境的路由项;或者,当该NFCC路由中不包含第 四路由项时,在该NFCC路由中配置该第四路由项;当该NFCC路由中包含该第三路由项且不包含第四路由项时,在该NFCC路由中清除该第三路由项并配置该第四路由项,其中,该第四路由项是用于将AID选择指令路由到主机NFC执行环境的路由项。当终端中只包含HCE应用,不包含卡应用时,上述配置NFCC路由流程可简化为在NFCC中配置协议路由,将所有ISO-DEP协议数据路由到主机CPU(即主机NFC执行环境,DH NFCEE),从而实现将AID选择指令(其中,该AID选择指令包含PPSE选择指令)路由到主机NFC执行环境即主机CPU;当第一终端中包含HCE应用和卡应用时,同样可以采用上述设置NFCC路由的方式,在NFCC路由中配置第二路由项或第四路由项并清除第三路由项。在该NFC应用框架的路由中,配置第一程序和该PPSE AID的对应关系,该第一程序用于使用该应答消息应答该PPSE选择指令。The first terminal configuring the PPSE route includes: when the NFCC route does not include the first routing entry, configuring the second routing entry in the NFCC route; or, when the NFCC route includes the third routing entry, Clearing the third routing entry in the NFCC route and configuring the second routing entry, where the first routing entry is a routing entry including a PPSE AID, the second routing entry is a PPSE AID, and the routing target is a host NFC execution environment. (English full name: Device Host NFC Execution Environment, abbreviation: DH NFCEE) routing item, the third routing item is a routing item containing a PPSE AID but the routing destination is not the host NFC execution environment; or, when the NFCC routing does not include the first The fourth routing entry is configured in the NFCC route. When the NFCC route includes the third routing entry and does not include the fourth routing entry, the third routing entry is cleared and configured in the NFCC routing. The fourth routing entry, wherein the fourth routing entry is a routing entry for routing the AID selection instruction to the host NFC execution environment. When the terminal only contains the HCE application and does not include the card application, the above configuration of the NFCC routing process can be simplified to configure the protocol routing in the NFCC, and route all ISO-DEP protocol data to the host CPU (ie, the host NFC execution environment, DH NFCEE). Therefore, the AID selection instruction (where the AID selection instruction includes the PPSE selection instruction) is routed to the host NFC execution environment, that is, the host CPU; when the first terminal includes the HCE application and the card application, the above-mentioned setting of the NFCC route may also be adopted. The second routing entry or the fourth routing entry is configured in the NFCC route and the third routing entry is cleared. In the routing of the NFC application framework, a correspondence between the first program and the PPSE AID is configured, and the first program is configured to respond to the PPSE selection instruction by using the response message.
可见,在该NFCC路由中配置第二路由项或第四路由项,即,该第二路由项即包含PPSE AID且路由目标是主机NFC执行环境的路由项,该第四路由项是用于将AID选择指令路由到主机NFC运行环境的路由项,进一步,在该NFC应用框架中,配置第一程序(即:PPSE配置程序)与PPSE AID之间的对应关系,即:配置PPSE AID对应于第一程序,该第一程序使用该队列生成应答所述PPSE选择指令的应答消息。在NFC应用框架中,保留唯一一条包含PPSE AID的路由信息,屏蔽所有其他程序声明的处理PPSE AID的信息,将PPSE选择指令只路由给第一终端上的PPSE配置程序,PPSE配置程序为使用该队列生成应答PPSE选择指令的应答消息的程序。NFC应用框架中的路由格式可以由OS提供或者HCE应用框架提供。其中,该队列是一种有序的用于保存支付应用的AID的数据结构,队列有头部和尾部,遍历队列时,先获得队列头部的节点,后获得队列尾部的节点。可以在队列尾部插入队列节点,可以在队列头部删除队列节点。在另一种队列实现方式中,可以在队列头部插入和删除节点,也可以在队列尾部插入和删除节点。每个节点除保存AID之外还可保存支付应用的其他相关信息。It can be seen that the second routing entry or the fourth routing entry is configured in the NFCC route, that is, the second routing entry is a routing entry that includes the PPSE AID and the routing destination is the host NFC execution environment, and the fourth routing entry is used to The AID selection command is routed to the routing entry of the host NFC operating environment. Further, in the NFC application framework, the correspondence between the first program (ie, the PPSE configuration program) and the PPSE AID is configured, that is, the configuration PPSE AID corresponds to the first A program that uses the queue to generate a response message responsive to the PPSE selection instruction. In the NFC application framework, a unique routing information including the PPSE AID is reserved, and the PPSE AID information declared by all other programs is blocked, and the PPSE selection instruction is only routed to the PPSE configuration program on the first terminal, and the PPSE configuration program uses the PPSE configuration program. The queue generates a program that responds to the response message of the PPSE selection instruction. The routing format in the NFC application framework can be provided by the OS or by the HCE application framework. The queue is an ordered data structure for storing the AID of the payment application. The queue has a header and a tail. When the queue is traversed, the node at the head of the queue is obtained first, and then the node at the end of the queue is obtained. A queue node can be inserted at the end of the queue, and the queue node can be deleted at the head of the queue. In another queue implementation, nodes can be inserted and deleted at the head of the queue, or nodes can be inserted and deleted at the end of the queue. Each node can save other relevant information of the payment application in addition to the AID.
在一些可能的实现方式中,该支付应用的第一信息包括以下至少一种:支付应用的当前运行状态、支付应用的运行环境、支付应用的优先级以及支付应用的使用记录。可见,该第一信息可以为其中一种或者任意多种组合,此处不 做具体限定。In some possible implementation manners, the first information of the payment application includes at least one of a current running state of the payment application, an operating environment of the payment application, a priority of the payment application, and a usage record of the payment application. It can be seen that the first information can be one of or any combination of multiple, not here. Make specific limits.
在一些可能的实现方式中,该支付应用的第一信息为支付应用的当前运行状态,该第一终端根据该M个支付应用的第一信息将该N个AID配置到队列中包括:当该M个支付应用的当前运行状态包括前台运行和后台运行时,将前台运行的支付应用的全部AID配置到该队列的第一位置并设置第一优先级,将后台运行的支付应用的全部AID配置到该队列的第二位置并设置第二优先级,其中,该第一优先级高于该第二优先级。In some possible implementations, the first information of the payment application is a current running state of the payment application, and the first terminal configuring the N AIDs into the queue according to the first information of the M payment applications includes: The current running status of the M payment applications includes the foreground running and the background running, configuring all the AIDs of the payment application running in the foreground to the first position of the queue and setting the first priority, and configuring all AIDs of the payment application running in the background. Go to the second location of the queue and set a second priority, wherein the first priority is higher than the second priority.
在实际应用中,将前台运行的支付应用的全部AID配置到该队列的头部并设置高优先级,将后台运行的支付应用的全部AID配置到该队列的尾部并设置低优先级,在实际应用中,第一终端将多个HCE应用和卡应用的AID配置到队列中并设置优先级,进而生成第一指令的应答消息,使得第二终端可以获得多个HCE应用和卡应用的AID,无需手动修改默认HCE应用设置,即可实现第二终端选中特定的AID,当然,还可以通过AID的优先级顺序优先选择特定的AID,减少了用户操作,有效提高用户体验。另外,第一终端上安装的支付应用不限于SE中的卡应用,还可以是HCE应用,因此,不会存在不支持物理SE的第一终端就无法完成读卡的问题。In the actual application, all the AIDs of the payment application running in the foreground are configured to the head of the queue and set a high priority, and all AIDs of the payment application running in the background are configured to the end of the queue and set with a low priority. In the application, the first terminal configures the AIDs of the multiple HCE applications and the card application into the queue and sets the priority, thereby generating a response message of the first instruction, so that the second terminal can obtain the AIDs of the multiple HCE applications and the card application. The second terminal can select a specific AID without manually modifying the default HCE application settings. Of course, the specific AID can be preferentially selected by the priority order of the AID, thereby reducing user operations and effectively improving the user experience. In addition, the payment application installed on the first terminal is not limited to the card application in the SE, and may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
在一些可能的实现方式中,该支付应用的第一信息为支付应用的运行环境,该支付应用的运行环境包括第一运行环境和第二运行环境,该第一运行环境为富执行环境REE或可信执行环境TEE,运行HCE应用;该第二运行环境为安全单元SE,运行卡应用,该第一终端根据该M个支付应用的第一信息将该N个AID配置到队列中包括:当该M个支付应用包括HCE应用和卡应用时,将该HCE应用的全部AID配置到该队列的第一位置并设置第一优先级,将该卡应用的全部AID配置到该队列的第二位置并设置第二优先级;或者,将该卡应用的全部AID配置到该队列的第一位置并设置第一优先级,将该HCE应用的的全部AID配置到该队列的第二位置并设置第二优先级,其中,该第一优先级高于该第二优先级。In some possible implementations, the first information of the payment application is an operating environment of the payment application, and the operating environment of the payment application includes a first operating environment and a second operating environment, where the first operating environment is a rich execution environment REE or The trusted execution environment TEE runs the HCE application; the second operating environment is the security unit SE, which runs the card application, and the first terminal configures the N AIDs into the queue according to the first information of the M payment applications. When the M payment application includes the HCE application and the card application, all the AIDs of the HCE application are configured to the first position of the queue and the first priority is set, and all the AIDs of the card application are configured to the second position of the queue. And setting a second priority; or configuring all the AIDs of the card application to the first location of the queue and setting the first priority, configuring all AIDs of the HCE application to the second location of the queue and setting the first Two priorities, wherein the first priority is higher than the second priority.
在实际应用中,根据实际需求,第一终端将HCE应用和卡应用的全部AID配置到队列的对应位置中并设置对应的优先级,进而生成第一指令的应答消息,使得第二终端可以同时获得多个HCE应用和卡应用的AID,无需手动修改 默认HCE应用设置,即可实现第二终端选中特定的AID,当然,还可以通过AID的优先级顺序优先选择特定的AID,减少了用户操作,有效提高用户体验。另外,第一终端上安装的支付应用不限于SE中的卡应用,还可以是HCE应用,因此,不会存在不支持物理SE的第一终端就无法完成读卡的问题。In an actual application, the first terminal configures all the AIDs of the HCE application and the card application to the corresponding positions of the queue and sets corresponding priorities according to the actual requirements, thereby generating a response message of the first instruction, so that the second terminal can simultaneously Get multiple AIDs for HCE applications and card applications without manual modification By default, the HCE application settings can be used to select a specific AID for the second terminal. Of course, the specific AID can be preferentially selected through the priority order of the AID, thereby reducing user operations and effectively improving the user experience. In addition, the payment application installed on the first terminal is not limited to the card application in the SE, and may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
在一些可能的实现方式中,该支付应用的第一信息为支付应用的优先级,该第一终端根据该M个支付应用的第一信息将该N个AID配置到队列中包括:当该M个支付应用包括该第一终端默认的支付应用和用户指定的支付应用时,将该用户指定的支付应用的全部AID配置到该队列的第一位置并设置第一优先级,将该第一终端默认的支付应用的全部AID配置到该队列的第二位置并设置第二优先级;或者,将该第一终端默认的支付应用的全部AID配置到该队列的第一位置并设置第一优先级,将该用户指定的支付应用的的全部AID配置到该队列的第二位置并设置第二优先级,其中,该第一终端默认的支付应用和该用户指定的支付应用为不同的支付应用,该第一优先级高于该第二优先级,该第一终端默认的支付应用和用户指定的支付应用的优先级高于该第一终端上的其他支付应用的优先级。In some possible implementations, the first information of the payment application is a priority of the payment application, and the first terminal configuring the N AIDs into the queue according to the first information of the M payment applications includes: when the M When the payment application includes the default payment application of the first terminal and the payment application specified by the user, all the AIDs of the payment application specified by the user are configured to the first position of the queue and the first priority is set, and the first terminal is set. The default AID of the default payment application is configured to the second location of the queue and the second priority is set; or, the entire AID of the default payment application of the first terminal is configured to the first location of the queue and the first priority is set. Configuring the entire AID of the user-specified payment application to the second location of the queue and setting a second priority, where the default payment application of the first terminal and the payment application specified by the user are different payment applications. The first priority is higher than the second priority, and the default payment application of the first terminal and the user-specified payment application have higher priority than other payment on the first terminal. The priority of the application.
可见,根据实际需求,将终端默认的支付应用和用户指定的支付应用的全部AID配置到队列的对应位置中并设置对应的优先级,进而生成第一指令的应答消息使得第二终端可以同时获得多个HCE应用和卡应用的AID,无需手动修改默认HCE应用设置,即可实现第二终端选中特定的AID,当然,还可以通过AID的优先级顺序优先选择特定的AID,减少了用户操作,有效提高用户体验。另外,第一终端上安装的支付应用不限于SE中的卡应用,还可以是HCE应用,因此,不会存在不支持物理SE的第一终端就无法完成读卡的问题。It can be seen that, according to actual requirements, all the AIDs of the default payment application of the terminal and the user-specified payment application are configured into the corresponding positions of the queue and the corresponding priorities are set, thereby generating a response message of the first instruction so that the second terminal can simultaneously obtain The AID of multiple HCE applications and card applications can be used to select a specific AID without manually modifying the default HCE application settings. Of course, the AID priority order can be used to preferentially select a specific AID, which reduces user operations. Effectively improve the user experience. In addition, the payment application installed on the first terminal is not limited to the card application in the SE, and may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
在一些可能的实现方式中,该支付应用的第一信息包括支付应用的使用记录,该第一终端根据该M个支付应用的第一信息将该N个AID配置到队列中包括:In some possible implementations, the first information of the payment application includes a usage record of the payment application, and the first terminal configuring the N AIDs into the queue according to the first information of the M payment applications includes:
将最近一次进行NFC支付时使用的支付应用的全部AID配置到该队列的第一位置并设置第一优先级;或者,依照该M个支付应用的使用频率的高低,依次将每个支付应用的全部AID配置到该队列中并设置优先级,其中,该第一优先级高于除该第一优先级以外的其他优先级。 Configuring all the AIDs of the payment application used in the last NFC payment to the first position of the queue and setting the first priority; or, according to the frequency of use of the M payment applications, sequentially applying the payment application All AIDs are configured into the queue and prioritized, wherein the first priority is higher than other priorities than the first priority.
在实际应用中,第一终端根据支付应用的使用频率高低设置优先级高低,并根据设置的优先级顺序将支付应用的AID配置到用于应答第一指令的应答消息中,使得第二终端可以同时获得多个HCE应用和卡应用的AID,无需手动修改默认HCE应用设置,即可实现第二终端选中特定的AID,当然,还可以通过AID的优先级顺序优先选择特定的AID,减少了用户操作,有效提高用户体验。另外,第一终端上安装的支付应用不限于SE中的卡应用,还可以是HCE应用,因此,不会存在不支持物理SE的第一终端就无法完成读卡的问题。In a practical application, the first terminal sets a priority according to the frequency of use of the payment application, and configures the AID of the payment application into a response message for answering the first instruction according to the set priority order, so that the second terminal can Obtaining the AIDs of multiple HCE applications and card applications at the same time, the second terminal can select a specific AID without manually modifying the default HCE application settings. Of course, the AID priority order can be used to preferentially select a specific AID, thereby reducing the number of users. Operation to effectively improve the user experience. In addition, the payment application installed on the first terminal is not limited to the card application in the SE, and may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
在一些可能的实现方式中,在第一终端配置PPSE路由之后,在第一终端界面上生成PPSE控制界面,该PPSE控制界面用于用户手动修改支付应用的优先级顺序,从而有效提高用户体验。In some possible implementations, after the first terminal configures the PPSE route, the PPSE control interface is generated on the first terminal interface, where the PPSE control interface is used for manually modifying the priority order of the payment application, thereby effectively improving the user experience.
在一些可能的实现方式中,当所述M个支付应用中的至少一个支付应用处于非运行状态时,激活该至少一个支付应用。In some possible implementations, when at least one of the M payment applications is in a non-operational state, the at least one payment application is activated.
在实际应用中,当该M个支付应用当前均处于非运行状态时,激活该M个支付应用中的部分或者全部支付应用;并将该M个支付应用中被激活的部分或者全部支付应用的全部AID配置到该队列中,使得该队列根据部分或者全部支付应用的全部AID生成应答第一指令的应答消息。In an actual application, when the M payment applications are currently in a non-operation state, some or all of the payment applications are activated, and some or all of the M payment applications are activated. All AIDs are configured into the queue such that the queue generates a reply message acknowledging the first instruction based on all AIDs of some or all of the payment applications.
可见,当该M个支付应用均处于非运行状态时,激活该M个支付应用的部分或者全部支付应用,其中,激活该部分或者全部支付应用的目的在于让该部分或者全部支付应用处于运行状态,即:启动该部分或者全部支付应用的应用程序,并执行相关的流程。从而避免了M个支付应用均未处于运行状态则无法配置应答第一指令的应答消息,进而无法完成支付应用与读卡器或者POS机之间的交互流程。It can be seen that when the M payment applications are in a non-operational state, part or all of the payment applications of the M payment applications are activated, wherein the part or all of the payment applications are activated to make the part or all payment applications run. That is, start the application that partially or completely pays the application, and execute the related process. Therefore, it is avoided that the M payment applications are not in the running state, and the response message acknowledging the first instruction cannot be configured, and the interaction process between the payment application and the card reader or the POS machine cannot be completed.
在一些可能的实现方式中,获取该第一终端上的N个AID包括:通过该第一终端上的支付应用管理模块获取该第一终端上的N个AID;或者,通过解析该M个支付应用保存在该第一终端中的资源文件获取该N个AID。In some possible implementations, acquiring the N AIDs on the first terminal includes: acquiring, by the payment application management module on the first terminal, the N AIDs on the first terminal; or by parsing the M The N AIDs are obtained by applying a resource file saved in the first terminal.
在实际应用中,第一终端上的第一程序向NFC应用框架中的支付应用管理模块发送查询消息,查询到每个支付应用在NFC服务中注册的AID(包括静态注册和动态注册的全部AID),或者,第一终端上的第一程序可以通过解析该M个支付应用保存在该第一终端中的资源文件获取该N个AID。 In an actual application, the first program on the first terminal sends a query message to the payment application management module in the NFC application framework, and queries the AID registered by each payment application in the NFC service (including all AIDs of static registration and dynamic registration). Or, the first program on the first terminal may obtain the N AIDs by parsing the resource files saved by the M payment applications in the first terminal.
第二方面提供一种第一终端,该第一终端为支持近场通信NFC的终端,该第一终端包括M个支付应用,M大于1,该第一终端包括:接收模块,用于接收第二终端发送的近距离支付环境第一指令;The second aspect provides a first terminal, where the first terminal is a terminal that supports NFC, the first terminal includes M payment applications, and M is greater than 1. The first terminal includes: a receiving module, configured to receive the first The first instruction of the short-distance payment environment sent by the second terminal;
发送模块,用于向该第二终端发送用于应答该第一指令的应答消息;其中,该应答消息包括N个应用标识符AID,该N个AID为该M个支付应用包括的全部AID,每个支付应用包括至少一个AID,其中,该M个支付应用包括主机卡模拟HCE应用或者该M个支付应用包括HCE应用和卡应用。a sending module, configured to send, to the second terminal, a response message for answering the first instruction, where the response message includes N application identifiers AID, where the N AIDs are all AIDs included in the M payment applications, Each payment application includes at least one AID, wherein the M payment applications include a host card emulation HCE application or the M payment applications include an HCE application and a card application.
可见,第一终端上安装M个支付应用,M大于1,第一终端的接收模块接收第二终端发送的近距离支付环境第一指令;第一终端的发送模块向该第二终端发送用于应答该第一指令的应答消息;其中,该应答消息包括N个应用标识符AID,该N个AID为该M个支付应用中包括的全部AID,每个支付应用包括至少一个AID,其中,该M个支付应用包括主机卡模拟HCE应用或者该M个支付应用包括HCE应用和卡应用。因此,不限于只提供默认的一个支付应用去应答第一指令,在本发明中,用于应答第一指令的应答消息中包括多个HCE应用和卡应用的AID,进而使得使得第二终端可以获得多个HCE应用和卡应用的AID,即:给第二终端提供多个归属于不同HCE应用的AID或者多个归属于不同HCE应用和不同卡应用的AID,无需手动修改默认HCE应用设置,即可实现第二终端选中特定的AID,减少了用户操作,有效提高用户体验。另外,由于第一终端上安装的支付应用不限于SE中的卡应用,还可以是HCE应用,因此,不会存在不支持物理SE的第一终端就无法完成读卡的问题。It can be seen that, when the M terminal is installed on the first terminal, the M is greater than 1, the receiving module of the first terminal receives the first instruction of the short-range payment environment sent by the second terminal, and the sending module of the first terminal sends the second terminal to the second terminal. Responding to the response message of the first instruction; wherein the response message includes N application identifiers AID, the N AIDs are all AIDs included in the M payment applications, and each payment application includes at least one AID, where The M payment applications include host card emulation HCE applications or the M payment applications include HCE applications and card applications. Therefore, it is not limited to providing only one default payment application to answer the first instruction. In the present invention, the response message for answering the first instruction includes multiple ACEs of the HCE application and the card application, thereby enabling the second terminal to Obtaining the AIDs of the multiple HCE applications and the card application, that is, providing the second terminal with multiple AIDs belonging to different HCE applications or multiple AIDs belonging to different HCE applications and different card applications, without manually modifying the default HCE application settings, The second terminal can select a specific AID, which reduces user operations and effectively improves the user experience. In addition, since the payment application installed on the first terminal is not limited to the card application in the SE, it may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
第三方面提供一种第一终端,包括:一个或多个处理器、存储器、总线系统以及收发器,该一个或多个处理器、该存储器和该收发器通过该总线系统连接;其中,该存储器中存储一个或多个程序,该一个或多个程序包括指令,该指令当被该第一终端执行时使该第一终端执行如第一方面或者第一方面的任意一种可能的实现方式中所述的方法。A third aspect provides a first terminal, comprising: one or more processors, a memory, a bus system, and a transceiver, wherein the one or more processors, the memory, and the transceiver are connected by the bus system; wherein Storing one or more programs in the memory, the one or more programs comprising instructions that, when executed by the first terminal, cause the first terminal to perform any one of the possible implementations of the first aspect or the first aspect The method described in the above.
可见,第一终端上安装M个支付应用,M大于1,该第一终端接收第二终端发送的第一指令,第一终端向第二终端发送应答该第一指令的应答消息,其中,该应答消息包括N个AID,该N个AID为该M个支付应用包括的全部AID,每个支付应用有至少一个AID,该M个支付应用包括主机卡模拟HCE应用或者 该M个支付应用包括HCE应用和卡应用。因此,不限于只提供默认的一个支付应用去应答第一指令,在本发明中,用于应答第一指令的应答消息包括多个HCE应用和卡应用的AID,进而使得第二终端可以获得多个HCE应用和卡应用的AID,无需手动修改默认HCE应用设置,即可实现第二终端选中特定的AID,减少了用户操作,有效提高用户体验。另外,由于第一终端上安装的支付应用不限于SE中的卡应用,还可以是HCE应用,因此,不会存在不支持物理SE的第一终端就无法完成读卡的问题。It can be seen that the M terminals are installed on the first terminal, and the M is greater than 1. The first terminal receives the first command sent by the second terminal, and the first terminal sends a response message to the second terminal that responds to the first command, where the The response message includes N AIDs, which are all AIDs included in the M payment applications, each payment application has at least one AID, and the M payment applications include a host card emulation HCE application or The M payment applications include HCE applications and card applications. Therefore, it is not limited to providing only one default payment application to answer the first instruction. In the present invention, the response message for answering the first instruction includes multiple HCE applications and the AID of the card application, thereby enabling the second terminal to obtain more The AID of the HCE application and the card application can realize the specific AID of the second terminal without manually modifying the default HCE application setting, thereby reducing the user operation and effectively improving the user experience. In addition, since the payment application installed on the first terminal is not limited to the card application in the SE, it may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
附图说明DRAWINGS
图1为现有技术中卡应用的一个结构图;1 is a structural diagram of a card application in the prior art;
图2为现有技术中HCE应用的一个结构图;2 is a structural diagram of an HCE application in the prior art;
图3为本发明实施例中第一终端的一个结构示意图;3 is a schematic structural diagram of a first terminal according to an embodiment of the present invention;
图4为本发明实施例中NFC支付方法的应用场景的一个实施例示意图;FIG. 4 is a schematic diagram of an embodiment of an application scenario of an NFC payment method according to an embodiment of the present disclosure;
图5为本发明实施例中NFC支付方法的一个流程示意图;FIG. 5 is a schematic flowchart diagram of an NFC payment method according to an embodiment of the present invention;
图6为本发明实施例中NFCC路由的一种实现方式示意图;FIG. 6 is a schematic diagram of an implementation manner of an NFCC route according to an embodiment of the present invention;
图7为本发明实施例中NFC应用框架路由的一种实现方式示意图;FIG. 7 is a schematic diagram of an implementation manner of a route of an NFC application framework according to an embodiment of the present invention; FIG.
图8为本发明实施例中第一终端的另一个结构示意图;FIG. 8 is another schematic structural diagram of a first terminal according to an embodiment of the present invention;
图9为本发明实施例中第一终端的另一个结构示意图。FIG. 9 is another schematic structural diagram of a first terminal according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获取的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等是用于区别不同的对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对 于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth" and the like in the specification and claims of the present invention and the above drawings are used to distinguish different objects, and are not intended to describe a specific order. Furthermore, the terms "comprises" and "comprising" and "comprising" are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or device that comprises a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units not listed, or alternatively Correct Other steps or units inherent to these processes, methods, products or equipment.
本发明的技术方案,应用于支持NFC功能的第一终端,如图3所示,该第一终端300包括通信单元301、输入单元302、输出单元303、处理器304、存储单元305、外设接口306,各个单元之间通过一条或多条总线连接。其中,通信单元301用于建立通信信道,使得第一终端通过所述通信信道与远端电子设备或服务器进行语音通信、文字通信、数据通信等;输入单元302用于实现用户与终端的交互和/或信息输入到第一终端中;处理器304为电子设备的控制中心,利用各种接口和线路连接整个第一终端的各个部分,通过运行或执行存储在存储单元内的软件程序和/或模块,以及调用存储在存储单元内的数据,以执行第一终端的各种功能和/或处理数据;输出单元303包括但不限于声音输出单元,用来将处理器所输出的音频信号从数字格式转换为模拟格式;存储单元305可用于存储软件程序以及模块;外设接口306用于连接远端电子设备或服务器。The technical solution of the present invention is applied to a first terminal supporting an NFC function. As shown in FIG. 3, the first terminal 300 includes a communication unit 301, an input unit 302, an output unit 303, a processor 304, a storage unit 305, and peripheral devices. Interface 306, each unit is connected by one or more buses. The communication unit 301 is configured to establish a communication channel, so that the first terminal performs voice communication, text communication, data communication, and the like with the remote electronic device or server through the communication channel; the input unit 302 is configured to implement interaction between the user and the terminal. And/or information is input to the first terminal; the processor 304 is a control center of the electronic device, and connects various parts of the entire first terminal by using various interfaces and lines, by running or executing a software program stored in the storage unit and/or a module, and calling data stored in the storage unit to perform various functions and/or processing data of the first terminal; the output unit 303 includes but is not limited to a sound output unit for using the audio signal output by the processor from the digital The format is converted to an analog format; the storage unit 305 can be used to store software programs and modules; the peripheral interface 306 is used to connect to remote electronic devices or servers.
此外,第一终端还可以包括安全单元(SE)。SE可以通过客户识别模块(英文全称:Subscriber Identity Module,缩写:SIM)卡槽或SD卡(Secure Digital Memory Card)卡槽接入第一终端。或者,SE可以作为一个芯片焊在第一终端的主板上,并且SE通过串口与终端的处理器和NFC控制器(NFCC)通信。Furthermore, the first terminal may also comprise a security unit (SE). The SE can access the first terminal through a customer identification module (English name: Subscriber Identity Module, abbreviation: SIM) card slot or a SD card (Secure Digital Memory Card) card slot. Alternatively, the SE can be soldered as a chip on the motherboard of the first terminal, and the SE communicates with the processor of the terminal and the NFC controller (NFCC) through the serial port.
具体地,通信单元301可以包括NFC控制器和NFC天线,通过NFC控制器和NFC天线,第一终端中的支付应用可以利用NFC信号与远端的第二终端(例如:NFC读卡器或非接触POS机)进行通信;处理器304可以是第一终端主机CPU,处理器304可以运行HCE应用,HCE应用可通过通信单元301与NFC读卡器或非接触POS机通信;存储单元305可以是第一终端的只读存储器(英文全称:read-only memory,缩写:ROM)、随机存取存储器(英文全称:Ramdom Access Memory,缩写:RAM),运行于处理器304上的HCE应用的代码和数据,保存于存储单元305中;处理器304可配置通信单元301中的NFCC路由即配置NFCC路由表,还可用于配置保存于存储单元305中的NFC应用框架中的路由;处理器304还用于获取HCE应用和卡应用的第一信息,并利用第一信息,配置一个AID队列,该队列应用于生成第一指令的应答消息。Specifically, the communication unit 301 may include an NFC controller and an NFC antenna, and the payment application in the first terminal may utilize the NFC signal and the second terminal of the remote end (for example, an NFC card reader or a non-NFC antenna) Contacting the POS machine for communication; the processor 304 may be the first terminal host CPU, the processor 304 may run the HCE application, and the HCE application may communicate with the NFC card reader or the contactless POS machine through the communication unit 301; the storage unit 305 may be The first terminal's read-only memory (English full name: read-only memory, abbreviation: ROM), random access memory (English full name: Ramdom Access Memory, abbreviation: RAM), the code of the HCE application running on the processor 304 and The data is stored in the storage unit 305. The processor 304 can configure the NFCC route in the communication unit 301 to configure the NFCC routing table, and can also be used to configure the route stored in the NFC application framework in the storage unit 305. The processor 304 also uses The first information of the HCE application and the card application is obtained, and the first information is used to configure an AID queue, and the queue is applied to generate a response message of the first instruction.
本领域技术人员可以理解的是,图3中所示出的第一终端的结构并不构成对本发明的限定,它既可以是总线形结构,也可以是星型结构,还可以包括比 图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。在本发明实施方式中的第一终端包括但不限于移动电话、移动电脑、平板电脑、个人数字助理(英文全称:Personal Digital Assistant,缩写:PDA)、媒体播放器、智能电视,可穿戴设备(例如,智能手表或智能眼镜等)以及上述两项或两项以上的组合等。It can be understood by those skilled in the art that the structure of the first terminal shown in FIG. 3 does not constitute a limitation of the present invention, and it may be a bus-shaped structure or a star-shaped structure, and may also include a ratio. More or fewer components are illustrated, or some components are combined, or different component arrangements. The first terminal in the embodiment of the present invention includes but is not limited to a mobile phone, a mobile computer, a tablet computer, a personal digital assistant (English full name: Personal Digital Assistant, abbreviation: PDA), a media player, a smart TV, and a wearable device ( For example, a smart watch or smart glasses, etc.), a combination of two or more of the above, and the like.
图4为本发明实施例提供的一个应用场景示例。常见的NFC终端是支持多个支付应用的。例如:NFC终端上有多个支付应用,每个支付应用具有至少一个AID。而POS机一般可以读取多种支付应用。POS机无法预知所有支付应用的AID,因此,POS机和NFC终端之间,就选定哪个卡应用进行交易,需要有一个交互流程,以便POS机从多个支付应用中选出一个进行交易。国际银行卡标准组织EMVCo规定POS机使用PPSE选择指令获得支付应用信息。POS机会向NFC终端发送PPSE选择指令,而NFC终端需要向POS机发送应答消息。POS机通过接收到的应答消息获得一组激活的支付应用的AID,进而选择一个激活的支付应用执行后续的交易。除了EMVCo标准外,中国制定的PBOC3.0标准也要求NFC终端和POS机支持PPSE机制。任何NFC终端要和POS机通信,必须支持PPSE机制。FIG. 4 is an example of an application scenario provided by an embodiment of the present invention. Common NFC terminals support multiple payment applications. For example, there are multiple payment applications on the NFC terminal, and each payment application has at least one AID. POS machines can generally read a variety of payment applications. The POS machine cannot predict the AID of all payment applications. Therefore, between the POS machine and the NFC terminal, which card application is selected for transaction, an interaction process is required, so that the POS machine selects one of the plurality of payment applications for transaction. The International Bank Card Standards Organization EMVCo stipulates that POS machines use the PPSE selection command to obtain payment application information. The POS device sends a PPSE selection command to the NFC terminal, and the NFC terminal needs to send a response message to the POS machine. The POS machine obtains the AID of a group of activated payment applications by receiving the response message, and then selects an activated payment application to perform subsequent transactions. In addition to the EMVCo standard, the PBOC 3.0 standard developed by China also requires NFC terminals and POS machines to support the PPSE mechanism. Any NFC terminal that communicates with the POS must support the PPSE mechanism.
如图4所示,目前常见的NFC终端(即上述的第一终端)支持安装HCE应用,终端上往往会安装多个HCE应用。此外,NFC终端可以搭载SE芯片即NFC终端的主板上包含嵌入式安全单元eSE,或通过安全数码卡(英文全称:Secure Digital Memory Card,缩写:SD)接口或客户识别模块(英文全称:Subscriber Identity Module,缩写:SIM)卡接口外接SE,这样,终端上可能存在多个HCE应用和多个位于SE中的卡应用。而NFC读卡器要和各种各样的不同配置的终端通信,NFC读卡器无法预知所有的终端中卡应用的AID和HCE应用的AID,所以NFC读卡器需要先向终端发送第一指令,例如:该第一指令为PPSE选择指令,并从应答消息中获得终端中激活的卡应用及HCE应用的AID,进而选择卡应用或HCE应用进行交易。在实际应用中,例如:购物商场或超市中部署的读卡器,它需要面对不同的银行发布的各种各样的集成电路(英文全称:integrated circuit,缩写:IC)卡,这些IC卡中的支付应用的AID是不同的,因此,这些卡片必须支持PPSE程序,读卡器需要通过第一 指令的应答获得卡片中的支付应用的AID以便选中其中一个。而在手机上,一个手机通过安装HCE应用或安装SE(例如:使用移动运营商的NFC-SIM)可以模拟多张卡片,相当于把一张卡片内部存在多个卡应用面对读卡器,手机可以模拟成一张安装了多个支付应用的超级卡片。在实际应用中,手机中的HCE应用是手机上安装的应用程序,每个HCE应用程序可以绑定多张银行卡,其中,每张银行卡包括一个AID。手机通过应答第一指令的方式将银行卡的AID告知读卡器,以便读卡器选择对应的银行卡进行交易。As shown in Figure 4, the current NFC terminal (that is, the first terminal mentioned above) supports the installation of HCE applications, and multiple HCE applications are often installed on the terminal. In addition, the NFC terminal can be equipped with an embedded chip security unit eSE on the motherboard of the SE chip, that is, the NFC terminal, or through a secure digital card (English full name: Secure Digital Memory Card, abbreviation: SD) interface or a customer identification module (English full name: Subscriber Identity Module, abbreviation: SIM) The card interface is connected to the SE. In this way, there may be multiple HCE applications and multiple card applications in the SE. The NFC card reader needs to communicate with a variety of terminals of different configurations. The NFC card reader cannot predict the AID of the card application in all terminals and the AID of the HCE application, so the NFC card reader needs to send the first to the terminal first. The instruction, for example, the first instruction is a PPSE selection instruction, and obtains the card application activated in the terminal and the AID of the HCE application from the response message, and then selects the card application or the HCE application to perform the transaction. In practical applications, such as card readers deployed in shopping malls or supermarkets, it needs to face a variety of integrated circuits issued by different banks (English full name: integrated circuit, abbreviation: IC) cards, these IC cards The AID of the payment application is different, therefore, these cards must support the PPSE program, and the card reader needs to pass the first The response of the instruction obtains the AID of the payment application in the card to select one of them. On a mobile phone, a mobile phone can simulate multiple cards by installing an HCE application or installing an SE (for example, using a mobile operator's NFC-SIM), which is equivalent to having multiple card applications inside a card facing the card reader. The phone can be modeled as a super card with multiple payment applications installed. In practical applications, the HCE application in the mobile phone is an application installed on the mobile phone, and each HCE application can be bound with multiple bank cards, wherein each bank card includes an AID. The mobile phone notifies the card reader of the AID of the bank card by responding to the first instruction, so that the card reader selects the corresponding bank card for transaction.
请参阅图5,本发明实施例中近场通信NFC支付方法的一个实施例,该方法应用于支持NFC的第一终端;第一终端可以包括处理器(主机CPU)、NFCC和SE,其中,SE可以是第一终端中的一个芯片,也可以是通过外设接口(例如SIM卡槽、SD卡卡槽)接入第一终端的硬件实体。该实施例的具体流程如下:Referring to FIG. 5, an embodiment of a near field communication NFC payment method in an embodiment of the present invention is applied to a first terminal supporting NFC; the first terminal may include a processor (host CPU), NFCC, and SE, where The SE may be a chip in the first terminal, or may be a hardware entity that accesses the first terminal through a peripheral interface (such as a SIM card slot or an SD card slot). The specific process of this embodiment is as follows:
步骤501、第一终端根据支付应用白名单、支付应用黑名单和支付应用的第一信息中的至少一种,从该第一终端上的全部支付应用中确定M个支付应用。Step 501: The first terminal determines, according to at least one of the payment application whitelist, the payment application blacklist, and the first information of the payment application, the M payment applications from all the payment applications on the first terminal.
其中,M大于1,所述M个支付应用包括M个HCE应用或者所述M个支付应用包括HCE应用和卡应用,所述卡应用包含在所述第一终端的安全单元中。Where M is greater than 1, the M payment applications include M HCE applications or the M payment applications include an HCE application and a card application, and the card application is included in a security unit of the first terminal.
在一些可能的实现方式中,将所述第一终端上的支付应用白名单中的全部支付应用确定为所述M个支付应用;或者,将所述第一终端上的除所述支付应用黑名单以外的其他支付应用确定为所述M个支付应用。In some possible implementations, all payment applications in the whitelist of payment applications on the first terminal are determined as the M payment applications; or, the payment application black on the first terminal is Other payment applications outside the list are determined as the M payment applications.
在实际应用中,第一终端需要根据支付应用白名单和/或支付应用黑名单,从第一终端上安装的全部支付应用中确定M个支付应用。第一终端上安装的支付应用,可以是主机卡模拟HCE应用或运行于SE中的卡应用。在第一终端中,HCE应用可以使用一个标识来标识自己,例如可以使用一个字符串或者服务名(service name)作为标识,每一个HCE应用具有一个唯一的标识或服务名,是该HCE应用区别于第一终端中其他应用的标识,方便第一终端操作系统对已经安装的应用进行管理;在第一终端的SE中,卡应用使用应用标识符AID来标识自己,AID是国际标准组织ISO制定的标准ISO/IEC 7816-5标准中定义的,专门用于标识非接触芯片卡或SE中的卡应用的标识符,同一个芯片卡或同一 个SE内,两个卡应用不可以使用相同的AID。第一终端中包含预设的支付应用白名单和/或支付应用黑名单,白名单或黑名单中包含HCE应用的服务名或应用标识(APP ID)以及卡应用的AID,将HCE应用的标识,或者卡应用的AID作为支付应用的标识。当第一终端中仅预设有支付应用黑名单时,首先获得第一终端上已经安装的所有支付应用,得到一个支付应用标识集合,从该集合中,去掉黑名单包括的所有支付应用,将集合中最后剩下的支付应用作为M个支付应用;当第一终端中预设有支付应用白名单时,将白名单对应的应用标识集合,与第一终端上已经安装的全部支付应用的标识集合做交集,将交集中的标识对应的所有支付应用作为M个支付应用。In an actual application, the first terminal needs to determine M payment applications from all payment applications installed on the first terminal according to the payment application white list and/or the payment application blacklist. The payment application installed on the first terminal may be a host card emulating an HCE application or a card application running in the SE. In the first terminal, the HCE application may use an identifier to identify itself. For example, a string or a service name may be used as the identifier. Each HCE application has a unique identifier or service name, which is the difference between the HCE applications. The identifier of the other application in the first terminal is convenient for the first terminal operating system to manage the installed application; in the SE of the first terminal, the card application uses the application identifier AID to identify itself, and the AID is defined by the international standard organization ISO. An identifier defined in the standard ISO/IEC 7816-5 standard for identifying a card application in a contactless chip card or SE, the same chip card or the same Within two SEs, two card applications cannot use the same AID. The first terminal includes a preset payment application white list and/or a payment application blacklist, and the whitelist or the blacklist includes the service name or application identifier (APP ID) of the HCE application and the AID of the card application, and the identifier of the HCE application is used. , or the AID of the card application as the identity of the payment application. When only the payment application blacklist is pre-configured in the first terminal, all the payment applications that have been installed on the first terminal are obtained first, and a payment application identifier set is obtained. From the set, all payment applications included in the blacklist are removed. The last remaining payment application in the collection is used as the M payment application; when the whitelist of the payment application is pre-configured in the first terminal, the application identifier set corresponding to the whitelist is associated with the identifier of all the payment applications already installed on the first terminal. The collection is done as an intersection, and all payment applications corresponding to the identifiers in the intersection are used as M payment applications.
其中,该支付应用的第一信息包括以下至少一种:支付应用的当前运行状态、支付应用的运行环境、支付应用的优先级以及支付应用的使用记录。在实际应用中,第一终端可以根据支付应用的第一信息来确定所述M个支付应用。The first information of the payment application includes at least one of the following: a current running state of the payment application, an operating environment of the payment application, a priority of the payment application, and a usage record of the payment application. In an actual application, the first terminal may determine the M payment applications according to the first information of the payment application.
在另一些可能的实现方式中,所述支付应用的第一信息为支付应用的当前运行状态,且所述支付应用的当前运行状态包括前台运行和后台运行时,将所述前台运行和所述后台运行的全部支付应用确定为所述M个支付应用。In other possible implementation manners, the first information of the payment application is a current running state of the payment application, and the current running state of the payment application includes a foreground running and a background running, the foreground running and the All payment applications running in the background are determined as the M payment applications.
在实际应用中,处于运行状态的支付应用可以处理POS机发送指令,而非运行状态的支付应用必须启动后才可以处理POS机发送的指令,因此,第一终端获取前台运行和后台运行的支付应用,并将前台和后台运行的支付应用确定为所述M个支付应用,可见,将第一终端上处于运行状态的全部支付应用确定为所述M个支付应用。In an actual application, the payment application in the running state can process the POS machine to send an instruction, and the non-operating payment application must be started to process the instruction sent by the POS machine. Therefore, the first terminal acquires the payment of the foreground operation and the background operation. Applying, and determining the payment application running in the foreground and the background as the M payment applications, it can be seen that all payment applications in the running state on the first terminal are determined as the M payment applications.
或者,所述支付应用的第一信息为支付应用的运行环境,且所述支付应用的运行环境包括第一运行环境和第二运行环境时,将所述第一运行环境和所述第二运行环境中的全部支付应用确定为所述M个支付应用或者将所述第一运行环境中的全部支付应用确定为所述M个支付应用,其中,所述第一运行环境为REE或TEE,运行HCE应用,所述第二运行环境为SE,运行卡应用。Or the first information of the payment application is the running environment of the payment application, and the operating environment of the payment application includes the first running environment and the second running environment, and the first running environment and the second running are performed. All payment applications in the environment are determined as the M payment applications or all payment applications in the first operating environment are determined as the M payment applications, wherein the first running environment is REE or TEE, running The HCE application, the second operating environment is SE, running a card application.
在实际应用中,为了兼容现有的卡应用,将第一终端上的卡应用和HCE应用确定为所述M个支付应用,当然,有些手机不支持卡应用,则直接将第一终端上的HCE应用确定为所述M个支付应用。In practical applications, in order to be compatible with the existing card application, the card application and the HCE application on the first terminal are determined as the M payment applications. Of course, some mobile phones do not support the card application, and directly on the first terminal The HCE application is determined to be the M payment applications.
或者,所述支付应用的第一信息为支付应用的优先级,将所述第一终端默 认的支付应用和用户指定的全部支付应用确定为所述M个支付应用。其中,所述第一终端默认的支付应用和用户指定的支付应用的优先级高于所述第一终端上的其他支付应用的优先级。Or the first information of the payment application is a priority of the payment application, and the first terminal is silent. The recognized payment application and all payment applications specified by the user are determined as the M payment applications. The priority of the default payment application and the user-specified payment application of the first terminal is higher than the priority of other payment applications on the first terminal.
在实际应用中,例如:用户倾向于使用某个银行的HCE应用或者手机上默认提供用户常用的一些支付应用,可见,可以将第一终端上的默认支付应用和用户指定的全部支付应用确定为所述M个支付应用,从而有效贴近用户体验。In practical applications, for example, the user tends to use the HCE application of a certain bank or some payment applications commonly used by the user by default on the mobile phone. It can be seen that the default payment application on the first terminal and all payment applications specified by the user can be determined as The M payment applications are effectively close to the user experience.
或者,所述支付应用的第一信息为支付应用的使用记录,将所述使用记录中的全部支付应用确定为所述M个支付应用。Alternatively, the first information of the payment application is a usage record of the payment application, and all payment applications in the usage record are determined as the M payment applications.
在实际应用中,根据使用记录,将进行NFC支付时使用过的全部支付应用确定为所述M个支付应用,例如:第一终端获取进行NFC支付时使用过的支付应用,并将使用过的全部支付应用确定为所述M个支付应用,以方便读卡器选择其中的一个支付应用进行交易。In an actual application, according to the usage record, all the payment applications used in the NFC payment are determined as the M payment applications, for example, the first terminal acquires the payment application used in the NFC payment, and uses the used payment application. All payment applications are determined as the M payment applications to facilitate the card reader to select one of the payment applications for the transaction.
需要说明的是,当第一终端中没有预设支付应用白名单和支付应用黑名单时,第一终端可以把所有通过可信应用市场(例如:终端预装的应用市场)下载的支付应用或者所有具有可信的数字签名的支付应用作为M个支付应用,还可以将第一终端中已经安装的所有支付应用作为M个支付应用,此处不做具体限定。It should be noted that, when there is no preset payment application whitelist and payment application blacklist in the first terminal, the first terminal may download all payment applications that are downloaded through the trusted application market (for example, the terminal pre-installed application market) or All the payment applications with the trusted digital signatures are used as the M payment applications, and all the payment applications that have been installed in the first terminal are also used as the M payment applications, which are not specifically limited herein.
步骤502、第一终端接收第二终端发送的第一指令。Step 502: The first terminal receives the first instruction sent by the second terminal.
在实际应用中,第二终端向第一终端发送第一指令,则第一终端接收该第一指令。该第一指令可以为PPSE选择指令,即SELECT PPSE指令,其中,该第二终端是读卡装置或者POS机等,此处不做具体限定。In a practical application, the second terminal sends the first instruction to the first terminal, and the first terminal receives the first instruction. The first instruction may be a PPSE selection instruction, that is, a SELECT PPSE instruction, wherein the second terminal is a card reading device or a POS machine, and is not specifically limited herein.
需要说明的是,步骤501与步骤502的时序不做具体限定,步骤501和步骤502可以同时发生,也可以是先后发生。It should be noted that the sequence of step 501 and step 502 is not specifically limited, and step 501 and step 502 may occur simultaneously or sequentially.
步骤503、第一终端获取N个AID和M个支付应用的第一信息。Step 503: The first terminal acquires first information of the N AIDs and the M payment applications.
其中,所述N个AID为所述M个支付应用包括的全部AID,每个支付应用包括至少一个AID。当支付应用为HCE应用时,该支付应用可以包括一个或多个AID。当支付应用为SE中的卡应用时,该支付应用包括一个AID,即该支付应用对应一个AID。The N AIDs are all AIDs included in the M payment applications, and each payment application includes at least one AID. When the payment application is an HCE application, the payment application may include one or more AIDs. When the payment application is a card application in the SE, the payment application includes an AID, that is, the payment application corresponds to one AID.
所述支付应用的第一信息包括以下至少一种:支付应用的当前运行状态、 支付应用的运行环境、支付应用的优先级以及支付应用的使用记录。The first information of the payment application includes at least one of the following: a current running state of the payment application, The operating environment of the payment application, the priority of the payment application, and the usage record of the payment application.
在一些可能的实现方式中,通过该第一终端上的支付应用管理模块获取该第一终端上的N个AID;或者,通过解析该M个支付应用保存在该第一终端中的资源文件获取该N个AID。例如:第一终端的PPSE配置程序向NFC应用框架中的支付应用管理模块发送查询消息,查询到每个支付应用在NFC服务中注册的AID(包括静态注册和动态注册的全部AID),或者,第一终端的PPSE配置程序可以通过解析该M个支付应用保存在该第一终端中的资源文件获取该N个AID。In some possible implementations, the N application AIDs on the first terminal are obtained by the payment application management module on the first terminal; or the resource file acquired in the first terminal is obtained by parsing the M payment applications. The N AIDs. For example, the PPSE configuration program of the first terminal sends a query message to the payment application management module in the NFC application framework, and queries the AID (including all AIDs of static registration and dynamic registration) registered by each payment application in the NFC service, or The PPSE configuration program of the first terminal may obtain the N AIDs by parsing the resource files saved by the M payment applications in the first terminal.
步骤504、第一终端根据M个支付应用的第一信息将该N个AID配置到队列中,并使用该队列生成应答消息。Step 504: The first terminal configures the N AIDs into the queue according to the first information of the M payment applications, and uses the queue to generate a response message.
在一些可能的实现方式中,所述支付应用的第一信息为支付应用的当前运行状态,所述步骤504具体可以包括:当所述M个支付应用的当前运行状态包括前台运行和后台运行时,将前台运行的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级,将后台运行的支付应用的全部AID配置到所述队列的第二位置并设置第二优先级,其中,所述第一优先级高于所述第二优先级。In some possible implementation manners, the first information of the payment application is a current running state of the payment application, and the step 504 may specifically include: when the current running states of the M payment applications include a foreground running and a background running All the AIDs of the payment application running in the foreground are configured to the first position of the queue and set a first priority, and all AIDs of the payment application running in the background are configured to the second position of the queue and the second priority is set. Wherein the first priority is higher than the second priority.
在实际应用中,将前台运行的支付应用的全部AID配置到该队列的头部并设置高优先级,将后台运行的支付应用的全部AID配置到该队列的尾部并设置低优先级。另外,未处于前台运行或后台运行状态的支付应用,其AID可以配置到队列中的其他位置并设置低优先级。可见,将多个处于运行状态的AID配置到队列中并设置优先级,进而生成第一指令的应答消息,使得第二终端可以获得多个AID,无需手动修改默认HCE应用设置,即可实现第二终端选中特定的AID,当然,还可以通过AID的优先级顺序优先选择特定的AID,减少了用户操作,有效提高用户体验。另外,第一终端上安装的支付应用不限于SE中的卡应用,还可以是HCE应用,因此,不会存在不支持物理SE的第一终端就无法完成读卡的问题。In an actual application, all AIDs of the payment application running in the foreground are configured to the head of the queue and set to a high priority, and all AIDs of the payment application running in the background are configured to the end of the queue and set to a low priority. In addition, payment applications that are not in the foreground or background running state can have their AIDs configured to other locations in the queue and set low priority. It can be seen that multiple AIDs in the running state are configured into the queue and set priorities, thereby generating a response message of the first instruction, so that the second terminal can obtain multiple AIDs, and the first HCE application setting can be manually modified. The second terminal selects a specific AID. Of course, the specific AID can be preferentially selected through the priority order of the AID, thereby reducing user operations and effectively improving the user experience. In addition, the payment application installed on the first terminal is not limited to the card application in the SE, and may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
在另一些可能的实现方式中,所述支付应用的第一信息为支付应用的运行环境,所述步骤504具体可以包括:所述支付应用的运行环境包括第一运行环境和第二运行环境,所述第一运行环境中运行HCE应用,所述第二运行环境中 运行卡应用;当所述M个支付应用包括HCE应用和卡应用时,将所述HCE应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述卡应用的全部AID配置到所述队列的第二位置并设置第二优先级;或者,将所述卡应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述HCE应用的的全部AID配置到所述队列的第二位置并设置第二优先级,其中,所述第一优先级高于所述第二优先级。In another possible implementation manner, the first information of the payment application is an operating environment of the payment application, and the step 504 may specifically include: the operating environment of the payment application includes a first running environment and a second running environment, Running the HCE application in the first operating environment, in the second operating environment Running a card application; when the M payment applications include an HCE application and a card application, configuring all AIDs of the HCE application to a first location of the queue and setting a first priority, and applying all of the cards Configuring an AID to a second location of the queue and setting a second priority; or configuring all AIDs of the card application to a first location of the queue and setting a first priority, applying the HCE All AIDs are configured to a second location of the queue and a second priority is set, wherein the first priority is higher than the second priority.
在实际应用中,将HCE应用的全部AID配置到该队列的头部并设置高优先级,将卡应用的全部AID配置到该队列的尾部并设置低优先级;或者,将卡应用的全部AID配置到该队列的头部并设置高优先级,将HCE应用的的全部AID配置到该队列的尾部并设置低优先级。In practical applications, configure all AIDs of the HCE application to the head of the queue and set a high priority, configure all AIDs of the card application to the end of the queue and set a low priority; or, apply all AIDs of the card application. Configure to the head of the queue and set a high priority. Configure all AIDs of the HCE application to the end of the queue and set a low priority.
在另一些可能的实现方式中,所述支付应用的第一信息为支付应用的优先级,所述步骤504具体可以包括:当所述M个支付应用包括所述第一终端默认的支付应用和用户指定的支付应用时,将所述用户指定的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述第一终端默认的支付应用的全部AID配置到所述队列的第二位置并设置第二优先级;或者,将所述第一终端默认的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述用户指定的支付应用的的全部AID配置到所述队列的第二位置并设置第二优先级,其中,所述第一终端默认的支付应用和所述用户指定的支付应用为不同的支付应用,所述第一优先级高于所述第二优先级,所述第一终端默认的支付应用和用户指定的支付应用的优先级高于所述第一终端上的其他支付应用的优先级。In other possible implementation manners, the first information of the payment application is a priority of the payment application, and the step 504 may specifically include: when the M payment applications include the first terminal default payment application and When the user specifies the payment application, all the AIDs of the payment application specified by the user are configured to the first location of the queue and the first priority is set, and all the AIDs of the default payment application of the first terminal are configured to the Determining a second location of the queue and setting a second priority; or configuring all AIDs of the default payment application of the first terminal to a first location of the queue and setting a first priority, the user-specified All the AIDs of the payment application are configured to the second location of the queue and set a second priority, wherein the default payment application of the first terminal and the payment application specified by the user are different payment applications, a priority is higher than the second priority, and the default payment application of the first terminal and the payment application specified by the user are higher than other payment on the first terminal. Priority.
在实际应用中,将该用户指定的支付应用的全部AID配置到该队列的头部并设置高优先级,将该第一终端默认的支付应用的全部AID配置到该队列的尾部并设置低优先级;或者,将该第一终端默认的支付应用的全部AID配置到该队列的头部并设置高优先级,将该用户指定的支付应用的的全部AID配置到该队列的尾部并设置低优先级,其中,该第一终端默认的支付应用和该用户指定的支付应用为不同的支付应用。可见,第一终端将第一终端默认的支付应用和用户指定的支付应用的全部AID配置到队列的对应位置中并设置对应的优先级,进而生成第一指令的应答消息。 In an actual application, all AIDs of the payment application specified by the user are configured to the head of the queue and a high priority is set, and all AIDs of the default payment application of the first terminal are configured to the end of the queue and a low priority is set. Or; configure all the AIDs of the default payment application of the first terminal to the head of the queue and set a high priority, configure all AIDs of the payment application specified by the user to the end of the queue and set a low priority Level, wherein the default payment application of the first terminal and the payment application specified by the user are different payment applications. It can be seen that the first terminal configures all the AIDs of the default payment application of the first terminal and the user-specified payment application into corresponding positions of the queue and sets corresponding priorities, thereby generating a response message of the first instruction.
在另一些可能的实现方式中,所述支付应用的第一信息包括支付应用的使用记录,所步骤504具体可以包括:将最近一次进行NFC支付时使用的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级;或者,依照所述M个支付应用的使用频率的高低,依次将每个支付应用的全部AID配置到所述队列中并设置优先级,其中,所述第一优先级高于除所述第一优先级以外的其他优先级。In other possible implementations, the first information of the payment application includes a usage record of the payment application, and the step 504 may specifically include: configuring all AIDs of the payment application used when the NFC payment was last performed to the queue. And setting a first priority; or, according to the frequency of use of the M payment applications, sequentially configuring all AIDs of each payment application into the queue and setting priorities, wherein The first priority is higher than the priorities other than the first priority.
在实际应用中,将最近一次进行NFC支付时使用的支付应用的全部AID配置到该队列的头部并设置高优先级;或者,依照该M个支付应用的使用频率的高低,依次将每个支付应用的全部AID配置到该队列中并设置优先级。第一终端通过读取支付应用的使用日志,可以获得最近一次执行非接触支付时使用的支付应用,或者获得支付应用的使用频率信息,进而根据上述信息配置支付应用的AID并设置优先级。In an actual application, all the AIDs of the payment application used in the last NFC payment are configured to the head of the queue and set to a high priority; or, according to the frequency of use of the M payment applications, each of them is sequentially All AIDs of the payment application are configured into the queue and prioritized. By reading the usage log of the payment application, the first terminal can obtain the payment application used when the contactless payment is last executed, or obtain the usage frequency information of the payment application, and then configure the AID of the payment application according to the above information and set the priority.
另外,在实际应用中,当M个支付应用中存在前台运行的默认支付应用和后台运行的默认支付应用时,将前台正在运行的默认支付应用的AID设置高优先级,将后台正在运行且默认的支付应用的AID设置次高优先级,将M个支付应用中剩余的支付应用(即:除前台正在运行的默认支付应用和后台正在运行的默认支付应用以外)的AID设置低优先级,并依据上述优先级将AID配置到队列中。或者,当M个支付应用中存在默认的支付应用时,将默认的支付应用的AID设置高优先级,从M个支付应用中获取最近一次使用的支付应用,并将最近一次使用的支付应用的AID设置次高优先级,根据M个支付应用中除默认支付应用与上次使用的支付应用之外的其他支付应用的历史使用记录,获得这些支付应用的使用频率信息,并依据使用频率高低设置这些支付应用的优先级,最后将AID配置到队列中。In addition, in the actual application, when there are a default payment application running in the foreground and a default payment application running in the background in the M payment applications, the AID of the default payment application running in the foreground is set to a high priority, and the background is running and defaults. The AID of the payment application sets the second highest priority, and sets the AID of the remaining payment applications in the M payment applications (ie, except the default payment application running in the foreground and the default payment application running in the background), and The AID is configured into the queue according to the above priority. Or, when there is a default payment application in the M payment applications, the AID of the default payment application is set to a high priority, the last used payment application is obtained from the M payment applications, and the payment application of the last use is used. The AID sets the second highest priority, and according to the historical usage records of the payment applications other than the default payment application and the last used payment application, the usage frequency information of the payment applications is obtained according to the usage frequency. The priority of these payment applications, and finally the AID is configured into the queue.
需要说明的是,在实际应用中,由于支付应用的第一信息包括支付应用的当前运行状态、支付应用的运行环境、支付应用的优先级以及支付应用的使用记录中的至少一种,因此可根据该第一信息中的至少一种的自由组合,从而确定该M个支付应用的AID配置到队列中的位置关系以及优先级顺序,进而通过该队列生成应答第一指令的应答消息,此处不做具体限定。It should be noted that, in an actual application, since the first information of the payment application includes at least one of a current running state of the payment application, an operating environment of the payment application, a priority of the payment application, and a usage record of the payment application, Determining, according to the free combination of at least one of the first information, a location relationship and a priority order of the AIDs of the M payment applications to the queue, and generating a response message acknowledging the first instruction by using the queue, where No specific restrictions.
在另一些可能的实现方式中,当所述M个支付应用中的至少一个支付应用 处于非运行状态时,激活所述至少一个支付应用。In other possible implementations, when at least one of the M payment applications is a payment application When in the non-operational state, the at least one payment application is activated.
在实际应用中,当该M个支付应用当前均处于非运行状态时,激活该M个支付应用中的部分支付应用或者全部支付应用;并将该M个支付应用中被激活的部分或者全部支付应用的全部AID配置到该队列中并设定优先级。其中,PPSE配置程序激活该部分或者全部支付应用的目的在于让该部分或者全部支付应用处于运行状态,即:启动该部分或者全部支付应用的应用程序,并执行相关的配置流程。从而避免了M个支付应用均未处于运行状态则无法配置应答第一指令的应答消息,进而无法完成支付应用与读卡器或者POS机之间的交互流程。In an actual application, when the M payment applications are currently in a non-operation state, a part of the payment applications or all payment applications in the M payment applications are activated; and some or all of the M payment applications are activated. All AIDs of the application are configured into the queue and prioritized. The PPSE configuration program activates the part or all of the payment application to enable the part or all of the payment application to be in a running state, that is, to start the application of the part or all of the payment application, and execute the related configuration process. Therefore, it is avoided that the M payment applications are not in the running state, and the response message acknowledging the first instruction cannot be configured, and the interaction process between the payment application and the card reader or the POS machine cannot be completed.
步骤505、第一终端配置PPSE路由。所述PPSE路由用于确保所述第一终端使用所述应答消息应答所述第一指令,其中,所述PPSE路由包括NFC应用框架中的路由或者所述PPSE路由包括NFCC路由和NFC应用框架中的路由。通过配置PPSE路由,以确保使用步骤504中生成的应答消息来应答该第一指令,即:PPSE选择指令。其中NFCC路由的格式如图6所示,NFCC路由以表格的形式组织,每一行为一个路由项,每个路由项包含一个AID以及该AID对应的路由目标,也就是支付应用所在的执行环境(英文全称:Near Field Communication Execution Environment,缩写:NFCEE)的标识,因为支付应用可以是SE中的卡应用或主机卡模拟应用,所以NFCC路由中的路由目标可以是SE的标识,或主机NFC执行环境即主机CPU的标识。Step 505: The first terminal configures a PPSE route. The PPSE route is used to ensure that the first terminal responds to the first instruction by using the response message, wherein the PPSE route includes a route in an NFC application framework or the PPSE route includes an NFCC route and an NFC application framework Routing. The PPSE route is configured to ensure that the first command, ie, the PPSE select command, is replied to using the reply message generated in step 504. The format of the NFCC route is as shown in FIG. 6. The NFCC routes are organized in the form of a table, each of which acts as a routing item, and each routing item includes an AID and a routing target corresponding to the AID, that is, an execution environment in which the payment application is located ( English full name: Near Field Communication Execution Environment, abbreviation: NFCEE), because the payment application can be a card application or host card simulation application in the SE, so the routing target in the NFCC route can be the SE identifier, or the host NFC execution environment. That is, the identity of the host CPU.
在一些可能的实现方式中,当第一终端上的支付应用只包括HCE应用不包括卡应用时,所述PPSE路由包括NFC应用框架中的路由,所述第一终端配置PPSE路由包括:在所述NFC应用框架的路由中,配置第一程序和所述PPSE AID的对应关系,所述第一程序用于使用所述应答消息应答所述PPSE选择指令,其中,所述PPSE AID包含在所述PPSE选择指令中。In some possible implementation manners, when the payment application on the first terminal only includes the HCE application and does not include the card application, the PPSE route includes a route in the NFC application framework, and the first terminal configures the PPSE route to include: In the routing of the NFC application framework, configuring a correspondence between the first program and the PPSE AID, the first program is configured to respond to the PPSE selection instruction by using the response message, where the PPSE AID is included in the PPSE selection instruction.
在另一些可能的实现方式中,当第一终端上的支付应用包括HCE应用和卡应用时,所述PPSE路由包括近场通信控制器NFCC路由和近场通信NFC应用框架中的路由,所述第一终端配置PPSE路由包括:In other possible implementations, when the payment application on the first terminal includes an HCE application and a card application, the PPSE route includes a route in a near field communication controller NFCC routing and a near field communication NFC application framework, The first terminal configures PPSE routes including:
当所述NFCC路由中不包含第一路由项时,在所述NFCC路由中配置第二路由项;或者,当所述NFCC路由中包含第三路由项时,在所述NFCC路由中清除 所述第三路由项并配置所述第二路由项,其中,所述第一路由项为包含PPSE AID的路由项,所述第二路由项为包含PPSE AID且路由目标是主机NFC执行环境的路由项,所述第三路由项为包含PPSE AID但路由目标不是主机NFC执行环境的路由项;或者,当所述NFCC路由中不包含第四路由项时,在所述NFCC路由中配置所述第四路由项;当所述NFCC路由中包含所述第三路由项且不包含第四路由项时,在所述NFCC路由中清除所述第三路由项并配置所述第四路由项,所述第四路由项是用于将AID选择指令路由到主机NFC执行环境的路由项,其中,AID选择指令(即:SELECT AID)包含PPSE选择指令,是ISO/IEC7816-4定义的一条APDU指令,用于读卡器选中某个支付应用,具体的,第四路由项可以是路由目标为主机NFC执行环境(DH NFCEE)的协议路由项,用于将ISO-DEP协议数据路由到主机NFC执行环境。在所述NFC应用框架的路由中,配置第一程序和所述PPSE AID的对应关系,所述第一程序用于使用所述应答消息应答所述PPSE选择指令。Configuring a second routing entry in the NFCC route when the NFCC route does not include the first routing entry; or clearing in the NFCC routing when the NFCC routing includes the third routing entry The third routing entry is configured to configure the second routing entry, where the first routing entry is a routing entry that includes a PPSE AID, and the second routing entry is a PPSE AID and the routing target is a host NFC execution environment. a routing entry, where the third routing entry is a routing entry that includes a PPSE AID but the routing destination is not a host NFC execution environment; or, when the NFCC routing does not include a fourth routing entry, configuring the NFCC routing a fourth routing entry, where the third routing entry is included in the NFCC route, and the fourth routing entry is not included, the third routing entry is cleared in the NFCC route, and the fourth routing entry is configured. The fourth routing entry is a routing entry for routing the AID selection instruction to the host NFC execution environment, wherein the AID selection instruction (ie, SELECT AID) includes a PPSE selection instruction, which is an APDU instruction defined by ISO/IEC 7816-4. The card reader is used to select a payment application. Specifically, the fourth routing item may be a protocol routing item whose routing target is the host NFC execution environment (DH NFCEE), and is used to route the ISO-DEP protocol data to the host NFC execution environment. . In the routing of the NFC application framework, a correspondence between the first program and the PPSE AID is configured, and the first program is configured to respond to the PPSE selection instruction by using the response message.
其中,该NFC应用框架,即第一终端操作系统中实现的NFC Framework,NFC应用框架为应用开发者提供应用程序编程接口(英文全称:Application Programming Interface,缩写:API),同时是第一终端上运行卡模拟应用的软件基础。在NFC应用框架中,尤其是针对HCE应用,需要向OS声明HCE应用处理的AID,即在NFC应用框架中注册AID及其对应的HCE应用的服务名(HCE应用的标识),以便第一终端的主机NFC执行环境(英文全称:Device Host NFC Execution Environment,缩写:DH-NFCEE)收到APDU命令时,将APDU转发给对应的HCE应用,其中,APDU为ISO/IEC7816-4标准定义的智能卡与读卡器之间的通信单元。在该NFC应用框架中,配置PPSE AID对应于第一程序,其中,该第一程序为第一终端操作系统中一个模块或者一个系统应用,第一程序可以是PPSE配置程序,该第一程序使用步骤504中的队列生成应答该PPSE选择指令的应答消息。在具体实现方案中,可以由第一程序以外的其他程序预先生成应答消息,然后第一程序获取该预先生成的应答消息并通过获取的应答消息应答PPSE选择指令,也可以是第一程序执行上述步骤501至步骤504,此处不做具体限定。相比于现有技术,不是单个的卡应用或者HCE应用去应答PPSE选择指令,而是在第一终端上新增加第一程序,并通过第一程序发送包 含多个支付应用(多个HCE应用,或者多个HCE应用和卡应用)的AID的应答消息去应答PPSE选择指令,其中,在NFC应用框架中,保留且只保留一条PPSE AID路由信息,屏蔽所有其他程序注册到NFC应用框架中的要求处理PPSE AID的信息,路由PPSE选择指令给第一服务即PPSE配置程序,第一服务使用该队列生成该应答消息。NFC应用框架中的路由格式,具体可参阅图7,NFC应用框架中的路由也可以用表格的形式组织的,每一行标识一个路由项,包含一个AID和一个HCE应用标识即HCE服务名,每一行将一个AID与一个HCE应用进行关联。The NFC application framework, that is, the NFC Framework implemented in the first terminal operating system, provides an application programming interface (English full name: Application Programming Interface, API) for the application developer, and is also on the first terminal. The software foundation for running the card simulation application. In the NFC application framework, especially for the HCE application, the AID of the HCE application processing needs to be declared to the OS, that is, the service name (the identifier of the HCE application) of the AID and its corresponding HCE application is registered in the NFC application framework, so that the first terminal The host NFC Execution Environment (English name: Device Host NFC Execution Environment, abbreviation: DH-NFCEE) forwards the APDU to the corresponding HCE application when the APDU command is received. The APDU is a smart card defined by the ISO/IEC7816-4 standard. The communication unit between the readers. In the NFC application framework, configuring the PPSE AID corresponds to the first program, where the first program is a module or a system application in the first terminal operating system, and the first program may be a PPSE configuration program, and the first program is used. The queue in step 504 generates a reply message in response to the PPSE selection command. In a specific implementation, the response message may be generated in advance by a program other than the first program, and then the first program acquires the pre-generated response message and responds to the PPSE selection instruction by using the acquired response message, or the first program may execute the above. Step 501 to step 504, which are not specifically limited herein. Compared with the prior art, instead of a single card application or an HCE application to answer the PPSE selection instruction, a new program is newly added on the first terminal, and the package is sent through the first program. A reply message of an AID containing multiple payment applications (multiple HCE applications, or multiple HCE applications and card applications) to answer the PPSE selection instruction, wherein in the NFC application framework, one PPSE AID routing information is reserved and only one mask is reserved. All other programs are registered to the NFC application framework to process the PPSE AID information, and the PPSE selection command is routed to the first service, the PPSE configuration program, and the first service uses the queue to generate the response message. For the routing format in the NFC application framework, refer to Figure 7. The routes in the NFC application framework can also be organized in the form of a table. Each row identifies a routing entry, including an AID and an HCE application identifier, that is, the HCE service name. One row associates an AID with an HCE application.
需要说明的是,步骤505与步骤504的时序不做具体限定,步骤505和步骤504可以同时发生,也可以是先后发生。步骤505与步骤502的时序不做具体限定,步骤505和步骤502可以同时发生,也可以是先后发生。It should be noted that the timings of step 505 and step 504 are not specifically limited, and steps 505 and 504 may occur simultaneously or sequentially. The sequence of step 505 and step 502 is not specifically limited. Steps 505 and 502 may occur simultaneously or sequentially.
步骤506、第一终端向第二终端发送用于应答第一指令的应答消息。Step 506: The first terminal sends a response message for answering the first instruction to the second terminal.
可见,第一终端配置PPSE路由,以确保使用在队列中生成的应答消息应答该第一指令。It can be seen that the first terminal configures the PPSE route to ensure that the first instruction is answered using the response message generated in the queue.
需要说明的是,步骤501、步骤503、步骤504、步骤505在一些实施例中无需完全执行,即:在一些实施例中,第一终端无需每次执行确定所述M个支付应用的过程,可以第一次确定M个支付应用后,后续无需再执行步骤501;在一些实施例中,第一终端可能提前生成应答消息,因此,直接获取该应答消息即可,无需执行步骤503和步骤504;在一些实施例中第一终端可能预先配置好PPSE路由,因此无需执行步骤505。针对本发明的必要技术特征而言,在一些实施例中,直接执行步骤502和步骤506,此处不做具体限定。It should be noted that step 501, step 503, step 504, and step 505 need not be completely performed in some embodiments, that is, in some embodiments, the first terminal does not need to perform the process of determining the M payment applications each time. After the M payment application is determined for the first time, the step 501 is not required to be performed. In some embodiments, the first terminal may generate the response message in advance. Therefore, the response message may be directly obtained, and step 503 and step 504 need not be performed. In some embodiments, the first terminal may pre-configure the PPSE route, so step 505 need not be performed. For the necessary technical features of the present invention, in some embodiments, step 502 and step 506 are directly performed, and are not specifically limited herein.
为便于更好的实施本发明实施例的上述相关方法,下面还提供用于配合上述方法的相关装置。In order to facilitate the better implementation of the above related methods of the embodiments of the present invention, related devices for cooperating with the above methods are also provided below.
请参阅图8,本发明实施例中第一终端800的一个结构示意图,该第一终端800为支持近场通信的终端,该第一终端包括M个支付应用,M大于1,该第一终端800包括:接收模块801和发送模块802,在一些可能的实现方式中,该第一终端800还包括处理模块803。Referring to FIG. 8, a schematic structural diagram of a first terminal 800 in the embodiment of the present invention, the first terminal 800 is a terminal supporting near field communication, and the first terminal includes M payment applications, where M is greater than 1, the first terminal The 800 includes a receiving module 801 and a sending module 802. In some possible implementations, the first terminal 800 further includes a processing module 803.
接收模块801,用于接收第二终端发送的第一指令;The receiving module 801 is configured to receive a first instruction sent by the second terminal;
发送模块802,用于向所述第二终端发送用于应答所述第一指令的应答消 息;其中,所述应答消息包括N个应用标识符AID,所述N个AID为所述M个支付应用中包括的全部AID,每个支付应用包括至少一个AID,其中,所述M个支付应用包括主机卡模拟HCE应用或者所述M个支付应用包括HCE应用和卡应用,所述卡应用包含在所述第一终端的安全单元中。The sending module 802 is configured to send, to the second terminal, a response for answering the first instruction. The response message includes N application identifiers AID, the N AIDs are all AIDs included in the M payment applications, and each payment application includes at least one AID, wherein the M payments The application includes a host card emulation HCE application or the M payment applications include an HCE application and a card application, the card application being included in a security unit of the first terminal.
在一些可能的实现方式中,所述第一终端800还包括:In some possible implementations, the first terminal 800 further includes:
处理模块803,用于在所述发送模块802向所述第二终端发送用于应答所述第一指令的应答消息之前,获取所述N个AID和所述M个支付应用的第一信息;根据所述M个支付应用的第一信息将所述N个AID配置到队列中,所述队列用于生成所述应答消息;使用所述队列生成所述应答消息。The processing module 803 is configured to acquire the first information of the N AIDs and the M payment applications before the sending module 802 sends a response message for responding to the first instruction to the second terminal; And configuring the N AIDs into a queue according to the first information of the M payment applications, where the queue is used to generate the response message; and the response message is generated by using the queue.
所述处理模块803,还用于在所述发送模块802向所述第二终端发送用于应答所述第一指令的应答消息之前,配置PPSE路由,其中,所述PPSE路由包括NFC应用框架中的路由或者所述PPSE路由包括近场通信控制器NFCC路由和近场通信NFC应用框架中的路由,其中,所述第一指令为PPSE选择指令。The processing module 803 is further configured to: before the sending module 802 sends a response message for answering the first instruction to the second terminal, configure PPSE routing, where the PPSE route includes an NFC application framework. The routing or the PPSE routing includes routing in a near field communication controller NFCC routing and a near field communication NFC application framework, wherein the first instruction is a PPSE selection instruction.
在另一些可能的实现方式中,当所述PPSE路由包括NFC应用框架中的路由时,所述处理模块803在配置PPSE路由时,具体用于在所述NFC应用框架的路由中,配置第一程序和所述PPSE AID的对应关系,所述第一程序用于使用所述应答消息应答所述PPSE选择指令,其中,所述PPSE AID包含在所述PPSE选择指令中;In other possible implementations, when the PPSE route includes a route in the NFC application framework, the processing module 803 is configured to configure the first in the route of the NFC application framework when configuring the PPSE route. Corresponding relationship between the program and the PPSE AID, the first program is configured to respond to the PPSE selection instruction by using the response message, wherein the PPSE AID is included in the PPSE selection instruction;
或者,当所述PPSE路由包括近场通信控制器NFCC路由和近场通信NFC应用框架中的路由时,所述处理模块803在配置PPSE路由时,具体用于当所述NFCC路由中不包含第一路由项时,在所述NFCC路由中配置第二路由项;或者,当所述NFCC路由中包含第三路由项时,在所述NFCC路由中清除所述第三路由项并配置所述第二路由项,其中,所述第一路由项为包含PPSE AID的路由项,所述第二路由项为包含PPSE AID且路由目标是主机NFC执行环境的路由项,所述第三路由项为包含PPSE AID但路由目标不是主机NFC执行环境的路由项;或者,当所述NFCC路由中不包含第四路由项时,在所述NFCC路由中配置所述第四路由项;当该NFCC路由中包含所述第三路由项且不包含第四路由项时,在所述NFCC路由中清除所述第三路由项并配置所述第四路由项,其中,所述第四路由项是用于将AID选择指令路由到主机NFC执行环境的路由项。 在所述NFC应用框架的路由中,配置第一程序和所述PPSE AID的对应关系,所述第一程序用于使用所述应答消息应答所述PPSE选择指令。Or, when the PPSE route includes a route in the near field communication controller NFCC route and the near field communication NFC application framework, the processing module 803 is configured to: when the PPSE route is configured, specifically, when the NFCC route does not include the first When a routing entry is configured, the second routing entry is configured in the NFCC route; or, when the NFCC routing includes the third routing entry, the third routing entry is cleared in the NFCC routing and configured The second routing entry, wherein the first routing entry is a routing entry that includes a PPSE AID, and the second routing entry is a routing entry that includes a PPSE AID and the routing destination is a host NFC execution environment, and the third routing entry is included a PPSE AID but the routing destination is not a routing entry of the host NFC execution environment; or, when the NFCC route does not include the fourth routing entry, configuring the fourth routing entry in the NFCC routing; when the NFCC routing includes When the third routing entry does not include the fourth routing entry, the third routing entry is cleared in the NFCC route and the fourth routing entry is configured, where the fourth routing entry is used to use the AID. Select command routing Host NFC execution environment of routing entries. In the routing of the NFC application framework, a correspondence between the first program and the PPSE AID is configured, and the first program is configured to respond to the PPSE selection instruction by using the response message.
在另一些可能的实现方式中,所述支付应用的第一信息包括以下至少一种:支付应用的当前运行状态、支付应用的运行环境、支付应用的优先级以及支付应用的使用记录。In other possible implementation manners, the first information of the payment application includes at least one of a current running state of the payment application, an operating environment of the payment application, a priority of the payment application, and a usage record of the payment application.
在另一些可能的实现方式中,所述处理模块803,还用于在获取所述N个AID之前,根据支付应用白名单、支付应用黑名单和支付应用的第一信息中的至少一种,从所述第一终端上的全部支付应用中确定所述M个支付应用。In another possible implementation manner, the processing module 803 is further configured to: according to at least one of a payment application whitelist, a payment application blacklist, and a first information of a payment application, before acquiring the N AIDs, The M payment applications are determined from all payment applications on the first terminal.
在另一些可能的实现方式中,在所述处理模块803根据所述支付应用白名单、支付应用黑名单和支付应用的第一信息中的至少一种,从所述第一终端上的全部支付应用中确定所述M个支付应用时,所述处理模块803具体用于将所述第一终端上的支付应用白名单中的全部支付应用确定为所述M个支付应用;In other possible implementation manners, at the processing module 803, according to at least one of the payment application whitelist, the payment application blacklist, and the first information of the payment application, all payment from the first terminal When the M payment application is determined in the application, the processing module 803 is specifically configured to determine, as the M payment applications, all payment applications in the whitelist of payment applications on the first terminal;
或者,将所述第一终端上的除所述支付应用黑名单以外的其他支付应用确定为所述M个支付应用;Or determining, by the first terminal, a payment application other than the payment application blacklist as the M payment applications;
或者,所述支付应用的第一信息为支付应用的当前运行状态,且所述支付应用的当前运行状态包括前台运行和后台运行时,将所述前台运行和所述后台运行的全部支付应用确定为所述M个支付应用;Or the first information of the payment application is a current running state of the payment application, and the current running state of the payment application includes a foreground running and a background running, and determining, by the foreground running, all the payment applications running in the background For the M payment applications;
或者,所述支付应用的第一信息为支付应用的运行环境,且所述支付应用的运行环境包括第一运行环境和第二运行环境时,将所述第一运行环境和所述第二运行环境中的全部支付应用确定为所述M个支付应用或者将所述第一运行环境中的全部支付应用确定为所述M个支付应用,其中,所述第一运行环境中运行HCE应用,所述第二运行环境中运行卡应用;Or the first information of the payment application is the running environment of the payment application, and the operating environment of the payment application includes the first running environment and the second running environment, and the first running environment and the second running are performed. All payment applications in the environment are determined as the M payment applications or all payment applications in the first operating environment are determined as the M payment applications, wherein the HCE application is run in the first operating environment, Running the card application in the second operating environment;
或者,所述支付应用的第一信息为支付应用的优先级,将所述第一终端默认的支付应用和用户指定的全部支付应用确定为所述M个支付应用,其中,所述第一终端默认的支付应用和用户指定的支付应用的优先级高于所述第一终端上的其他支付应用的优先级;Or the first information of the payment application is a priority of the payment application, and the default payment application of the first terminal and all payment applications specified by the user are determined as the M payment applications, wherein the first terminal The default payment application and the user-specified payment application have higher priority than other payment applications on the first terminal;
或者,所述支付应用的第一信息为支付应用的使用记录,将所述使用记录中的全部支付应用确定为所述M个支付应用。Alternatively, the first information of the payment application is a usage record of the payment application, and all payment applications in the usage record are determined as the M payment applications.
在另一些可能的实现方式中,所述支付应用的第一信息为支付应用的当前 运行状态,所述当前运行状态包括前台运行和后台运行,所述处理模块803根据所述M个支付应用的第一信息将所述N个AID配置到队列中时,具体用于,将前台运行的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级,将后台运行的支付应用的全部AID配置到所述队列的第二位置并设置第二优先级,其中,所述第一优先级高于所述第二优先级。In other possible implementation manners, the first information of the payment application is a current payment application. An operating state, where the current running state includes a foreground running and a background running, and the processing module 803 is configured to run the foreground when the N AIDs are configured in the queue according to the first information of the M payment applications. All AIDs of the payment application are configured to the first location of the queue and set a first priority, and all AIDs of the payment application running in the background are configured to the second location of the queue and set a second priority, wherein The first priority is higher than the second priority.
在另一些可能的实现方式中,所述支付应用的第一信息为支付应用的运行环境,所述支付应用的运行环境包括第一运行环境和第二运行环境,所述第一运行环境中运行HCE应用,所述第二运行环境中运行卡应用,所述处理模块803根据所述M个支付应用的第一信息将所述N个AID配置到队列中时,具体用于当所述M个支付应用包括HCE应用和卡应用时,将所述HCE应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述卡应用的全部AID配置到所述队列的第二位置并设置第二优先级;或者,将所述卡应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述HCE应用的的全部AID配置到所述队列的第二位置并设置第二优先级,其中,所述第一优先级高于所述第二优先级。In another possible implementation manner, the first information of the payment application is an operating environment of a payment application, and the operating environment of the payment application includes a first running environment and a second running environment, where the first running environment runs. In the HCE application, the card application is run in the second running environment, and the processing module 803 is configured to configure the N AIDs into the queue according to the first information of the M payment applications, specifically, when the M When the payment application includes the HCE application and the card application, configuring all AIDs of the HCE application to the first location of the queue and setting a first priority, and configuring all AIDs of the card application to the second of the queue Positioning and setting a second priority; or configuring all AIDs of the card application to a first location of the queue and setting a first priority, configuring all AIDs of the HCE application to the queue The second location is set and the second priority is set, wherein the first priority is higher than the second priority.
在另一些可能的实现方式中,所述支付应用的第一信息为支付应用的优先级,所述M个支付应用包括所述第一终端默认的支付应用和用户指定的支付应用,所述处理模块803根据所述M个支付应用的第一信息将所述N个AID配置到队列中时,具体用于将所述用户指定的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述第一终端默认的支付应用的全部AID配置到所述队列的第二位置并设置第二优先级;或者,将所述第一终端默认的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述用户指定的支付应用的的全部AID配置到所述队列的第二位置并设置第二优先级,其中,所述第一终端默认的支付应用和所述用户指定的支付应用为不同的支付应用,所述第一优先级高于所述第二优先级,所述第一终端默认的支付应用和用户指定的支付应用的优先级高于所述第一终端上的其他支付应用的优先级。In other possible implementation manners, the first information of the payment application is a priority of a payment application, where the M payment applications include a default payment application of the first terminal and a payment application specified by a user, where the processing When the module 803 configures the N AIDs into the queue according to the first information of the M payment applications, specifically configured to configure all AIDs of the payment application specified by the user to the first location of the queue and set First priority, configuring all AIDs of the default payment application of the first terminal to the second location of the queue and setting a second priority; or configuring all AIDs of the default payment application of the first terminal Go to a first location of the queue and set a first priority, configure all AIDs of the user-specified payment application to a second location of the queue and set a second priority, wherein the first terminal The default payment application and the user-specified payment application are different payment applications, the first priority is higher than the second priority, and the first terminal default payment application and user finger Payment application priority higher than the priority of other payment application on the first terminal.
在另一些可能的实现方式中,所述支付应用的第一信息包括支付应用的使用记录,所述处理模块803根据所述M个支付应用的第一信息将所述N个AID 配置到队列中时,具体用于将最近一次进行NFC支付时使用的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级;或者,依照所述M个支付应用的使用频率的高低,依次将每个支付应用的全部AID配置到所述队列中并设置优先级,其中,所述第一优先级高于除所述第一优先级以外的其他优先级。In other possible implementations, the first information of the payment application includes a usage record of the payment application, and the processing module 803: the N AIDs according to the first information of the M payment applications. When configured in the queue, specifically configured to configure all AIDs of the payment application used in the last NFC payment to the first location of the queue and set the first priority; or, according to the use of the M payment applications The frequency is set, and the entire AID of each payment application is sequentially configured into the queue and the priority is set, wherein the first priority is higher than the priority other than the first priority.
在另一些可能的实现方式中,所述处理模块803,还用于当所述M个支付应用中的至少一个支付应用处于非运行状态时,激活所述至少一个支付应用。In other possible implementations, the processing module 803 is further configured to activate the at least one payment application when at least one of the M payment applications is in a non-operation state.
在实际应用中,当该M个支付应用当前均处于非运行状态时,激活该M个支付应用中的部分或者全部支付应用;并将该M个支付应用中被激活的部分或者全部支付应用的全部AID配置到该队列中,使得该队列根据部分或者全部支付应用的全部AID生成应答PPSE选择指令的应答消息。In an actual application, when the M payment applications are currently in a non-operation state, some or all of the payment applications are activated, and some or all of the M payment applications are activated. All AIDs are configured into the queue such that the queue generates a reply message acknowledging the PPSE selection command based on all AIDs of some or all of the payment applications.
可见,当该M个支付应用均处于非运行状态时,激活该M个支付应用的部分或者全部支付应用,其中,激活该部分或者全部支付应用的目的在于让该部分或者全部支付应用处于运行状态,即:启动该部分或者全部支付应用的应用程序,并执行相关的流程。从而避免了M个支付应用均未处于运行状态则无法配置应答PPSE选择指令的应答消息,进而无法完成支付应用与读卡器或者POS机之间的交互流程。It can be seen that when the M payment applications are in a non-operational state, part or all of the payment applications of the M payment applications are activated, wherein the part or all of the payment applications are activated to make the part or all payment applications run. That is, start the application that partially or completely pays the application, and execute the related process. Therefore, it is avoided that the M payment applications are not in the running state, and the response message responding to the PPSE selection command cannot be configured, and the interaction process between the payment application and the card reader or the POS machine cannot be completed.
可见,第一终端上安装M个支付应用,M大于1,第一终端的接收模块接收第二终端发送的近距离支付环境第一指令;第一终端的发送模块向该第二终端发送用于应答该第一指令的应答消息;其中,该应答消息包括N个应用标识符AID,该N个AID为该M个支付应用中包括的全部AID,每个支付应用包括至少一个AID,其中,该M个支付应用包括主机卡模拟HCE应用或者该M个支付应用包括HCE应用和卡应用。因此,不限于只提供默认的支付应用去应答第一指令,用于应答第一指令的应答消息中包括多个HCE应用和卡应用的AID,进而使得第二终端可以获得M个支付应用的AID,第二终端选中M个支付应用中的其中一个支付应用进行交易,无需手动修改默认支付应用设置,即可实现第二终端选中特定的AID,当然,还可以通过AID的优先级顺序优先选择特定的AID,有效提高用户体验。另外,由于第一终端上安装的支付应用不限于SE中的卡应用,还可以是HCE应用,因此,不会存在不支持物理SE的第一终端就无法完成读卡的问题。 It can be seen that, when the M terminal is installed on the first terminal, the M is greater than 1, the receiving module of the first terminal receives the first instruction of the short-range payment environment sent by the second terminal, and the sending module of the first terminal sends the second terminal to the second terminal. Responding to the response message of the first instruction; wherein the response message includes N application identifiers AID, the N AIDs are all AIDs included in the M payment applications, and each payment application includes at least one AID, where The M payment applications include host card emulation HCE applications or the M payment applications include HCE applications and card applications. Therefore, it is not limited to providing only the default payment application to answer the first instruction, and the response message for answering the first instruction includes the AIDs of the plurality of HCE applications and the card application, thereby enabling the second terminal to obtain the AIDs of the M payment applications. The second terminal selects one of the M payment applications to perform the transaction, and the second terminal may select a specific AID without manually modifying the default payment application setting. Of course, the priority may be preferentially selected by the AID priority order. The AID effectively improves the user experience. In addition, since the payment application installed on the first terminal is not limited to the card application in the SE, it may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
需要说明的是,在一些可选的实施例中,第一终端800不包括处理模块803,可根据实际情况而定,此处不做具体限定。另外,处理模块803可以是软件模块,能够在计算机系统的处理器中执行,也可以是特定的集成电路,并取得对应的技术效果,此处不做具体限定。It should be noted that, in some optional embodiments, the first terminal 800 does not include the processing module 803, and may be determined according to actual conditions, and is not specifically limited herein. In addition, the processing module 803 can be a software module, can be executed in a processor of the computer system, or can be a specific integrated circuit, and obtain corresponding technical effects, which are not specifically limited herein.
图8所示的实施例从功能模块的角度对第一终端的具体结构进行了说明,以下结合图9的实施例从硬件角度对第一终端的具体结构进行说明:一种第一终端900,包括:一个或多个处理器901、存储器902、总线系统903以及收发器904,所述一个或多个处理器901、所述存储器902和所述收发器903通过所述总线系统904连接;The embodiment shown in FIG. 8 illustrates the specific structure of the first terminal from the perspective of the function module. The specific structure of the first terminal is described from the hardware point of view with reference to the embodiment of FIG. 9 : a first terminal 900, Included: one or more processors 901, a memory 902, a bus system 903, and a transceiver 904, the one or more processors 901, the memory 902, and the transceiver 903 being connected by the bus system 904;
其中,所述存储器902中存储一个或多个程序905,所述一个或多个程序905包括指令,所述指令当被所述第一终端执行时使所述第一终端执行如图5所示的方法。One or more programs 905 are stored in the memory 902, and the one or more programs 905 include instructions that, when executed by the first terminal, cause the first terminal to perform as shown in FIG. Methods.
需要说明的是,本发明中的第一终端的功能可根据图5所示实施例中的方法具体实现,其具体实现过程可参考图5所示方法实施例中的相关描述,此处不再赘述,通过该第一终端执行图5所示实施例的方法,取得该方法实施例所能取得的技术效果。It should be noted that the function of the first terminal in the present invention may be specifically implemented according to the method in the embodiment shown in FIG. 5, and the specific implementation process may refer to the related description in the method embodiment shown in FIG. It is to be noted that the first terminal performs the method of the embodiment shown in FIG. 5 to obtain the technical effects that can be obtained by the method embodiment.
可见,第一上安装M个支付应用,M大于1,该第一终端接收第二终端发送的第一指令,第一终端向第二终端发送应答该第一指令的应答消息,其中,该应答消息包括N个AID,该N个AID为该M个支付应用包括的全部AID,每个支付应用有至少一个AID,该M个支付应用包括主机卡模拟HCE应用或者该M个支付应用包括HCE应用和卡应用。因此,不限于只有默认的支付应用才能应答第一指令,用于应答第一指令的应答消息包括多个HCE应用和卡应用的AID,即:给POS机提供多个归属于不同HCE应用的AID或者多个归属于不同HCE应用和不同卡应用的AID,使得第二终端可以获得M个支付应用的AID,进而选中M个支付应用中的其中一个支付应用进行交易,无需手动修改默认支付应用设置,即可实现第二终端选中特定的AID,当然,还可以通过AID的优先级顺序优先选择特定的AID,减少了用户操作,有效提高用户体验。另外,由于第一终端上安装的支付应用不限于SE中的卡应用,还可以是HCE应用,因此,不会存在不支持物理SE的第一终端就无法完成读卡的问题。 It can be seen that the M payment application is installed on the first, the M is greater than 1, the first terminal receives the first command sent by the second terminal, and the first terminal sends a response message to the second terminal that responds to the first command, where the response The message includes N AIDs, which are all AIDs included in the M payment applications, each payment application has at least one AID, the M payment applications include a host card emulation HCE application or the M payment applications include an HCE application And card applications. Therefore, it is not limited to only the default payment application to respond to the first instruction, and the response message for answering the first instruction includes multiple ACEs of the HCE application and the card application, that is, providing the POS machine with multiple AIDs belonging to different HCE applications. Or multiple AIDs belonging to different HCE applications and different card applications, so that the second terminal can obtain the AIDs of the M payment applications, and then select one of the M payment applications to perform the transaction, without manually modifying the default payment application settings. The second terminal can select a specific AID. Of course, the specific AID can be preferentially selected through the priority order of the AID, thereby reducing user operations and effectively improving the user experience. In addition, since the payment application installed on the first terminal is not limited to the card application in the SE, it may also be an HCE application. Therefore, there is no problem that the first terminal that does not support the physical SE cannot complete the card reading.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above embodiments, the descriptions of the various embodiments are different, and the details that are not detailed in a certain embodiment can be referred to the related descriptions of other embodiments.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of cells is only a logical function division. In actual implementation, there may be another division manner. For example, multiple units or components may be combined or integrated. Go to another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序 代码的介质。An integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, can be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present invention. The foregoing storage medium includes: a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. The medium of the code.
以上对本发明所提供的一种近场通信支付方法及终端进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本发明的限制。 The present invention provides a detailed description of the near field communication payment method and the terminal provided by the present invention. The principles and embodiments of the present invention are described herein. The description of the above embodiments is only for helping to understand the present invention. The method and its core idea; at the same time, those skilled in the art, according to the idea of the present invention, there will be changes in the specific embodiments and application scope. In summary, the content of the present specification should not be construed as the present invention. limits.

Claims (25)

  1. 一种近场通信NFC支付方法,所述方法应用于支持NFC的第一终端,其特征在于,所述第一终端包括M个支付应用,M大于1,所述方法包括:A near field communication NFC payment method, the method is applied to a first terminal that supports NFC, wherein the first terminal includes M payment applications, and M is greater than 1, the method includes:
    所述第一终端接收第二终端发送的第一指令;Receiving, by the first terminal, a first instruction sent by the second terminal;
    所述第一终端向所述第二终端发送用于应答所述第一指令的应答消息;其中,所述应答消息包括N个应用标识符AID,所述N个AID为所述M个支付应用包括的全部AID,每个支付应用包括至少一个AID,其中,所述M个支付应用包括主机卡模拟HCE应用或者所述M个支付应用包括HCE应用和卡应用。Sending, by the first terminal, a response message for responding to the first instruction to the second terminal, where the response message includes N application identifiers AID, and the N AIDs are the M payment applications All AIDs included, each payment application including at least one AID, wherein the M payment applications include a host card emulation HCE application or the M payment applications include an HCE application and a card application.
  2. 根据权利要求1所述的方法,其特征在于,所述第一终端向所述第二终端发送用于应答所述第一指令的应答消息之前,所述方法还包括:The method according to claim 1, wherein the method further comprises: before the first terminal sends a response message for answering the first instruction to the second terminal, the method further comprising:
    所述第一终端获取所述N个AID和所述M个支付应用的第一信息;Obtaining, by the first terminal, the N AIDs and the first information of the M payment applications;
    所述第一终端根据所述M个支付应用的第一信息将所述N个AID配置到队列中,所述队列用于生成所述应答消息;The first terminal configures the N AIDs into a queue according to the first information of the M payment applications, where the queue is used to generate the response message;
    所述第一终端使用所述队列生成所述应答消息。The first terminal generates the response message by using the queue.
  3. 根据权利要求2所述的方法,其特征在于,所述支付应用的第一信息包括以下至少一种:The method according to claim 2, wherein the first information of the payment application comprises at least one of the following:
    支付应用的当前运行状态、支付应用的运行环境、支付应用的优先级以及支付应用的使用记录。The current operational status of the payment application, the operating environment of the payment application, the priority of the payment application, and the usage record of the payment application.
  4. 根据权利要求2或3所述的方法,其特征在于,所述第一终端获取所述N个AID之前,所述方法还包括:The method according to claim 2 or 3, wherein before the acquiring, by the first terminal, the N AIDs, the method further comprises:
    所述第一终端根据支付应用白名单、支付应用黑名单和支付应用的第一信息中的至少一种,从所述第一终端上的全部支付应用中确定所述M个支付应用。The first terminal determines the M payment applications from all payment applications on the first terminal according to at least one of a payment application white list, a payment application blacklist, and a first information of a payment application.
  5. 根据权利要求4所述的方法,其特征在于,所述第一终端根据支付应用白名单、支付应用黑名单和支付应用的第一信息中的至少一种,从所述第一终端上的全部支付应用中确定所述M个支付应用包括:The method according to claim 4, wherein the first terminal is based on at least one of a payment application white list, a payment application blacklist, and a first information of a payment application, from all of the first terminals. Determining the M payment applications in the payment application includes:
    将所述第一终端上的支付应用白名单中的全部支付应用确定为所述M个支付应用;Determining, in the payment application white list on the first terminal, all payment applications as the M payment applications;
    或者,将所述第一终端上的除所述支付应用黑名单以外的其他支付应用确 定为所述M个支付应用;Or, the payment application other than the blacklist of the payment application on the first terminal is confirmed Set as the M payment application;
    或者,所述支付应用的第一信息为支付应用的当前运行状态,且所述支付应用的当前运行状态包括前台运行和后台运行时,将所述前台运行和所述后台运行的全部支付应用确定为所述M个支付应用;Or the first information of the payment application is a current running state of the payment application, and the current running state of the payment application includes a foreground running and a background running, and determining, by the foreground running, all the payment applications running in the background For the M payment applications;
    或者,所述支付应用的第一信息为支付应用的运行环境,且所述支付应用的运行环境包括第一运行环境和第二运行环境时,将所述第一运行环境和所述第二运行环境中的全部支付应用确定为所述M个支付应用或者将所述第一运行环境中的全部支付应用确定为所述M个支付应用,其中,所述第一运行环境中运行HCE应用,所述第二运行环境中运行卡应用;Or the first information of the payment application is the running environment of the payment application, and the operating environment of the payment application includes the first running environment and the second running environment, and the first running environment and the second running are performed. All payment applications in the environment are determined as the M payment applications or all payment applications in the first operating environment are determined as the M payment applications, wherein the HCE application is run in the first operating environment, Running the card application in the second operating environment;
    或者,所述支付应用的第一信息为支付应用的优先级,将所述第一终端默认的支付应用和用户指定的全部支付应用确定为所述M个支付应用,其中,所述第一终端默认的支付应用和用户指定的支付应用的优先级高于所述第一终端上的其他支付应用的优先级;Or the first information of the payment application is a priority of the payment application, and the default payment application of the first terminal and all payment applications specified by the user are determined as the M payment applications, wherein the first terminal The default payment application and the user-specified payment application have higher priority than other payment applications on the first terminal;
    或者,所述支付应用的第一信息为支付应用的使用记录,将所述使用记录中的全部支付应用确定为所述M个支付应用。Alternatively, the first information of the payment application is a usage record of the payment application, and all payment applications in the usage record are determined as the M payment applications.
  6. 根据权利要求1至5任一项所述的方法,其特征在于,所述第一终端向所述第二终端发送用于应答所述第一指令的应答消息之前,所述方法还包括:The method according to any one of claims 1 to 5, wherein before the first terminal sends a response message for answering the first instruction to the second terminal, the method further includes:
    所述第一终端配置近距离支付环境PPSE路由,所述PPSE路由用于确保所述第一终端使用所述应答消息应答所述第一指令,其中,所述PPSE路由包括NFC应用框架中的路由或者所述PPSE路由包括近场通信控制器NFCC路由和NFC应用框架中的路由,其中,所述第一指令为PPSE选择指令。The first terminal configures a proximity payment environment PPSE route, the PPSE route is used to ensure that the first terminal responds to the first instruction by using the response message, where the PPSE route includes a route in an NFC application framework Or the PPSE route includes a near field communication controller NFCC route and a route in an NFC application framework, wherein the first instruction is a PPSE selection instruction.
  7. 根据权利要求6所述的方法,其特征在于,The method of claim 6 wherein:
    当所述PPSE路由包括NFC应用框架中的路由时,所述第一终端配置PPSE路由包括:在所述NFC应用框架的路由中,配置第一程序和PPSE AID的对应关系,所述第一程序用于使用所述应答消息应答所述PPSE选择指令,其中,所述PPSE AID包含在所述PPSE选择指令中;或者When the PPSE route includes the route in the NFC application framework, the first terminal configuring the PPSE route includes: configuring a correspondence between the first program and the PPSE AID in the route of the NFC application framework, where the first program Responsive to the PPSE selection instruction using the response message, wherein the PPSE AID is included in the PPSE selection instruction; or
    当所述PPSE路由包括NFCC路由和NFC应用框架中的路由时,所述第一终端配置PPSE路由包括: When the PPSE route includes a route in the NFCC route and the NFC application framework, the first terminal configuring the PPSE route includes:
    当所述NFCC路由中不包含第一路由项时,在所述NFCC路由中配置第二路由项;或者,当所述NFCC路由中包含第三路由项时,在所述NFCC路由中清除所述第三路由项并配置所述第二路由项,其中,所述第一路由项为包含PPSE AID的路由项,所述第二路由项为包含PPSE AID且路由目标是主机NFC执行环境的路由项,所述第三路由项为包含PPSE AID但路由目标不是主机NFC执行环境的路由项;或者,当所述NFCC路由中不包含第四路由项时,在所述NFCC路由中配置所述第四路由项,所述第四路由项是用于将AID选择指令路由到主机NFC执行环境的路由项;Configuring a second routing entry in the NFCC route when the NFCC route does not include the first routing entry; or clearing the NFCC routing in the NFCC routing when the NFCC routing includes the third routing entry The third routing entry is configured to configure the second routing entry, where the first routing entry is a routing entry that includes a PPSE AID, and the second routing entry is a routing entry that includes a PPSE AID and the routing destination is a host NFC execution environment. The third routing entry is a routing entry that includes the PPSE AID but the routing destination is not the host NFC execution environment; or, when the NFCC routing does not include the fourth routing entry, configuring the fourth in the NFCC routing a routing item, where the fourth routing item is a routing item used to route the AID selection instruction to the host NFC execution environment;
    在所述NFC应用框架的路由中,配置第一程序和所述PPSE AID的对应关系,所述第一程序用于使用所述应答消息应答所述PPSE选择指令。In the routing of the NFC application framework, a correspondence between the first program and the PPSE AID is configured, and the first program is configured to respond to the PPSE selection instruction by using the response message.
  8. 根据权利要求2至7任一项所述的方法,其特征在于,所述支付应用的第一信息为支付应用的当前运行状态,所述当前运行状态包括前台运行和后台运行,所述第一终端根据所述M个支付应用的第一信息将所述N个AID配置到队列中包括:The method according to any one of claims 2 to 7, wherein the first information of the payment application is a current running state of the payment application, and the current running state includes a foreground running and a background running, the first And configuring, by the terminal, the N AIDs into the queue according to the first information of the M payment applications includes:
    将前台运行的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级,将后台运行的支付应用的全部AID配置到所述队列的第二位置并设置第二优先级,其中,所述第一优先级高于所述第二优先级。All AIDs of the payment application running in the foreground are configured to the first location of the queue and set a first priority, and all AIDs of the payment application running in the background are configured to the second location of the queue and the second priority is set. The first priority is higher than the second priority.
  9. 根据权利要求2至7任一项所述的方法,其特征在于,所述支付应用的第一信息为支付应用的运行环境,所述支付应用的运行环境包括第一运行环境和第二运行环境,所述第一运行环境中运行HCE应用,所述第二运行环境中运行卡应用,所述第一终端根据所述M个支付应用的第一信息将所述N个AID配置到队列中包括:The method according to any one of claims 2 to 7, wherein the first information of the payment application is an operating environment of a payment application, and the operating environment of the payment application comprises a first operating environment and a second operating environment. The first operating environment runs an HCE application, and the second operating environment runs a card application, and the first terminal configures the N AIDs into the queue according to the first information of the M payment applications. :
    当所述M个支付应用包括HCE应用和卡应用时,将所述HCE应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述卡应用的全部AID配置到所述队列的第二位置并设置第二优先级;或者,将所述卡应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述HCE应用的的全部AID配置到所述队列的第二位置并设置第二优先级,其中,所述第一优先级高于所述第二优先级。When the M payment applications include an HCE application and a card application, all AIDs of the HCE application are configured to a first location of the queue and a first priority is set, and all AIDs of the card application are configured to the Determining the second location of the queue and setting the second priority; or configuring all the AIDs of the card application to the first location of the queue and setting the first priority, configuring all AIDs of the HCE application to a second location of the queue and a second priority, wherein the first priority is higher than the second priority.
  10. 根据权利要求2至7任一项所述的方法,其特征在于,所述支付应用 的第一信息为支付应用的优先级,所述M个支付应用包括所述第一终端默认的支付应用和用户指定的支付应用,所述第一终端根据所述M个支付应用的第一信息将所述N个AID配置到队列中包括:Method according to any of claims 2 to 7, characterized in that the payment application The first information is a priority of the payment application, and the M payment applications include a default payment application of the first terminal and a payment application specified by the user, and the first terminal is configured according to the first information of the M payment applications. Configuring the N AIDs into the queue includes:
    将所述用户指定的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述第一终端默认的支付应用的全部AID配置到所述队列的第二位置并设置第二优先级;或者,将所述第一终端默认的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述用户指定的支付应用的的全部AID配置到所述队列的第二位置并设置第二优先级,其中,所述第一终端默认的支付应用和所述用户指定的支付应用为不同的支付应用,所述第一优先级高于所述第二优先级,所述第一终端默认的支付应用和用户指定的支付应用的优先级高于所述第一终端上的其他支付应用的优先级。All AIDs of the payment application specified by the user are configured to a first location of the queue and a first priority is set, and all AIDs of the default payment application of the first terminal are configured to a second location of the queue and Setting a second priority; or configuring all AIDs of the default payment application of the first terminal to the first location of the queue and setting a first priority, configuring all AIDs of the payment application specified by the user Go to the second location of the queue and set a second priority, wherein the default payment application of the first terminal and the payment application specified by the user are different payment applications, and the first priority is higher than the The second priority is that the priority of the default payment application and the user-specified payment application of the first terminal is higher than the priority of other payment applications on the first terminal.
  11. 根据权利要求2至7任一项所述的方法,其特征在于,所述支付应用的第一信息包括支付应用的使用记录,所述第一终端根据所述M个支付应用的第一信息将所述N个AID配置到队列中包括:The method according to any one of claims 2 to 7, wherein the first information of the payment application comprises a usage record of the payment application, and the first terminal according to the first information of the M payment applications The configuration of the N AIDs into the queue includes:
    将最近一次进行NFC支付时使用的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级;或者,依照所述M个支付应用的使用频率的高低,依次将每个支付应用的全部AID配置到所述队列中并设置优先级,其中,所述第一优先级高于除所述第一优先级以外的其他优先级。All AIDs of the payment application used in the last NFC payment are configured to the first location of the queue and set a first priority; or, according to the frequency of use of the M payment applications, each payment is sequentially All AIDs of the application are configured into the queue and prioritized, wherein the first priority is higher than other priorities than the first priority.
  12. 根据权利要求1至11任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 11, wherein the method further comprises:
    当所述M个支付应用中的至少一个支付应用处于非运行状态时,激活所述至少一个支付应用。The at least one payment application is activated when at least one of the M payment applications is in a non-operational state.
  13. 一种第一终端,所述第一终端为支持近场通信NFC的终端,其特征在于,所述第一终端包括M个支付应用,M大于1,所述第一终端包括:A first terminal, the first terminal is a terminal that supports a near field communication NFC, and the first terminal includes M payment applications, where M is greater than 1, and the first terminal includes:
    接收模块,用于接收第二终端发送的第一指令;a receiving module, configured to receive a first instruction sent by the second terminal;
    发送模块,用于向所述第二终端发送用于应答所述第一指令的应答消息;其中,所述应答消息包括N个应用标识符AID,所述N个AID为所述M个支付应用包括的全部AID,每个支付应用包括至少一个AID,其中,所述M个支付应用包括主机卡模拟HCE应用或者所述M个支付应用包括HCE应用和卡应用。 a sending module, configured to send, to the second terminal, a response message for responding to the first instruction, where the response message includes N application identifiers AID, and the N AIDs are the M payment applications All AIDs included, each payment application including at least one AID, wherein the M payment applications include a host card emulation HCE application or the M payment applications include an HCE application and a card application.
  14. 根据权利要求13所述的第一终端,其特征在于,所述第一终端还包括:The first terminal according to claim 13, wherein the first terminal further comprises:
    处理模块,用于在所述发送模块向所述第二终端发送用于应答所述第一指令的应答消息之前,获取所述N个AID和所述M个支付应用的第一信息;根据所述M个支付应用的第一信息将所述N个AID配置到队列中,所述队列用于生成所述应答消息;使用所述队列生成所述应答消息。a processing module, configured to acquire first information of the N AIDs and the M payment applications before the sending module sends a response message for responding to the first instruction to the second terminal; The first information of the M payment applications configures the N AIDs into a queue, the queue is used to generate the response message, and the response message is generated using the queue.
  15. 根据权利要求14所述的第一终端,其特征在于,所述支付应用的第一信息包括以下至少一种:支付应用的当前运行状态、支付应用的运行环境、支付应用的优先级以及支付应用的使用记录。The first terminal according to claim 14, wherein the first information of the payment application comprises at least one of: a current running state of the payment application, an operating environment of the payment application, a priority of the payment application, and a payment application. Usage record.
  16. 根据权利要求14或15所述的第一终端,其特征在于,A first terminal according to claim 14 or 15, wherein
    所述处理模块,还用于在获取所述N个AID之前,根据支付应用白名单、支付应用黑名单和支付应用的第一信息中的至少一种,从所述第一终端上的全部支付应用中确定所述M个支付应用。The processing module is further configured to: before obtaining the N AIDs, all the payment from the first terminal according to at least one of a payment application whitelist, a payment application blacklist, and a first information of a payment application. The M payment applications are determined in an application.
  17. 根据权利要求16所述的第一终端,其特征在于,在所述处理模块根据所述支付应用白名单、支付应用黑名单和支付应用的第一信息中的至少一种,从所述第一终端上的全部支付应用中确定所述M个支付应用时,所述处理模块具体用于:The first terminal according to claim 16, wherein at least one of the processing module according to the payment application white list, the payment application blacklist, and the first information of the payment application is from the first When the M payment applications are determined in all the payment applications on the terminal, the processing module is specifically configured to:
    将所述第一终端上的支付应用白名单中的全部支付应用确定为所述M个支付应用;Determining, in the payment application white list on the first terminal, all payment applications as the M payment applications;
    或者,将所述第一终端上的除所述支付应用黑名单以外的其他支付应用确定为所述M个支付应用;Or determining, by the first terminal, a payment application other than the payment application blacklist as the M payment applications;
    或者,所述支付应用的第一信息为支付应用的当前运行状态,且所述支付应用的当前运行状态包括前台运行和后台运行时,将所述前台运行和所述后台运行的全部支付应用确定为所述M个支付应用;Or the first information of the payment application is a current running state of the payment application, and the current running state of the payment application includes a foreground running and a background running, and determining, by the foreground running, all the payment applications running in the background For the M payment applications;
    或者,所述支付应用的第一信息为支付应用的运行环境,且所述支付应用的运行环境包括第一运行环境和第二运行环境时,将所述第一运行环境和所述第二运行环境中的全部支付应用确定为所述M个支付应用或者将所述第一运行环境中的全部支付应用确定为所述M个支付应用,其中,所述第一运行环境中运行HCE应用,所述第二运行环境中运行卡应用; Or the first information of the payment application is the running environment of the payment application, and the operating environment of the payment application includes the first running environment and the second running environment, and the first running environment and the second running are performed. All payment applications in the environment are determined as the M payment applications or all payment applications in the first operating environment are determined as the M payment applications, wherein the HCE application is run in the first operating environment, Running the card application in the second operating environment;
    或者,所述支付应用的第一信息为支付应用的优先级,将所述第一终端默认的支付应用和用户指定的全部支付应用确定为所述M个支付应用,其中,所述第一终端默认的支付应用和用户指定的支付应用的优先级高于所述第一终端上的其他支付应用的优先级;Or the first information of the payment application is a priority of the payment application, and the default payment application of the first terminal and all payment applications specified by the user are determined as the M payment applications, wherein the first terminal The default payment application and the user-specified payment application have higher priority than other payment applications on the first terminal;
    或者,所述支付应用的第一信息为支付应用的使用记录,将所述使用记录中的全部支付应用确定为所述M个支付应用。Alternatively, the first information of the payment application is a usage record of the payment application, and all payment applications in the usage record are determined as the M payment applications.
  18. 根据权利要求13至17任一项所述的第一终端,其特征在于,所述处理模块,还用于在所述发送模块向所述第二终端发送用于应答所述第一指令的应答消息之前,配置PPSE路由,所述PPSE路由用于确保所述第一终端使用所述应答消息应答所述第一指令,其中,所述PPSE路由包括NFC应用框架中的路由或者所述PPSE路由包括近场通信控制器NFCC路由和NFC应用框架中的路由,其中,所述第一指令为PPSE选择指令。The first terminal according to any one of claims 13 to 17, wherein the processing module is further configured to: send, by the sending module, a response for responding to the first instruction to the second terminal Before the message, configuring a PPSE route, the PPSE route is used to ensure that the first terminal responds to the first instruction by using the response message, where the PPSE route includes a route in an NFC application framework or the PPSE route includes The near field communication controller NFCC routing and routing in the NFC application framework, wherein the first instruction is a PPSE selection instruction.
  19. 根据权利要求18所述的第一终端,其特征在于,当所述PPSE路由包括NFC应用框架中的路由时,所述处理模块在配置PPSE路由时,具体用于在所述NFC应用框架的路由中,配置第一程序和PPSE AID的对应关系,所述第一程序用于使用所述应答消息应答所述PPSE选择指令,其中,所述PPSE AID包含在所述PPSE选择指令中;或者,The first terminal according to claim 18, wherein when the PPSE route includes a route in an NFC application framework, the processing module is specifically configured to use the route in the NFC application framework when configuring a PPSE route. And configuring a correspondence between the first program and the PPSE AID, where the first program is configured to respond to the PPSE selection instruction by using the response message, where the PPSE AID is included in the PPSE selection instruction; or
    当所述PPSE路由包括NFCC路由和NFC应用框架中的路由时,所述处理模块在配置PPSE路由时,具体用于:When the PPSE route includes the NFCC route and the route in the NFC application framework, the processing module is specifically configured to:
    当所述NFCC路由中不包含第一路由项时,在所述NFCC路由中配置第二路由项;或者,当所述NFCC路由中包含第三路由项时,在所述NFCC路由中清除所述第三路由项并配置所述第二路由项,其中,所述第一路由项为包含PPSE AID的路由项,所述第二路由项为包含PPSE AID且路由目标是主机NFC执行环境的路由项,所述第三路由项为包含PPSE AID但路由目标不是主机NFC执行环境的路由项;或者,当所述NFCC路由中不包含第四路由项时,在所述NFCC路由中配置所述第四路由项,所述第四路由项是用于将AID选择指令路由到主机NFC执行环境的路由项;Configuring a second routing entry in the NFCC route when the NFCC route does not include the first routing entry; or clearing the NFCC routing in the NFCC routing when the NFCC routing includes the third routing entry The third routing entry is configured to configure the second routing entry, where the first routing entry is a routing entry that includes a PPSE AID, and the second routing entry is a routing entry that includes a PPSE AID and the routing destination is a host NFC execution environment. The third routing entry is a routing entry that includes the PPSE AID but the routing destination is not the host NFC execution environment; or, when the NFCC routing does not include the fourth routing entry, configuring the fourth in the NFCC routing a routing item, where the fourth routing item is a routing item used to route the AID selection instruction to the host NFC execution environment;
    在所述NFC应用框架的路由中,配置第一程序和所述PPSE AID的对应关系,所述第一程序用于使用所述应答消息应答所述PPSE选择指令。 In the routing of the NFC application framework, a correspondence between the first program and the PPSE AID is configured, and the first program is configured to respond to the PPSE selection instruction by using the response message.
  20. 根据权利要求14至19任一项所述的第一终端,其特征在于,所述支付应用的第一信息为支付应用的当前运行状态,所述当前运行状态包括前台运行和后台运行,所述处理模块根据所述M个支付应用的第一信息将所述N个AID配置到队列中时,具体用于:将前台运行的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级,将后台运行的支付应用的全部AID配置到所述队列的第二位置并设置第二优先级,其中,所述第一优先级高于所述第二优先级。The first terminal according to any one of claims 14 to 19, wherein the first information of the payment application is a current running state of the payment application, and the current running state includes a foreground running and a background running, When the processing module configures the N AIDs into the queue according to the first information of the M payment applications, the method is specifically configured to: configure all AIDs of the payment application running in the foreground to the first position of the queue and set the first a priority, configuring all AIDs of the payment application running in the background to the second location of the queue and setting a second priority, wherein the first priority is higher than the second priority.
  21. 根据权利要求14至19任一项所述的第一终端,其特征在于,所述支付应用的第一信息为支付应用的运行环境,所述支付应用的运行环境包括第一运行环境和第二运行环境,所述第一运行环境中运行HCE应用,所述第二运行环境中运行卡应用,所述处理模块根据所述M个支付应用的第一信息将所述N个AID配置到队列中时,具体用于:当所述M个支付应用包括HCE应用和卡应用时,将所述HCE应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述卡应用的全部AID配置到所述队列的第二位置并设置第二优先级;或者,将所述卡应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述HCE应用的的全部AID配置到所述队列的第二位置并设置第二优先级,其中,所述第一优先级高于所述第二优先级。The first terminal according to any one of claims 14 to 19, wherein the first information of the payment application is an operating environment of a payment application, and the operating environment of the payment application comprises a first operating environment and a second An operating environment, the HCE application is run in the first operating environment, and the card application is run in the second operating environment, and the processing module configures the N AIDs into the queue according to the first information of the M payment applications. Specifically, when the M payment application includes an HCE application and a card application, configuring all AIDs of the HCE application to a first location of the queue and setting a first priority, and applying the card All AIDs are configured to the second location of the queue and set a second priority; or, configuring all the AIDs of the card application to the first location of the queue and setting a first priority, applying the HCE All of the AIDs are configured to a second location of the queue and a second priority is set, wherein the first priority is higher than the second priority.
  22. 根据权利要求14至19任一项所述的第一终端,其特征在于,所述支付应用的第一信息为支付应用的优先级,所述M个支付应用包括所述第一终端默认的支付应用和用户指定的支付应用,所述处理模块根据所述M个支付应用的第一信息将所述N个AID配置到队列中时,具体用于:将所述用户指定的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述第一终端默认的支付应用的全部AID配置到所述队列的第二位置并设置第二优先级;或者,将所述第一终端默认的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级,将所述用户指定的支付应用的的全部AID配置到所述队列的第二位置并设置第二优先级,其中,所述第一终端默认的支付应用和所述用户指定的支付应用为不同的支付应用,所述第一优先级高于所述第二优先级,所述第一终端默认的支付应用和用户指定的支付应用的优先级高于所述第一终端上的其他支付应用的优先级。 The first terminal according to any one of claims 14 to 19, wherein the first information of the payment application is a priority of a payment application, and the M payment applications comprise a default payment of the first terminal. And the user-specified payment application, when the processing module configures the N AIDs into the queue according to the first information of the M payment applications, specifically, is used to: use the entire AID of the payment application specified by the user Configuring a first priority to the queue and setting a first priority, configuring all AIDs of the default payment application of the first terminal to a second location of the queue and setting a second priority; or All AIDs of the default payment application of the first terminal are configured to the first location of the queue and set a first priority, and all AIDs of the payment application specified by the user are configured to the second location of the queue and set a second priority, wherein the default payment application of the first terminal and the payment application specified by the user are different payment applications, and the first priority is higher than the second priority, the first end The default priority application and the user-specified payment payment application priority over other payment application on the first terminal.
  23. 根据权利要求14至19任一项所述的第一终端,其特征在于,所述支付应用的第一信息包括支付应用的使用记录,所述处理模块根据所述M个支付应用的第一信息将所述N个AID配置到队列中时,具体用于:将最近一次进行NFC支付时使用的支付应用的全部AID配置到所述队列的第一位置并设置第一优先级;或者,依照所述M个支付应用的使用频率的高低,依次将每个支付应用的全部AID配置到所述队列中并设置优先级,其中,所述第一优先级高于除所述第一优先级以外的其他优先级。The first terminal according to any one of claims 14 to 19, wherein the first information of the payment application comprises a usage record of a payment application, and the processing module is configured according to the first information of the M payment applications. When the N AIDs are configured in the queue, the specific AIDs of the payment application used in the last NFC payment are configured to the first location of the queue and the first priority is set; or Determining the frequency of use of the M payment applications, sequentially configuring all the AIDs of each payment application into the queue and setting priorities, wherein the first priority is higher than the first priority Other priorities.
  24. 根据权利要求13至23任一项所述的第一终端,其特征在于,A first terminal according to any one of claims 13 to 23, characterized in that
    所述处理模块,还用于当所述M个支付应用中的至少一个支付应用处于非运行状态时,激活所述至少一个支付应用。The processing module is further configured to activate the at least one payment application when at least one of the M payment applications is in a non-operation state.
  25. 一种第一终端,其特征在于,包括:一个或多个处理器、存储器、总线系统以及收发器,所述一个或多个处理器、所述存储器和所述收发器通过所述总线系统连接;A first terminal, comprising: one or more processors, a memory, a bus system, and a transceiver, wherein the one or more processors, the memory, and the transceiver are connected by the bus system ;
    其中,所述存储器中存储一个或多个程序,所述一个或多个程序包括指令,所述指令当被所述第一终端执行时使所述第一终端执行如权利要求1-12任一项所述的方法。 Wherein the memory stores one or more programs, the one or more programs including instructions that, when executed by the first terminal, cause the first terminal to perform any of claims 1-12 The method described in the item.
PCT/CN2016/072527 2016-01-28 2016-01-28 Near field communication payment method and terminal WO2017128182A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201680003886.2A CN107251069B (en) 2016-01-28 2016-01-28 Near field communication payment method and terminal
PCT/CN2016/072527 WO2017128182A1 (en) 2016-01-28 2016-01-28 Near field communication payment method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/072527 WO2017128182A1 (en) 2016-01-28 2016-01-28 Near field communication payment method and terminal

Publications (1)

Publication Number Publication Date
WO2017128182A1 true WO2017128182A1 (en) 2017-08-03

Family

ID=59396919

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/072527 WO2017128182A1 (en) 2016-01-28 2016-01-28 Near field communication payment method and terminal

Country Status (2)

Country Link
CN (1) CN107251069B (en)
WO (1) WO2017128182A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110020569A (en) * 2019-03-11 2019-07-16 华为技术有限公司 Automatically select method, electronic equipment and the communication system of NFC analog card
CN111383011A (en) * 2018-12-29 2020-07-07 华为技术有限公司 Method for processing relay attack and security unit
CN115018483A (en) * 2021-11-19 2022-09-06 荣耀终端有限公司 Application processing method, terminal device and storage medium

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020088753A1 (en) * 2018-10-31 2020-05-07 Huawei Technologies Co., Ltd. Device and method for enforcing a data policy
CN110764772B (en) * 2019-09-02 2023-04-25 广东天波信息技术股份有限公司 Method and device for being compatible with multiple NFCCs
CN114286345B (en) * 2021-12-27 2024-04-02 无锡融卡科技有限公司 NFC communication device and method in intelligent terminal

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140025516A1 (en) * 2012-07-23 2014-01-23 Wal-Mart Stores, Inc. Transferring digital receipt data to mobile devices
CN103679439A (en) * 2012-09-03 2014-03-26 中国银联股份有限公司 Payment method based on mobile communication equipment, mobile communication equipment and smart card
CN104115173A (en) * 2011-12-21 2014-10-22 茂福公司 Method for routing within a mobile terminal emulating a contactless payment card

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8016192B2 (en) * 2006-06-06 2011-09-13 Motorola Mobility, Inc. User-configurable priority list for mobile device electronic payment applications
FR3018972B1 (en) * 2014-03-18 2016-04-15 Proton World Int Nv SECURE NFC ROUTING
CN104751330B (en) * 2015-03-13 2018-01-19 广东欧珀移动通信有限公司 Method of payment and smart machine

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104115173A (en) * 2011-12-21 2014-10-22 茂福公司 Method for routing within a mobile terminal emulating a contactless payment card
US20140025516A1 (en) * 2012-07-23 2014-01-23 Wal-Mart Stores, Inc. Transferring digital receipt data to mobile devices
CN103679439A (en) * 2012-09-03 2014-03-26 中国银联股份有限公司 Payment method based on mobile communication equipment, mobile communication equipment and smart card

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111383011A (en) * 2018-12-29 2020-07-07 华为技术有限公司 Method for processing relay attack and security unit
CN111383011B (en) * 2018-12-29 2023-09-29 华为技术有限公司 Method for processing relay attack and safety unit
CN110020569A (en) * 2019-03-11 2019-07-16 华为技术有限公司 Automatically select method, electronic equipment and the communication system of NFC analog card
WO2020182064A1 (en) * 2019-03-11 2020-09-17 华为技术有限公司 Method for automatically selecting nfc emulation card, electronic apparatus, and communications system
CN110020569B (en) * 2019-03-11 2022-03-29 华为技术有限公司 Method for automatically selecting NFC analog card, electronic equipment and communication system
CN115018483A (en) * 2021-11-19 2022-09-06 荣耀终端有限公司 Application processing method, terminal device and storage medium

Also Published As

Publication number Publication date
CN107251069B (en) 2020-09-29
CN107251069A (en) 2017-10-13

Similar Documents

Publication Publication Date Title
WO2017128182A1 (en) Near field communication payment method and terminal
US20220180351A1 (en) Method, electronic device, and communications system for automatically selecting nfc emulation card
JP6305559B2 (en) Secure element management method and terminal
RU2489813C2 (en) Method and apparatus for automatic application selection in electronic device using multiple discovery managers
US10911565B2 (en) Method, device and system for associating a service account
US20090247077A1 (en) Method and Apparatus for Automatic Near Field Communication Application Selection in an Electronic Device
JP6127318B2 (en) Contactless payment method, device and system
US9600816B2 (en) Method and system for executing a NFC transaction supporting multiple applications and multiples instances of a same application
US10387219B2 (en) Enabling multiple secure elements in a card computing device
US10032050B2 (en) Electronic device, system and method for NFC
WO2017128516A1 (en) Nfc payment method selection method and apparatus, and terminal
CN106663017B (en) Method, terminal, data routing method and device for realizing host card simulation
SG173004A1 (en) Portable mobile communication device and method of controlling near field communication
CN114500138A (en) Linkage control configuration method, linkage control method and linkage control system
US8776251B2 (en) Data exchange between a secure element and a terminal
WO2012037791A1 (en) Method, device and system for displaying radio frequency identification application information
CN113518341B (en) eSIM code number management method and device
CN112738774A (en) Application sharing method and device, terminal and computer readable storage medium
US8533747B2 (en) Method and system for selecting one or more integrated circuit card interface devices
US8844827B2 (en) Chip card, and method for the software-based modification of a chip card
CN108307286B (en) Method and system for realizing communication between android devices based on NFC
US8369894B1 (en) Confirming certification of combinations of secure elements and mobile devices
WO2018161224A1 (en) Data processing method and related device
US20150332255A1 (en) Method and system for token-based communication between extraneous applications and an electronic wallet
CN112712356B (en) Method and system for configuring Java Card parameter

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

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

Country of ref document: EP

Kind code of ref document: A1