Transaction method, electronic equipment and computer readable storage medium

By introducing random update mechanisms and session verification information of initial identification and identification to be verified in electronic devices, the activation status of payment cards is automatically managed, and the security risks and user operation complexity problems in electronic card transactions are solved, and a higher level of operation is achieved. Transaction security and ease of operation.

CN119090498APending Publication Date: 2024-12-06SHENZHEN XUNLIAN ZHIFU NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310621897.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-29
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

There are security risks in existing electronic card transactions, especially the risk of deactivation notifications being intercepted, and the user's operation is relatively complex, especially when the PIN code needs to be entered to verify.

Method used

By introducing a random update mechanism of initial identification and the identification to be verified in electronic devices, combined with the effectiveness of session verification information, the payment card will be automatically activated or deactivated, which will reduce the interaction between users and card readers, improve transaction security and reduce operational complexity. Spend.

Benefits of technology

Effectively eliminate the risk of deactivation notifications being intercepted, improve transaction security, and reduce the need for users to enter PIN codes on the card reader, simplifying user operation processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090498A_ABST
    Figure CN119090498A_ABST
Patent Text Reader

Abstract

The invention provides a transaction method, electronic equipment and a computer readable storage medium, and the method comprises the steps: updating the value of an initial identifier to a first random value when the initial identifier is different from a to-be-verified identifier and / or the payment state of a first payment card corresponding to a first transaction instruction is an inactive state, and obtaining the verification information of a second session; when the verification information of the second session is invalid, triggering a use object for verifying the first session to obtain a verification result of the first session; when the verification result of the first session indicates that the verification is passed, updating the payment state of the first payment card to an activated state, and updating the value of the to-be-verified identifier to a first random value; and executing a transaction process corresponding to the third transaction instruction through the first payment card. According to the application, the interaction between the user and the card reader can be reduced while the transaction security of the electronic card is improved, so that the operation complexity of the user is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a transaction method, an electronic device, and a computer-readable storage medium. Background Art

[0002] When users use some electronic cards for daily transactions, they often need to verify their identity through face or fingerprint. When the user passes the verification, the electronic card is activated, and the user can use the activated electronic card and the card reader to perform the transaction process. And for the activated electronic card, when the transaction process is completed, it is necessary to exit the activation state in time to avoid the security risks caused by the electronic card being in the activated state for a long time.

[0003] In order to reduce the existing security risks, it is usually possible to add a user verification stage on the card reader before executing the transaction process through the activated electronic card. For example, before the user transfers money through the activated electronic card, he or she needs to enter the personal identification number (PIN) code on the card reader for verification. However, this method increases the interaction between the user and the card reader, making the user's operation more complicated. Summary of the invention

[0004] The embodiments of the present application provide a transaction method, an electronic device, and a computer-readable storage medium, which can improve the security of electronic card transactions while reducing the interaction between the user and the card reader, thereby reducing the complexity of user operations.

[0005] In a first aspect, an embodiment of the present application provides a transaction method, the method comprising: when an initial identifier is different from an identifier to be verified and / or the payment status of a first payment card corresponding to a first transaction instruction is in an inactive state, updating the value of the initial identifier to a first random value, and obtaining verification information of a second session; wherein the card identifier corresponding to the first payment card is included in a high-security payment card identifier set; the first random value is different from a preset value; the second session is a communication session established based on a received second transaction instruction before receiving the first transaction instruction; when the verification information of the second session is invalid, triggering verification of a user of the first session to obtain a verification result of the first session; the first session is a communication session established based on the first transaction instruction; when the verification result of the first session indicates that the user of the first session has been verified, updating the payment status of the first payment card to an activated state, and updating the value of the identifier to be verified to the first random value; executing a transaction process corresponding to a third transaction instruction through the first payment card; the third transaction instruction is a transaction instruction received after receiving the first transaction instruction.

[0006] It can be seen from the above method that, on the one hand, since the malicious attacker in the electronic device cannot control the initial identification to be the same as / different from the identification to be verified, and cannot directly activate the payment card without user verification, even if the malicious attacker can intercept the notification of deactivating the electronic card, when the initial identification is different from the identification to be verified and / or the payment card is not activated, the malicious attacker cannot directly conduct transactions through the activated payment card, but needs to determine whether the user verification is invalid, and can only activate the payment card or maintain the activation status of the payment card after the user verification is valid, and conduct transactions when the transaction instruction is received next time. Based on this, the risk of interception of the notification of deactivating the electronic card can be eliminated, and the security of the transaction can be improved. On the other hand, the transaction process proposed in this application only involves user verification on the electronic device, and the user does not need to enter the PIN code on the card reader, etc., so the interaction between the user and the card reader can be reduced, and the complexity of the user's operation can be reduced.

[0007] In combination with the first aspect, in a possible implementation, the method further includes: if the initial identifier is different from the identifier to be verified, the payment status of the first payment card is activated, and the verification information of the second session is invalid, updating the payment status of the first payment card to an inactivated state.

[0008] In this way, the electronic device can update the first payment card from an activated state to a deactivated state before obtaining the verification result of the first session, thereby preventing the user of the first session from using the activated first payment card to conduct transactions before passing the verification, thereby improving the security of the transaction.

[0009] In combination with the first aspect, in a possible implementation, when the verification information of the second session is valid, the payment status of the first payment card is obtained; if the payment status of the first payment card is in an inactive state, the payment status of the first payment card is updated to an activated state and the value of the identifier to be verified is updated to a first random value; or, if the payment status of the first payment card is an activated state, the value of the identifier to be verified is updated to a first random value and the payment status of the first payment card is maintained as an activated state.

[0010] In this way, the electronic device can maintain the first payment card in an activated state or activate the first payment card when the verification information of the second session is valid, and by updating the identification to be verified to the first random value, the updated identification to be verified is the same as the initial identification.

[0011] In combination with the first aspect, in a possible implementation, the method further includes: obtaining a rich execution environment (REE) instruction, and updating the value of the initial identifier to a preset value; the REE instruction is used to trigger the interruption of the second session; the REE instruction is an instruction obtained after the second session is established and before the first transaction instruction is received; or, obtaining that the chip status of the first payment card is any one of a power-off state, a restart state, a sleep state, and a low power consumption state, and updating the value of the initial identifier to a preset value; the chip status of the first payment card is obtained after the second session is established and before the first transaction instruction is received.

[0012] In this way, when the electronic device receives a REE instruction or determines that the first chip state is any one of a power-off state, a restart state, a sleep state, and a low-power state, it can update the value of the initial identifier to a preset value so that the initial identifier and the identifier to be verified are different, thereby triggering the electronic device to execute steps such as "updating the value of the initial identifier to a first random value and obtaining verification information of the second session" in the above method.

[0013] In combination with the first aspect, in a possible implementation, the verification information of the second session includes the verification time of the second session, and the method further includes: when the verification time of the second session is a null value, determining that the verification information of the second session is invalid; or, when the time difference between the current moment and the verification moment of the second session is greater than a preset threshold, determining that the verification information of the second session is invalid; the current moment is the moment when the first transaction instruction is received.

[0014] In this way, the electronic device can determine that the verification information of the second session is invalid by determining that the verification time of the second session is a null value, or by determining that the verification of the second session has timed out.

[0015] In combination with the first aspect, in a possible implementation, the method further includes: when the initial identifier is the same as the identifier to be verified and the payment status of the first payment card is an activated status, executing a transaction process corresponding to the first transaction instruction through the first payment card and the card reader.

[0016] In this way, the electronic device can directly conduct transactions through the first payment card when the initial identifier is the same as the identifier to be verified and the payment status of the first payment card is activated.

[0017] In combination with the first aspect, in a possible implementation manner, the second transaction instruction is a transaction instruction received for the first time from the card reader.

[0018] In combination with the first aspect, in a possible implementation, the method further includes: when receiving the second transaction instruction, the initial identifier and the identifier to be verified are both null values, and the payment status of the payment card corresponding to the second transaction instruction is in an inactivated state, updating the value of the initial identifier to a second random value; the second random value is different from the preset value; triggering verification of the user object of the second session to obtain a verification result of the second session; when the verification result of the second session indicates that the user object of the second session has passed the verification, updating the payment status of the payment card corresponding to the second transaction instruction to an activated state, and updating the value of the identifier to be verified to the second random value.

[0019] In this way, when the electronic device receives the transaction instruction for the first time, it can trigger the verification of the user object of the second session by determining that the initial identifier and the identifier to be verified are both null values, and the payment status of the payment card in the transaction instruction is in an inactive state, and after the verification is passed, activate the corresponding payment card and make the identifier to be verified the same as the initial identifier.

[0020] In a second aspect, an embodiment of the present application provides an electronic device, comprising one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store a computer program, and the computer program includes computer instructions. When the one or more processors execute the computer instructions, the electronic device executes a method in any possible implementation of the first aspect.

[0021] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed on an electronic device, the electronic device executes a method in any possible implementation of the first aspect above.

[0022] In a fourth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute a method in any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a schematic diagram of the flow of an existing electronic card transaction;

[0024] Figure 2 It is a schematic diagram of the architecture of a communication system provided by an embodiment of the present application;

[0025] Figure 3 is a schematic diagram of the hardware structure of an electronic device 201 provided in an embodiment of the present application;

[0026] Figure 4 is a schematic diagram of software modules of an electronic device 201 provided in an embodiment of the present application;

[0027] Figure 5 It is a schematic diagram of a processing flow of receiving an initial transaction instruction provided by an embodiment of the present application;

[0028] Figure 6 It is a schematic diagram of a process of performing a transaction after receiving a non-initial transaction instruction provided by an embodiment of the present application;

[0029] Figure 7 It is a schematic diagram of the overall process of a transaction method provided by an embodiment of the present application;

[0030] Figure 8A to Figure 8C It is a schematic diagram of the interaction flow of some software modules provided in the embodiments of the present application. DETAILED DESCRIPTION

[0031] The embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0032] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0033] Some principles involved in this application are explained below to facilitate understanding by those skilled in the art.

[0034] 1. Principles of electronic card transactions

[0035] One or more electronic cards are running in an independent secure element (SE) of an electronic device, and a user can use the electronic card to conduct transactions with a card reader (such as a point of sales terminal (POS) machine).

[0036] Among them, when users use electronic cards such as electronic transportation cards and electronic access control cards, they can directly use electronic cards such as transportation cards and access control cards to conduct transactions with card readers. However, when users use electronic cards such as electronic bank cards, they need to perform user verification (or verification of the user object) on the electronic device. When the user verification is passed, the electronic device can activate the electronic card and update the electronic card from an unactivated state to an activated state. The user can then use the activated electronic card to conduct transactions with the card reader (unactivated electronic cards cannot be traded with the card reader). In addition, the electronic device can also deactivate the activated electronic card after a period of time, that is, remove the activation state of the electronic card, so that the activated electronic card is updated from an activated state to an unactivated state.

[0037] Among them, user verification in an electronic device means that after the user / card reader selects an electronic card in the electronic device and conducts a transaction with the card reader, the electronic device verifies the identity of the user. For example, the user selects the electronic card for the transaction in the interface of the wallet APP displayed by the electronic device, and then the electronic device displays the user verification interface to verify the identity of the user.

[0038] For example, the user verification method includes, but is not limited to, one or more of the fingerprint verification method, face verification method, and wallet payment PIN verification method. For example, when the fingerprint verification method is adopted, the electronic device first displays the fingerprint verification interface, then collects the fingerprint input by the user, and obtains the verification result by comparing the collected fingerprint with the pre-stored fingerprint template. When the face verification method is adopted, the electronic device first displays the face verification interface, then collects the user's real-time face, and compares the collected face with the pre-stored face template to obtain the verification result; when the wallet payment PIN code verification method is adopted, the electronic device 100 first displays the PIN code input interface, then collects the PIN code input by the user, and compares the collected PIN code with the PIN code preset by the user / or the default PIN code to obtain the verification result.

[0039] In the embodiment of the present application, an electronic card that requires user verification is referred to as an electronic card with higher security requirements (or high-security electronic card), and an electronic card that does not require user verification is referred to as an electronic card with lower security requirements (non-high-security electronic card).

[0040] Furthermore, the activation state and the inactivation state of the electronic card can be represented by a state identifier stored in the electronic device. For example, when the state identifier of the electronic card stored in the electronic device is 0, the electronic card is in an inactivation state. When the state identifier of the electronic card stored in the electronic device is 1, the electronic card is in an activation state.

[0041] Below Figure 1 Taking this as an example, the activation and deactivation processes of electronic cards with higher security requirements are explained:

[0042] Among them, according to the different security of the internal operating environment of the electronic device 100, the internal operating environment of the electronic device 100 can be divided into a rich execution environment (REE), a trusted execution environment (TEE), and a security chip SE, among which SE has the highest security, REE has the lowest security, and TEE has a security between SE and REE. The software modules related to electronic card transactions include a wallet application APP, a wallet trusted application TA, and a contactless registration service CRS, among which the wallet APP runs in REE, is user-perceivable, and is responsible for managing transactions; the wallet TA runs in TEE and is responsible for executing security-related tasks in transactions, such as user verification; CRS runs in SE and is responsible for activating or deactivating the electronic card running in SE.

[0043] like Figure 1 As shown, steps 1 to 4 are the activation stage of the electronic card, and step 5 and the subsequent steps of step 5 are the deactivation stage of the electronic card:

[0044] 1. The electronic device 100 notifies the wallet TA to activate the electronic card through the wallet APP.

[0045] 2. The electronic device 100 determines whether the user has passed the verification through the wallet TA.

[0046] 3. After the electronic device 100 determines that the user verification is successful through the wallet TA, it notifies the CRS to activate the electronic card through the wallet TA.

[0047] 4. The electronic device 100 activates the electronic card through the CRS.

[0048] Among them, in steps 1 to 4, the electronic device 100 can determine whether the user has passed the verification through the wallet TA before activating the electronic card. For example, the wallet TA obtains the verification result by executing the user verification method, and determines whether the user has passed the verification according to the verification result. The user verification method includes but is not limited to one or more of the following: fingerprint verification method, face verification method, wallet payment PIN code verification method, etc. When the electronic device 100 completes the user verification and determines that the user verification is passed, it means that the currently verified user has the authority to conduct transactions with the card reader through the electronic card, so the electronic device 100 can activate the electronic card, and the activated electronic card can be used to perform transactions with the card reader. For example, after the electronic device 100 activates the electronic card, it receives a transaction instruction sent by the card reader, and can respond to the transaction instruction and perform the transaction through the activated electronic card.

[0049] 5. The electronic device 100 determines through the wallet APP that the transaction interface switching or electronic card activation reaches a preset time threshold.

[0050] 6.1 The electronic device 100 notifies the wallet TA to activate the electronic card through the wallet APP.

[0051] 6.2 The electronic device 100 notifies the CRS through the wallet TA to activate the electronic card.

[0052] 6.3 The electronic device 100 deactivates the electronic card via the CRS.

[0053] Among them, in step 5 and step 6.1 to step 6.3, the electronic device 100 can promptly notify the CRS to deactivate the electronic card after the transaction executed through the electronic card is completed. Deactivating the electronic card means updating the electronic card from an activated state to an unactivated state. An unactivated electronic card can no longer execute transactions, which can effectively ensure the security of the transaction. For example, in step 5, the electronic device 100 can determine whether the electronic card needs to be deactivated based on whether the transaction interface has been switched or whether the electronic card activation has reached a preset time threshold. When it is determined that the transaction interface has been switched or the electronic card activation has reached a preset time threshold, the CRS can be deactivated by sending a notification to the CRS to deactivate the electronic card.

[0054] However, in another case, the notification of deactivating the electronic card may be maliciously intercepted midway. In this case, after executing step 5, the electronic device 100 will execute the following process of steps 7.1 to 7.2.

[0055] 7.1 The electronic device 100 notifies the wallet APP to deactivate the electronic card.

[0056] 7.2 The attack program in the electronic device 100 intercepts the notification to activate the electronic card, and the electronic card remains in the activated state.

[0057] Among them, since the electronic device 100 sends the notification of deactivating the electronic card through the wallet APP, the wallet APP is located in the REE with lower security, and the security of the wallet APP cannot be guaranteed. Therefore, when the notification of deactivating the electronic card sent by the wallet APP is intercepted, the CRS in the electronic device 100 cannot receive the notification of deactivating the electronic card, and the electronic card is still in an activated state after the transaction is completed, which has certain security risks.

[0058] 2. Electronic Card Transaction Mechanism

[0059] Since there are certain security risks in the deactivation stage of the electronic card in the above electronic card transaction principle, when the above principle is actually applied to electronic card transactions with higher security requirements, the security of the transaction is too low.

[0060] In order to improve the security of transactions in practical applications, the following two transaction methods are currently proposed in the electronic card transaction mechanism:

[0061] Method 1: When the transaction amount is less than or equal to the preset amount, the electronic device 100 first performs user verification, and activates the electronic card after determining that the user verification is passed; then, the electronic device 100 completes the transaction through the activated electronic card and the card reader.

[0062] Method 2: When the transaction amount is greater than the preset amount, the electronic device 100 first performs user verification and activates the electronic card after determining that the user verification is passed; then, the user needs to perform user verification again on the card reader (such as entering a bank PIN code) before the electronic device 100 can complete the transaction with the activated electronic card and the card reader.

[0063] In method one, the electronic device 100 can ensure the security of transactions with transaction amounts less than or equal to the preset amount by performing user verification, but it cannot completely eliminate the risk of interception of notifications for deactivating electronic cards. In method two, the security of transactions can be ensured and the risk of interception of notifications for deactivating electronic cards can be eliminated through double user verification in the electronic device 100 and the card reader. It can be seen that when methods one and two are actually applied, the level of transaction security is completely limited by the setting of the preset amount. The lower the preset amount is set, the higher the transaction security. Conversely, the higher the preset amount is set, the lower the transaction security. At the same time, this transaction mechanism also increases the interaction between the user and the card reader, making the user's operation more complicated.

[0064] In order to reduce the problems existing in the above-mentioned methods, the embodiment of the present application proposes a transaction method. On the one hand, the transaction method can eliminate the risk of the notification of deactivating the electronic card being intercepted, thereby improving the transaction security; on the other hand, the transaction method can break the limitation of the preset amount on the transaction security, and can enable the user to complete the transaction exceeding the preset amount without user verification on the card reader. By reducing the interaction between the user and the card reader, the user's operation complexity is reduced. The transaction method can be applied to Figure 2 The communication system shown in FIG. Figure 2 As shown, the communication system 20 includes an electronic device 201, an electronic device 202, and a communication network 203. Exemplarily, one or more electronic cards for transactions may be running in the electronic device 201, and the electronic device 202 may perform a transaction process with the electronic card in the electronic device 201. In the embodiment of the present application, the electronic device 202 may send a transaction instruction to the electronic device 201, and when the electronic device 201 receives the transaction instruction, it may determine to activate or deactivate the corresponding electronic card based on the stored identification and the payment status of the electronic card and other information.

[0065] The electronic device 201 may be a smart phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device and / or a smart city device, etc. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device 201. The electronic device 202 may be a card reader, and the card reader may be a point of sales terminal (POS), etc. The communication network 203 may be a local area network (LAN) or a wide area network (WAN), such as the Internet. The communication network 203 can be implemented using any known network communication protocol, which can be various wired or wireless communication protocols, such as Ethernet, universal serial bus (USB), FIREWIRE, long term evolution (LTE), Bluetooth, wireless fidelity (Wi-Fi), near field communication (NFC), voice over Internet protocol (VoIP), communication protocols that support network slicing architecture, or any other suitable communication protocols.

[0066] See also Figure 3 , Figure 31 is a schematic diagram of the hardware structure of an electronic device 201 provided in an embodiment of the present application. By way of example, the electronic device 201 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, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope 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, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0067] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 201. In other embodiments of the present application, the electronic device 201 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0068] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0069] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0070] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0071] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0072] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 201. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0073] 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, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0074] The wireless communication function of the electronic device 201 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.

[0075] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 201 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0076] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 201. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0077] The modem processor may include a modulator and a demodulator. Among them, 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. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0078] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 201. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, demodulates 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, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0079] In some embodiments, the antenna 1 of the electronic device 201 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 201 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), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite based augmentation system (SBAS).

[0080] The electronic device 201 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0081] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 201 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0082] The electronic device 201 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0083] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 201 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0084] Video codecs are used to compress or decompress digital videos. The electronic device 201 may support one or more video codecs. Thus, the electronic device 201 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0085] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 201 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0086] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0087] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.; non-volatile memory may include disk storage devices and flash memory.

[0088] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; can be divided into single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage unit potential level; can be divided into universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.

[0089] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.

[0090] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .

[0091] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 201. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.

[0092] The electronic device 201 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0093] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0094] The speaker 170A, also called a "horn", is used to convert audio electrical signals into sound signals.

[0095] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals.

[0096] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals.

[0097] The earphone jack 170D is used to connect a wired earphone.

[0098] The key 190 includes a power key, a volume key, etc. The key 190 can be a mechanical key or a touch key. The electronic device 201 can receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0099] See also Figure 4 , Figure 4 4 is a schematic diagram of software modules of an electronic device 201 provided in an embodiment of the present application. The electronic device 201 includes a communication module 410, a user verification module 420 and an electronic card management module 430. Among them:

[0100] The communication module 410 is located in the REE, including a wallet APP, an NFC chip (CIF) and an NFC service. Among them, the wallet APP is used to manage transactions, such as users can add / delete / disable electronic cards in the wallet APP. And the electronic device can display the electronic card through the wallet APP, and the user can operate the electronic card in the wallet APP to initiate a transaction between the electronic card and the card reader. The NFC chip is used to forward instructions between the card reader and the electronic card management module 430, so that the electronic card in the electronic card management module 430 can execute the transaction process with the card reader. The NFC service is used to manage NFC-related services. For example, in an embodiment of the present application, the user can turn on the NFC function through the NFC service before conducting an electronic card transaction, so that the transaction between the electronic card and the card reader can be realized based on the turned-on NFC function.

[0101] The user verification module 420 is located in the TEE and includes two trusted applications: verification TA and wallet TA. Among them, verification TA and wallet TA are used to perform security-related tasks in electronic card transactions, such as user verification in the electronic device 201. In the embodiment of the present application, the wallet TA also stores verification information of the user verification, and the wallet TA is also used to determine whether the user verification is valid based on the verification information, and to update the verification information. For example, the verification information of the user verification may include the verification time, etc.

[0102] The electronic card management module 430 is located in the SE, and includes an electronic card and an electronic card operating system COS. Among them, the electronic card can be an electronic card added by the user through the wallet APP, and the electronic card operating system COS includes a contactless registration service CRS, and CRS is used to activate or deactivate the electronic card in the electronic card management module 430. In an embodiment of the present application, a high-security payment card identification set, a pending verification identification and an initial identification are also stored in the COS. Among them, the high-security payment card identification set includes card identifications of electronic cards with higher security requirements (that is, payment cards with higher payment security involved in the following description), and the pending verification identification and the initial identification are used to identify whether the communication session established between the electronic device 201 and the card reader is interrupted, so that the user verification module 420 decides whether to perform user verification based on whether the communication session is interrupted, and the CRS decides whether to activate or deactivate the electronic card based on whether the communication session is interrupted.

[0103] Based on the above introduction, the transaction method proposed in the present application can be applied to the electronic card transaction between the electronic device 201 and the electronic device 202. Among them, before the electronic device 201 and the electronic device 202 conduct the electronic card transaction, the electronic device 202 can send a transaction instruction to the electronic device 201, and the electronic device 201 can respond to the transaction instruction and perform corresponding steps. The transaction instruction includes an initial transaction instruction and a non-initial transaction instruction. When the electronic device 201 receives the initial transaction instruction, it can respond to the initial transaction instruction, establish an initial session and update the initial identification, and then the electronic device 201 initiates the initial user verification, and activates the electronic card and updates the identification to be verified after the user verification is passed. When the electronic device 201 receives a non-initial transaction instruction, it can respond to the non-initial transaction instruction to establish a non-initial session, and execute the corresponding process according to the initial identification, the identification to be verified and whether the electronic card is activated.

[0104] The following first describes the processing flow of the electronic device 201 receiving the initial transaction instruction:

[0105] See also Figure 5 , Figure 5This is a schematic diagram of a processing flow of receiving an initial transaction instruction provided by an embodiment of the present application: the method includes S501 to S505, and the execution subject is an electronic device. For example, the electronic device can be the electronic device 201 introduced in the above content. Among them:

[0106] S501: receiving an initial transaction instruction from a card reader, triggering establishment of an initial session with the card reader.

[0107] In the embodiment of the present application, an instant messaging application is running in the electronic device, and one or more payment cards can be displayed in the instant messaging application, and each payment card is an electronic card used to perform corresponding transactions. For example, the instant messaging application can be a wallet APP, and the user can add an electronic bank card, an electronic transportation card, etc. in the wallet APP in advance, so that the user can perform transactions for purchasing goods / services through the electronic bank card displayed by the wallet APP, and perform transactions for taking public transportation through the displayed electronic transportation card.

[0108] Among them, the initial transaction instruction is the transaction instruction received for the first time from the card reader, that is, before the electronic device receives the initial transaction instruction, the electronic device has never received a transaction instruction sent by any card reader. Correspondingly, the initial session is the first communication session established by the electronic device with the card reader. The card identifier of the payment card targeted by the initial transaction instruction is included in the high-security payment card identifier set, and the payment card targeted by the initial transaction instruction is a payment card with higher payment security. For example, the payment card targeted by the initial transaction instruction may be an electronic bank card that requires user verification during the transaction. It should be noted that the payment card targeted by the initial transaction instruction can also be described as the payment card corresponding to the initial transaction instruction, etc., and this application is not limited to this.

[0109] S502: Determine that the value of the initial identifier and the value of the identifier to be verified are both null values, and the payment status of the payment card targeted by the initial transaction instruction is in an inactivated status.

[0110] In the embodiment of the present application, an initial identification and an identification to be verified are stored in the electronic device. For example, the electronic device may store the initial identification in a random access memory (RAM) and store the identification to be verified in an electrically erasable programmable read only memory (EEPROM); storing the identification to be verified in the EEPROM can achieve persistent storage and ensure that the identification to be verified will not be lost.

[0111] When the electronic device triggers the establishment of the initial session with the card reader, since the initial session is the first communication session established between the electronic device and the card reader, the value of the initial identifier and the value of the identifier to be verified are both null values. Optionally, in the embodiment of the present application, it can be pre-set that when the value of the initial identifier and the value of the identifier to be verified are both null values, the electronic device determines that the initial identifier and the identifier to be verified are different. At the same time, since the payment card targeted by the initial transaction instruction has not been activated before the establishment of the initial session, it can be determined that the payment status of the payment card targeted by the initial transaction instruction is in an inactive state.

[0112] S503: Update the value of the initial identifier to a second random value, where the second random value is different from the preset value.

[0113] Wherein, updating the value of the initial identifier to the second random value means that the electronic device updates the value of the stored initial identifier from a null value to a second random value. For example, the second random value may be any value within a preset range, and the preset value may be any value not within the preset range, for example, the preset value may be 0, and the second random value may be any natural number not equal to 0, and so on.

[0114] S504: Trigger user verification for the initial session and obtain the verification result of the initial session.

[0115] Among them, the user verification method includes but is not limited to: fingerprint verification method, face verification method, payment PIN code verification method, etc. The verification result of the first session is used to indicate whether the user of the first session has passed the verification. It should be noted that the user in this application can also be called a user object, etc., and this application does not limit this.

[0116] For example, the electronic device may perform user authentication based on Figure 4The software module is implemented. The following takes the face verification method as an example to explain the specific process of executing the face verification method: for example, the face verification front-end module and the acquisition module are also running in REE; when executing face verification, the wallet APP triggers the electronic device to display the face verification interface by calling the face verification front-end module; the face verification front-end module collects the face information displayed by the user on the face verification interface by calling the acquisition module, and sends it to the verification TA; the verification TA compares the collected face information with the stored face template, and determines whether the current verified user has passed the verification through the comparison result; when the verification TA determines that the user has passed the verification, the verification result can be saved and the wallet APP is notified that the user has passed the verification; the wallet APP then notifies the wallet TA that the user has passed the verification. Since the security of the wallet APP is relatively low, when the wallet TA receives the notification of the user's verification passing sent by the wallet APP, it also needs to retrieve the saved verification result from the verification TA with higher security to verify the notification of the user's verification passing; when the wallet TA passes the verification, it is determined that the current verified user has passed the verification.

[0117] S505: When the verification result of the initial session indicates that the user verification of the initial session has passed, the payment status of the payment card targeted by the initial transaction instruction is updated to an activated status, and the value of the to-be-verified identifier is updated to a second random value.

[0118] In an embodiment of the present application, if the verification result of the initial session indicates that the user verification of the initial session has passed, it means that the electronic device allows the user to conduct transactions with the card reader through the payment card targeted by the initial transaction, so the electronic device can update the payment status of the payment card targeted by the initial transaction from an inactivated state to an activated state.

[0119] At the same time, the electronic device can update the value of the identifier to be verified to the second random value. Since the value of the initial identifier has been updated to the second random value in S503, this process can also be understood as assigning the value of the initial identifier to the identifier to be verified. Based on this method, the stored initial identifier and the identifier to be verified can remain the same.

[0120] Optionally, if the payment card targeted by the initial transaction instruction is an electronic bank card, the electronic device may also activate a proximity payment systems environment (PPSE), which stores the payment card targeted by the initial transaction instruction, other electronic bank cards other than the payment card targeted by the initial transaction instruction, and the priority of each electronic bank card.

[0121] In the implementation of the embodiment of the present application, when the electronic device receives the initial transaction instruction, it can initiate user verification to determine whether the user is allowed to conduct transactions with the card reader through the payment card. When the user verification is passed, the corresponding payment card is activated and the value of the initial identifier and the value of the identifier to be verified are both updated to the second random value.

[0122] It should be noted that after the electronic device updates the payment status of the payment card targeted by the initial transaction instruction to the activated status, the electronic device cannot immediately perform transactions with the card reader based on the activated payment card. The electronic device needs to receive the transaction instruction sent by the card reader again and decide whether to perform transactions with the card reader in response to the transaction instruction. This process is equivalent to the processing flow after the electronic device receives a non-initial transaction instruction.

[0123] The following takes the case where an electronic device receives a non-initial transaction instruction as an example to explain the processing after receiving the non-initial transaction instruction:

[0124] Assume that the non-initial transaction instruction received by the electronic device this time is called the current non-initial transaction instruction, the session corresponding to the current non-initial transaction instruction is the current session, and the communication session established when the electronic device last received the transaction instruction is the last session, and the electronic device has activated the payment card targeted by the last transaction instruction. For example, the last transaction instruction received may be Figure 5 The last session is the first session.

[0125] When the electronic device receives this non-initial transaction instruction, the last session established between the electronic device and the card reader may be interrupted / uninterrupted; and the payment card targeted by this non-initial transaction instruction may have been activated or not activated. For example, before receiving this non-initial transaction instruction, the electronic device also received a certain transaction instruction (such as the previous transaction instruction) and activated the payment card targeted by the certain transaction instruction. If the payment card targeted by a certain transaction instruction is the same as the payment card targeted by this non-initial transaction instruction, and the payment card targeted by a certain transaction instruction has not been deactivated after successful activation, then when receiving this non-initial transaction instruction, the payment card targeted by this transaction instruction has been activated. For another example, if the payment card targeted by this transaction instruction has not been activated, or the payment card targeted by this transaction instruction has been deactivated after successful activation, then when receiving this non-initial transaction instruction, the payment card targeted by this transaction instruction has not been activated.

[0126] Furthermore, the electronic device may perform any one of the following four processing procedures according to whether the last session was interrupted or not, and whether the payment card targeted by the current non-initial transaction instruction has been activated or not:

[0127] Case 1: The previous session was not interrupted, and the payment card for this non-initial transaction instruction has been activated.

[0128] In a possible implementation, when the electronic device receives this non-initial transaction instruction, it can determine that the previous session was not interrupted by determining that the stored initial identifier is the same as the identifier to be verified (eg, both are the second random value).

[0129] At the same time, since the payment card targeted by this non-initial transaction instruction has been activated, the payment status of the payment card targeted by this non-initial transaction instruction is activated, and the electronic device can directly execute the transaction process through the payment card targeted by this non-initial transaction instruction and the card reader.

[0130] Case 2: The previous session was not interrupted, and the payment card targeted by this non-initial transaction instruction is not activated.

[0131] In a possible implementation, when the electronic device receives this non-initial transaction instruction, it can determine that the previous session was not interrupted by determining that the stored initial identifier is the same as the identifier to be verified (eg, both are the second random value).

[0132] However, since the payment card targeted by this non-initial transaction instruction has not been activated, the payment status of the payment card targeted by this non-initial transaction instruction is inactive.

[0133] In this case, in order to ensure the security of the payment card targeted by this non-initial transaction instruction, the electronic device needs to determine whether the user verification performed in the previous session has been invalidated. When it is determined that the user verification is valid, the electronic device activates the payment card targeted by this non-initial transaction instruction; when it is determined that the user verification is invalid, the electronic device deactivates all payment cards with higher payment security in the electronic device and re-initiates user verification, and only when the electronic device determines that the re-initiated user verification is successful can the electronic device activate the payment card targeted by this non-initial transaction instruction.

[0134] Case 3: The previous session has been interrupted, and the payment card for this non-initial transaction instruction has been activated.

[0135] In a possible implementation, when the electronic device receives the non-initial transaction instruction, it can determine that the previous session has been interrupted by determining that the stored initial identifier is different from the identifier to be verified.

[0136] At the same time, since the payment card targeted by this non-initial transaction instruction has been activated, the payment status of the payment card targeted by this non-initial transaction instruction is activated.

[0137] In this case, to ensure the security of this session, the electronic device needs to determine whether the user verification performed in the previous session has been invalidated. When it is determined that the user verification is valid, the electronic device can maintain the payment status of the payment card targeted by this non-initial transaction instruction as an activated state; when it is determined that the user verification is invalid, the electronic device deactivates all payment cards with higher payment security in the electronic device (including the activated payment card targeted by this non-initial transaction instruction) and re-initiates user verification, and only when the electronic device determines that the re-initiated user verification is successful, can the electronic device activate the payment card targeted by this non-initial transaction instruction.

[0138] Case 4: The last session has been interrupted, and the payment card for this non-initial transaction instruction has not been activated.

[0139] In a possible implementation, when the electronic device receives the non-initial transaction instruction, it can determine that the previous session has been interrupted by determining that the stored initial identifier is different from the identifier to be verified.

[0140] At the same time, since the payment card targeted by this non-initial transaction instruction has not been activated, the payment status of the payment card targeted by this non-initial transaction instruction is inactive.

[0141] In this case, in order to ensure the security of the current session and the payment card targeted by the non-initial transaction instruction, the electronic device needs to determine whether the user verification performed in the previous session has been invalidated. When it is determined that the user verification is valid, the electronic device activates the payment card targeted by the non-initial transaction instruction; when it is determined that the user verification is invalid, the electronic device deactivates all payment cards with higher payment security in the electronic device and re-initiates user verification, and only when it is determined that the re-initiated user verification is successful, can the electronic device activate the payment card targeted by the non-initial transaction instruction.

[0142] It should be noted that when the electronic device receives other non-initial transaction instructions, it can also process them according to the processing procedures of Cases 1 to 4 for receiving the non-initial transaction instruction. Furthermore, if the electronic device processes the non-initial transaction instruction according to the processing procedures of Cases 2 to 4, the electronic device can only activate the payment card after receiving the non-initial transaction instruction. The electronic device also needs to receive a new non-initial transaction instruction again, and respond to and process the new non-initial transaction instruction according to the processing procedures of any of the above four cases.

[0143] In case 1, since the previous session was not interrupted and the payment card has been activated, the security of the transaction is relatively high, and the electronic device can directly conduct the transaction through the activated payment card targeted by the non-initial transaction instruction. This application does not elaborate on case 1;

[0144] In situations 2 to 4, since the previous session has been interrupted and / or the payment card has not been activated, the security of the transaction is relatively low, and the electronic device first determines whether the user verification is invalid; when it is determined that the user verification is valid, the electronic device can maintain the payment status of the payment card targeted by this non-initial transaction instruction as an activated state; when it is determined that the user verification is invalid, the electronic device first deactivates all payment cards with higher payment security in the electronic device and re-initiates user verification, and then when it is determined that the re-initiated user verification is valid, the electronic device can activate the payment card targeted by this non-initial transaction instruction.

[0145] Based on the above description, when the transaction security is low, the electronic device can improve the security of the transaction by determining whether the user verification is invalid and initiating the user verification again when the user verification is invalid.

[0146] It should be noted that the non-initial transaction instruction in this application may also be referred to as the first transaction instruction, the current session may also be referred to as the first session, the last received transaction instruction may also be referred to as the second transaction instruction, and the last session may also be referred to as the second session. For example, the second transaction instruction may be the initial transaction instruction in the above content, and the second session may be the initial transaction in the above content.

[0147] Below Figure 6 As an example, how to implement a complete transaction process under any of the conditions from situation 2 to situation 4 is explained. Figure 6 , Figure 6 The present invention provides a flowchart of a transaction after receiving a non-initial transaction instruction. The method includes S601 to S604, and the execution subject is an electronic device. For example, the electronic device may be the electronic device 201 described in the above content.

[0148] S601: If the initial identifier is different from the identifier to be verified and / or the payment status of the first payment card targeted by the first transaction instruction is in an inactivated state, the value of the initial identifier is updated to a first random value, and verification information of a second session is obtained.

[0149] Among them, the card identifier corresponding to the first payment card is included in the high-security payment card identifier set; the first random value is different from the preset value; and the second session is a communication session established based on the received second transaction instruction before receiving the first transaction instruction.

[0150] In the present application, an initial identification and an identification to be verified are stored in the electronic device. The initial identification can be updated by triggering a session interruption. The initial identification updated by triggering a session interruption is different from the identification to be verified.

[0151] Assuming that the electronic device receives a previous transaction instruction of the first transaction instruction, it can trigger the establishment of a second session with the card reader. Then, the second session can be interrupted and the update of the initial identification can be triggered according to the following method:

[0152] In a possible implementation, if the electronic device obtains a rich execution environment (REE) instruction after establishing the second session and before receiving the first transaction instruction, the value of the initial identifier is updated to a preset value; the REE instruction is used to trigger the interruption of the second session.

[0153] Among them, the rich execution environment REE instruction refers to the instruction sent from the REE to the SE in the electronic device, which can also be called the instruction sent based on the development terminal interface (open mobile api, OMA) channel. For example, the REE instruction may include instructions for the application in the REE to obtain the SE identifier from the SE under normal circumstances; the REE instruction may also include instructions sent from the REE for malicious attacks on the SE under abnormal circumstances. Since the source of the REE instruction is the REE with lower security, the security of the REE instruction cannot be ensured. Therefore, in this application, once the electronic device obtains the REE instruction, it interrupts the established second session and updates the value of the initial identifier to the preset value.

[0154] In another possible implementation, if the electronic device determines that the chip status of the first payment card is any one of a power-off state, a restart state, a sleep state, and a low power consumption state after establishing the second session and before receiving the first transaction instruction, the value of the initial identifier is updated to a preset value.

[0155] Among them, in order to reduce the power consumption of the electronic device, when the chip state of the chip (SE) where the first payment card in the electronic device is located does not receive any instruction for more than a preset time, the chip state of the chip may be switched from a power-on state to a power-off state, a restart state, a sleep state, or a low power consumption state. In this case, the established second session can be interrupted and the value of the initial identifier can be updated to a preset value.

[0156] Because before the second session is interrupted, the initial identification stored in the electronic device is the same as the identification to be verified (for example, Figure 5 In the example, if the second session is the first session, the initial identifier and the identifier to be verified are both the second random value), therefore, when the second session is interrupted, the operation of updating the value of the initial identifier to the preset value can enable the electronic device to clearly identify the interruption of the second session based on the difference between the initial identifier and the identifier to be verified after establishing the first session.

[0157] At the same time, since the first payment card targeted by the first transaction instruction may have never been activated before receiving the first transaction instruction, or the first payment card has been activated but has been deactivated, the payment status of the first payment card is inactive. It is understandable that the first payment card targeted by the first transaction instruction may also be described as the first payment card corresponding to the first transaction instruction, etc.

[0158] Based on the above description, the electronic device may determine that the initial identifier is different from the identifier to be verified when triggering the establishment of the first session (corresponding to situation 3); or, the electronic device may determine that the payment status of the first payment card is in an inactivated state when triggering the establishment of the first session (corresponding to situation 2); or, the electronic device may determine that the initial identifier is different from the identifier to be verified and the payment status of the first payment card is in an inactivated state when triggering the establishment of the first session (corresponding to situation 4).

[0159] In an embodiment of the present application, the electronic device may update the value of the initial identifier to a first random value when the initial identifier is different from the identifier to be verified and / or the payment status of the first payment card targeted by the first transaction instruction is in an inactive state. Updating the value of the initial identifier to the first random value means that the electronic device updates the stored value of the initial identifier from a preset value to the first random value. For example, the first random value may be any value within a preset range, and the preset value may be any value not within the preset range, for example, the preset value may be 0, and the first random value may be any natural number not equal to 0, and so on.

[0160] Furthermore, the electronic device also obtains verification information of the second session.

[0161] Optionally, the verification information of the second session includes but is not limited to: a method of user verification to be performed, a verification time of the second session, etc. The verification time of the second session is a time when the user verification is passed in the second session.

[0162] It should be noted that the verification information of the second session is stored in the TEE of the electronic device. When the TEE is restarted, the verification information of the second session will be cleared.

[0163] S602: When the verification information of the second session is invalid, trigger the user verification of the first session to obtain the verification result of the first session.

[0164] The first session is a communication session established based on the first transaction instruction.

[0165] Optionally, if the initial identifier is different from the identifier to be verified and the first payment card is in an activated state, when the verification information of the second session is invalid, the payment state of the first payment card is also updated to an inactivated state.

[0166] Optionally, when the electronic device updates the payment status of the first payment card to an inactivated state, it may also update the payment status of other payment cards with higher payment security to an inactivated state (optionally, if PPSE is included, PPSE is also deactivated). Based on this, the security of the payment cards with higher payment security can be ensured to further improve the security of the transaction.

[0167] In a possible implementation, the electronic device determines that the verification information of the second session is invalid when the verification time of the second session is empty; or, the electronic device determines that the verification information of the second session is invalid when the time difference between the current moment and the verification moment of the second session is greater than a preset threshold.

[0168] The current time is the time when the first transaction instruction is received. If the TEE in the electronic device is restarted before the first transaction instruction is received, the verification time of the second session is empty after being cleared, and the verification information of the second session is invalid. If the time difference between the current time and the verification time of the second session is greater than the preset threshold, it means that the verification information of the second session has timed out and the verification information of the second session is invalid.

[0169] In this case, since the verification information of the second session is invalid, in order to improve the security of the transaction, the electronic device can re-initiate user verification, and the re-initiated user verification can be called the user verification of the first session. Accordingly, the result of the re-initiated user verification is the verification result of the first session. In addition, if the payment status of the first payment card is activated, the payment status of the first payment card is also updated to inactive. Then the electronic device can obtain the verification result of the first session by performing user verification. This method can refer to Figure 5 The implementation method of S504 is not described here.

[0170] S603: When the verification result of the first session indicates that the user verification of the first session has passed, the payment status of the first payment card is updated to an activated status, and the value of the to-be-verified identifier is updated to a first random value.

[0171] In the embodiment of the present application, if the verification result of the first session indicates that the user of the first session has passed the verification, it means that after the first session is established, the currently verified user has passed the verification. In this case, the electronic device allows the currently verified user to conduct transactions with the card reader through the first payment card, and the electronic device can update the payment status of the first payment card from the inactive state to the activated state.

[0172] Optionally, if the first payment card is an electronic bank card, PPSE is also activated.

[0173] Furthermore, the electronic device may also update the value of the identifier to be verified to the first random value. Since the electronic device has updated the value of the initial identifier to the second random value in S602, this process may also be understood as the electronic device assigning the value of the initial identifier to the identifier to be verified.

[0174] Based on this method, the electronic device can keep the stored initial identifier and the identifier to be verified the same before the first session is interrupted, so that when the first session is interrupted later, the electronic device can update the value of the initial identifier to a preset value, and the initial identifier is different from the identifier to be verified, thereby determining that the first session is different from the subsequently established new session.

[0175] S604: Execute the transaction process corresponding to the third transaction instruction through the first payment card.

[0176] The third transaction instruction is a transaction instruction received after the first transaction instruction is received.

[0177] In the embodiment of the present application, after receiving the first transaction instruction, the electronic device may also receive a third transaction instruction from the card reader. When receiving the third transaction instruction, the electronic device triggers the establishment of a third session with the card reader. If the first session is not interrupted before receiving the third transaction instruction, the initial identifier is the same as the identifier to be verified when the third transaction instruction is received. In addition, since in the first session, the electronic device makes the payment status of the first payment card active, and the third transaction instruction is also a transaction instruction for the first payment card, the electronic device can determine that the payment status of the first payment card is active.

[0178] When it is determined that the initial identifier is the same as the identifier to be verified and the payment status of the first payment card is activated, the electronic device can execute the transaction process corresponding to the third transaction instruction based on the activated first payment card. For example, the electronic device performs transaction processes such as transferring money and purchasing goods / services with the card reader based on the first payment card. This application does not elaborate on the implementation of the transaction process.

[0179] It should be noted that if the verification information of the second session obtained by the electronic device in S601 is valid, the electronic device does not need to execute the above S602 to S603, and can update the payment status of the first payment card to an activated state or maintain the payment status of the first payment card to an activated state after executing S601, and update the value of the identifier to be verified to a first random value, and then execute S604.

[0180] In implementing the embodiments of the present application, on the one hand, since the malicious attacker in the electronic device cannot control the initial identifier to be the same as / different from the identifier to be verified, and cannot directly activate the payment card without user verification, even if the malicious attacker can intercept the notification of deactivating the electronic card, when the last session is interrupted and / or the payment card is not activated, the malicious attacker cannot directly conduct transactions through the activated payment card, but needs to determine whether the user verification is invalid, and can only activate the payment card or maintain the activation status of the payment card after the user verification is valid, and conduct transactions when the transaction instruction is received next time. Based on this, the risk of interception of the notification of deactivating the electronic card can be eliminated, and the security of the transaction can be improved. On the other hand, the transaction process proposed in the present application only involves user verification on the electronic device, and the user does not need to enter the PIN code on the card reader, etc., so the interaction between the user and the card reader can be reduced, and the complexity of the user's operation can be reduced.

[0181] Optionally, if the electronic device triggers establishment of a first session with the card reader when receiving the first transaction instruction, and determines that the initial identifier is the same as the identifier to be verified and the payment status of the first payment card targeted by the first transaction instruction is activated, the transaction process corresponding to the first transaction instruction can be directly executed based on the activated first payment card and the card reader.

[0182] Based on the above description, the following Figure 7 The flow chart of the transaction method proposed in the embodiment of the present application is systematically described. The various situations of receiving the initial transaction instruction and the non-initial transaction instruction can be described by Figure 7 The process shown is implemented as follows:

[0183] See also Figure 7 , Figure 7 This is a schematic diagram of the overall process of a transaction method proposed in an embodiment of the present application. The method includes S701 to S711, and the execution subject is an electronic device. For example, the electronic device may be the electronic device 201 introduced in the above content. Among them:

[0184] S701. Receive a transaction instruction from a card reader.

[0185] The electronic device receives the transaction instruction from the card reader as follows: Figure 5 The initial transaction instruction or Figure 6 The transaction instruction can be sent by the card reader to the electronic device when the physical distance between the electronic device and the card reader is less than a preset distance. For example, if the communication distance of NFC is 10 cm, the card reader can send the transaction instruction to the electronic device when the electronic device is less than 10 cm from the card reader.

[0186] Optionally, before the electronic device receives the transaction instruction from the card reader, the user can actively select the payment card corresponding to the transaction instruction through the electronic device, and the payment card must be a payment card that can be used for transactions with the card reader, and the transaction instruction sent by the card reader is a transaction instruction for the payment card selected by the user. Alternatively, the card reader can only conduct transactions with a certain type of payment card, and the user does not need to select a payment card through the electronic device, and the card reader can directly send a transaction instruction for a certain type of payment card in the electronic device.

[0187] S702. Determine through COS whether the payment card targeted by the transaction instruction is a payment card with high payment security.

[0188] In some possible implementations, the electronic device stores a high-security payment card identification set, which includes card identifications (applet identity documents, AIDs) corresponding to payment cards with higher payment security. The transaction instruction may include the AID corresponding to the payment card targeted by the transaction instruction. The electronic device can determine through COS whether the AID corresponding to the payment card targeted by the transaction instruction exists in the high-security payment card identification set, thereby determining whether the payment card targeted by the transaction instruction is a payment card with higher payment security.

[0189] If it is determined that the AID corresponding to the payment card targeted by the transaction instruction does not exist in the high-security payment card identification set, the electronic device executes S711, that is, the transaction process is executed with the card reader through the payment card targeted by the transaction instruction.

[0190] If it is determined that the AID corresponding to the payment card targeted by the transaction instruction exists in the high-security payment card identification set, the electronic device executes S703 and subsequent steps.

[0191] S703: Determine through COS whether the initial identifier is the same as the identifier to be verified, and whether the payment status of the payment card targeted by the transaction instruction is activated.

[0192] If the transaction instruction is an initial transaction instruction, the value of the initial identifier and the value of the identifier to be verified are both null values, the initial identifier is different from the identifier to be verified, and the payment status of the payment card targeted by the transaction instruction is in an inactivated state.

[0193] If the transaction instruction is not an initial transaction instruction, then according to the description of the above situation 1 to situation 4:

[0194] In case 1, the initial identifier is the same as the identifier to be verified (for example, both are the second random value), and the payment status of the payment card targeted by the transaction instruction is activated;

[0195] In case 2, the initial identifier is the same as the identifier to be verified (for example, both are the second random value), and the payment status of the payment card targeted by the transaction instruction is in an inactive state;

[0196] In case 3, the initial identifier (such as the preset value) and the identifier to be verified (such as the value Figure 6 The second random value in the embodiment is different, and the payment status of the payment card targeted by the transaction instruction is an activated status;

[0197] In situation 4, the initial identifier (such as a preset value) is different from the identifier to be verified (such as a second random value), and the payment status of the payment card targeted by the transaction instruction is in an inactivated state.

[0198] In an embodiment of the present application: if it is determined through COS that the initial identifier is the same as the identifier to be verified and the payment status of the payment card targeted by the transaction instruction is activated (corresponding to situation 1), the electronic device executes S711, that is, executes the transaction process through the payment card targeted by the transaction instruction and the card reader.

[0199] If COS determines that the initial identifier is different from the identifier to be verified and / or the payment status of the payment card targeted by the transaction instruction is inactive (corresponding to receiving the initial transaction instruction and situations 2 to 4), the electronic device executes S704 and subsequent steps.

[0200] S704: Update the initial identification through COS.

[0201] Here, updating the initial identifier means updating the value of the initial identifier to a random value that is not a preset value. Figure 5 In the update, the value of the initial identifier is updated to the second random value. Figure 6 The value of the initial identifier is updated to the first random value.

[0202] Optionally, after the electronic device updates the initial identification through COS, it can also return an error code through COS to trigger the card reader to enter a sleep state, and then send a transaction instruction again after entering the sleep state.

[0203] S705. Determine whether the user authentication is valid through the wallet TA.

[0204] In an embodiment of the present application, the electronic device can determine whether the user authentication is valid through stored authentication information (such as authentication time).

[0205] If the transaction instruction is an initial transaction instruction, the verification information is empty and the user verification is invalid.

[0206] If the transaction instruction is not an initial transaction instruction, the verification information is the verification information of the session established before receiving the transaction instruction (such as Figure 6Verification information of the second session in the embodiment): when the verification information times out or is cleared, the user verification is invalid; when the verification information is not cleared and the verification information has not timed out, the user verification is valid.

[0207] In the embodiment of the present application: if the user authentication is valid (corresponding to cases 2 to 4), the electronic device executes S706 and subsequent steps.

[0208] If the user verification is invalid (corresponding to the first transaction and cases 2 to 4), the electronic device executes S709 and subsequent steps.

[0209] S706. Determine, through the wallet TA, whether the payment status of the payment card targeted by the transaction instruction is activated.

[0210] If the payment status of the payment card targeted by the transaction instruction is activated, the electronic device first executes S707, and then jumps to execute S701 again after executing S707. That is, the electronic device first maintains the payment status of the payment card targeted by the transaction instruction as activated and updates the pending verification identifier through the wallet TA, and then receives a new transaction instruction sent by the card reader again and repeats the above steps.

[0211] If the payment status of the payment card targeted by the transaction instruction is in an inactive state, the electronic device first executes S708 and then jumps to execute S701 again after executing S707. That is, the electronic device first updates the payment status of the payment card targeted by the transaction instruction to an activated state and updates the pending verification mark through the wallet TA, and then receives a new transaction instruction sent by the card reader again and repeats the above steps.

[0212] S707. Update the identification to be verified through the wallet TA.

[0213] Specifically, when the electronic device updates the identification to be verified through the wallet TA, the updated identification to be verified can be made the same as the initial identification updated in S704. And since the payment status of the payment card targeted by the transaction instruction is activated, the payment status of the payment card targeted by the transaction instruction can be maintained.

[0214] Optionally, if the payment card targeted by the transaction instruction is an electronic bank card, the activation status of PPSE may also be maintained.

[0215] Furthermore, after executing S707, the electronic device may jump to execute S701 again, that is, the electronic device receives a new transaction instruction sent by the card reader again and repeats the above steps.

[0216] S708. The payment status of the payment card targeted by the transaction instruction is updated from an inactive state to an active state through the wallet TA, and the pending verification flag is updated.

[0217] Specifically, when the electronic device updates the identification to be verified through the wallet TA, the updated identification to be verified can be made the same as the initial identification updated in S704.

[0218] Optionally, if the payment card targeted by the transaction instruction is an electronic bank card, PPSE is also activated.

[0219] Furthermore, after executing S708, the electronic device may jump to execute S701 again, that is, the electronic device receives a new transaction instruction sent by the card reader again and repeats the above steps.

[0220] S709. Re-initiate user verification through wallet TA to obtain the user's verification result; or, update the payment status of the payment card targeted by the transaction instruction to an inactivated state through wallet TA, and re-initiate user verification to obtain the user's verification result.

[0221] Optionally, when the payment status of the payment card targeted by the transaction instruction is updated to an inactivated state, all payment cards and PPSEs with higher payment security may also be deactivated.

[0222] If the transaction instruction is the first transaction instruction, the user's verification result is Figure 5 Verification result of the initial session in the embodiment.

[0223] If the transaction instruction is not the first transaction instruction, the user's verification result is Figure 6 Verification result of the first session in the embodiment.

[0224] In one possible implementation, the electronic device may actively trigger the display of a card selection interface / or prompt the user to manually trigger the display of a card selection interface, where the card selection interface includes the payment card targeted by the transaction instruction, and the user may perform user verification after selecting the payment card targeted by the transaction instruction on the card selection interface.

[0225] S710. When the verification result indicates that the user verification has been passed, the wallet TA updates the payment status of the payment card targeted by the transaction instruction from an inactive status to an active status, and updates the pending verification flag.

[0226] Specifically, when the electronic device updates the identification to be verified through the wallet TA, the updated identification to be verified can be made the same as the initial identification updated in S704.

[0227] Optionally, the electronic device may also save the verification information of the user verification when the verification result indicates that the user verification has passed, for example, Figure 5 , when the verification result of the initial session indicates that the user has passed the verification, the verification information of the initial session is saved; Figure 6, when the verification result of the first session is valid, save the verification information of the first session. It should be noted that when the electronic device has stored the verification information of the user verification, the electronic device needs to delete the stored verification information of the user verification when saving the verification information of the user verification. This process can also be understood as updating the stored verification information of the user verification to the verification information of the user verification newly obtained in this step, such as in Figure 6 In a corresponding embodiment, the verification information of the second session is updated to the verification information of the first session.

[0228] Optionally, if the payment card targeted by the transaction instruction is an electronic bank card, PPSE is also activated.

[0229] Optionally, if the verification result indicates that the user verification has failed, the electronic device may prompt the user that the verification has failed and initiate user verification again until the user verification passes or the number of user verifications reaches a preset number, which is not limited in this application.

[0230] Further, after executing S710, the electronic device may jump to execute S701 again and repeat the above steps. That is, the electronic device receives a new transaction instruction sent by the card reader again and repeats the above steps. For example, after receiving a new transaction instruction sent by the card reader again, S701, S702, S703 and S711 may be executed in sequence.

[0231] S711. Execute the transaction process with the card reader through the payment card targeted by the transaction instruction.

[0232] In implementing the embodiments of the present application, firstly, the electronic device can determine the corresponding processing flow according to the payment security of the payment card, and secondly, it can determine the further processing flow by determining whether the initial identification and the identification to be verified are the same, as well as the payment status of the payment card. On the one hand, this method is compatible with various scenarios of electronic card transactions, and on the other hand, through the judgment of the initial identification, the identification to be verified, and the payment status, even if a malicious attacker intercepts the notification of deactivating the payment card, he cannot directly conduct transactions through the payment card, which can improve the security of the transaction. On the other hand, it can reduce the interaction between the user and the card reader and reduce the complexity of the user's operation.

[0233] Below through Fig. 8A , Figure 8B and Figure 8C The interaction process of each software module in the electronic device 201 is introduced. The software modules in the electronic device 201 can refer to Figure 4 The schematic diagram shown:

[0234] Among them, through Fig. 8A The interaction of various software modules in the electronic device 201 when a payment card with higher payment security is added / deleted / disabled is introduced; Figure 8B and Figure 8C Introduce the above Figure 7 In specific implementation, the various software modules inside the electronic device 201 interact with each other.

[0235] See also Fig. 8A , Fig. 8A This is a schematic diagram of the interaction process of a software module proposed in an embodiment of the present application, including S801 to S804.

[0236] S801. The electronic device 201 sends an update notification of a target payment card to the wallet TA through the wallet APP.

[0237] Among them, the target payment card is a payment card with higher payment security.

[0238] Optionally, the number of target payment cards may be one, and the target payment card may be a payment card to be added / deleted / disabled.

[0239] Optionally, there may be multiple target payment cards. When there are multiple target payment cards, the types of the multiple target payment cards may be the same or different. For example, some of the multiple target payment cards are payment cards to be added, another part of the target payment cards are payment cards to be deleted, and another part of the target payment cards are payment cards to be disabled. Batch addition and / or batch deletion and / or batch disabling of multiple payment cards may be achieved based on subsequent steps S802 to S804.

[0240] After the electronic device 201 receives the user's instructions for adding and / or deleting and / or disabling the target payment card in the wallet APP, the electronic device 201 may send an update notification of the target payment card to the wallet TA through the wallet APP.

[0241] S802. The electronic device 201 responds to the update notification through the wallet TA to update the stored high-security payment card identification set and generate an updated high-security payment card identification set.

[0242] Optionally, the update notification may include the card ID of the target payment card and an ID corresponding to the update type, where the ID corresponding to the update type includes one or more IDs corresponding to addition, deletion, and disabling. The electronic device 201 may update the stored high-security payment card ID set according to the update notification and the stored high-security payment card ID set to generate an updated high-security payment card ID set. For example, the electronic device 201 may add and / or delete and / or disable the card ID of the target payment card in the stored high-security payment card ID set according to the ID corresponding to the update type.

[0243] S803. The electronic device 201 sends the updated high-security payment card identification set to the COS through the wallet TA.

[0244] S804. The electronic device 201 updates the stored high-security payment card identification set according to the updated high-security payment card identification set.

[0245] For example, the electronic device 201 may delete the stored high-security payment card identification set and store an updated high-security payment card identification set.

[0246] It should be noted that if the target payment card is an electronic bank card, and the stored high-security payment card identification set does not include the card identification of the electronic bank card, then when the electronic device updates the stored high-security payment card identification set, it also needs to update the card identification corresponding to the proximity payment systems environment (PPSE).

[0247] By implementing the embodiments of the present application, the electronic device can timely update the high-security payment card identification set according to the user's update of the target payment card, so that the electronic device can realize transactions with the card reader according to the updated high-security payment card identification set. Since the high-security payment card identification set is stored in the TEE and SE, it is not easily tampered with, thus improving the transactions between the electronic device and the card reader.

[0248] See also Figure 8B , Figure 8B is a schematic diagram of the interaction flow of another software module proposed in the embodiment of the present application, wherein the card reader can be Figure 2 Electronic devices introduced in 202:

[0249] S811. The electronic device 201 receives a transaction instruction via the NFC chip.

[0250] The transaction instruction may include a card identifier of the payment card to which the transaction instruction is directed.

[0251] S812. The electronic device 201 sends the transaction instruction to the COS via the NFC chip.

[0252] S813-1. If the electronic device 201 determines through COS that the card identifier of the payment card targeted by the transaction instruction is not in the high-security payment card identifier set, the transaction process is executed with the card reader through the payment card targeted by the transaction instruction.

[0253] S813-2. If the electronic device 201 determines through COS that the card identifier of the payment card targeted by the transaction instruction is in the high-security payment card identifier set, and the initial identifier is the same as the identifier to be verified, and the payment status of the payment card targeted by the transaction instruction is activated, the transaction process is executed through the payment card targeted by the transaction instruction and the card reader.

[0254] After executing S811 and S812, the electronic device may execute S813-1 or S813-2. S813-1 is a transaction implementation method for non-high-security payment cards. S813-2 corresponds to the implementation method of situation 1 when a non-initial transaction instruction is received.

[0255] See also Figure 8C , Figure 8C is another interactive flow diagram of a software module proposed in the embodiment of the present application, wherein the card reader can be Figure 2 Electronic devices introduced in 202:

[0256] S811. The electronic device 201 receives a transaction instruction via the NFC chip.

[0257] The transaction instruction may include a card identifier of the payment card to which the transaction instruction is directed.

[0258] S812. The electronic device 201 sends the transaction instruction to the COS via the NFC chip.

[0259] After executing S811 and S812, the electronic device 201 may execute S813-1 or S813-2, or may execute Figure 8C S813-3 and the steps after S813-3 in the Execution Figure 8C S813-3 and the steps after S813-3 correspond to the implementation method of receiving the initial transaction instruction or the implementation method of any one of Cases 2 to 4 when a non-initial transaction instruction is received.

[0260] S813-3. If the electronic device 201 determines through COS that the card identifier of the payment card targeted by the transaction instruction is in the high-security payment card identifier set, and the initial identifier is different from the identifier to be verified and / or the payment status of the payment card targeted by the transaction instruction is in an inactivated state, then the initial identifier is updated and an error code is generated.

[0261] The error code is used to instruct the electronic device to determine whether the user authentication is invalid. Updating the initial identifier means updating the value of the initial identifier to a random value (such as Figure 5 The second random value in Figure 6 The first random value in .

[0262] S814. The electronic device 201 sends the error code and the updated initial identifier to the NFC chip via the COS.

[0263] S815. The electronic device 201 sends the error code to the card reader via the NFC chip.

[0264] S816. The electronic device 201 sends the card identification and the updated initial identification to the NFC service via the NFC chip.

[0265] S817. The electronic device 201 sends the card ID and the updated initial ID to the wallet APP via the NFC service.

[0266] S818. The electronic device 201 sends the card ID and the updated initial ID to the wallet TA through the wallet APP.

[0267] Among them, after executing the above steps, the electronic device 201 can execute S819-1-1 to S819-1-3, S820 to S822 in sequence; or execute S819-2-1 to S819-2-9, S820 to S822 in sequence.

[0268] S819-1-1. If the electronic device 201 determines through the wallet TA that the user authentication is valid, the payment status of the payment card targeted by the transaction instruction is obtained through the wallet TA.

[0269] S819-1-2. If the electronic device 201 determines through the wallet TA that the payment status of the payment card targeted by the transaction instruction is in an inactivated state, the wallet TA notifies the CRS to activate the payment card targeted by the transaction instruction.

[0270] S819-1-3. The electronic device 201 activates the payment card targeted by the transaction instruction through CRS.

[0271] It should be noted that if the electronic device 201 determines through the wallet TA that the payment card payment status is activated, it does not need to execute S819-1-2 to S819-1-3, and can directly execute S820 to S821 and receive a new transaction instruction again after executing S821, and execute again Figure 8B or Figure 8C The processing flow in .

[0272] S819-2-1. If the electronic device 201 determines through the wallet TA that the user authentication is invalid, it notifies the CRS through the wallet TA to activate the payment card targeted by the transaction instruction.

[0273] S819-2-2. The electronic device 201 activates the payment card targeted by the transaction instruction through CRS.

[0274] S819-2-3. The electronic device 201 notifies the wallet TA through the CRS that the payment card targeted by the transaction instruction has been successfully activated.

[0275] It should be noted that S819-2-2 to S819-2-3 are optional steps. When S813-3 determines through COS that the payment status of the payment card targeted by the transaction instruction is in an inactive state, S819-2-2 to S819-2-3 may not be executed. When it is determined through COS that the payment status of the payment card targeted by the transaction instruction is in an activated state, S819-2-2 to S819-2-3 may be executed.

[0276] S819-2-4. The electronic device 201 notifies the wallet APP through the wallet TA to re-initiate user verification.

[0277] S819-2-5. The electronic device 201 performs user verification through the wallet APP, and the user verification is passed.

[0278] S819-2-6. The electronic device 201 notifies the wallet TA through the wallet APP to activate the payment card targeted by the transaction instruction.

[0279] S819-2-7. The electronic device 201 determines through the wallet TA that the user verification has been passed and updates the verification information of the user verification.

[0280] S819-2-8. The electronic device 201 notifies the CRS through the wallet TA to activate the payment card targeted by the transaction instruction.

[0281] S819-2-9. The electronic device 201 activates the payment card targeted by the transaction instruction through CRS.

[0282] S820. The electronic device 201 notifies the wallet TA through the CRS that the payment card targeted by the transaction instruction has been successfully activated.

[0283] S821. The electronic device 201 notifies the CRS through the wallet TA to update the identification to be verified.

[0284] S822. The electronic device 201 updates the identification to be verified through the CRS.

[0285] When the electronic device 201 updates the identifier to be verified through the CRS, the value of the updated initial identifier in S813-3 can be assigned to the identifier to be verified, thereby obtaining an updated identifier to be verified, and the updated identifier to be verified can be stored in the COS.

[0286] It should be noted that after the electronic device executes S819-1-1 to S819-1-3, S820 to S822 in sequence, or after executing S819-2-1 to S819-2-9, S820 to S822 in sequence, it can receive new transaction instructions again and then execute Figure 8B or Figure 8C The corresponding process is to receive a new transaction instruction again and decide whether to trade according to the same processing flow.

[0287] Above Figure 8B to Figure 8C The specific implementation process can be referred to Figure 7 The corresponding embodiments.

[0288] Depend on Figure 8B and Figure 8C It can be seen that during the entire transaction process, COS in SE can determine whether the initial identifier is the same as the identifier to be verified, and whether the payment card targeted by the transaction instruction is activated, and the wallet TA in TEE can determine whether the user verification is invalid, thereby improving the security of the transaction from REE to TEE and SE. Even if the transaction is attacked maliciously from REE, the security of the transaction can be ensured because TEE and SE will not be affected.

[0289] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0290] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0291] The terms "component", "module", "system", etc. used in this specification are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program and / or a computer. By way of illustration, both applications running on a computing device and a computing device can be components. One or more components may reside in a process and / or an execution thread, and a component may be located on a computer and / or distributed between two or more computers. In addition, these components may be executed from various computer-readable media having various data structures stored thereon. Components may, for example, communicate through local and / or remote processes according to signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system and / or a network, such as the Internet interacting with other systems through signals).

[0292] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0293] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0294] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the above-mentioned units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0295] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0296] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0297] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present application. Among them, the aforementioned storage medium may include: U disk, mobile hard disk, magnetic disk, optical disk, read-only memory (Read-Only Memory, abbreviated: ROM) or random access memory (Random Access Memory, abbreviated: RAM) and other media that can store program codes.

[0298] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A trading method, characterized in that: The method comprises: The initial identifier is different from the identifier to be verified and / or the payment status of the first payment card corresponding to the first transaction instruction is in an inactive state, the value of the initial identifier is updated to a first random value, and verification information of the second session is obtained; wherein the card identifier corresponding to the first payment card is included in the high-security payment card identifier set; the first random value is different from a preset value; and the second session is a communication session established based on the received second transaction instruction before receiving the first transaction instruction; When the verification information of the second session is invalid, triggering verification of the user object of the first session to obtain the verification result of the first session; the first session is a communication session established based on the first transaction instruction; When the verification result of the first session indicates that the user of the first session has passed the verification, updating the payment state of the first payment card to an activated state, and updating the value of the to-be-verified identifier to the first random value; The transaction process corresponding to the third transaction instruction is executed through the first payment card; the third transaction instruction is a transaction instruction received after receiving the first transaction instruction.

2. The method according to claim 1, characterized in that The method further comprises: The initial identifier is different from the identifier to be verified, the payment status of the first payment card is activated, and the verification information of the second session is invalid, and the payment status of the first payment card is updated to inactivated.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: When the verification information of the second session is valid, obtaining a payment status of the first payment card; The payment status of the first payment card is the inactive status, the payment status of the first payment card is updated to the active status and the value of the to-be-verified identifier is updated to the first random value; or, The payment status of the first payment card is the activated status, the value of the to-be-verified identifier is updated to the first random value, and the payment status of the first payment card is maintained as the activated status.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: A rich execution environment (REE) instruction is obtained, and the value of the initial identifier is updated to the preset value; the REE instruction is used to trigger the interruption of the second session; the REE instruction is an instruction obtained after the second session is established and before the first transaction instruction is received; Alternatively, the chip status of the first payment card is obtained to be any one of a power-off state, a restart state, a sleep state, and a low power consumption state, and the value of the initial identifier is updated to the preset value; the chip status of the first payment card is obtained after establishing the second session and before receiving the first transaction instruction.

5. The method according to any one of claims 1 to 3, characterized in that: The verification information of the second session includes a verification time of the second session, and the method further includes: When the verification time of the second session is a null value, determining that the verification information of the second session is invalid; Alternatively, when the time difference between the current moment and the verification moment of the second session is greater than a preset threshold, it is determined that the verification information of the second session is invalid; the current moment is the moment when the first transaction instruction is received.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: The initial identifier is the same as the identifier to be verified and the payment status of the first payment card is an activated status, and the transaction process corresponding to the first transaction instruction is executed through the first payment card and the card reader.

7. The method according to any one of claims 1 to 6, characterized in that: The second transaction instruction is a transaction instruction received from the card reader for the first time.

8. The method according to claim 7, characterized in that The method further comprises: When the second transaction instruction is received, the initial identifier and the identifier to be verified are both null values, and the payment status of the payment card corresponding to the second transaction instruction is the inactivated status, and the value of the initial identifier is updated to a second random value; the second random value is different from the preset value; triggering verification of the user object of the second session, and obtaining a verification result of the second session; When the verification result of the second session indicates that the user of the second session has passed the verification, the payment state of the payment card corresponding to the second transaction instruction is updated to the activated state, and the value of the to-be-verified identifier is updated to the second random value.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store a computer program, and the computer program comprises computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 8.

11. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 8.