WO2024001767A1 - 安全业务的切换方法及终端 - Google Patents

安全业务的切换方法及终端 Download PDF

Info

Publication number
WO2024001767A1
WO2024001767A1 PCT/CN2023/100042 CN2023100042W WO2024001767A1 WO 2024001767 A1 WO2024001767 A1 WO 2024001767A1 CN 2023100042 W CN2023100042 W CN 2023100042W WO 2024001767 A1 WO2024001767 A1 WO 2024001767A1
Authority
WO
WIPO (PCT)
Prior art keywords
card
module
terminal
instruction
cutting
Prior art date
Application number
PCT/CN2023/100042
Other languages
English (en)
French (fr)
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 EP23825590.5A priority Critical patent/EP4346250A1/en
Publication of WO2024001767A1 publication Critical patent/WO2024001767A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/08Access security
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/18Processing of user or subscriber data, e.g. subscribed services, user preferences or user profiles; Transfer of user or subscriber data
    • H04W8/183Processing at user equipment or user record carrier
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/26Network addressing or numbering for mobility support
    • H04W8/265Network addressing or numbering for mobility support for initial activation of new user

Definitions

  • the present application relates to the field of terminals, and in particular to security service switching methods and terminals.
  • terminals such as mobile phones and watches include three-tier application environments, namely Rich Execution Environment (REE), Trusted Execution Environment (TEE) and Secure Element (SE).
  • the terminal deploys corresponding applications in the three-layer application environment according to the security levels of different data in security services (such as bank cards, bus cards, car keys, etc.).
  • security services such as bank cards, bus cards, car keys, etc.
  • a security service may have corresponding applications in REE, TEE and SE.
  • the application of the security business in SE needs to be activated. If the application of the security service in the SE is not activated, the user needs to manually activate the application of the security service in the SE.
  • the terminal can also automatically activate the application of the security service in the SE.
  • Huawei's smart flash card can automatically identify scenarios based on geographical location, card reading equipment and other conditions, and automatically activate the application of current security services in SE, that is, automatic switching of security services.
  • SE current security services
  • the current automatic switching of terminal security services is not efficient.
  • the terminal when the terminal is powered off, the terminal will not be able to automatically switch security services.
  • the security service switching method and terminal provided by this application can improve the security service switching efficiency, and can also realize automatic switching when the terminal is shut down, expanding the security service switching scenario.
  • the first aspect provides a card switching method, which is applied to a terminal including a near field communication NFC module and a secure element SE module.
  • the SE module includes a first card; the method includes: before the terminal is shut down, the first card is in Inactive state; the terminal is shut down; after the terminal is shut down, the first card is still in the inactive state, and the terminal receives the first instruction to select the first card sent by the first card reading device through the NFC module; the terminal determines the first card according to the first instruction.
  • the first card is activated through the SE module; the terminal receives the second instruction to select the first card sent by the first card reading device through the NFC module; in response to receiving the first instruction, the terminal The first card and the first card reading device perform transaction business.
  • the entire automatic card cutting path is located in the NFC module and SE module, and does not pass through the REE module and TEE module. And because, when the terminal is shut down, the remaining power of the terminal can power the NFC module and SE module of the terminal, that is, the NFC module and SE module of the terminal can still work, and automatic card switching can still be achieved. It can be seen that when the terminal is shut down, this application can still realize automatic card cutting of the terminal.
  • the terminal activates the first card through the SE module, including: the NFC module forwarding the first step of selecting the first card to the SE module. Instruction; the SE module determines that the first card is a card that allows automatic card cutting, and the SE module activates the first card.
  • the SE module triggers automatic activation of the first card.
  • the COS in the SE module can specifically determine that the first card is a card that allows automatic card cutting. If so, the CRS in the SE module is called to activate the first card.
  • the SE module also includes a second card, and the second card is activated when the terminal is shut down; after the SE module determines that the first card is a card that allows automatic card cutting, and the SE module activates the Before the first card, the method also includes: the SE module deactivating the second card.
  • different cards may have different contactless parameter settings. That is to say, when there is a conflict in the activation of contactless parameters of two or more cards, these cards cannot be activated at the same time. Then, in some examples, in order to avoid subsequent failure to activate the first card, the activated second card is first deactivated to ensure successful activation of the first card.
  • the method further includes: the SE module returns a first response to the NFC module, and the first response is used to indicate that the first card is not selected. cards, and the first card is the card that allows automatic card cutting.
  • the first response is a custom response that differs from the existing standard response for an unselected card.
  • the method further includes: the NFC module returns a second response to the first card reading device, and the second response is used to indicate that the first card is not selected. , and the second response is different from the first response.
  • the second response is a response of an unselected card in the existing standard (for example, the error code carried in the response is 6A82). Because the NFC module returns a standard response to the first card reading device. It can be seen that in this embodiment, there is no need to modify the communication protocol between the first card reading device and the terminal (specifically, the NFC module).
  • the SE module includes a fifth card
  • the method further includes: after the terminal is turned on, the fifth card is in an inactive state, and the terminal receives the selected third card sent by the third card reading device through the NFC module.
  • the fifth instruction of the five cards the NFC module forwards the fifth instruction to the SE module; after the SE module determines that the fifth card is a card that does not allow automatic cutting according to the fifth instruction, the SE module returns the third response to the NFC module, the third response Used to indicate that the fifth card is not selected, and the fifth card is a card that does not allow automatic card cutting.
  • COS returns the third response (that is, a standard response, such as the error code carried by the response is 6A82) to the NFC module. Accordingly, the NFC module can determine based on the returned third response that the fifth card is a card that does not allow automatic card cutting. Subsequently, the terminal can execute the business logic of non-automatic card switching through the REE module and prompt the user to manually activate the fifth card.
  • this application also provides a method for the NFC module to determine whether the card to be activated is a card that allows automatic card cutting, so as to facilitate the NFC module to execute different business logic.
  • the terminal further includes a rich execution environment REE module.
  • the SE module returns a third response to the NFC module
  • the method further includes: after the NFC module receives the third response, sends a sixth response to the REE module. command, the sixth command is used to prompt the user to manually activate the fifth card.
  • the first card before the terminal is shut down, the first card is in an inactive state.
  • the method further includes: when the terminal is shut down, the terminal interacts with the second card reading device through the NFC module to exchange messages of the first protocol; and when the terminal starts to interact with the second card reading device through the NFC module, the terminal After a preset time period after the message of the first protocol, if the NFC module does not receive the message of the second protocol sent by the second card reading device, the NFC module sends a third instruction of the second protocol to select the third card to the SE module,
  • the third instruction includes a default application identification AID. This provides a solution for triggering non-standard cards (that is, cards that do not originally support the second protocol) to perform automatic card cutting based on the second protocol.
  • the method further includes: after receiving the third instruction, the SE module modifies the third instruction. is the fourth command; the fourth command includes the AID of the fourth card, and the fourth card is the user identification UID card; after it is determined that the fourth card is in an inactive state, and the fourth card is a card that allows automatic card cutting, the SE module is activated The fourth card.
  • the SE module modifies the third instruction. is the fourth command; the fourth command includes the AID of the fourth card, and the fourth card is the user identification UID card; after it is determined that the fourth card is in an inactive state, and the fourth card is a card that allows automatic card cutting, the SE module is activated The fourth card.
  • the terminal activates the first card through the SE module, including: the NFC module determines that the first card is a card that allows automatic card cutting. After the card, the NFC module instructs the SE module to activate the first card.
  • the terminal after the terminal determines that the first card is a card that allows automatic card cutting according to the first instruction, the terminal activates the first card through the SE module terminal, which further includes: the SE module receives an instruction to activate the first card. After that, it is judged whether the first card is a card that allows automatic card cutting; after judging that the first card is a card that allows automatic card cutting, the SE module activates the first card.
  • the SE module needs to perform security verification on the instruction to activate the first card, that is, the SE module determines whether the first card is an automatically cut card.
  • the SE module includes a second card, and the second card is activated when the terminal is shut down; before the SE module activates the first card, the method further includes: the SE module deactivating the second card.
  • the method further includes: the NFC module forwards the first instruction to select the first card to the SE module. An instruction; the SE module returns a fourth response to the NFC module according to the first instruction, and the fourth response is used to indicate that the first card is not selected; in response to receiving the fourth response, the NFC module determines whether the first card is allowed to automatically cut the card. card. This provides an opportunity for the NFC module to trigger activation of the first card.
  • the method before the terminal is shut down, the method further includes: the NFC module receiving a first card list, where the first card list includes information about cards that allow automatic card cutting.
  • the NFC module receives a first card list, where the first card list includes information about cards that allow automatic card cutting.
  • the terminal also includes a trusted execution environment TEE module; before the terminal is shut down, the method also includes: the SE module receiving a second card list sent by the TEE module, and the second card list includes allowing automatic card cutting card information.
  • TEE module trusted execution environment
  • the SE module receives a second card list sent by the TEE module, and the second card list includes allowing automatic card cutting card information.
  • the terminal after the terminal determines that the first card is a card that allows automatic card cutting according to the first instruction, the terminal activates the first card through the SE module, which further includes: after the SE module receives the first instruction, Sure After the first card is in an inactive state, it is determined whether the first card is a card that allows automatic card cutting; after it is determined that the first card is a card that allows automatic card cutting, the first card is activated.
  • the SE module triggers and activates the business logic of the first instruction.
  • the business logic of activating the first instruction can be triggered by the COS in the SE module.
  • the SE module also includes a second card, and the second card is activated when the terminal is shut down; after the SE module determines that the first card is a card that allows automatic card cutting, the SE module activates the second card. Before the first card, the method also includes: the SE module deactivating the second card.
  • the SE module includes a sixth card
  • the terminal also includes a REE module.
  • the method further includes: after the terminal is turned on, the sixth card is in an inactive state, and the terminal receives the third card through the NFC module.
  • the fourth card reading device sends the seventh instruction to select the sixth card; the NFC module forwards the seventh instruction to the SE module; after the SE module determines that the sixth card is a card that does not allow automatic cutting according to the seventh instruction, the SE module sends the Return a fifth response, which is used to indicate that the sixth card is not selected; after receiving the fifth response, the NFC module sends an eighth instruction to select the sixth card to the SE module; the SE module determines that the sixth card is not selected.
  • the sixth response is returned to the NFC module.
  • the sixth response is used to indicate that the sixth card is not selected.
  • the NFC module sends the ninth command to the REE module.
  • the ninth command is used to prompt the user to activate manually.
  • the sixth card This provides a method for the NFC module to determine whether the card to be activated is a card that allows automatic card cutting, which facilitates the NFC module to execute different business logic.
  • a terminal including: a processor, a memory, a near field communication NFC module and a touch screen.
  • the memory, touch screen, NFC module is coupled with the processor.
  • the processor includes a secure element SE module, and the memory is used to store computer program codes.
  • the computer program code includes computer instructions, and when the processor reads the computer instructions from the memory, the terminal performs the above aspects and the method described in any possible implementation manner.
  • a third aspect is to provide a device, which is included in a terminal and has the function of realizing the terminal behavior in any of the above aspects and possible implementation methods.
  • This function can be implemented by hardware, or it can be implemented by hardware executing corresponding software.
  • the hardware or software includes at least one module or unit corresponding to the above functions. For example, a receiving module or unit, a display module or unit, a processing module or unit, etc.
  • a fourth aspect is to provide a computer-readable storage medium, which includes computer instructions.
  • the terminal is caused to perform the method described in the above aspect and any possible implementation manner.
  • a computer program product is provided.
  • the computer program product When the computer program product is run on a computer, it causes the computer to execute the method described in the above aspects and any of the possible implementations.
  • a sixth aspect provides a chip system, including a processor.
  • the processor executes instructions, the processor executes the method described in the above aspects and any of the possible implementations.
  • Figure 1 is a schematic structural diagram of a communication system provided by an embodiment of the present application.
  • Figure 2 is a schematic structural diagram of a terminal provided by an embodiment of the present application.
  • Figure 3 is a schematic flow chart of an automatic switching method for security services provided by an embodiment of the present application.
  • Figure 4 is a schematic diagram of user interfaces of some terminals provided by embodiments of the present application.
  • Figure 5 is a schematic flow chart of yet another automatic switching method for security services provided by an embodiment of the present application.
  • Figure 6 is a schematic flow chart of yet another automatic switching method for security services provided by an embodiment of the present application.
  • Figure 7A is a schematic flow chart of yet another automatic switching method for security services provided by an embodiment of the present application.
  • Figure 7B is a schematic flow chart of yet another automatic switching method for security services provided by an embodiment of the present application.
  • Figure 8 is a schematic flow chart of yet another automatic switching method for security services provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a chip system provided by an embodiment of the present application.
  • first and second are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of indicated technical features. Therefore, features defined as “first” and “second” may explicitly or implicitly include one or more of these features. In the description of the embodiments of this application, unless otherwise specified, "plurality” means two or more.
  • the communication system includes a terminal 100 and a card reading device 200.
  • the terminal 100 in the embodiment of the present application can be, for example, a mobile phone, a tablet computer, a personal computer (PC), a personal digital assistant (PDA), a netbook, or a wearable terminal (such as a smart watch, smart phone, etc.) bracelets, etc.), augmented reality technology (augmented reality, AR) equipment, virtual reality (VR) equipment, vehicle-mounted equipment, smart screens, smart cars, smart speakers, etc.
  • augmented reality technology augmented reality, AR
  • VR virtual reality
  • the card reading device 200 in the embodiment of the present application may be, for example, a point of sale terminal (POS), a bus or subway card swiping machine, an access control card swiping machine, etc.
  • the terminal 100 includes three application environments: a rich execution environment (Rich Execution Environment, REE) module, a trusted execution environment (Trusted Execution Environment, TEE) module and a secure element (Secure Element, SE) module.
  • REE Rich Execution Environment
  • TEE trusted Execution Environment
  • SE secure element
  • the REE module and the TEE module are integrated on one chip, such as an application processor (Application Processor, AP) chip
  • the SE module is integrated on another chip, such as an SE chip.
  • the REE module includes a general operating system (not shown in the figure) running on a general-purpose embedded processor, such as Rich OS or a kernel-based operating system (such as Android system, Hongmeng system, etc.), and the REE module.
  • a general-purpose embedded processor such as Rich OS or a kernel-based operating system (such as Android system, Hongmeng system, etc.)
  • the REE module is called client application (CA).
  • CA client application
  • the TEE module is an independent operating environment running outside the REE module. It provides security services to the REE module and is isolated from the REE module. REE modules (including general operating systems and applications on them) cannot Direct access to the hardware and software resources of the TEE module.
  • the TEE module provides a trustworthy operating environment for applications in the TEE module, and ensures end-to-end security through confidentiality, integrity protection and data access control.
  • the TEE module is parallel to the REE module and interacts with the REE module through a secure application programming interface (API).
  • API application programming interface
  • the TEE module provides a higher security level operating environment than the REE module, but it cannot provide a secure key storage and key operating environment at the hardware isolation level.
  • the application in the TEE module is also called a trusted application (TEE application, TA).
  • the SE module is used to build a trusted and secure key storage and key computing environment. This is because the software system in the SE module is simple and there are relatively few hardware components, so it is easy to establish physical protection and implement security guarantees, thereby improving the security strength of the SE module and thus serving security systems with higher security requirements.
  • the SE module includes a card operating system (Chip Operating System, COS) module, a contactless registration service (Contactless Registry service, CRS) module, and applications in the SE module (for example, card 1...card n in Figure 1).
  • COS is the operating system of the SE chip, which is used to preprocess received application protocol data unit (Application Protocol Data Unit, APDU) instructions and distribute the instructions to corresponding services or applications in the SE for processing.
  • APDU Application Protocol Data Unit
  • CRS is a system application in the SE module and is responsible for registration and management of applications in the SE module, activating or deactivating (i.e., deactivating) applications in the SE module.
  • Applications in the SE module can also be called Applets or cards.
  • they can be one or more of bank cards, bus cards, access cards, work cards, electronic documents, car keys, and typical supports (such as AlipayTM , WeChat PayTM ). item.
  • the terminal 100 will deploy corresponding applications in the three-layer application environment according to the security levels of different data in the security service.
  • a security service may have corresponding applications deployed in the REE module, TEE module and SE module.
  • the automatic switching method of security services provided by this application also involves the Cheka CA deployed in the REE module, the Cheka TA deployed in the TEE module, and the corresponding services or applications in the SE module (such as COS, CRS, and various SE modules). card).
  • Cheka CA can be deployed in the REE module for wallet applications
  • Cheka TA can be deployed in the TEE module for wallet applications
  • various cards in the SE module can be deployed in the wallet application.
  • Various cards in the SE module such as bank cards, transportation cards, electronic documents, change, membership cards, invoices, community access cards, smart home lock cards, smart hotel room cards, etc. The specific functions of each module will be described in subsequent specific embodiments.
  • the terminal 100 also includes an NFC module for supporting the terminal 100 to communicate with other NFC devices (such as the card reading device 200).
  • the NFC module includes a contactless front-end (CLF), which is the controller of the NFC module. It can receive APDU instructions from the card reading device 200 and send the received APDU instructions to the COS of the SE chip so that the COS will receive the The received APDU instructions are distributed to the applications in the corresponding SE modules for business transactions.
  • CLF can also assemble APDU instructions.
  • the NFC module can be integrated on another chip independent of the AP chip and SE chip, also called an NFC chip.
  • the REE module of the terminal 100 determines a list of cards that are allowed to automatically cut cards based on the card types that the user has added, that is, a white list; or, the REE module of the terminal 100 receives a white list set by the user. Then, the REE module sends the whitelist to the SE module and NFC module of the terminal 100 respectively. When the terminal 100 approaches the card reading device 200, the NFC module of the terminal 100 receives the selected number sent by the card reading device 200. One card instructions. The NFC module of the terminal 100 routes the instruction to select the first card to the SE module of the terminal 100 .
  • the SE module determines whether the first card is in an inactive state, it returns a response that the first card is not selected to the NFC module. After receiving the response of the unselected first card, the NFC module determines whether the first card is in a white list that allows automatic card cutting. When it is determined that the first card is in the white list, the NFC module sends an instruction to activate the first card to the SE module. When the SE module receives the instruction to activate the first card, it performs security verification. For example, the SE module determines whether the first card is in a white list that allows automatic card cutting. If the first card is not in the whitelist, the SE module does not activate the first card. If the first card is in the whitelist, the SE module activates the first card.
  • the card reading device 200 continues to send instructions for selecting the first card, so the terminal 100 will receive the instructions for selecting the first card sent by the card reading device 200 again.
  • the NFC module of the terminal 100 routes the instruction to select the first card to the SE module of the terminal 100 .
  • the SE module determines that the first card has been activated, then the SE module forwards the instruction to select the first card to the first card, and then the card reading device 200 performs a transaction with the first card in the SE.
  • the terminal 100 realizes the function of automatically cutting cards.
  • the NFC module triggers the action of activating the first card after receiving a response that the first card is not selected.
  • the SE module can also automatically trigger the action of activating the first card after determining that the first card is in an inactive state.
  • the REE module of the terminal 100 determines a list of cards that are allowed to automatically cut cards based on the card types that the user has added, that is, a white list; or, the REE module of the terminal 100 receives a white list set by the user. Then, the REE module sends the whitelist to the SE module of the terminal 100.
  • the SE module After the SE module receives the instruction to select the first card forwarded by the NFC module and determines that the first card is in an inactive state, the SE module returns a response of not selecting the first card to the NFC module on the one hand, and on the other hand Security verification, for example, the SE module determines whether the first card is in the whitelist. If the first card is not in the whitelist, the SE module does not activate the first card. If it is determined that the first card is in the whitelist, the first card is automatically activated. Here we take the first card in the whitelist as an example to continue the explanation. On the NFC module side, after receiving the response of the unselected first card returned by the SE module, the NFC module sends an instruction to select the first card to the SE module again.
  • the SE module determines that the first card has been activated. Similarly, when the terminal 100 receives the instruction to select the first card again, the NFC module of the terminal 100 routes the instruction to select the first card to the SE module of the terminal 100 . At this time, the SE module determines that the first card has been activated, then the SE module forwards the instruction to select the first card to the first card, and then the card reading device 200 performs a transaction with the first card in the SE. Thus, the terminal 100 realizes the function of automatically cutting cards.
  • the REE module of the terminal 100 determines a list of cards that are allowed to automatically cut cards based on the card types that the user has added, that is, a white list; or, the REE module of the terminal 100 receives a white list set by the user. Then, the REE module sends the whitelist to the SE module of the terminal 100. Then, after the SE module receives the instruction to select the first card forwarded by the NFC module and determines that the first card is in an inactive state, the SE module further determines whether the first card is in the whitelist.
  • the first card is automatically activated and a first response (for example, a customized response) indicating that the first card is not selected is returned to the NFC module.
  • a first response for example, a customized response
  • the SE module does not activate the first card and returns a second response of the unselected first card to the NFC module (for example, a standard response of the unselected card).
  • the NFC module receives the first response of the unselected first card returned by the SE module, it determines that the first card is a card in the white list. If the NFC module receives the second response from the SE module that the first card is not selected, it determines that the first card is not in the whitelist.
  • the business logic of non-automatic card cutting will be executed.
  • the first card in the whitelist as an example to continue the explanation.
  • the NFC module of the terminal 100 routes the instruction to select the first card to the SE module of the terminal 100 .
  • the SE module determines that the first card has been activated, then the SE module forwards the instruction to select the first card to the first card, and then the card reading device 200 performs a transaction with the first card in the SE.
  • the terminal 100 realizes the function of automatically cutting cards.
  • Figure 2 shows a schematic structural diagram of the terminal 100.
  • the terminal 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, Mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and user Identification module (subscriber identification module, SIM) card interface 195, etc.
  • a processor 110 an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, Mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen
  • the sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal 100.
  • the terminal 100 may include more or fewer components than shown in the figures, or some components may be combined, or some components may be separated, or may be arranged differently.
  • the components illustrated may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit
  • the controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive wireless charging input through the wireless charging coil of the terminal 100 . While charging the battery 142, the charging management module 140 can also provide power to the terminal through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, the wireless communication module 160, and the like.
  • the power management module 141 can also be used to Monitor battery capacity, battery cycle times, battery health status (leakage, impedance) and other parameters.
  • the power management module 141 may also be provided in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the terminal 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in terminal 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • Antenna 1 can be reused as a diversity antenna for a wireless LAN. In other embodiments, antennas may be used in conjunction with tuning switches.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied to the terminal 100.
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 1 for radiation.
  • at least part of the functional modules of the mobile communication module 150 may be disposed in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • a modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
  • the demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the application processor outputs sound signals through audio devices (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194.
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 110 and may be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the terminal 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (bluetooth, BT), and global navigation satellite system. (global navigation satellite system, GNSS), frequency modulation (FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation
  • the antenna 1 of the terminal 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology wait.
  • the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the terminal 100 implements the display function through the GPU, the display screen 194, and the application processor.
  • the GPU is an image processing microprocessor and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the terminal 100 can implement the shooting function through the ISP, camera 193, video codec, GPU, display screen 194, application processor, etc.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. Such as saving music, videos, etc. files in external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the internal memory 121 may include a program storage area and a data storage area.
  • the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image playback function, etc.).
  • the storage data area may store data created during use of the terminal 100 (such as audio data, phone book, etc.).
  • the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
  • the processor 110 executes various functional applications and data processing of the terminal 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the terminal 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • FIG. 3 it is a schematic flow chart of an automatic switching method for security services provided by an embodiment of the present application.
  • the method includes:
  • the card-switching CA sends a list of cards that allow automatic card-switching (i.e., a white list) to the CRS in the SE module through the card-switching TA.
  • the card list includes information of one or more cards.
  • the card-cutting CA sends the card list to the CRS in the SE module through the card-cutting TA.
  • the card list may include information on all cards that the user has added in the terminal 100 that allow automatic card cutting.
  • the terminal 100 may default to cards that do not require user verification as cards that allow automatic card cutting, such as transportation cards, access control cards (or, specifically, access control cards for non-secure areas), keys (for example, car keys or smart phones). door lock keys), bank cards (limited to verification-free small payment functions), electronic documents, etc.
  • the user can also set whether the card allows automatic card cutting.
  • the wallet application installed on the terminal 100 is taken as an example for explanation. As shown in (1) in FIG. 4 , it is the setting interface of the wallet application displayed on the terminal 100 .
  • the setting interface includes the setting items of the default card.
  • the terminal 100 displays the default card setting interface as shown in (2) in FIG. 4 .
  • the card setting interface includes smart flash cards and various cards that have been added in the wallet application.
  • the default card is the card activated by the terminal 100 by default.
  • the smart flash card can automatically identify the scene based on geographical location, card reading equipment and other conditions, and automatically activate the corresponding card, that is, it can realize the function of automatic card cutting.
  • the terminal 100 activates transportation card 1 by default, and other cards are in an inactive state.
  • transportation card 2 When the user needs to use other cards, such as transportation card 2, the user needs to manually switch to transportation card 2, that is, manually activate transportation card 2.
  • the card switching CA of the terminal 100 that is, the application of the wallet application in the REE
  • the card list includes the cards that the wallet application has added. Information about all cards that allow automatic card cutting. That is to say, the terminal 100 has started the automatic card cutting function at this time.
  • the terminal 100 when the terminal 100 receives the selected transportation card 1 sent by the card reading device 200, the terminal 100 can automatically activate the transportation card 1.
  • the terminal 100 receives the selected car key sent by another card reading device 200, the terminal 100 can automatically activate the car key to realize automatic switching.
  • the terminal 100 displays the interface shown in (3) in Figure 4, which includes allowing Automatically cut card information, such as transportation cards, car keys, access cards, etc.
  • the interface shown in (3) in Figure 4 can also provide editing controls for the user to set the cards that allow automatic card cutting, etc.
  • the terminal 100 can also provide other interfaces for the user to initiate the automatic card cutting function.
  • the operation method of the terminal 100 to initiate the automatic card cutting function is not specifically limited here.
  • the card cutting CA when the terminal 100 turns on the automatic card cutting function for the first time, the card cutting CA sends the card list to the CRS in the SE module through the card cutting TA of the TEE module.
  • the card list may include the card cutting CA. All card information that has been added to allow automatic card cutting.
  • the card cutting CA can send the changed part of the card information to the CRS for CRS update permission. Card information for automatic card cutting.
  • the card cutting CA when the user adds card 1 that allows automatic card cutting, the card cutting CA sends the information of card 1 to the CRS in the SE module through the card cutting TA of the TEE module, and instructs CRS to add it to the list of cards that allow automatic card cutting. Card 1 information.
  • the card cutting CA when the user deletes card 2 that allows automatic card cutting, the card cutting CA sends the information of card 2 to the CRS in the SE module through the card cutting TA of the TEE module, and instructs CRS to be in the card list that allows automatic card cutting. Delete card 2 information.
  • the user can also manually change the card information in the terminal 100 that allows automatic card cutting.
  • the cards preset in the CRS that allow automatic card cutting may include cards that have been added by the terminal 100 or cards that have not been added by the terminal 100 . In this example, this step S301 may not be performed.
  • the CRS in the SE module stores a list of cards that allow automatic card cutting. Subsequently, the CRS can perform security verification on the card that is requested to be activated based on the card list.
  • the CRS of the SE module can first determine whether the instruction comes from the TEE module, or more specifically from a specific TA in the TEE module, such as Cheka TA. If the instruction comes from the TEE module, or more specifically from a specific TA in the TEE module, such as cutting a card TA, the CRS stores the card list in the instruction, or updates the card list according to the instruction. This prevents other malicious applications from sending fake card lists to the SE module and prevents cards from being maliciously activated, thereby improving the security of card transactions in the SE module.
  • the card-cutting CA sends the card list to the NFC module.
  • the card list includes information of one or more cards.
  • the card CA sends the card list to the NFC module (for example, more specifically, the CLF module).
  • the switching CA periodically sends the card list to the NFC module (for example, more specifically, the CLF module).
  • the card list may include information about all cards that have been added in the card cutting CA and allow automatic card cutting.
  • the card cutting CA when the terminal 100 turns on the automatic card cutting function for the first time, the card cutting CA sends a card list to the NFC module.
  • the card list may include all cards added in the card cutting CA that allow automatic card cutting.
  • the card cutting CA can send the changed part of the card information to the NFC module for use by the NFC module Update information for cards that allow automatic card cutting.
  • this step S302 may not be performed.
  • the NFC module stores a list of cards that allow automatic card cutting. Subsequently, the NFC module can request the SE module to activate the corresponding card based on the card list to realize the automatic card cutting function.
  • step S302 may be executed simultaneously with step S301, may be executed before step S301, or may be executed after step S301. This application does not limit the execution order of step S301 and step S302.
  • the above steps S301 and S302 involve the REE module and TEE module of the terminal 100 . Since the terminal 100 can start the REE module when the terminal 100 is turned on, the terminal 100 can execute the above steps S301 and S302 only when the terminal 100 is turned on.
  • the following steps S303 to S319 only involve the NFC module and SE module of the terminal 100 and do not pass through the REE module and TEE module. Because when the terminal 100 is shut down, the remaining power of the terminal 100 can power the NFC module and SE module of the terminal 100, that is, the NFC module and SE module of the terminal 100 can still work. In other words, when the terminal 100 is powered off, the terminal 100 can still perform the following steps S303 to S319. In other words, when the terminal 100 is powered on or off, the following steps S303 to S319 may be executed.
  • the NFC module receives the instruction to select the first card sent by the card reading device 200.
  • the card reading device 200 will continue to send instructions for selecting the first card.
  • the instruction to select the first card includes an application ID (AID) of the first card, which is used to identify the card type of the first card.
  • the NFC module in the terminal 100 can receive the instruction to select the first card sent by the card reading device 200.
  • the bus card swiping machine i.e., the card reading device 200
  • the mobile phone will receive an instruction to select a transportation card sent by the card swiping machine.
  • the NFC module forwards the instruction to select the first card to the COS in the SE module.
  • the NFC module routes the received instruction to select the first card to the COS of the SE module.
  • the COS determines that the first card is in an inactive state, it returns a response that the first card is not selected to the NFC module.
  • terminal 100 may support activation of one card, or support activation of multiple cards at the same time.
  • terminal 100 supports activation of a card.
  • the terminal 100 is powered on, if another card (for example, a second card) was previously activated and used, the first card is in an inactive state at this time.
  • the terminal 100 is shut down, if the terminal 100 activates and uses another card (for example, a second card) before the terminal 100 is shut down, the first card is in an inactive state at this time.
  • the COS determines that the first card is in the activated state, the COS forwards the instruction to select the first card to the first card, that is, performs step S317 and subsequent steps.
  • the NFC module After receiving the response that the first card is not selected, the NFC module returns a response that the first card is not selected to the card reading device 200.
  • the NFC module determines whether the first card is in the card list. If it is determined that the first card is in the card list, the NFC module sends an instruction to select the CRS to the COS. Among them, the instruction to select the CRS is used to instruct the NFC module to subsequently send deactivation and activation instructions to the CRS.
  • step S302 has explained that the NFC module stores a list of cards that allow automatic card cutting. Then, when the NFC module receives the response of the unselected first card, the NFC can query the list of cards that allow automatic card cutting, for example, the smart flash card list shown in (3) in Figure 4 to determine whether the first card is allowed. Automatically cut cards. If the first card is in the list of cards that allow automatic card cutting, and it is determined that the first card allows automatic card cutting, the NFC module triggers the action of automatically activating the first card, that is, selecting the CRS and instructing the CRS to activate the first card.
  • the NFC module triggers the action of automatically activating the first card, that is, selecting the CRS and instructing the CRS to activate the first card.
  • the NFC module can interact with the REE module, and the REE module prompts the user to manually activate the first card (for example, the REE module prompts the user to select a card, and instructs the SE module to activate the user's selection through the TEE module card), or the REE module requests the user to authenticate through the TEE module and activates the first card after successful authentication (for example, the REE module automatically selects the corresponding card, such as a bank card, and then prompts the user to enter such as fingerprint or face After the authentication is carried out and the TEE module passes the authentication, the SE module is instructed to activate the card) and finally complete the transaction.
  • the REE module prompts the user to manually activate the first card
  • the REE module prompts the user to select a card, and instructs the SE module to activate the user's selection through the TEE module card
  • the REE module requests the user to authenticate through the TEE module and activates the first card after successful authentication (for example, the REE module automatically selects the corresponding card, such as a
  • step S307 may be executed simultaneously with step S306, may be executed before step S306, or may be executed after step S307. This application does not limit the execution order of step S306 and step S307. In some other examples, step S306 may not be executed.
  • the COS forwards the instruction to select the CRS to the CRS.
  • the CRS returns a response of selecting the CRS to the COS.
  • COS forwards the response of selecting CRS to the NFC module.
  • the NFC module sends an instruction to deactivate the second card currently in the activated state to the CRS.
  • deactivating the second card means canceling the activation state of the second card, so that the second card is in an inactivated state.
  • the non-contact parameters refer to the communication parameters when each card in the SE module communicates with the card reading device 200 through the NFC module. That is to say, when When there is a conflict in the activation of contactless parameters of two or more cards, these cards cannot be activated at the same time. Then, in some examples, in order to avoid subsequent failure to activate the first card, the NFC module can send a message to the CRS to activate all cards currently in the activated state, that is, the second card is all cards currently in the activated state. In other examples, the NFC module can also determine whether among the currently activated cards there are cards that conflict with the activated first card, and only activate these conflicting cards. That is, the second card is a card whose contact parameters for activating the first card conflict.
  • the NFC module can also send deactivation instructions to the CRS through COS.
  • the COS or CRS determines whether there are cards that conflict with the activated first card among the currently activated cards, and only these conflicting cards are activated. This is not specifically limited in the embodiment of the present application.
  • CRS deactivates the second card and returns a deactivation success response to NFC.
  • CRS returns the response of selecting CRS to the NFC module through COS.
  • the NFC module sends an instruction to activate the first card to the CRS.
  • the NFC module sends an instruction to activate the first card to the CRS through the COS.
  • CRS determines whether the first card is in the card list. If the first card is in the card list, then the first card is a card that allows automatic card cutting, then CRS activates the first card.
  • the CRS can verify the security of the activation card instruction from the NFC module based on a pre-stored list of cards that allow automatic card cutting. It has been explained in step S301 that the CRS obtains a list of cards that allow automatic card cutting. It should be emphasized that CRS only stores the card list from the TEE module (such as card cutting TA) that allows automatic card cutting, thereby ensuring the security of card transactions. If the first card is in the card list, then the first card is a card that allows automatic card cutting, then CRS activates the first card. Otherwise, CRS does not activate the first card. The subsequent steps are explained by taking the first card in the card list that allows automatic card cutting as an example.
  • the CRS returns a response indicating successful activation of the first card to the NFC module.
  • the CRS returns a response of successful activation of the first card to the NFC module through COS.
  • the NFC module receives the instruction to select the first card sent by the card reading device 200.
  • the NFC module of the terminal 100 will receive the instructions for selecting the first card sent by the card reading device 200 again.
  • the NFC module forwards the instruction to select the first card to the COS in the SE module.
  • the NFC module routes the received instruction to select the first card to the COS of the SE module.
  • the COS determines that the first card is in the activated state, and then forwards the instruction to select the first card to the first card.
  • the COS can determine that the first card is in an activated state.
  • the first card returns a response of selecting the first card to the card reading device 200.
  • step S318a This step is shown in the figure as step S318a, step S318b and step S318c.
  • the card reading device 200 starts a transaction with the first card in the terminal 100.
  • the NFC module triggers the action of automatically activating the first card
  • the CRS in the SE module performs security verification on the action of activating the first card, thereby realizing the function of automatically activating the first card.
  • the mobile phone when the mobile phone is turned on, the user sets the default card to be a smart flash card.
  • the mobile phone sends the list of allowed automatic card cutting to the NFC module and SE module respectively.
  • the mobile phone can automatically cut the card according to the selection instruction of the card reading device 200.
  • a user takes a bus and uses his mobile phone to get close to the bus Then the mobile phone receives the instruction to select the transportation card from the bus card swiping machine, and the mobile phone automatically switches to the transportation card according to the instruction, that is, activates the transportation card.
  • the transportation card in the phone is activated and other cards are inactive.
  • the mobile phone receives the instruction to select the access control card sent by the access control card reader through the NFC module. Then, the NFC module forwards the instruction to select the access card to the COS of the SE module. At this time, the access control card is inactive. COS returns an unchecked response to the NFC module. When the NFC module receives the unselected response, it determines whether the access control card is a card that allows automatic card cutting.
  • the NFC module After determining that the access card is a card that allows automatic card cutting, the NFC module sends an instruction to activate the transportation card and an instruction to activate the access card to the CRS in the SE module.
  • the CRS determines that the access card is a card that allows automatic card cutting, it activates the transportation card and activates the access card.
  • the mobile phone receives the instruction to select the access card from the access control card swiping machine again through the NFC module, the access control card of the mobile phone will be traded with the access control card swiping machine.
  • the entire path of automatic card cutting in this application is located in the NFC module and SE module, and does not pass through the REE module and TEE module. Therefore, this application speeds up the speed of automatic card cutting.
  • the remaining power of the terminal 100 can power the NFC module and SE module of the terminal 100, that is, the NFC module and SE module of the terminal 100 can still work, and automatic card switching can still be achieved.
  • the present application can still realize automatic card cutting of the terminal 100 .
  • this embodiment only involves modifying the system application in the NFC module and SE module, and the modification workload is smaller.
  • the NFC module of the terminal 100 and the business logic of the CRS in the SE module are modified accordingly in the embodiment described in FIG. 3 .
  • steps S301, S302, S307, S310, S312, S313, etc. are added.
  • the CRS in the SE module is used to perform security verification on the instruction to activate the first card from the NFC module.
  • other modules in the SE module such as a card-cutting Applet
  • Figure 5 it is a schematic flow chart of yet another automatic switching method for security services provided by an embodiment of the present application. The method includes:
  • the card-cutting CA sends a list of cards that allow automatic card-cutting (i.e., a white list) to the card-cutting Applet in the SE module through the card-cutting CA.
  • the card list includes information of one or more cards.
  • the card-cutting Applet in the SE module performs security verification on the instruction to activate the first card. Therefore, the card-cutting CA sends the card list that allows automatic card-cutting to the card-cutting Applet through the card-cutting TA. list).
  • the card-cutting Applet may also be preset with a card list (ie, a whitelist) for automatic card-cutting, that is, step S501 may not be performed. For other content, please refer to the above step S301.
  • the SE module's card cutting Applet can first determine whether the command comes from the TEE module, or more specifically from a specific TA in the TEE module. , Joucheka TA. If the instruction comes from the TEE module, or more specifically from a specific TA in the TEE module, such as card cutting TA, the card cutting Applet stores the card list in the command, or updates the card list according to the command. This prevents other malicious applications from sending fake card lists to the SE module and prevents cards from being maliciously activated, thereby improving the security of card transactions in the SE module.
  • the card-cutting CA sends the card list to the NFC module.
  • the card list includes information of one or more cards.
  • This step is the same as step S302.
  • step S502 may be executed simultaneously with step S501, may be executed before step S501, or may be executed after step S501. This application does not limit the execution order of step S501 and step S502.
  • the NFC module receives the instruction to select the first card sent by the card reading device 200.
  • the NFC module forwards the instruction to select the first card to the COS in the SE module.
  • the COS determines that the first card is in an inactive state, it returns a response that the first card is not selected to the NFC module.
  • the NFC module After receiving the response that the first card is not selected, the NFC module returns a response that the first card is not selected to the card reading device 200.
  • steps S503 to S506 please refer to the contents of the above steps S303 to S306, which will not be repeated here.
  • the NFC module determines whether the first card is in the card list. If it is determined that the first card is in the card list, the NFC module sends an instruction to select the card-cutting Applet to the COS. Among them, the instruction to select the Cheka Apple is used to instruct the NFC module to subsequently send deactivation and activation instructions to the Cheka Applet, and the Cheka Applet can execute the deactivation and activation instructions by calling CRS.
  • step S502 has explained that the NFC module stores a list of cards that allow automatic card cutting. Then, after the NFC module receives the response that the first card is not selected, the NFC can query the list of cards that allow automatic card cutting and determine whether the first card allows automatic card cutting. If the first card is in the list of cards that allow automatic card cutting, and it is determined that the first card allows automatic card cutting, the NFC module triggers an action to automatically activate the first card, that is, selects the card cutting Applet and instructs the CRS to activate the first card.
  • the first card is a card that does not allow automatic card cutting, and the NFC module cannot automatically activate the first card. If the terminal 100 is powered on at this time, the NFC module can interact with the REE module, and the REE module prompts the user to manually activate the first card, or the REE module requests the user to authenticate through the TEE module and activates the first card after the authentication is successful. Card, etc., and finally complete this transaction.
  • step S507 may be executed simultaneously with step S506, may be executed before step S506, or may be executed after step S507. This application does not limit the execution order of step S506 and step S507. In some other examples, step S506 may not be executed.
  • the COS forwards the instruction to select the card switching applet to the card switching applet.
  • the Applet for switching cards returns a response of selecting the Applet for switching cards to COS.
  • COS forwards the response of the selected Applet to the NFC module.
  • the NFC module sends an instruction to deactivate the second card that is currently activated to the card switching Applet.
  • deactivating the second card means canceling the activation state of the second card, so that the second card is in an inactivated state.
  • the NFC module can send to the card switching Applet through COS to activate all cards currently in the activated state, that is, the second card is all cards currently in the activated state.
  • the NFC module can also determine whether among the currently activated cards there are cards that conflict with the activated first card, and only activate these conflicting cards. That is, the second card is a non-connected parameter that activates the first card. Count conflicting cards.
  • the NFC module can also send deactivation instructions to the Cheka Applet through COS.
  • the COS or the card-cutting Applet determines whether there are cards that conflict with the activated first card among the currently activated cards, and only these conflicting cards are activated. This is not specifically limited in the embodiment of the present application.
  • the card-changing Applet sends an instruction to deactivate the second card to the CRS.
  • the card-changing Applet can also first determine whether the first card is in the card list. If it is determined that the first card is in the card list, then the first card is allowed to automatically cut cards, and then the card cut Applet will activate the second card. If it is determined that the first card is not in the card list, the first card is not allowed to automatically switch cards, and the Card Switch Applet does not need to activate the second card.
  • CRS deactivates the second card and returns a successful deactivation response to the card Applet.
  • the Cheka Applet returns a deactivation success response to the NFC module.
  • the Cheka Applet returns a deactivation success response to the NFC module through COS.
  • the NFC module sends an instruction to activate the first card to the card switching Applet.
  • the NFC module sends an instruction to activate the first card to the card-changing Applet through COS.
  • the card-cutting Applet determines whether the first card is in the card list. If the first card is in the card list, the card switching Applet sends a message to the CRS to activate the first card.
  • the card cutting Applet can verify the security of the activation card instruction from the NFC module based on a pre-stored card list that allows automatic card cutting.
  • step S501 it has been explained that the card cutting Applet obtains the card list that allows automatic card cutting. It should be emphasized that the card cutting Applet only stores the card list from the TEE module (such as card cutting TA) that allows automatic card cutting, thereby ensuring the security of card transactions. If the first card is in the card list, then the first card is a card that allows automatic card cutting, and then the card cutting Applet activates the first card. Otherwise, the card-changing Applet does not activate the first card.
  • CRS sends a response that the first card activation is successful to the card-cutting Applet.
  • the card-changing Applet sends a response indicating successful activation of the first card to the NFC module.
  • the card-cheating Applet sends a response that the first card is successfully activated to the NFC module through COS.
  • the NFC module receives the instruction to select the first card sent by the card reading device 200.
  • the NFC module forwards the instruction to select the first card to the COS in the SE module.
  • the COS determines that the first card is in the activated state, and then forwards the instruction to select the first card to the first card.
  • the first card returns a response of selecting the first card to the card reading device 200.
  • step S518a This step is shown in the figure as step S518a, step S518b and step S518c.
  • the card reading device 200 starts a transaction with the first card in the terminal 100.
  • the NFC module triggers the action of automatically activating the first card
  • the card-cutting Applet in the SE module performs security verification on the action of activating the first card, thereby realizing automatic activation of the first card. function.
  • the entire path of automatic card cutting in this application is located in the NFC module and SE module, and does not pass through the REE module and TEE module. Therefore, this application speeds up the speed of automatic card cutting.
  • the remaining power of the terminal 100 can power the NFC module and SE module of the terminal 100, that is, the NFC module and SE module of the terminal 100 can still work, and automatic card switching can still be achieved. In other words, on terminal 100 When shut down, this application can still realize automatic card cutting of the terminal 100.
  • the embodiment described in Figure 5 makes corresponding modifications to the NFC module of the terminal 100 and the business logic of the SE module.
  • a card-cutting Applet is added to the SE module, or the function of the card-cutting Applet in this embodiment is added to other modules in the SE module.
  • Step S501, step S502, step S507, step S510a, step S510b, step S512a, step S512b, etc. are added.
  • FIG. 6 it is a schematic flow chart of yet another automatic switching method for security services provided by an embodiment of the present application. The method includes:
  • the card-switching CA sends a list of cards that allow automatic card-switching (i.e., a white list) to the COS in the SE module through the card-switching TA.
  • the card list includes information of one or more cards.
  • the COS in the SE module initiates automatic activation of the first card and security verification of the instruction to activate the first card. Therefore, the card cutting CA sends a list of cards that allow automatic card cutting to the COS through the card cutting TA. (i.e. whitelist).
  • the COS may also be preset with a card list (ie, a white list) for automatic card cutting, that is, step S601 may not be performed. For other content, please refer to the above step S301.
  • the COS of the SE module can first determine whether the instruction comes from the TEE module, or more specifically from a specific TA in the TEE module, such as Cheka TA. If the instruction comes from the TEE module, or more specifically from a specific TA in the TEE module, such as cutting a card TA, COS stores the card list in the instruction, or updates the card list according to the instruction. This prevents other malicious applications from sending fake card lists to the SE module and improves the security of card transactions in the SE module.
  • the NFC module receives the instruction to select the first card sent by the card reading device 200.
  • the NFC module forwards the instruction to select the first card to the COS in the SE module.
  • the COS determines whether the first card is in an activated state.
  • step S605a and S606a are executed. If it is determined that the first card is in the activated state, the following step S611 is executed.
  • COS If the first card is in an inactive state, COS returns a response that the first card is not selected to the NFC module.
  • the NFC module returns a response that the first card is not selected to the card reading device 200.
  • the COS determines whether the first card is in the card list.
  • step S606a can be executed simultaneously with step S605a, or after step S605a, or before step S605a.
  • the embodiment of the present application does not limit the execution order of step S606a and step S605a.
  • the COS sends an instruction to deactivate the second card to the CRS. Among them, the second card is active.
  • the COS will not automatically activate the first card, and the terminal 100 will not execute steps S606b to S606e.
  • CRS deactivates the second card, and returns to COS a response that the second card is successfully deactivated.
  • the COS sends an instruction to activate the first card to the CRS.
  • the CRS activates the first card and returns a response to the COS that the activation of the first card is successful.
  • the NFC module sends the instruction to select the first card to the COS again.
  • the NFC module After the NFC module receives a response from COS that the first card is not selected, that is, after step S605a, the NFC module sends an instruction to select the first card to COS again.
  • the COS determines that the first card is in the activated state, and returns a response of selecting the first card to the NFC module.
  • the NFC module sends an instruction to select the first card to the COS again.
  • the NFC module is used to distinguish whether the first card is a card that allows automatic card cutting, so that the NFC module can select a card that allows automatic card cutting and a card that allows automatic card cutting. Automatically cut cards are not allowed to execute different business logic.
  • the card cutting CA sends a list of cards that allow automatic card cutting to the COS in the SE module through the card cutting TA.
  • the NFC module does not store a list of cards that allow automatic card cutting, so the NFC module does not know whether the first card is a card that allows automatic card cutting.
  • the NFC module sends an instruction to select the first card again (ie, performs step S607). If the NFC module receives a response of selecting the first card (ie, performs step S608), it can be determined that the first card allows automatic card cutting. card. This is because if the first card is a card that allows automatic card cutting, then the COS has automatically activated the first card in the above step S606d. The NFC module sends an instruction to select the first card again (ie, perform step S607).
  • the NFC module can determine that the first card is a card that does not allow automatic card cutting ( For example, cards that require user authentication, such as bank cards that require user authentication, access cards for secure areas, etc.). In this case, the NFC module can execute non-automatic card cutting business logic for cards that do not allow automatic card cutting. For example, if the terminal 100 is powered on at this time, the NFC module can interact with the REE module, and the REE module prompts the user to manually activate the first card, or the REE module requests the user to authenticate through the TEE module and activates it after the authentication is successful. The first card waits until the transaction is finally completed.
  • the REE module prompts the user to manually activate the first card
  • the REE module requests the user to authenticate through the TEE module and activates it after the authentication is successful. The first card waits until the transaction is finally completed.
  • the response of successful selection of the first card received by NFC at this time is in response to the instruction to select the first card actively initiated by the NFC module in step S607, rather than the instruction to select the first card actively initiated by the card reading device 200. instruction, therefore, the NFC module will not return a response of selecting the first card to the card reading device 200, and will not establish a transaction between the card reading device 200 and the first card.
  • the NFC module receives the instruction to select the first card sent by the card reading device 200.
  • the NFC module forwards the instruction to select the first card to the COS in the SE module.
  • the COS determines that the first card is in the activated state, and then forwards the instruction to select the first card to the first card.
  • the first card returns a response of selecting the first card to the card reading device 200.
  • step S612a This step is shown in the figure as step S612a, step S612b and step S612c.
  • the card reading device 200 starts a transaction with the first card in the terminal 100.
  • steps S609 to step S613 refer to the relevant contents in the above-mentioned steps S315 to step S319.
  • COS determines whether the first card to be activated is in the card list, which is not only used to trigger the action of automatically activating the first card, but also performs security verification on the action of activating the first card.
  • the entire path of automatic card cutting in this application is located in the NFC module and SE module and does not pass through the REE module and TEE module, when the terminal 100 is shut down, this application can still realize automatic card cutting of the terminal 100 .
  • step S601 steps S606a-S606e, step S607, etc. are added.
  • the NFC module selects the first card by sending it to the COS again after receiving the response of the unselected first card, and then determines whether the first card is a card that allows automatic card cutting based on the response returned by the COS. Therefore, when it is determined that the first card is a card that does not allow automatic card cutting, the business logic of non-automatic card cutting is executed.
  • the same module in the terminal 100 for example, the COS in the SE module
  • the COS is for cards that allow automatic card cutting and do not allow automatic card cutting. Cut cards return different responses.
  • the NFC module can determine whether the first card is a card that allows automatic card cutting based on different responses, and execute different business logic.
  • Figure 7A it is a schematic flow chart of yet another automatic switching method for security services provided by an embodiment of the present application. The method includes:
  • the card-switching CA sends a list of cards that allow automatic card-switching (i.e., a white list) to the COS in the SE module through the card-switching TA.
  • the card list includes information of one or more cards.
  • the COS in the SE module initiates automatic activation of the first card and security verification of the instruction to activate the first card. Therefore, the card cutting CA sends a list of cards that allow automatic card cutting to the COS through the card cutting TA. (i.e. whitelist).
  • the COS may also be preset with a card list (ie, a white list) for automatic card switching, that is, step S701 may not be performed. For other content, please refer to the above step S301.
  • the COS of the SE module can first determine whether the instruction comes from the TEE module, or more specifically from a specific TA in the TEE module, such as Cheka TA. If the instruction comes from the TEE module, or more specifically from a specific TA in the TEE module, such as cutting a card TA, COS stores the card list in the instruction, or updates the card list according to the instruction. This prevents other malicious applications from sending fake card lists to the SE module and improves the security of card transactions in the SE module.
  • the NFC module receives the instruction to select the first card sent by the card reading device 200.
  • the NFC module forwards the instruction to select the first card to the COS in the SE module.
  • the COS determines whether the first card is in an activated state.
  • step S705 If it is determined that the first card is in an inactive state, step S705 is executed. If it is determined that the first card is in the activated state, step S710 is executed.
  • COS determines whether the first card is in the card list.
  • step S710 if the first card is in the activated state, the COS forwards the instruction to select the first card to the first card, that is, step S710 is performed.
  • COS sends a first response of unselected first card to the NFC module.
  • the COS when the COS determines that the first card is in the card list and determines that the first card is a card that allows automatic card cutting, the COS returns a first response to the NFC.
  • the first response is used to notify the NFC module that the first card is not selected.
  • One card, and the first card is a card that allows automatic card cutting.
  • the first response is a customized response.
  • the NFC module returns a second response indicating that the first card is not selected to the card reading device 200. Wherein, the second response is different from the first response.
  • the second response is a response of an unselected card defined in the GP protocol (for example, the error code carried in the response is 6A82). That is to say, after receiving the first response that the first card is not selected, the NFC module sends a second response to the card reading device 200 to notify the card reading device 200 that the first card is not selected this time. It can be seen that in this embodiment, there is no need to modify the communication protocol between the card reading device 200 and the terminal 100 (specifically, the NFC module).
  • the COS sends an instruction to deactivate the second card to the CRS. Among them, the second card is active.
  • the COS will not automatically activate the first card, and the terminal 100 will not execute steps S707a to S707d.
  • CRS deactivates the second card and returns a response to COS indicating that the second card is successfully deactivated.
  • COS sends an instruction to activate the first card to CRS.
  • the CRS activates the first card and returns a response to the COS that the activation of the first card is successful.
  • the NFC module receives the instruction to select the first card sent by the card reading device 200.
  • the NFC module forwards the instruction to select the first card to the COS in the SE module.
  • the COS determines that the first card is in the activated state, and then forwards the instruction to select the first card to the first card.
  • the first card returns a response of selecting the first card to the card reading device 200.
  • step S711a This step is shown in the figure as step S711a, step S711b and step S711c.
  • the card reading device 200 starts a transaction with the first card in the terminal 100.
  • COS determines whether the first card to be activated is in the card list, which is not only used to trigger the action of automatically activating the first card, but also performs security verification on the action of activating the first card.
  • COS returns different responses for cards that allow automatic card cutting and cards that do not allow automatic card cutting
  • the NFC module determines whether the first card is a card that allows automatic card cutting based on the different responses, and Execute different business logic. It can be seen that this embodiment further reduces the interactive instructions involved in the automatic card cutting process, and the automatic card cutting process is more efficient.
  • the entire path of automatic card cutting in this application is located in the NFC module and SE module and does not pass through the REE module and TEE module, when the terminal 100 is shut down, this application can still realize automatic card cutting of the terminal 100 .
  • step S701 step S704-step S706a, step S707a-step S707d, etc. are added.
  • step S713 and steps S714a and S714b are executed after step S705.
  • COS sends a second response of unselected first card to the NFC module.
  • COS determines that the first card is not in the card list, then the first card is a card that does not allow automatic card cutting, then COS does not activate the first card, and COS returns a second response of unselected first card to the NFC module.
  • the second response is used to notify the NFC module that the first card is not selected, and the first card is a card that does not allow automatic card cutting.
  • the second response is the response of an unselected card defined in the GP (for example, the error code carried by the response is 6A82).
  • the NFC module returns a second response indicating that the first card is not selected to the card reading device 200.
  • Step S714b may be executed at the same time as step S714a, or may be executed before or after step S714a.
  • the NFC module can interact with the REE module, and the REE module prompts the user to manually activate the first card (for example, the REE module prompts the user to select a card, and instructs the SE module to activate the user's selection through the TEE module card), or the REE module requests the user to authenticate through the TEE module and activates the first card after successful authentication (for example, the REE module automatically selects the corresponding card, such as a bank card, and then prompts the user to enter such as fingerprint or face After the authentication is carried out and the TEE module passes the authentication, the SE module is instructed to activate the card) and finally complete the transaction.
  • the REE module prompts the user to manually activate the first card
  • the REE module prompts the user to select a card, and instructs the SE module to activate the user's selection through the TEE module card
  • the REE module requests the user to authenticate through the TEE module and activates the first card after successful authentication (for example, the REE module automatically selects the corresponding card, such as a
  • step S714b may be executed simultaneously with step S714a, and may be executed before or after step S714b.
  • step S706 in Figure 7A and step S713 in Figure 7B it can be seen that when COS determines that the first card is in the card list, and when it determines that the first card is not in the card list, the unselected response returned by COS to the NFC module is different. , which facilitates the NFC module to determine whether the first card is in the card list to execute different business logic.
  • step S713 is added.
  • the above embodiments are all based on the fact that all cards in the terminal 100 support the ISO/IEC 14443-4 protocol (the international standard for contactless IC cards) Illustrated as an example. Among them, cards that support the ISO/IEC 14443-4 protocol are also called standard cards. It should also be noted that the ISO/IEC 14443-4 protocol uses application ID (AID) to identify each card, so cards that support the ISO/IEC 14443-4 protocol are also called AID cards.
  • AID application ID
  • the card reading device 200 and the standard card in the terminal 100 first complete the primary handshake through the ISO/IEC 14443-3 protocol, and then exchange transaction-related instructions (such as , the card reading device 200 sends an instruction to select the first card; the terminal 100 returns to the card reading device 200 a response of selecting the first card or a response of not selecting the first card), etc.
  • cards in the SE module that support the ISO/IEC 14443-3 protocol but do not support the ISO/IEC 14443-4 protocol, such as bus cards that cannot be interconnected and old versions of access control cards. wait.
  • cards that support the ISO/IEC 14443-3 protocol but do not support the ISO/IEC 14443-4 protocol are also called non-standard cards.
  • UID is used to identify each card, so non-standard cards are also called user identification (UID) cards.
  • the non-standard card in the terminal 100 and the card reading device 200 may directly exchange transaction-related instructions through the ISO/IEC 14443-3 protocol. That is to say, the terminal 100 may not receive the instruction to select a certain card sent by the card reading device 200 through the ISO/IEC 14443-4 protocol.
  • the embodiment of the present application also provides a method of automatically cutting the card.
  • the NFC module of the terminal 100 can automatically initiate a card-cutting method based on the ISO/IEC 14443-3 protocol.
  • the IEC 14443-4 protocol selects a card instruction, thereby realizing the function of automatically switching non-standard cards through the ISO/IEC 14443-4 protocol.
  • FIG. 8 it is a schematic flow chart of a method for automatic switching of security services provided by an embodiment of the present application.
  • the method includes:
  • the card-switching CA sends a list of cards that allow automatic card-switching (i.e., a white list) to the COS in the SE module through the card-switching TA.
  • the card list includes information of one or more cards.
  • the card list includes information about each standard card that allows automatic card cutting, such as the AID of each standard card.
  • standard cards include bus cards, keys, electronic documents, etc. that realize interconnection.
  • the card list also includes information about non-standard cards that allow automatic card cutting, such as the UID of the non-standard card and the AID corresponding to the non-standard card.
  • the terminal 100 also sets the corresponding AID for the non-standard card, so that subsequent terminals can automatically activate the non-standard card through the ISO/IEC 14443-4 protocol.
  • non-standard cards include bus cards that cannot be interconnected, old version access cards, etc.
  • the COS in the SE module initiates automatic activation of the first card and security verification of the instruction to activate the first card. Therefore, the card cutting CA sends a list of cards that allow automatic card cutting to the COS through the card cutting TA. (i.e. whitelist).
  • the COS may also be preset with a card list (ie, a white list) for automatic card switching, that is, step S801 may not be performed. For other content, please refer to the above step S301.
  • the terminal 100 (specifically, the NFC module of the terminal 100) and the card reading device 200 exchange messages of the first protocol (ie, ISO/IEC 14443-3 protocol), such as performing a primary handshake process, etc.
  • the first protocol ie, ISO/IEC 14443-3 protocol
  • the NFC module of the terminal 100 After the preset time period after starting to interact with the card reading device 200 in the message of the first protocol, the NFC module of the terminal 100 has not yet received the second protocol (i.e. ISO/IEC 14443-4 protocol) sent by the card reading device 200. message, the NFC module sends an instruction of the second protocol to select the third card to the COS.
  • the identifier of the third card is a customized AID, which is a default AID.
  • the card reading device 200 If the card reading device 200 conducts a standard card transaction with the terminal 100, after the card reading device 200 performs a preliminary handshake with the terminal 100 based on the first protocol, the card reading device 200 will send an instruction to select a certain standard card based on the second protocol. , for example, the command carries the AID of the standard card. If none of the standard cards in the terminal 100 are activated at this time, the process shown in FIG. 7A can be used to automatically activate the standard card, that is, to realize automatic card cutting.
  • the card reading device 200 If the card reading device 200 conducts a non-standard card transaction with the terminal 100, after the card reading device 200 performs a preliminary handshake with the terminal 100 based on the first protocol, the card reading device 200 will not send a message to select a certain card based on the second protocol. Standard card instructions. Then, the NFC module of the terminal 100 will not receive the instruction to select a certain standard card based on the second protocol.
  • the NFC module can It is considered that the card that the card reading device 200 requires for transaction is a non-standard card, so the business logic of the non-standard card in the SE module is automatically activated. Specifically, the NFC module sends an instruction to select the third card based on the second protocol to the COS, which is used to trigger the activation of the non-standard card in the SE module. Among them, the identifier of the third card is a customized AID. It should be noted that the third card here is not the card that the card reading device 200 requires for transaction.
  • the COS modifies the AID of the third card to the AID of the fourth card.
  • the fourth card is a non-standard card added by the terminal 100.
  • step S805 it is further determined whether the fourth card is on the card list, that is, step S805 and subsequent steps are performed.
  • COS determines whether the fourth card is in the card list.
  • the fourth card is a card that allows automatic switching.
  • COS returns the first response of the unselected card to the NFC module.
  • the first response is used to notify the NFC module that the fourth card is not selected, and the fourth card is a card that allows automatic card cutting.
  • the first response is a customized response.
  • the fourth card if it is determined that the fourth card is not in the card list, the fourth card cannot be automatically activated, and the COS returns an unselected second response to the NFC module, that is, step S806a is not executed, but Execute step S806b.
  • the second response is different from the first response.
  • the second response is a response of an unselected card defined in the GP (for example, the error code carried in the response is 6A82). Similar to the process in Figure 7A, when the NFC module receives the second response of the unselected card, it can be determined that the fourth card is not in the card list and is a card that does not allow automatic card cutting, and the NFC module performs non-automatic card cutting services. logic. Please refer to the previous description for related content.
  • the COS sends an instruction to deactivate the second card to the CRS. Among them, the second card is active.
  • step S807 can also be executed simultaneously with step S806a, or before or after step S806a. This application does not limit the execution order of step S807 and step S806a.
  • the CRS deactivates the second card and returns a successful response to the COS for deactivating the second card.
  • the COS sends an instruction to activate the fourth card to the CRS.
  • the CRS returns a response to the COS indicating that the fourth card is successfully deactivated.
  • the card reading device 200 performs the transaction with the fourth card.
  • the terminal 100 automatically activates the non-standard card that allows automatic card cutting to improve the transaction success rate of the non-standard card. It can be understood that when the card reading device 200 requires a non-standard card in the terminal 100 that allows automatic switching, this embodiment implements automatic switching of the non-standard card.
  • the NFC module of the terminal 100 and the business logic of the COS in the SE module are modified accordingly in the embodiment described in FIG. 8 .
  • steps S803 to S810 are added.
  • the message of the first protocol is preset.
  • the NFC module of the terminal 100 After a period of time, when the NFC module of the terminal 100 has not received the message of the second protocol (i.e. ISO/IEC 14443-4 protocol) sent by the card reading device 200, the NFC module sends an instruction of the second protocol to select the third card to the COS.
  • the third card The AID identified as custom is the default AID.
  • COS/CRS receives the instruction to select the third card, it modifies the instruction of the third card to an instruction to select the fourth card.
  • the fourth card is the UID card added in the terminal 100 .
  • the subsequent processing of the instruction to select the fourth card can refer to the processing of the first card selection instruction in the above-mentioned Figures 3, 4, and 6, which will not be described again here.
  • this application realizes the function of automatically switching cards when the terminal 100 interacts with the card reading device 200 . Moreover, the method provided by the embodiment of the present application improves the efficiency of automatically cutting cards when the terminal 100 is turned on, and also realizes the function of automatically cutting cards when the terminal 100 is turned off.
  • the chip system includes at least one processor 1101 and at least one interface circuit 1102.
  • the processor 1101 and the interface circuit 1102 may be interconnected by wires.
  • interface circuitry 1102 may be used to receive signals from other devices, such as the memory of terminal 100.
  • interface circuit 1102 may be used to send signals to other devices (eg, processor 1101).
  • the interface circuit 1102 can read instructions stored in the memory and send the instructions to the processor 1101.
  • the terminal can be caused to perform various steps performed by the terminal 100 (such as a mobile phone) in the above embodiment.
  • the chip system may also include other discrete devices, which are not specifically limited in the embodiments of this application.
  • An embodiment of the present application also provides a device, which is included in a terminal and has the function of realizing the terminal behavior in any of the methods in the above embodiments.
  • This function can be implemented by hardware, or it can be implemented by hardware executing corresponding software.
  • the hardware or software includes at least one module or unit corresponding to the above functions. For example, detection module or unit, display module or unit, determination module or unit, and calculation module or unit, etc.
  • Embodiments of the present application also provide a computer storage medium that includes computer instructions.
  • the computer instructions When the computer instructions are run on a terminal, the terminal is caused to perform any of the methods in the above embodiments.
  • Embodiments of the present application also provide a computer program product.
  • the computer program product When the computer program product is run on a computer, it causes the computer to perform any of the methods in the above embodiments.
  • Embodiments of the present application also provide a graphical user interface on a terminal.
  • the terminal has a display screen, a camera, a memory, and one or more processors.
  • the one or more processors are used to execute data stored in the memory.
  • One or more computer programs, the graphical user interface includes a graphical user interface displayed when the terminal executes any of the methods in the above embodiments.
  • the above-mentioned terminals include hardware structures and/or software modules corresponding to each function.
  • Persons skilled in the art should easily realize that, in conjunction with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving the hardware depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementations should not be considered to be beyond the scope of the embodiments of the present invention.
  • Embodiments of the present application can divide the above-mentioned terminals into functional modules according to the above-mentioned method examples.
  • each functional module can be divided corresponding to each function, or two or more functions can be integrated into one place. in the management module.
  • the above integrated modules can be implemented in the form of hardware or software function modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. In actual implementation, there may be other division methods.
  • Each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software functional units.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
  • the technical solutions of the embodiments of the present application are essentially or contribute to the existing technology, or all or part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage device.
  • the medium includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of this application.
  • the aforementioned storage media include: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Telephone Function (AREA)
  • Control Of Vending Devices And Auxiliary Devices For Vending Devices (AREA)

Abstract

安全业务的切换方法及终端,涉及终端领域,可以提升安全业务的切换效率,且在终端关机时也可以实现自动切换,扩展了安全业务切换场景,该方法包括:在终端关机后,终端SE模块中的第一卡片处于未激活状态,终端通过NFC模块接收到读卡设备发送的选择第一卡片的指令后,根据该指令确定第一卡片是允许自动切卡的卡片后,通过SE模块激活第一卡片;终端通过NFC模块再次接收到读卡设备发送的选择第一卡片的指令后,终端的第一卡片与读卡设备执行交易业务。

Description

安全业务的切换方法及终端
本申请要求于2022年06月30日提交国家知识产权局、申请号为202210764350.X、申请名称为“安全业务的切换方法及终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端领域,尤其涉及安全业务的切换方法及终端。
背景技术
目前,例如手机、手表等的终端包括三层应用环境,分别是富执行环境(Rich Execution Environment,REE)、可信执行环境(Trust Execution Environment,TEE)和安全元件(Secure Element,SE)。终端根据安全业务(例如银行卡、公交卡、车钥匙等)中不同数据的安全性级别,分别在三层应用环境中部署相应的应用。也就是说,一个安全业务可能在REE、TEE以及SE均设置有相应的应用。需要说明的是,在安全业务交易之前,需要该安全业务在SE中的应用处于激活状态。若该安全业务在SE中的应用处于未激活状态,那么需要用户手动激活该安全业务在SE中的应用。在一些技术中,终端也可以自动激活该安全业务在SE中的应用。例如,华为的智闪卡,能够根据地理位置、读卡设备等条件自动识别场景,自动激活当前安全业务在SE中的应用,即实现安全业务的自动切换。但,目前终端安全业务自动切换的效率不高。并且,在终端关机时,则终端将无法实现安全业务的自动切换。
发明内容
本申请提供的安全业务的切换方法及终端,可以提升安全业务的切换效率,且在终端关机时也可以实现自动切换,扩展了安全业务切换场景。
为了实现上述目的,本申请实施例提供了以下技术方案:
第一方面、提供一种卡片的切换方法,应用于包括近场通信NFC模块和安全元件SE模块的终端上,SE模块中包括第一卡片;该方法包括:在终端关机之前,第一卡片处于未激活状态;终端关机;在终端关机后,第一卡片处于仍未激活状态,终端通过NFC模块接收到第一读卡设备发送的选择第一卡片的第一指令;终端根据第一指令确定第一卡片是允许自动切卡的卡片后,通过SE模块激活第一卡片;终端通过NFC模块接收到第一读卡设备发送的选择第一卡片的第二指令;响应于接收到第一指令,终端的第一卡片与第一读卡设备执行交易业务。
需要说明的是,整个自动切卡的路径均位于NFC模块和SE模块,不经过REE模块和TEE模块。又因为,在终端关机时,终端剩余的电量可为终端的NFC模块和SE模块供电,即终端的NFC模块和SE模块仍可工作,仍可实现自动切卡。由此可见,在终端关机时,本申请仍可实现终端的自动切卡。
可以理解的,在终端开机时,由于自动切卡的路径不经过REE模块和TEE模块, 因此本申请加快了开机时自动切卡的速度。
在一种可能的实现方式中,终端根据第一指令确定第一卡片是允许自动切卡的卡片后,通过SE模块激活第一卡片,包括:NFC模块向SE模块转发选择第一卡片的第一指令;SE模块确定第一卡片是允许自动切卡的卡片,SE模块激活第一卡片。
也就是说,由SE模块触发自动激活第一卡片。一个具体的示例中,可具体由SE模块中的COS判断第一卡片是允许自动切卡的卡片,若是,则调用SE模块中的CRS激活第一卡片。
在一种可能的实现方式中,SE模块还包括第二卡片,且第二卡片在终端关机时处于激活状态;在SE模块确定第一卡片是允许自动切卡的卡片之后,且SE模块激活第一卡片之前,该方法还包括:SE模块去激活第二卡片。
需要说明的是,不同卡片可能具有不同的非接参数设置。也就是说,当有两个或两个以上卡片的非接参数激活存在冲突时,这些卡片不能同时被激活。那么,在一些示例中,为了避免后续激活第一卡片失败,先将处于激活状态的第二卡片去激活,确保成功激活第一卡片。
在一种可能的实现方式中,在SE模块确定第一卡片是允许自动切卡的卡片之后,该方法还包括:SE模块向NFC模块返回第一响应,第一响应用于指示未选中第一卡片,且第一卡片是允许自动切卡的卡片。
在一个示例中,第一响应为自定义的响应,与现有标准中,未选中卡片的响应不同。
在一种可能的实现方式中,在SE模块向NFC模块返回第一响应之后,该方法还包括:NFC模块向第一读卡设备返回第二响应,第二响应用于指示未选中第一卡片,且第二响应与第一响应不同。
在一个示例中,第二响应为现有标准中未选中卡片的响应(例如响应携带的错误码为6A82)。由于NFC模块向第一读卡设备返回的为标准响应。可见,本实施例无需对第一读卡设备与终端(具体是NFC模块)之间的通信协议进行修改。
在一种可能的实现方式中,SE模块中包括第五卡片,该方法还包括:在终端开机后,第五卡片处于未激活状态,终端通过NFC模块接收到第三读卡设备发送的选择第五卡片的第五指令;NFC模块向SE模块转发第五指令;SE模块根据第五指令确定第五卡片是不允许自动切卡的卡片后,SE模块向NFC模块返回第三响应,第三响应用于指示未选中第五卡片,且第五卡片是不允许自动切卡的卡片。
也就是说,在终端开机时,当选择的第五卡片是不允许自动切卡的卡片时,COS向NFC模块返回第三响应(即标准的响应,如响应携带的错误码为6A82)。据此,NFC模块根据返回的第三响应可以确定该第五卡片是不允许自动切卡的卡片。后续,终端可以通过REE模块执行非自动切卡的业务逻辑,提示用户手动激活第五卡片。
可见,本申请还提供了一种NFC模块如何判断待激活的卡片是否为允许自动切卡的卡片的方法,便于NFC模块执行不同的业务逻辑。
在一种可能的实现方式中,终端还包括富执行环境REE模块,在SE模块向NFC模块返回第三响应之后,该方法还包括:NFC模块接收到第三响应后,向REE模块发送第六指令,第六指令用于提示用户手动激活第五卡片。
在一种可能的实现方式中,在终端关机之前,第一卡片处于未激活状态。
在一种可能的实现方式中,该方法还包括:终端在关机时,终端通过NFC模块与第二读卡设备交互第一协议的消息;在终端开始通过NFC模块与第二读卡设备交互第一协议的消息后的预设时长后,若NFC模块未接收到第二读卡设备发送的第二协议的消息,则NFC模块向SE模块发送第二协议的选择第三卡片的第三指令,第三指令包括预设的应用程序标识AID。由此,提供了一种触发非标准卡(即原本不支持第二协议的卡片)执行基于第二协议的自动切卡的方案。
在一种可能的实现方式中,在NFC模块向SE模块发送第二协议的选择第三卡片的第三指令之后,该方法还包括:SE模块在接收到第三指令后,将第三指令修改为第四指令;其中第四指令包括第四卡片的AID,第四卡片为用户标识UID卡;确定第四卡片处于未激活状态,且第四卡片是允许自动切卡的卡片后,SE模块激活第四卡片。由此,提供了非标准卡的自动切卡的方案。
在一种可能的实现方式中,终端根据第一指令确定第一卡片是允许自动切卡的卡片后,通过SE模块终端激活第一卡片,包括:NFC模块确定第一卡片是允许自动切卡的卡片后,NFC模块指示SE模块激活第一卡片。
由此,提供了一种由NFC模块触发激活第一卡片的业务逻辑。
在一种可能的实现方式中,终端根据第一指令确定第一卡片是允许自动切卡的卡片后,通过SE模块终端激活第一卡片,还包括:SE模块在接收到激活第一卡片的指示后,判断第一卡片是否是允许自动切卡的卡片;判断第一卡片是允许自动切卡的卡片后,SE模块激活第一卡片。
也就是说,在由NFC模块触发激活第一卡片的业务逻辑后,需要SE模块对激活第一卡片的指令进行安全校验,即SE模块判断第一卡片是否是自动切卡的卡片,由此提供卡片交易的重要性。
在一种可能的实现方式中,SE模块包括第二卡片,且第二卡片在终端关机时处于激活状态;在SE模块激活第一卡片之前,该方法还包括:SE模块去激活第二卡片。
在一种可能的实现方式中,在终端通过NFC模块接收到第一读卡设备发送的选择第一卡片的第一指令之后,该方法还包括:NFC模块向SE模块转发选择第一卡片的第一指令;SE模块根据第一指令向NFC模块返回第四响应,第四响应用于指示未选中第一卡片;响应于接收到第四响应,NFC模块确定第一卡片是否是允许自动切卡的卡片。由此,提供了一种NFC模块触发激活第一卡片的时机。
在一种可能的实现方式中,在终端关机之前,该方法还包括:NFC模块接收到第一卡片列表,第一卡片列表包括允许自动切卡的卡片的信息。由此,提供了NFC模块判断第一卡片是否是自动切卡的卡片的方法。
在一种可能的实现方式中,终端还包括可信执行环境TEE模块;在终端关机之前,该方法还包括:SE模块接收TEE模块发送的第二卡片列表,第二卡片列表包括允许自动切卡的卡片的信息。由此,提供了SE模块判断第一卡片是否是自动切卡的卡片的方法,或者,SE模块对激活第一卡片指令安全性校验的方法。
在一种可能的实现方式中,所述终端根据第一指令确定第一卡片是允许自动切卡的卡片后,通过SE模块激活第一卡片,还包括:SE模块在接收到第一指令后,确定 第一卡片处于未激活状态后,判断第一卡片是否为允许自动切卡的卡片;确定第一卡片是允许自动切卡的卡片后,激活第一卡片。
也就是说,由SE模块触发激活第一指令的业务逻辑。在一个具体的示例中,可以由SE模块中的COS触发激活第一指令的业务逻辑。
在一种可能的实现方式中,SE模块还包括第二卡片,且在终端关机时第二卡片处于激活状态;在SE模块确定第一卡片是允许自动切卡的卡片之后,且SE模块激活第一卡片之前,该方法还包括:SE模块去激活第二卡片。
在一种可能的实现方式中,SE模块中包括第六卡片,终端还包括REE模块,该方法还包括:在终端开机后,第六卡片处于未激活状态,终端通过所述NFC模块接收到第四读卡设备发送的选择第六卡片的第七指令;NFC模块向SE模块转发第七指令;SE模块根据第七指令确定第六卡片是不允许自动切卡的卡片后,SE模块向NFC模块返回第五响应,第五响应用于指示未选中所述第六卡片;NFC模块在接收到第五响应后,向SE模块发送选择第六卡片的第八指令;SE模块确定第六卡片处于未激活状态,向NFC模块返回第六响应,第六响应用于指示未选中第六卡片;NFC模块在接收到第六响应后,向REE模块发送第九指令,第九指令用于提示用户手动激活所述第六卡片。由此提供了一种NFC模块如何判断待激活的卡片是否为允许自动切卡的卡片的方法,便于NFC模块执行不同的业务逻辑。
第二方面、提供一种终端,包括:处理器、存储器、近场通信NFC模块和触摸屏,存储器、触摸屏、NFC模块与处理器耦合,处理器包括安全元件SE模块,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当处理器从存储器中读取所述计算机指令,以使得终端执行上述方面及其中任一种可能的实现方式中所述的方法。
第三方面、提供一种装置,该装置包含在终端中,该装置具有实现上述方面及可能的实现方式中任一方法中终端行为的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括至少一个与上述功能相对应的模块或单元。例如,接收模块或单元、显示模块或单元以及处理模块或单元等。
第四方面、提供一种计算机可读存储介质,包括计算机指令,当计算机指令在终端上运行时,使得终端执行如上述方面及其中任一种可能的实现方式中所述的方法。
第五方面、提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如上述方面中及其中任一种可能的实现方式中所述的方法。
第六方面、提供一种芯片系统,包括处理器,当处理器执行指令时,处理器执行如上述方面中及其中任一种可能的实现方式中所述的方法。
上述第二方面提供的终端,第三方面提供的装置,第四方面提供的计算机可读存储介质,第五方面提供的计算机程序产品,第六方面提供的芯片系统所能达到的技术效果,请参考第一方面以及第一方面中任一种可能实现方式中关于技术效果的描述,这里不再说明。
附图说明
图1为本申请实施例提供的一种通信系统的结构示意图;
图2为本申请实施例提供的一种终端的结构示意图;
图3为本申请实施例提供的一种安全业务的自动切换方法的流程示意图;
图4为本申请实施例提供的一些终端的用户界面示意图;
图5为本申请实施例提供的又一种安全业务的自动切换方法的流程示意图;
图6为本申请实施例提供的又一种安全业务的自动切换方法的流程示意图;
图7A为本申请实施例提供的又一种安全业务的自动切换方法的流程示意图;
图7B为本申请实施例提供的又一种安全业务的自动切换方法的流程示意图;
图8为本申请实施例提供的又一种安全业务的自动切换方法的流程示意图;
图9为本申请实施例提供的一种芯片系统的结构示意图。
具体实施方式
在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
如图1所示,为本申请实施例提供一种通信系统的结构示意图。该通信系统包括终端100和读卡设备200。示例性的,本申请实施例中终端100例如可以为手机、平板电脑、个人计算机(personal computer,PC)、个人数字助理(personal digital assistant,PDA)、上网本、可穿戴终端(如智能手表、智能手环等)、增强现实技术(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、车载设备、智慧屏、智能汽车、智能音响等,本申请对该终端100的具体形式不做特殊限制。示例性的,本申请实施例中读卡设备200例如可以为销售终端(point of sale,POS)、公交或地铁的刷卡机、门禁的刷卡机等。
其中,终端100包括富执行环境(Rich Execution Environment,REE)模块、可信执行环境(Trusted Execution Environment,TEE)模块和安全元件(Secure Element,SE)模块三种应用环境。在一个示例中,REE模块和TEE模块集成在一个芯片上,例如集成在应用处理器(Application Processor,AP)芯片,SE模块集成在另一个芯片上,如SE芯片。
其中,REE模块包括运行在通用的嵌入式处理器上的一般操作系统(图中未示出),如Rich OS或基于kernel的操作系统(如安卓系统、鸿蒙系统等),以及REE模块中的应用/服务。其中,REE中的应用称为客户端应用(client application,CA)。
其中,TEE模块是运行于REE模块之外的独立运行环境,其向REE模块提供安全服务并且与REE模块隔离。REE模块(包括一般操作系统及其上的应用程序)无法 直接访问TEE模块的硬件和软件资源。TEE模块为TEE模块中的应用提供可信赖的运行环境,再通过对机密性、完整性的保护和数据访问权限的控制,确保端到端的安全。TEE模块与REE模块并行,通过安全的应用程序编程接口(Application Programming Interface,API)与REE模块进行交互。TEE模块提供了一个比REE模块更高安全等级的运行环境,但无法提供硬件隔离级别的安全的密钥存储和密钥运行环境。其中,TEE模块中的应用也称为可信应用(TEE application,TA)。
其中,SE模块用来构建可信的安全的密钥存储和密钥运算环境。这是因为SE模块中软件系统简单,硬件元器件相对较少,故而容易建立物理防护和实施安全保障,从而提高SE模块的安全强度,从而可以服务于安全性要求更高的安全系统。其中,SE模块包括卡片操作系统(Chip Operating System,COS)模块、非接注册服务(Contactless Registry service,CRS)模块以及SE模块中的应用(例如图1中的卡片1……卡片n)。其中,COS为SE芯片的操作系统,用于对接收到的应用协议数据单元(Application Protocol Data Unit,APDU)指令进行预处理,并将指令分发给SE中的相应的服务或应用进行处理。CRS为SE模块中的一个系统应用,负责对SE模块中的应用的注册管理,激活或去激活(即取消激活)SE模块中的应用。SE模块中的应用也可以称为Applet或卡片,例如可以为银行卡、公交卡、门禁卡、工卡、电子证件、车钥匙、典型支持(如支付宝TM,微信支付TM)中一项或多项。
需要说明的是,终端100会根据安全业务中不同数据的安全性级别,分别在三层应用环境中部署相应的应用。也就是说,一个安全业务可能在REE模块、TEE模块以及SE模块均部署有相应的应用。本申请提供的安全业务的自动切换方法也涉及部署在REE模块的切卡CA、部署在TEE模块中的切卡TA,以及SE模块中相应的服务或应用(例如COS、CRS以及SE中的各类卡片)。在一个具体的实施例中,切卡CA可以为钱包应用部署在REE模块中应用,切卡TA可以为钱包应用部署在TEE模块中的应用,SE模块中的各类卡片可以为钱包应用部署在SE模块中的各类卡片,如银行卡、交通卡、电子证件、零钱、会员卡、发票,以及社区门禁卡、智能家用锁门卡、智能酒店房卡等。各个模块的具体功能将在后续的具体实施例中展开说明。
还需要说明的是,这里的“切卡CA”、“切卡TA”,以及下文的“切卡Applet”均是本申请为方便方案描述提供的名称,在一些示例中不能作为对本申请方案的功能的限定。
如图1所示,终端100还包括NFC模块,用于支持终端100与其他NFC设备(例如读卡设备200)进行通信。NFC模块包括非接触性前端(Contactless Front-End,CLF),为NFC模块的控制器,可以接收读卡设备200的APDU指令,并将接收的APDU指令发送给SE芯片的COS,以便COS将接收到的APDU指令分发给相应的SE模块中的应用进行业务交易。可选的,CLF也可以组装APDU指令。在一个示例中,NFC模块可以集成在独立于AP芯片和SE芯片之外的另一个芯片上,也称为NFC芯片。
在本申请的一些实施例中,终端100的REE模块根据用户已添加的卡片类型确定允许自动切卡的卡片列表,即白名单;或者,终端100的REE模块接收用户设置的白名单。而后,REE模块将白名单分别发送至终端100的SE模块和NFC模块中。当终端100接近读卡设备200时,终端100的NFC模块接收到读卡设备200发送的选择第 一卡片的指令。终端100的NFC模块将选择第一卡片的指令路由至终端100的SE模块上。若SE模块确定该第一卡片处于未激活状态时,向NFC模块返回未选中第一卡片的响应。NFC模块接收到未选中第一卡片的响应后,确定该第一卡片是否位于允许自动切卡的白名单中。当确定第一卡片在白名单中时,NFC模块向SE模块发送激活该第一卡片的指令。当SE模块接收到激活第一卡片的指令后,进行安全校验。例如,SE模块确定该第一卡片是否在允许自动切卡的白名单中。若第一卡片不在白名单中,则SE模块不激活第一卡片。若第一卡片在白名单中时,则SE模块激活第一卡片。这里以第一卡片在白名单中为例继续说明。需要说明的是,读卡设备200是持续发送选择第一卡片的指令的,因此终端100会再次接收到读卡设备200发送的选择第一卡片的指令。当终端100再次接收到选择第一卡片的指令后,终端100的NFC模块将选择第一卡片的指令路由至终端100的SE模块上。此时,SE模块确定已激活该第一卡片,那么SE模块将选择第一卡片的指令转发至第一卡片,而后读卡设备200与SE中的第一卡片进行交易。由此,终端100实现了自动切卡的功能。
在上述实施例中,是由NFC模块在接收到第一卡片未选中第一卡片的响应后,触发激活第一卡片的动作。在其他一些实施例中,也可以由SE模块在确定第一卡片处于未激活状态后,自动触发激活第一卡片的动作。在一些示例中,终端100的REE模块根据用户已添加的卡片类型确定允许自动切卡的卡片列表,即白名单;或者,终端100的REE模块接收用户设置的白名单。而后,REE模块将白名单发送至终端100的SE模块。那么,在SE模块接收到NFC模块转发的选择第一卡片的指令后,确定该第一卡片处于未激活状态时,SE模块一方面向NFC模块返回未选中第一卡片的响应,另一方面进行安全校验,例如SE模块确定第一卡片是否在白名单中。若第一卡片不在白名单中,则SE模块不激活第一卡片。若确定第一卡片在白名单中,则自动激活第一卡片。这里以第一卡片在白名单为例继续说明。在NFC模块侧,当NFC模块接收到SE模块返回的未选中第一卡片的响应后,再次向SE模块发送选择第一卡片的指令。此时,当SE模块接收到选择第一卡片的指令后,确定第一卡片已激活。同样,当终端100再次接收到选择第一卡片的指令后,终端100的NFC模块将选择第一卡片的指令路由至终端100的SE模块上。此时,SE模块确定已激活该第一卡片,那么SE模块将选择第一卡片的指令转发至第一卡片,而后读卡设备200与SE中的第一卡片进行交易。由此,终端100实现了自动切卡的功能。
在另一些示例中,终端100的REE模块根据用户已添加的卡片类型确定允许自动切卡的卡片列表,即白名单;或者,终端100的REE模块接收用户设置的白名单。而后,REE模块将白名单发送至终端100的SE模块。那么,在SE模块接收到NFC模块转发的选择第一卡片的指令后,确定该第一卡片处于未激活状态时,SE模块进一步确定第一卡片是否在白名单中。若确定第一卡片在白名单中,则自动激活第一卡片,并向NFC模块返回未选择第一卡片的第一响应(例如为自定义的响应)。若第一卡片不在白名单中,则SE模块不激活第一卡片,并向NFC模块返回未选中第一卡片的第二响应(例如为未选中卡片的标准响应)。在NFC模块侧,若NFC模块接收到SE模块返回的未选中第一卡片的第一响应后,则确定第一卡片为白名单中的卡片。若NFC模块接收到SE模块返回的未选择第一卡片的第二响应,则确定第一卡片不为白名单 中的卡片,则执行非自动切卡的业务逻辑。这里以第一卡片在白名单中为例继续说明。同样,当终端100再次接收到选择第一卡片的指令后,终端100的NFC模块将选择第一卡片的指令路由至终端100的SE模块上。此时,SE模块确定已激活该第一卡片,那么SE模块将选择第一卡片的指令转发至第一卡片,而后读卡设备200与SE中的第一卡片进行交易。由此,终端100实现了自动切卡的功能。
如图2所示,图2示出了终端100的结构示意图。
终端100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本发明实施例示意的结构并不构成对终端100的具体限定。在本申请另一些实施例中,终端100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过终端100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为终端供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于 监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
终端100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。终端100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在终端100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在终端100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,终端100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得终端100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术 等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
终端100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
终端100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展终端100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储终端100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行终端100的各种功能应用以及数据处理。
终端100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
以下结合图1所示的终端100的软件结构,对本申请实施例提供的技术方案进行详细说明。如图3所示,为本申请实施例提供的一种安全业务的自动切换方法的流程示意图,该方法包括:
S301、切卡CA通过切卡TA向SE模块中的CRS发送允许自动切卡的卡片列表(即白名单)。其中,卡片列表包括一个或多个卡片的信息。
在一些示例中,当用户指示终端100开启自动切卡功能,或者终端100自动开启自动切卡功能,或者终端100中允许自动切卡的卡片信息发生变化(例如用户添加或删除了允许自动切卡的卡片)时,切卡CA通过切卡TA向SE模块中的CRS发送卡片列表。该示例中,卡片列表可以包括用户在终端100中已添加的所有允许自动切卡的卡片的信息。在一个示例中,终端100可以默认不需要用户验证的卡片为允许自动切卡的卡片,例如交通卡、门禁卡(或者,具体为非安全区域的门禁卡)、钥匙(例如,车钥匙或智能门锁钥匙)、银行卡(仅限于免验证的小额支付功能)、电子证件等。在另一个示例中,也可以由用户来设置卡片是否允许自动切卡。
例如,以终端100其上安装的钱包应用为例进行说明。如图4中(1)所示,为终端100显示的钱包应用的设置界面,该设置界面中包括默认卡的设置项。响应于检测到用户操作默认卡设置项,终端100显示如图4中(2)所示的默认卡设置界面。默认 卡设置界面包括智闪卡以及钱包应用中已经添加的各类卡片。需要说明的是,默认卡为终端100默认激活的卡片。其中,智闪卡能够根据地理位置、读卡设备等条件自动识别场景,自动激活相应的卡片,即实现自动切卡的功能。例如,当检测到用户设置交通卡1为默认卡时,终端100默认激活交通卡1,其他卡片处于未激活状态。当用户需要使用其他卡片,例如交通卡2时,需要用户手动切换到交通卡2,即手动激活交通卡2。又例如,当检测到用户设置智闪卡为默认卡后,终端100的切卡CA(即钱包应用在REE中的应用)向SE模块中的CRS发送卡片列表,该卡片列表包括钱包应用已添加的所有允许自动切卡的卡片的信息。也就是说,此时终端100已启动自动切卡的功能。也就是说,当终端100接收到读卡设备200发送的选择交通卡1时,终端100可以自动激活交通卡1。当终端100接收到另一个读卡设备200发送的选择车钥匙时,终端100可以自动激活车钥匙,实现自动切换。响应于检测到用户在图4中(2)所示的界面中操作智闪卡设置项中的“详情”控件,终端100显示如图4中(3)所示的界面,该界面中包括允许自动切卡的卡片的信息,如交通卡,车钥匙,门禁卡等。在另一些示例中,图4中(3)所示的界面也可以提供编辑控件,供用户对允许自动切卡的卡片进行设置等。可以理解的是,终端100也可以提供其他的界面,用于用户启动自动切卡的功能,这里对终端100启动自动切卡功能的操作方式不做具体限定。
在另一些示例中,当终端100在第一次开启自动切卡功能后,切卡CA通过TEE模块的切卡TA向SE模块中的CRS发送卡片列表,此时卡片列表可以包括切卡CA中已添加的所有允许自动切卡的卡片信息。后续,当终端100中允许自动切卡的卡片信息发生变化(例如用户添加或删除了允许自动切卡的卡片)时,切卡CA可以向CRS发送变化部分的卡片的信息,用于CRS更新允许自动切卡的卡片的信息。例如,当用户添加了允许自动切卡的卡片1时,切卡CA通过TEE模块的切卡TA向SE模块中的CRS发送卡片1的信息,并指示CRS在允许自动切卡的卡片列表中添加卡片1的信息。又例如,当用户删除了允许自动切卡的卡片2时,切卡CA通过TEE模块的切卡TA向SE模块中的CRS发送卡片2的信息,并指示CRS在允许自动切卡的卡片列表中删除卡片2的信息。当然,用户也可以手动变更终端100中允许自动切卡的卡片信息。
在又一些示例中,也可以预先统计市面上所有卡片是否允许自动切卡,并在终端100的CRS中预置允许自动切卡的卡片列表。可以理解的是,CRS中预置的允许自动切卡的卡片可能包括终端100已添加的卡片,也可能包括终端100还未添加的卡片。在该示例中,也可以不执行本步骤S301。
由此,SE模块中的CRS中存储有允许自动切卡的卡片列表,后续,CRS可以基于该卡片列表对请求激活的卡片进行安全校验。
需要说明的是,SE模块的CRS在接收到卡片列表或者其他更新允许自动切卡的卡片的指令后,可以先判断该指令是否来自TEE模块,或者更具体的来自TEE模块中的特定TA,如切卡TA。若指令来自TEE模块,或者更具体的来自TEE模块中的特定TA,如切卡TA,则CRS存储该指令中的卡片列表,或者根据该指令更新卡片列表。由此,避免其他恶意应用向SE模块发送伪造的卡片列表,避免卡片被恶意激活,从而提升SE模块中卡片交易的安全性。
S302、切卡CA向NFC模块发送卡片列表。其中,卡片列表包括一个或多个卡片的信息。
在一些示例中,当用户指示终端100开启自动切卡功能,或者终端100自动开启自动切卡功能,或者终端100中允许自动切卡的卡片信息发生变化(例如用户添加或删除了允许自动切卡的卡片)时,切卡CA向NFC模块(例如,更具体的为CLF模块)发送卡片列表。或者,切换CA周期性向NFC模块(例如,更具体的为CLF模块)发送卡片列表。该示例中,卡片列表可以包括切卡CA中已添加的所有允许自动切卡的卡片的信息。
在另一些示例中,当终端100在第一次开启自动切卡功能后,切卡CA向NFC模块发送卡片列表,此时卡片列表可以包括切卡CA中已添加的所有允许自动切卡的卡片。后续,当终端100中允许自动切卡的卡片信息发生变化(例如用户添加或删除了允许自动切卡的卡片)时,切卡CA可以向NFC模块发送变化部分的卡片的信息,用于NFC模块更新允许自动切卡的卡片的信息。
在又一些示例中,也可以预先统计市面上所有卡片是否允许自动切卡,并在终端100的NFC模块中预置允许自动切卡的卡片列表。在该示例中,也可以不执行本步骤S302。
其他内容可以参考步骤S301中的内容描述,这里不再赘述。
由此,NFC模块中存储有允许自动切卡的卡片列表,后续,NFC模块可以基于该卡片列表向SE模块请求激活相应的卡片,以实现自动切卡功能。
需要说明的是,步骤S302可以与步骤S301同时执行,也可以在步骤S301之前执行,或者在步骤S301之后执行,本申请对步骤S301和步骤S302的执行顺序不做限定。
另外需要说明的是,上述步骤S301和步骤S302涉及终端100的REE模块和TEE模块。由于终端100在开机时才能启动REE模块,因此终端100只有在开机时才能执行上述步骤S301和步骤S302。而下述步骤S303-步骤S319仅涉及终端100的NFC模块和SE模块,不经过REE模块和TEE模块。由于在终端100关机时,终端100剩余的电量可为终端100的NFC模块和SE模块供电,即终端100的NFC模块和SE模块仍可工作。换言之,在终端100关机时,终端100仍可以执行下述步骤S303-步骤S319。再换言之,在终端100开机或关机时,均可以执行下述步骤S303-步骤S319。
S303、NFC模块接收到读卡设备200发送的选择第一卡片的指令。
根据全球平台(Global Platform,GP)关于TEE/SE领域的协议可知,读卡设备200会持续发送选择第一卡片的指令。其中,选择第一卡片的指令中包括第一卡片的应用标识(applicationID,AID),用于标识第一卡片的卡片类型。当终端100靠近读卡设备200后,终端100中的NFC模块便可以接收到读卡设备200发送的选择第一卡片的指令。例如,公交车的刷卡机(即读卡设备200)周期性发送选择交通卡(卡片类型)的指令。当用户将手机(即终端100)靠近刷卡机时,手机将接收到刷卡机发送的选择交通卡的指令。
S304、NFC模块向SE模块中的COS转发选择第一卡片的指令。
NFC模块将接收到的选择第一卡片的指令路由至SE模块的COS。
S305、若COS确定第一卡片处于未激活状态,则向NFC模块返回未选中第一卡片的响应。
在一些示例中,终端100可以支持激活一张卡片,或者支持同时激活多张卡片。在一个示例中,终端100支持激活一张卡片。在终端100开机时,若之前激活并使用的是另一张卡片(例如第二卡片),那么此时第一卡片处于未激活状态。在终端100关机时,若在终端100关机之前,终端100激活并使用的是另一张卡片(例如第二卡片),此时第一卡片处于未激活状态。
若COS确定第一卡片处于激活状态,则COS转发选择第一卡片的指令至第一卡片,即执行步骤S317以及之后的步骤。
S306、NFC模块在接收到未选中第一卡片的响应后,向读卡设备200返回未选中第一卡片的响应。
S307、NFC模块在接收到未选中第一卡片的响应后,NFC模块确定第一卡片是否在卡片列表中。若确定第一卡片在卡片列表中,则NFC模块向COS发送选择CRS的指令。其中,选择CRS的指令是用于指示NFC模块后续向CRS发送去激活和激活的指令。
可以理解的是,步骤S302中已说明NFC模块中存储有允许自动切卡的卡片列表。那么,当NFC模块接收到未选中第一卡片的响应后,NFC可以查询允许自动切卡的卡片列表,例如,图4中(3)所示的智闪卡列表,判断第一卡片是否为允许自动切卡。若第一卡片在允许自动切卡的卡片列表中,确定第一卡片是允许自动切卡的,则NFC模块触发自动激活第一卡片的动作,即选择CRS并指示CRS激活第一卡片。
在其他一些实施例中,若确定第一卡片不在卡片列表中,则第一卡片为不允许自动切卡的卡片,则NFC模块不能自动激活第一卡片。例如,若此时终端100处于开机状态,则NFC模块可以与REE模块进行交互,由REE模块提示用户手动激活第一卡片(例如REE模块提示用户选择卡片,并通过TEE模块指示SE模块激活用户选择的卡片),或者,由REE模块通过TEE模块请求用户进行认证以及在认证成功后激活第一卡片等(例如,REE模块自动选择相应的卡片,比如银行卡,而后提示用户输入例如指纹或人脸等进行认证,TEE模块认证通过后,指示SE模块激活该卡片),最终完成本次交易。
需要说明的是,步骤S307可以与步骤S306同时执行,也可以在步骤S306之前执行,或者在步骤S307之后执行,本申请对步骤S306和步骤S307的执行顺序不做限定。在其他一些示例中,步骤S306也可以不执行。
S308、COS向CRS转发选择CRS的指令。
S309a、CRS向COS返回选中CRS的响应。
S309b、COS向NFC模块转发选中CRS的响应。
S310、NFC模块向CRS发送去激活(deactivated)当前处于激活状态的第二卡片的指令。其中,去激活(deactivated)第二卡片,即取消第二卡片的激活状态,使得第二卡片处于未激活状态。
需要说明的是,不同卡片可能具有不同的非接参数设置。其中,非接参数是指SE模块中各个卡片通过NFC模块与读卡设备200进行通信时的通信参数。也就是说,当 有两个或两个以上卡片的非接参数激活存在冲突时,这些卡片不能同时被激活。那么,在一些示例中,为了避免后续激活第一卡片失败,NFC模块可以向CRS发送去激活当前处于激活状态的全部卡片,即第二卡片为当前处于激活状态的全部卡片。在另一些示例中,NFC模块也可以判断当前已激活的卡片中是否存在与激活第一卡片存在冲突的卡片,仅去激活这些冲突的卡片。即,第二卡片为激活第一卡片的非接参数存在冲突的卡片。
当然,在另外一些示例中,NFC模块也可以通过COS向CRS发送去激活的指令。由COS或者CRS判断当前已激活的卡片中是否存在与激活第一卡片冲突的卡片,仅去激活这些冲突的卡片,本申请实施例对此不做具体限定。
S311、CRS去激活第二卡片,并向NFC返回去激活成功的响应。
CRS通过COS向NFC模块返回选中CRS的响应。
S312、NFC模块向CRS发送激活第一卡片的指令。
NFC模块通过COS向CRS发送激活第一卡片的指令。
S313、CRS判断第一卡片是否在卡片列表中。若第一卡片在卡片列表中,则第一卡片为允许自动切卡的卡片,那么CRS激活第一卡片。
在本申请中,CRS可以基于预先存储的允许自动切卡的卡片列表来对来自NFC模块的激活卡片指令的安全性进行校验。在步骤S301中已说明CRS获取允许自动切卡的卡片列表。需要强调的是,CRS仅存储来自TEE模块(例如切卡TA)的允许自动切卡的卡片列表,从而保证卡片交易的安全性。若第一卡片在卡片列表中,则第一卡片为允许自动切卡的卡片,那么CRS激活第一卡片。否则,CRS不激活第一卡片。后续步骤以第一卡片在允许自动切卡的卡片列表中为例进行说明。
S314、CRS向NFC模块返回激活第一卡片成功的响应。
CRS通过COS向NFC模块返回激活第一卡片成功的响应。
S315、NFC模块接收到读卡设备200发送的选择第一卡片的指令。
前文已说明,读卡设备200持续发送选择第一卡片的指令,那么终端100的NFC模块会再次接收到读卡设备200发送的选择第一卡片的指令。
S316、NFC模块向SE模块中的COS转发选择第一卡片的指令。
NFC模块将接收到的选择第一卡片的指令路由至SE模块的COS。
S317、COS确定第一卡片处于激活状态,则向第一卡片转发选择第一卡片的指令。
由于上述步骤S313中已激活第一卡片,所以本步骤中,COS能够确定第一卡片处于激活状态。
S318、第一卡片向读卡设备200返回选中第一卡片的响应。
本步骤在图中以步骤S318a、步骤S318b和步骤S318c示出。
S319、读卡设备200与终端100中的第一卡片开始交易。
综上,在该实施例中,由NFC模块触发自动激活第一卡片的动作,并由SE模块中的CRS对激活第一卡片的动作进行安全性校验,从而实现自动激活第一卡片的功能。
以下结合一个具体场景进行说明。例如,手机在开机时,用户设置默认卡为智闪卡。手机将允许自动切卡的列表分别发送给NFC模块和SE模块。后续,手机可以根据读卡设备200的选择指令自动切卡。例如,用户乘坐公交,使用手机靠近公交车的 刷卡机,那么手机接收到公交车的刷卡机发送的选择交通卡的指令,手机根据该指令自动切换到交通卡,即激活交通卡。若手机关机了(用户主动关机或者手机自动关机),此时,手机内的交通卡处于激活状态,其他卡片处于未激活状态。当用户来到办公室,持手机靠近门禁读卡机处,手机通过NFC模块接收到门禁读卡机发送的选择门禁卡的指令。那么,NFC模块向SE模块的COS转发选择门禁卡的指令。此时,门禁卡处于未激活状态。COS向NFC模块返回未选中的响应。当NFC模块接收到未选中的响应后,判断该门禁卡是否是允许自动切卡的卡片。当确定门禁卡是允许自动切卡的卡片后,NFC模块向SE模块中的CRS发送去激活交通卡的指令,以及激活门禁卡的指令。当CRS确定门禁卡是允许自动切卡的卡片后,去激活交通卡,并激活门禁卡。当手机通过NFC模块再次接收到门禁刷卡机发送的选择门禁卡的指令后,手机的门禁卡与门禁刷卡机进行交易。
由此可见,本申请中自动切卡的整个路径均位于NFC模块和SE模块,不经过REE模块和TEE模块,因此本申请加快了自动切卡的速度。另外,需要说明的是,在终端100关机时,终端100剩余的电量可为终端100的NFC模块和SE模块供电,即终端100的NFC模块和SE模块仍可工作,仍可实现自动切卡。换言之,在终端100关机时,本申请仍可实现终端100的自动切卡。再有,相较于现有技术,本实施例中仅涉及修改NFC模块以及SE模块中的系统应用,修改的工作量较小。
另外,相较于现有技术,图3所述的实施例中对终端100的NFC模块,以及SE模块中的CRS的业务逻辑进行了相应的修改。例如,相较于现有技术,增加了步骤S301、步骤S302、步骤S307、步骤S310、步骤S312以及步骤S313等。
在上述实施例中,SE模块中的CRS用于对来自NFC模块的激活第一卡片的指令进行安全校验。在其他一些实施例中,也可以由SE模块中的其他模块(例如切卡Applet)对来自NFC模块的激活第一卡片的指令进行安全校验。如图5所示,为本申请实施例提供的又一种安全业务的自动切换方法的流程示意图,该方法包括:
S501、切卡CA通过切卡TA向SE模块中的切卡Applet发送允许自动切卡的卡片列表(即白名单)。其中,卡片列表包括一个或多个卡片的信息。
在该实施例中,由SE模块中的切卡Applet对激活第一卡片的指令进行安全校验,因此,切卡CA通过切卡TA向切卡Applet发送允许自动切卡的卡片列表(即白名单)。在一些示例中,切卡Applet也可以预置有自动切卡的卡片列表(即白名单),即可以不执行步骤S501。其他内容可以参考上述步骤S301。
需要说明的是,SE模块的切卡Applet在接收到卡片列表或者其他更新允许自动切卡的卡片的指令后,可以先判断该指令是否来自TEE模块,或者更具体的来自TEE模块中的特定TA,如切卡TA。若指令来自TEE模块,或者更具体的来自TEE模块中的特定TA,如切卡TA,则切卡Applet存储该指令中的卡片列表,或者根据该指令更新卡片列表。由此,避免其他恶意应用向SE模块发送伪造的卡片列表,避免卡片被恶意激活,从而提升SE模块中卡片交易的安全性。
S502、切卡CA向NFC模块发送卡片列表。其中,卡片列表包括一个或多个卡片的信息。
本步骤与步骤S302相同。
需要说明的是,步骤S502可以与步骤S501同时执行,也可以在步骤S501之前执行,或者在步骤S501之后执行,本申请对步骤S501和步骤S502的执行顺序不做限定。
S503、NFC模块接收到读卡设备200发送的选择第一卡片的指令。
S504、NFC模块向SE模块中的COS转发选择第一卡片的指令。
S505、若COS确定第一卡片处于未激活状态,则向NFC模块返回未选中第一卡片的响应。
S506、NFC模块在接收到未选中第一卡片的响应后,向读卡设备200返回未选中第一卡片的响应。
步骤S503-步骤S506请参考上述步骤S303-步骤S306的内容,这里不再重复赘述。
S507、NFC模块在接收到未选中第一卡片的响应后,NFC模块确定第一卡片是否在卡片列表中。若确定第一卡片在卡片列表中,则NFC模块向COS发送选择切卡Applet的指令。其中,选择切卡Apple的指令是用于指示NFC模块后续向切卡Applet发送去激活和激活的指令,而切卡Applet可以通过调用CRS执行去激活和激活的指令。
可以理解的是,步骤S502中已说明NFC模块中存储有允许自动切卡的卡片列表。那么,当NFC模块接收到未选中第一卡片的响应后,NFC可以查询允许自动切卡的卡片列表,判断第一卡片是否为允许自动切卡。若第一卡片在允许自动切卡的卡片列表中,确定第一卡片是允许自动切卡的,则NFC模块触发自动激活第一卡片的动作,即选择切卡Applet并指示CRS激活第一卡片。
在其他一些实施例中,若确定第一卡片不在卡片列表中,则第一卡片为不允许自动切卡的卡片,则NFC模块不能自动激活第一卡片。若此时终端100处于开机状态,则NFC模块可以与REE模块进行交互,由REE模块提示用户手动激活第一卡片,或者,由REE模块通过TEE模块请求用户进行认证以及在认证成功后激活第一卡片等,最终完成本次交易。
需要说明的是,步骤S507可以与步骤S506同时执行,也可以在步骤S506之前执行,或者在步骤S507之后执行,本申请对步骤S506和步骤S507的执行顺序不做限定。在其他一些示例中,步骤S506也可以不执行。
S508、COS向切卡Applet转发选择切卡Applet的指令。
S509a、切卡Applet向COS返回选中切卡Applet的响应。
S509b、COS向NFC模块转发选中切卡Applet的响应。
S510a、NFC模块向切卡Applet发送去激活(deactivated)当前处于激活状态的第二卡片的指令。其中,去激活第二卡片,即取消第二卡片的激活状态,使得第二卡片处于未激活状态。
需要说明的是,不同卡片可能具有不同的非接参数设置。也就是说,当有两个或两个以上卡片的非接参数激活存在冲突时,这些卡片不能同时被激活。那么,在一些示例中,为了避免后续激活第一卡片失败,NFC模块可以通过COS向切卡Applet发送去激活当前处于激活状态的全部卡片,即第二卡片为当前处于激活状态的全部卡片。在另一些示例中,NFC模块也可以判断当前已激活的卡片中是否存在与激活第一卡片存在冲突的卡片,仅去激活这些冲突的卡片。即,第二卡片为激活第一卡片的非接参 数存在冲突的卡片。
当然,在另外一些示例中,NFC模块也可以通过COS向切卡Applet发送去激活的指令。由COS或者切卡Applet判断当前已激活的卡片中是否存在与激活第一卡片冲突的卡片,仅去激活这些冲突的卡片,本申请实施例对此不做具体限定。
S510b、切卡Applet向CRS发送去激活第二卡片的指令。
可选的,切卡Applet在向CRS发送去激活第二卡片的指令之前,切卡Applet也可以先判断第一卡片是否在卡片列表中。若判断第一卡片在卡片列表中,则第一卡片是允许自动切卡的,那么切卡Applet才去激活第二卡片。若判断第一卡片不在卡片列表中,则第一卡片是不允许自动切卡的,那么切卡Applet也无需去激活第二卡片。
S511a、CRS去激活第二卡片,并向切卡Applet返回去激活成功的响应。
S511b、切卡Applet向NFC模块返回去激活成功的响应。
切卡Applet通过COS向NFC模块返回去激活成功的响应。
S512a、NFC模块向切卡Applet发送激活第一卡片的指令。
NFC模块通过COS向切卡Applet发送激活第一卡片的指令。
S512b、切卡Applet判断第一卡片是否在卡片列表中。若第一卡片在卡片列表中,则切卡Applet向CRS发送激活第一卡片。
在本申请中,切卡Applet可以基于预先存储的允许自动切卡的卡片列表来对来自NFC模块的激活卡片指令的安全性进行校验。在步骤S501中已说明切卡Applet获取允许自动切卡的卡片列表。需要强调的是,切卡Applet仅存储来自TEE模块(例如切卡TA)的允许自动切卡的卡片列表,从而保证卡片交易的安全性。若第一卡片在卡片列表中,则第一卡片为允许自动切卡的卡片,那么切卡Applet激活第一卡片。否则,切卡Applet不激活第一卡片。
S513、CRS激活第一卡片。
S514a、CRS向切卡Applet发送第一卡片激活成功的响应。
S514b、切卡Applet向NFC模块发送第一卡片激活成功的响应。
切卡Applet通过COS向NFC模块发送第一卡片激活成功的响应。
S515、NFC模块接收到读卡设备200发送的选择第一卡片的指令。
S516、NFC模块向SE模块中的COS转发选择第一卡片的指令。
S517、COS确定第一卡片处于激活状态,则向第一卡片转发选择第一卡片的指令。
S518、第一卡片向读卡设备200返回选中第一卡片的响应。
本步骤在图中以步骤S518a、步骤S518b和步骤S518c示出。
S519、读卡设备200与终端100中的第一卡片开始交易。
上述步骤S515-步骤S519参考上述步骤S315-步骤S319中的相关内容。
综上,在该实施例中,由NFC模块触发自动激活第一卡片的动作,并由SE模块中的切卡Applet对激活第一卡片的动作进行安全性校验,从而实现自动激活第一卡片的功能。由此可见,本申请中自动切卡的整个路径均位于NFC模块和SE模块,不经过REE模块和TEE模块,因此本申请加快了自动切卡的速度。另外,需要说明的是,在终端100关机时,终端100剩余的电量可为终端100的NFC模块和SE模块供电,即终端100的NFC模块和SE模块仍可工作,仍可实现自动切卡。换言之,在终端100 关机时,本申请仍可实现终端100的自动切卡。
另外,相较于现有技术,图5所述的实施例对终端100的NFC模块,以及SE模块的业务逻辑进行了相应的修改。例如,相较于现有技术,在SE模块中增加了切卡Applet,或者在SE模块中其他模块中增加本实施例中切卡Applet的功能。增加了步骤S501、步骤S502、步骤S507、步骤S510a、步骤S510b、步骤S512a、以及步骤S512b等。
上述实施例中,是由终端100中不同的模块触发自动激活第一卡片的动作以及执行安全校验,在另外一些实施例中,也可以由终端100中同一个模块(例如SE模块中的COS)触发自动激活第一卡片的动作以及执行安全校验。如图6所示,为本申请实施例提供的又一种安全业务的自动切换方法的流程示意图,该方法包括:
S601、切卡CA通过切卡TA向SE模块中的COS发送允许自动切卡的卡片列表(即白名单)。其中,卡片列表包括一个或多个卡片的信息。
在该实施例中,由SE模块中的COS发起自动激活第一卡片以及对激活第一卡片的指令进行安全校验,因此,切卡CA通过切卡TA向COS发送允许自动切卡的卡片列表(即白名单)。在一些示例中,COS也可以预置有自动切卡的卡片列表(即白名单),即可以不执行步骤S601。其他内容可以参考上述步骤S301。
需要说明的是,SE模块的COS在接收到卡片列表或者其他更新允许自动切卡的卡片的指令后,可以先判断该指令是否来自TEE模块,或者更具体的来自TEE模块中的特定TA,如切卡TA。若指令来自TEE模块,或者更具体的来自TEE模块中的特定TA,如切卡TA,则COS存储该指令中的卡片列表,或者根据该指令更新卡片列表。由此,避免其他恶意应用向SE模块发送伪造的卡片列表,提升SE模块中卡片交易的安全性。
S602、NFC模块接收到读卡设备200发送的选择第一卡片的指令。
S603、NFC模块向SE模块中的COS转发选择第一卡片的指令。
S604、COS在接收到选择第一卡片的指令后,判断第一卡片是否处于激活状态。
若确定第一卡片处于未激活状态则执行下述步骤S605a和步骤S606a。若确定第一卡片处于激活状态,则执行下述步骤S611。
S605a、若第一卡片处于未激活状态,COS向NFC模块返回未选中第一卡片的响应。
S605b、NFC模块向读卡设备200返回未选中第一卡片的响应。
S606a、若第一卡片处于未激活状态,则COS判断第一卡片是否在卡片列表中。
需要说明的是,本步骤S606a可以与步骤S605a同时执行,或者,在步骤S605a之后执行,或者,在步骤S605a之前执行。本申请实施例对步骤S606a和步骤S605a的执行顺序不做限定。
S606b、若第一卡片在卡片列表中,则COS向CRS发送去激活第二卡片的指令。其中,第二卡片处于激活状态。
需要说明的是,若第一卡片不在卡片列表中,则COS不会自动激活第一卡片,终端100不执行步骤S606b-步骤S606e。
S606c、CRS去激活第二卡片,并向COS返回去激活第二卡片成功的响应。
S606d、COS向CRS发送激活第一卡片的指令。
S606e、CRS激活第一卡片,并向COS返回激活第一卡片成功的响应。
S607、NFC模块向COS再次发送选择第一卡片的指令。
在NFC模块接收到COS返回未选择第一卡片的响应后,即在步骤S605a之后,NFC模块向COS再次发送选择第一卡片的指令。
S608、COS确定第一卡片处于激活状态,则向NFC模块返回选中第一卡片的响应。
需要说明的是,步骤S607中NFC模块向COS再次发送选择第一卡片的指令,是NFC模块用于区分第一卡片是否是允许自动切卡的卡片,以便NFC模块针对允许自动切卡的卡片和不允许自动切卡的卡片执行不同的业务逻辑。本实施例中,切卡CA通过切卡TA向SE模块中的COS发送了允许自动切卡的卡片列表。而NFC模块并没有存储允许自动切卡的卡片列表,因此NFC模块并不知晓第一卡片是否是允许自动切卡的卡片。然而,通过NFC模块再次发送选择第一卡片的指令(即执行步骤S607),若NFC模块接收到选中第一卡片的响应(即执行步骤S608),则可以确定第一卡片为允许自动切卡的卡片。这是因为若第一卡片是允许自动切卡的卡片,那么在上述步骤S606d中COS已自动激活第一卡片。通过NFC模块再次发送选择第一卡片的指令(即执行步骤S607),但若是NFC模块仍然接收到未选中第一卡片的响应,那么NFC模块可以确定第一卡片为不允许自动切卡的卡片(例如需要用户验证的卡片,如需要用户认证的银行卡、安全区域的门禁卡等)。在这种情况下,NFC模块可以针对不允许自动切卡的卡片执行非自动切卡的业务逻辑。例如,若此时终端100处于开机状态,则NFC模块可以与REE模块进行交互,由REE模块提示用户手动激活第一卡片,或者,由REE模块通过TEE模块请求用户进行认证以及在认证成功后激活第一卡片等,最终完成本次交易。
需要注意的是,此时NFC接收到的选择第一卡片成功的响应,是针对步骤S607中NFC模块主动发起的选择第一卡片的指令的,而非读卡设备200主动发起的选择第一卡片的指令,因此,NFC模块不会向读卡设备200返回选中第一卡片的响应,不会建立读卡设备200与第一卡片的交易。
S609、NFC模块接收到读卡设备200发送的选择第一卡片的指令。
S610、NFC模块向SE模块中的COS转发选择第一卡片的指令。
S611、COS确定第一卡片处于激活状态,则向第一卡片转发选择第一卡片的指令。
S612、第一卡片向读卡设备200返回选中第一卡片的响应。
本步骤在图中以步骤S612a、步骤S612b和步骤S612c示出。
S613、读卡设备200与终端100中的第一卡片开始交易。
上述步骤S609-步骤S613参考上述步骤S315-步骤S319中的相关内容。
综上,在该实施例中,COS判断待激活的第一卡片是否在卡片列表中,既用于触发自动激活第一卡片的动作,又对激活第一卡片的动作进行了安全性校验,自动切卡过程中涉及的交互指令更少,自动切卡的过程效率更高。同样,又由于本申请中自动切卡的整个路径均位于NFC模块和SE模块,不经过REE模块和TEE模块,因此在终端100关机时,本申请仍可实现终端100的自动切卡。
另外,相较于现有技术,图6所述的实施例中对终端100的NFC模块,以及SE模块中的COS的业务逻辑进行了相应的修改。例如,相较于现有技术,增加了步骤S601、步骤S606a-S606e、以及步骤S607等。
在上述实施例中,NFC模块是通过在接收到未选中第一卡片的响应后,再次向COS发送选择第一卡片,而后根据COS返回的响应判断第一卡片是否是允许自动切卡的卡片。由此,当确定第一卡片为不允许自动切卡的卡片的情况下执行非自动切卡的业务逻辑。在又一些实施例中,仍然由终端100中同一个模块(例如SE模块中的COS)触发自动激活第一卡片的动作以及执行安全校验,但COS针对允许自动切卡的卡片和不允许自动切卡的卡片返回不同的响应。那么NFC模块则可以根据不同的响应判断第一卡片是否是允许自动切卡的卡片,并执行不同的业务逻辑。具体的,如图7A所示,为本申请实施例提供的又一种安全业务的自动切换方法的流程示意图,该方法包括:
S701、切卡CA通过切卡TA向SE模块中的COS发送允许自动切卡的卡片列表(即白名单)。其中,卡片列表包括一个或多个卡片的信息。
在该实施例中,由SE模块中的COS发起自动激活第一卡片以及对激活第一卡片的指令进行安全校验,因此,切卡CA通过切卡TA向COS发送允许自动切卡的卡片列表(即白名单)。在一些示例中,COS也可以预置有自动切卡的卡片列表(即白名单),即可以不执行步骤S701。其他内容可以参考上述步骤S301。
需要说明的是,SE模块的COS在接收到卡片列表或者其他更新允许自动切卡的卡片的指令后,可以先判断该指令是否来自TEE模块,或者更具体的来自TEE模块中的特定TA,如切卡TA。若指令来自TEE模块,或者更具体的来自TEE模块中的特定TA,如切卡TA,则COS存储该指令中的卡片列表,或者根据该指令更新卡片列表。由此,避免其他恶意应用向SE模块发送伪造的卡片列表,提升SE模块中卡片交易的安全性。
S702、NFC模块接收到读卡设备200发送的选择第一卡片的指令。
S703、NFC模块向SE模块中的COS转发选择第一卡片的指令。
S704、COS在接收到选择第一卡片的指令后,判断第一卡片是否处于激活状态。
若确定第一卡片处于未激活状态,则执行步骤S705。若确定第一卡片处于激活状态,则执行步骤S710。
S705、若第一卡片处于未激活状态,COS判断第一卡片是否在卡片列表中。
在其他一些实施例中,若第一卡片处于激活状态,则COS向第一卡片转发选择第一卡片的指令,即执行步骤S710。
S706a、若第一卡片在卡片列表中,COS向NFC模块发送未选中第一卡片的第一响应。
在一些实施例中,当COS确定第一卡片在卡片列表中,确定第一卡片为允许自动切卡的卡片后,COS向NFC返回第一响应,该第一响应用于通知NFC模块未选中第一卡片,且第一卡片为允许自动切卡的卡片。在一个示例中,第一响应为自定义的响应。
S706b、NFC模块向读卡设备200返回未选中第一卡片的第二响应。其中,第二响应和第一响应不同。
在一些实施例中,第二响应为GP协议中已定义的未选中卡片的响应(例如响应携带的错误码为6A82)。也就是说,当NFC模块接收到未选中第一卡片的第一响应后,向读卡设备200发送第二响应,用于通知读卡设备200本次未选中第一卡片。可见,本实施例无需对读卡设备200与终端100(具体是NFC模块)之间的通信协议进行修改。
S707a、若第一卡片在卡片列表中,则COS向CRS发送去激活第二卡片的指令。其中,第二卡片处于激活状态。
需要说明的是,若第一卡片不在卡片列表中,则COS不会自动激活第一卡片,终端100不执行步骤S707a-步骤S707d。
S707b、CRS去激活第二卡片,并向COS返回去激活第二卡片成功的响应。
S707c、COS向CRS发送激活第一卡片的指令。
S707d、CRS激活第一卡片,并向COS返回激活第一卡片成功的响应。
S708、NFC模块接收到读卡设备200发送的选择第一卡片的指令。
S709、NFC模块向SE模块中的COS转发选择第一卡片的指令。
S710、COS确定第一卡片处于激活状态,则向第一卡片转发选择第一卡片的指令。
S711、第一卡片向读卡设备200返回选中第一卡片的响应。
本步骤在图中以步骤S711a、步骤S711b和步骤S711c示出。
S712、读卡设备200与终端100中的第一卡片开始交易。
上述步骤S708-步骤S712参考上述步骤S315-步骤S319中的相关内容。
综上,在该实施例中,COS判断待激活的第一卡片是否在卡片列表中,既用于触发自动激活第一卡片的动作,又对激活第一卡片的动作进行了安全性校验,自动切卡过程中涉及的交互指令更少,自动切卡的过程效率更高。另外,本实施例中,COS针对允许自动切卡的卡片和不允许自动切卡的卡片返回不同的响应,而NFC模块则根据不同的响应判断第一卡片是否是允许自动切卡的卡片,并执行不同的业务逻辑。可见,本实施例进一步减少了自动切卡过程中涉及的交互指令,自动切卡的过程效率更高。同样,又由于本申请中自动切卡的整个路径均位于NFC模块和SE模块,不经过REE模块和TEE模块,因此在终端100关机时,本申请仍可实现终端100的自动切卡。
另外,相较于现有技术,图7A所述的实施例中对终端100的NFC模块,以及SE模块中的COS的业务逻辑进行了相应的修改。例如,相较于现有技术,增加了步骤S701、步骤S704-步骤S706a、步骤S707a-步骤S707d等。
图7A所述的实施例是以第一卡片在卡片列表为例进行说明的,在其他一些实施例中,当第一卡片不在列表时,则终端执行如图7B所示的流程。具体的,在步骤S705之后执行步骤S713和步骤S714a和S714b。
S713、若第一卡片不在卡片列表中,COS向NFC模块发送未选中第一卡片的第二响应。
COS确定第一卡片不在卡片列表中,则第一卡片为不允许自动切卡的卡片,那么COS不激活第一卡片,COS向NFC模块返回未选中第一卡片的第二响应。该第二响应用于通知NFC模块未选中第一卡片,且第一卡片为不允许自动切卡的卡片。在一个示例中,该第二响应为GP中已定义的未选中卡片的响应(例如响应携带的错误码为 6A82)。
S714a、NFC模块向读卡设备200返回未选择第一卡片的第二响应。
S714b、若此时终端100处于开机,则执行非自动切卡的业务逻辑;若此时终端100处于关机,则本流程结束。
其中步骤S714b可以和步骤S714a同时执行,也可以在步骤S714a之前或之后执行。
例如,若此时终端100处于开机状态,则NFC模块可以与REE模块进行交互,由REE模块提示用户手动激活第一卡片(例如REE模块提示用户选择卡片,并通过TEE模块指示SE模块激活用户选择的卡片),或者,由REE模块通过TEE模块请求用户进行认证以及在认证成功后激活第一卡片等(例如,REE模块自动选择相应的卡片,比如银行卡,而后提示用户输入例如指纹或人脸等进行认证,TEE模块认证通过后,指示SE模块激活该卡片),最终完成本次交易。
需要说明的是,步骤S714b可以与步骤S714a同时执行,可以在步骤S714b之前或之后执行。
对比图7A中的步骤S706和图7B中的步骤S713可知,当COS确定第一卡片在卡片列表中时,与确定第一卡片不在卡片列表中时,COS向NFC模块返回的未选中的响应不同,便于NFC模块判断第一卡片是否在卡片列表中,以执行不同的业务逻辑。
另外,相较于现有技术,图7B所述的实施例中对终端100的NFC模块,以及SE模块中的COS的业务逻辑进行了相应的修改。例如,相较于现有技术,增加了步骤S713。
上述实施例(图3、图5、图6、图7A和图7B所述的实施例)均是以终端100中卡片均支持ISO/IEC 14443-4协议(非接触式IC卡的国际标准)为例进行说明的。其中,支持ISO/IEC 14443-4协议的卡片也称为标准卡。还需要说明的是,ISO/IEC 14443-4协议中采用应用程序标识(application ID,AID)识别各个卡片,因此支持ISO/IEC 14443-4协议的卡片也称为AID卡。也就是说,上述实施例中,读卡设备200与终端100中的标准卡先通过ISO/IEC 14443-3协议完成初级握手后,再通过ISO/IEC 14443-4协议交互交易相关的指令(例如,读卡设备200发送选择第一卡片的指令;终端100向读卡设备200返回选中第一卡片的响应或者未选中第一卡片的响应)等。
然而,在真实的场景中,SE模块中还可能存在支持ISO/IEC 14443-3协议,但不支持ISO/IEC 14443-4协议的卡片,例如不能实现互联互通的公交卡、旧版本的门禁卡等。其中,支持ISO/IEC 14443-3协议,但不支持ISO/IEC 14443-4协议的卡片也称为非标准卡。还需要说明的是,在ISO/IEC 14443-3协议中采用UID标识各个卡片,因此非标准卡也称为用户标识(user ID,UID)卡。那么,终端100中的非标准卡与读卡设备200在通过ISO/IEC 14443-3协议完成初级握手后,可能直接通过ISO/IEC 14443-3协议交互交易相关的指令。也就是说,终端100可能接收不到读卡设备200通过ISO/IEC 14443-4协议发送的选择某个卡片的指令。为此,本申请实施例还提供了一种自动切卡的方法,在终端100与读卡设备200通过ISO/IEC 14443-3协议完成初级握手后,终端100的NFC模块可以自动发起基于ISO/IEC 14443-4协议的选择某个卡片的指令,由此通过ISO/IEC 14443-4协议实现自动切换非标准卡的功能。
以下结合图7A和图7B所示的流程,对实现非标准卡的自动切换的方法进行说明。可以理解的是,终端100中添加有标准卡和非标准卡。这里以终端100中添加一个或多个标准卡,以及一个非标准卡为例进行说明。
如图8所示,为本申请实施例提供的一种安全业务的自动切换的方法的流程示意图,该方法包括:
S801、切卡CA通过切卡TA向SE模块中的COS发送允许自动切卡的卡片列表(即白名单)。其中,卡片列表包括一个或多个卡片的信息。
其中,卡片列表中包括允许自动切卡的各个标准卡的信息,例如各个标准卡的AID。其中,标准卡例如为实现互联互通的公交卡、钥匙、电子证件等。可选的,卡片列表中还包括允许自动切卡的非标准卡的信息,例如包括非标准卡的UID,以及非标准卡对应的AID。在本申请中,终端100为非标准卡还设置对应的AID,以便后续终端可以通过ISO/IEC 14443-4协议实现自动激活非标准卡。例如,非标准卡例如为不能实现互联互通的公交卡、旧版本的门禁卡等。
在该实施例中,由SE模块中的COS发起自动激活第一卡片以及对激活第一卡片的指令进行安全校验,因此,切卡CA通过切卡TA向COS发送允许自动切卡的卡片列表(即白名单)。在一些示例中,COS也可以预置有自动切卡的卡片列表(即白名单),即可以不执行步骤S801。其他内容可以参考上述步骤S301。
S802、终端100(具体为终端100的NFC模块)与读卡设备200交互第一协议(即ISO/IEC 14443-3协议)的消息,例如执行初级握手过程等。
S803、在开始与读卡设备200交互第一协议的消息后的预设时长后,终端100的NFC模块仍未接收到读卡设备200发送的第二协议(即ISO/IEC 14443-4协议)的消息时,NFC模块向COS发送第二协议的选择第三卡片的指令。在一个示例中,第三卡片的标识为自定义的AID,即为预设的AID。
如果读卡设备200与终端100进行标准卡的交易,在读卡设备200基于第一协议执行与终端100初级握手等过程后,读卡设备200将发送基于第二协议的选择某个标准卡的指令,例如指令中携带该标准卡的AID。若此时终端100中该标准卡均未激活,则采用图7A所示的流程即可实现对该标准卡的自动激活,即实现自动切卡。
如果读卡设备200与终端100进行非标准卡的交易时,在读卡设备200在基于第一协议执行与终端100初级握手等过程后,读卡设备200不会发送基于第二协议的选择某个标准卡的指令。那么,终端100的NFC模块将接收不到基于第二协议的选择某个标准卡的指令。因此,在开始基于第一协议执行初级握手等过程后的预设时长(例如800ms)内,如果NFC模块一直未接收到读卡设备200基于第二协议发送的选择卡片的指令,那么NFC模块可以认为读卡设备200要求交易的卡片为非标准卡,于是自动激活SE模块中非标准卡的业务逻辑。具体的,NFC模块向COS发送基于第二协议的选择第三卡片的指令,用于触发激活SE模块中非标准卡。其中,第三卡片的标识为自定义的AID。需要说明的是,这里的第三卡片并不是读卡设备200要求交易的卡片。
S804、COS在接收到选择第三卡片的指令后,将第三卡片的AID修改为第四卡片的AID。其中,第四卡片为终端100已添加的非标准卡。
换言之,选择第三卡片的指令变更为选择第四卡片的指令,那么后续将判断第四卡片是否处于激活状态。若第四卡片处于激活状态,则该流程结束。若第四卡片处于未激活状态,则进一步判断第四卡片是否在卡片列表上,即执行步骤S805以及之后的步骤。
S805、若第四卡片处于未激活状态,COS判断第四卡片是否在卡片列表中。
也就是说,判断第四卡片是否为允许自动切换的卡片。
S806a、若第四卡片在卡片列表中,COS向NFC模块返回未选中卡片的第一响应。
在一个示例中,第一响应,用于通知NFC模块未选中第四卡片,且第四卡片为允许自动切卡的卡片。在一个示例中,第一响应为自定义的响应。
需要说明的是,在另外一些实施例中,若确定第四卡片不在卡片列表中,则不能自动激活第四卡片,COS向NFC模块返回未选中的第二响应,即不执行步骤S806a,而是执行步骤S806b。其中,第二响应和第一响应不同。在一个示例中,第二响应为GP中已定义的未选中卡片的响应(例如响应携带的错误码为6A82)。与图7A流程类似的,当NFC模块接收到未选中卡片的第二响应后,可以确定第四卡片不在卡片列表中,为不允许自动切卡的卡片,则NFC模块执行非自动切卡的业务逻辑。相关内容请参考前文描述。
后续步骤是以第四卡片在卡片列表为例继续说明的。
S807、若第四卡片在卡片列表中,则COS向CRS发送去激活第二卡片的指令。其中,第二卡片处于激活状态。
需要说明的是,本步骤S807也可以与步骤S806a同时执行,或者在步骤S806a之前或之后执行,本申请对步骤S807和步骤S806a的执行顺序不做限定。
S808、CRS去激活第二卡片,并向COS返回去激活第二卡片成功的响应。
S809、COS向CRS发送激活第四卡片的指令。
S810、CRS向COS返回去激活第四卡片成功的响应。
S811、如果读卡设备200要求交易的卡片是第四卡片,则读卡设备200与第四卡片进行交易。
可以理解的是,如果读卡设备200要求交易的卡片不是第四卡片,则本次交易仍然失败。
综上,当确定读卡设备200要求交易的卡片为非标准卡时,终端100自动将允许自动切卡的非标准卡自动激活,用于提高非标准卡的交易成功率。可以理解的是,当读卡设备200要求的是终端100中允许自动切换的非标准卡时,本实施例实现了非标准卡的自动切换。
另外,相较于现有技术,图8所述的实施例中对终端100的NFC模块,以及SE模块中的COS的业务逻辑进行了相应的修改。例如,相较于现有技术,增加了步骤S803至步骤S810等。
基于相同的思路,在上述图3、图4和图6所示的流程也可以增加类似的步骤,例如,在终端100的NFC模块开始与读卡设备200交互第一协议的消息后的预设时长后,终端100的NFC模块仍未接收到读卡设备200发送的第二协议(即ISO/IEC 14443-4协议)的消息时,NFC模块向COS发送第二协议的选择第三卡片的指令,第三卡片的 标识为自定义的AID,即为预设的AID。当COS/CRS接收到选择第三卡片的指令后,将第三卡片的指令修改为选择第四卡片的指令,第四卡片为终端100中已添加的UID卡。而后,判断第四卡片是否已激活。当第四卡片未激活时,判断第四卡片是否在卡片列表中。当第四卡片在卡片列表中,自动激活第四卡片,由此实现非标准卡的自动切换。需要说明的是,后续针对选择第四卡片的指令的处理(包括如何判断第四卡片是否已激活,判断第四卡片是否在卡片列表中,如何激活第四卡片,以及如何向NFC模块以及读卡设备200返回响应等)均可以参考上述图3、图4、图6中关于对选择第一卡片指令的处理,这里不再赘述。
综上所述,本申请实现了终端100在与读卡设备200交互时,自动切换卡片的功能。并且,本申请实施例提供的方法提升了终端100开机时自动切卡的效率,还实现了终端100关机时也可以自动切卡的功能。
本申请实施例还提供一种芯片系统,如图9所示,该芯片系统包括至少一个处理器1101和至少一个接口电路1102。处理器1101和接口电路1102可通过线路互联。例如,接口电路1102可用于从其它装置(例如终端100的存储器)接收信号。又例如,接口电路1102可用于向其它装置(例如处理器1101)发送信号。示例性的,接口电路1102可读取存储器中存储的指令,并将该指令发送给处理器1101。当所述指令被处理器1101执行时,可使得终端执行上述实施例中的终端100(比如,手机)执行的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。
本申请实施例还提供一种装置,该装置包含在终端中,该装置具有实现上述实施例中任一方法中终端行为的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括至少一个与上述功能相对应的模块或单元。例如,检测模块或单元、显示模块或单元、确定模块或单元、以及计算模块或单元等。
本申请实施例还提供一种计算机存储介质,包括计算机指令,当计算机指令在终端上运行时,使得终端执行如上述实施例中任一方法。
本申请实施例还提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如上述实施例中任一方法。
本申请实施例还提供一种终端上的图形用户界面,所述终端具有显示屏、摄像头、存储器、以及一个或多个处理器,所述一个或多个处理器用于执行存储在所述存储器中的一个或多个计算机程序,所述图形用户界面包括所述终端执行如上述实施例中任一方法时显示的图形用户界面。
可以理解的是,上述终端等为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明实施例的范围。
本申请实施例可以根据上述方法示例对上述终端等进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处 理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本发明实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (19)

  1. 一种卡片的切换方法,其特征在于,应用于包括近场通信NFC模块和安全元件SE模块的终端上,所述SE模块中包括第一卡片;所述方法包括:
    所述终端关机;
    在所述终端关机后,所述第一卡片处于未激活状态,所述终端通过所述NFC模块接收到第一读卡设备发送的选择所述第一卡片的第一指令;
    所述终端根据所述第一指令确定所述第一卡片是允许自动切卡的卡片后,通过所述SE模块激活所述第一卡片;
    所述终端通过所述NFC模块接收到所述第一读卡设备发送的选择所述第一卡片的第二指令;
    响应于接收到所述第一指令,所述终端的所述第一卡片与所述第一读卡设备执行交易业务。
  2. 根据权利要求1所述的方法,其特征在于,所述终端根据所述第一指令确定所述第一卡片是允许自动切卡的卡片后,通过所述SE模块激活所述第一卡片,包括:
    所述NFC模块向所述SE模块转发所述选择第一卡片的所述第一指令;
    所述SE模块确定所述第一卡片是允许自动切卡的卡片,所述SE模块激活所述第一卡片。
  3. 根据权利要求2所述的方法,其特征在于,所述SE模块还包括第二卡片,且所述第二卡片在所述终端关机时处于激活状态;
    在所述SE模块确定所述第一卡片是允许自动切卡的卡片之后,且所述SE模块激活所述第一卡片之前,所述方法还包括:
    所述SE模块去激活所述第二卡片。
  4. 根据权利要求2或3所述的方法,其特征在于,在所述SE模块确定所述第一卡片是允许自动切卡的卡片之后,所述方法还包括:
    所述SE模块向所述NFC模块返回第一响应,所述第一响应用于指示未选中所述第一卡片,且所述第一卡片是允许自动切卡的卡片。
  5. 根据权利要求4所述的方法,其特征在于,在所述SE模块向所述NFC模块返回第一响应之后,所述方法还包括:
    所述NFC模块向所述第一读卡设备返回第二响应,所述第二响应用于指示未选中所述第一卡片,且所述第二响应与所述第一响应不同。
  6. 根据权利要求2或3所述的方法,其特征在于,所述SE模块中包括第五卡片,所述方法还包括:
    在所述终端开机后,所述第五卡片处于未激活状态,所述终端通过所述NFC模块接收到第三读卡设备发送的选择所述第五卡片的第五指令;
    所述NFC模块向所述SE模块转发所述第五指令;
    所述SE模块根据所述第五指令确定所述第五卡片是不允许自动切卡的卡片后,所述SE模块向所述NFC模块返回第三响应,所述第三响应用于指示未选中所述第五卡片,且所述第五卡片是不允许自动切卡的卡片。
  7. 根据权利要求6所述的方法,其特征在于,所述终端还包括富执行环境REE模 块,在所述SE模块向所述NFC模块返回第三响应之后,所述方法还包括:
    所述NFC模块接收到所述第三响应后,向所述REE模块发送第六指令,所述第六指令用于提示用户手动激活所述第五卡片。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,在所述终端关机之前,所述第一卡片处于未激活状态。
  9. 根据权利要求1-8任一项所述的方法,其特征在于,所述方法还包括:
    所述终端在关机时,所述终端通过所述NFC模块与第二读卡设备交互第一协议的消息;
    在所述终端开始通过所述NFC模块与第二读卡设备交互第一协议的消息后的预设时长后,若NFC模块未接收到所述第二读卡设备发送的第二协议的消息,则所述NFC模块向所述SE模块发送所述第二协议的选择第三卡片的第三指令,所述第三指令包括预设的应用程序标识AID。
  10. 根据权利要求9所述的方法,其特征在于,在所述NFC模块向所述SE模块发送所述第二协议的选择第三卡片的第三指令之后,所述方法还包括:
    所述SE模块在接收到所述第三指令后,将第三指令修改为第四指令;其中所述第四指令包括第四卡片的AID,所述第四卡片为用户标识UID卡;
    确定所述第四卡片处于未激活状态,且所述第四卡片是允许自动切卡的卡片后,SE模块激活所述第四卡片。
  11. 根据权利要求1所述的方法,其特征在于,所述终端根据所述第一指令确定所述第一卡片是允许自动切卡的卡片后,通过所述SE模块激活所述第一卡片,包括:
    所述NFC模块确定所述第一卡片是允许自动切卡的卡片后,所述NFC模块指示所述SE模块激活所述第一卡片。
  12. 根据权利要求11所述的方法,其特征在于,所述终端根据所述第一指令确定所述第一卡片是允许自动切卡的卡片后,通过所述SE模块激活所述第一卡片,还包括:
    所述SE模块在接收到激活所述第一卡片的指示后,判断所述第一卡片是否是允许自动切卡的卡片;
    判断所述第一卡片是允许自动切卡的卡片后,所述SE模块激活所述第一卡片。
  13. 根据权利要求12所述的方法,其特征在于,所述SE模块包括第二卡片,且所述第二卡片在所述终端关机时处于激活状态;在所述SE模块激活所述第一卡片之前,所述方法还包括:
    所述SE模块去激活所述第二卡片。
  14. 根据权利要求11-13任一项所述的方法,其特征在于,在所述终端通过所述NFC模块接收到第一读卡设备发送的选择所述第一卡片的第一指令之后,所述方法还包括:
    所述NFC模块向所述SE模块转发选择所述第一卡片的所述第一指令;
    所述SE模块根据所述第一指令向所述NFC模块返回第四响应,所述第四响应用于指示未选中所述第一卡片;
    响应于接收到所述第四响应,所述NFC模块确定所述第一卡片是否是允许自动切卡的卡片。
  15. 根据权利要求11-14任一项所述的方法,其特征在于,在所述终端关机之前,所述方法还包括:
    所述NFC模块接收到第一卡片列表,所述第一卡片列表包括允许自动切卡的卡片的信息。
  16. 根据权利要求1-15任一项所述的方法,其特征在于,所述终端还包括可信执行环境TEE模块;在所述终端关机之前,所述方法还包括:
    所述SE模块接收所述TEE模块发送的第二卡片列表,所述第二卡片列表包括允许自动切卡的卡片的信息。
  17. 一种终端,其特征在于,包括:处理器、存储器、近场通信NFC模块和触摸屏,所述存储器、所述触摸屏、所述NFC模块与所述处理器耦合,所述处理器包括安全元件SE模块,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述处理器从所述存储器中读取所述计算机指令,以使得所述终端执行如权利要求1-16中任一项所述的卡片的切换方法。
  18. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在终端上运行时,使得所述终端执行如权利要求1-16中任一项所述的卡片的切换方法。
  19. 一种芯片系统,其特征在于,包括一个或多个处理器,当所述一个或多个处理器执行指令时,所述一个或多个处理器执行如权利要求1-16中任一项所述的卡片的切换方法。
PCT/CN2023/100042 2022-06-30 2023-06-13 安全业务的切换方法及终端 WO2024001767A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP23825590.5A EP4346250A1 (en) 2022-06-30 2023-06-13 Method for switching security service, and terminal

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210764350.X 2022-06-30
CN202210764350.XA CN117376880A (zh) 2022-06-30 2022-06-30 安全业务的切换方法及终端

Publications (1)

Publication Number Publication Date
WO2024001767A1 true WO2024001767A1 (zh) 2024-01-04

Family

ID=89382868

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/100042 WO2024001767A1 (zh) 2022-06-30 2023-06-13 安全业务的切换方法及终端

Country Status (3)

Country Link
EP (1) EP4346250A1 (zh)
CN (1) CN117376880A (zh)
WO (1) WO2024001767A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120178366A1 (en) * 2011-01-06 2012-07-12 Koby Levy Multiple NFC Card Applications in Multiple Execution Environments
CN105574723A (zh) * 2015-12-14 2016-05-11 联想(北京)有限公司 信息的安全处理方法及安全处理装置
WO2018086229A1 (zh) * 2016-11-11 2018-05-17 宇龙计算机通信科技(深圳)有限公司 交易路由识别方法及系统
CN111316269A (zh) * 2017-11-10 2020-06-19 华为技术有限公司 一种终端的安全保护方法及装置
CN112136131A (zh) * 2018-05-17 2020-12-25 三星电子株式会社 连接到多个处理器的安全模块的控制方法以及用于实现该方法的电子装置
CN112492562A (zh) * 2017-06-02 2021-03-12 华为技术有限公司 一种nfc业务处理方法、终端及nfc芯片
CN112508554A (zh) * 2021-01-29 2021-03-16 北京紫光青藤微系统有限公司 基于近场通信的交易处理方法和装置

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120178366A1 (en) * 2011-01-06 2012-07-12 Koby Levy Multiple NFC Card Applications in Multiple Execution Environments
CN105574723A (zh) * 2015-12-14 2016-05-11 联想(北京)有限公司 信息的安全处理方法及安全处理装置
WO2018086229A1 (zh) * 2016-11-11 2018-05-17 宇龙计算机通信科技(深圳)有限公司 交易路由识别方法及系统
CN112492562A (zh) * 2017-06-02 2021-03-12 华为技术有限公司 一种nfc业务处理方法、终端及nfc芯片
CN111316269A (zh) * 2017-11-10 2020-06-19 华为技术有限公司 一种终端的安全保护方法及装置
CN112136131A (zh) * 2018-05-17 2020-12-25 三星电子株式会社 连接到多个处理器的安全模块的控制方法以及用于实现该方法的电子装置
CN112508554A (zh) * 2021-01-29 2021-03-16 北京紫光青藤微系统有限公司 基于近场通信的交易处理方法和装置

Also Published As

Publication number Publication date
CN117376880A (zh) 2024-01-09
EP4346250A1 (en) 2024-04-03

Similar Documents

Publication Publication Date Title
CN110020569B (zh) 自动选择nfc模拟卡的方法、电子设备及通信系统
US11595820B2 (en) Secure elements broker (SEB) for application communication channel selector optimization
US11212674B2 (en) Control method of secure module connected to a plurality of processors and electronic device for implementing the same
RU2489813C2 (ru) Способ и устройство для автоматического выбора приложений в электронном устройстве, использующем несколько администраторов обнаружения
EP2106107B1 (en) Method and apparatus for automatic near field communication application selection in an electronic device
CN111543041B (zh) 一种模拟卡的选择方法及移动设备
CN114462560B (zh) 一种模拟卡的切换方法、电子设备和通信系统
CN111835903B (zh) 对nfc标签中的数据进行快速分发的方法及电子设备
US20220038899A1 (en) Method for duplicating near field communication card and electronic device therefor
CN111107525B (zh) 一种se的自动路由方法及电子设备
CN115499897B (zh) WiFi网络接入方法及相关装置
JP4702830B2 (ja) 携帯機器、情報処理方法、並びにプログラム
WO2024001767A1 (zh) 安全业务的切换方法及终端
US20190172051A1 (en) Electronic device and method for processing remote payment
EP4145875A1 (en) Smart card sharing method, electronic device, and computer-readable storage medium
WO2023169214A1 (zh) 一种安全业务的交易方法及终端
CN116776332A (zh) 一种安全业务的交易方法及终端
KR101678793B1 (ko) 보안운영체제를 통한 앱 무결성 검증 방법

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 2023825590

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2023825590

Country of ref document: EP

Effective date: 20231229

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23825590

Country of ref document: EP

Kind code of ref document: A1