NFC card reading and writing method, mobile terminal and computer storage medium

By configuring information based on the security index of the NFC card and storing high-security card information in a high-security storage location, the problem of limited security of NFC cards in mobile terminals is solved, and security and usability in different scenarios are achieved.

CN115022886BActive Publication Date: 2025-09-23GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210588646.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-26
Publication Date
2025-09-23
Estimated Expiration
2042-05-26

AI Technical Summary

Technical Problem

The security of NFC cards in mobile terminals is threatened, mainly because the storage space of eSE is limited, which makes the card information of NFC cards easily stolen if it is not stored properly.

Method used

By obtaining the configuration information of the NFC card and based on the positive correlation between the security index of the card information and the storage location, the card information with a high security index is stored in a high-security storage location, such as eSE, and the card information with a low security index is stored in a low-security storage location. The corresponding data movement and routing settings are performed when the screen is turned off or the device is shut down to ensure the security of the card information.

Benefits of technology

The security of NFC cards is improved, security issues caused by random configuration are avoided, and normal use and data security are ensured in different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115022886B_ABST
    Figure CN115022886B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for reading and writing an NFC card. The method is applied to a mobile terminal. The NFC card is a card that is recorded by the mobile terminal via NFC. The method comprises: upon receiving a read / write signal for the NFC card's card information, obtaining configuration information of the NFC card; and responding to the read / write signal for the NFC card's card information based on the NFC card's configuration information. The security index of the storage location for the NFC card's card information in the NFC card's configuration information is positively correlated with the security index of the NFC card. The present invention also provides a mobile terminal and a computer storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a technology for implementing a card emulation function in a mobile terminal with a Near Field Communication (NFC) function, and in particular to a method for reading and writing an NFC card, a mobile terminal, and a computer storage medium. Background Art

[0002] Currently, when mobile terminals with NFC function simulate bus cards, access control cards and bank cards, the card information of these NFC cards is usually stored in the embedded secure element (eSE) inside the NFC chip of the mobile terminal. Users can manage these NFC cards through the application (APP) in the mobile terminal, including copying cards, opening new cards, deleting cards and recharging.

[0003] However, as more and more analog cards are used in mobile terminals and the storage space of eSE is limited, the security of NFC cards is threatened when the memory other than eSE in the mobile terminal is used to store NFC cards. It can be seen that there are security issues with NFC cards in existing mobile terminals. Summary of the Invention

[0004] The embodiments of the present application provide a method for reading and writing an NFC card, a mobile terminal, and a computer storage medium, which can improve the security of the NFC card in the mobile terminal.

[0005] The technical solution of this application is achieved as follows:

[0006] An embodiment of the present application provides a method for reading and writing an NFC card, which is applied to a mobile terminal. The NFC card is a card recorded by the mobile terminal via NFC, and includes:

[0007] When receiving a read / write signal for the card information of the NFC card, obtaining configuration information of the NFC card;

[0008] Responding to a read / write signal of the card information of the NFC card based on the configuration information of the NFC card;

[0009] The security index of the storage location of the card information of the NFC card in the configuration information of the NFC card is positively correlated with the security index of the NFC card.

[0010] An embodiment of the present application provides a mobile terminal for reading and writing an NFC card, wherein the NFC card is a card recorded by the mobile terminal via NFC, including:

[0011] an acquisition module, configured to acquire configuration information of the NFC card when receiving a read / write signal for card information of the NFC card;

[0012] A response module, configured to respond to a read / write signal of the card information of the NFC card based on the configuration information of the NFC card;

[0013] The security index of the storage location of the card information of the NFC card in the configuration information of the NFC card is positively correlated with the security index of the NFC card.

[0014] An embodiment of the present application provides a mobile terminal, including:

[0015] A processor and a storage medium storing instructions executable by the processor, wherein the storage medium relies on the processor to perform operations via a communication bus, and when the instructions are executed by the processor, the NFC card reading and writing method described in one or more of the above embodiments is executed.

[0016] An embodiment of the present application provides a computer storage medium storing executable instructions. When the executable instructions are executed by one or more processors, the processors execute the NFC card reading and writing method as described in one or more embodiments.

[0017] An embodiment of the present application provides a reading and writing method for an NFC card, a mobile terminal, and a computer storage medium. The method is applied to a mobile terminal, where the NFC card is a card recorded by the mobile terminal through NFC, comprising: when a read and write signal for the card information of the NFC card is received, obtaining configuration information of the NFC card, and responding to the read and write signal of the card information of the NFC card based on the configuration information of the NFC card, wherein the security index of the storage location of the card information of the NFC card in the configuration information of the NFC card is positively correlated with the security index of the NFC card; that is, in an embodiment of the present application, the security index of the NFC card is positively correlated with the security index of the storage location of the card information of the NFC card to configure the configuration information of the NFC card, and responding to the read and write signal of the card information of the received NFC card based on the configured NFC card configuration information, so that NFC cards with higher security indexes are stored in storage locations with higher security indexes, thereby avoiding security issues caused by random configuration of the configuration information of the NFC card, thereby improving the security of the NFC card. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A flowchart of an optional NFC card reading and writing method provided in an embodiment of the present application;

[0019] Figure 2 A schematic structural diagram of an example of an optional mobile terminal provided in an embodiment of the present application;

[0020] Figure 3 This is a partial log screenshot of an optional NFC-enabled device provided in an embodiment of the present application.

[0021] Figure 4 A flowchart of an example of an optional NFC card reading and writing method provided in an embodiment of the present application;

[0022] Figure 5 A schematic diagram of the structure of an optional mobile terminal provided in an embodiment of the present application;

[0023] Figure 6 A schematic structural diagram of another optional mobile terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application.

[0025] The embodiment of the present application provides a method for reading and writing an NFC card, which is applied to a mobile terminal. The NFC card is a card recorded by the mobile terminal via NFC. Figure 1 A flowchart of an optional NFC card reading and writing method provided in an embodiment of the present application is shown as follows: Figure 1 As shown, the NFC card reading and writing method may include:

[0026] S101: When receiving a read / write signal for the card information of the NFC card, obtaining configuration information of the NFC card;

[0027] Currently, when mobile terminals use NFC to implement card emulation functions, they usually store the card information of the NFC card in the eSE and main memory. However, when the NFC card is stored in a memory other than the eSE in the mobile terminal, the security of the NFC card is threatened, resulting in security issues with the NFC card.

[0028] In order to improve the security of the NFC card, when configuring the configuration information of the NFC card, the security index of the storage location of the NFC card information in the configuration information of the NFC card is positively correlated with the security index of the NFC card. That is, the storage location of the NFC card information is determined according to the security index of the NFC card. For example, the storage location of the card information of the NFC card with a high security index is determined to be a storage location with a high security index, such as eSE, and the storage location of the card information of the NFC card with a low security index is determined to be a storage location with a low security index, such as a memory other than eSE. The routing information of the card information of the NFC card is the routing information corresponding to the storage location, for example, the routing information corresponding to the eSE is eSE, and the routing information corresponding to the memory is host-based card emulation (HCE). That is, the card information of the NFC card is stored in the storage location corresponding to the security index that is positively correlated with the security index of the card information.

[0029] It should be noted that the configuration information of the above-mentioned NFC card may include the storage location of the card information of the NFC card, the routing information of the card information of the NFC card, the storage location of the card data of the NFC card and the routing information of the card data of the NFC card. Since each storage location corresponds to routing information, the storage location of the card information of the NFC card corresponds to the routing information of the card information of the NFC card, and the storage location of the card data of the NFC card corresponds to the routing information of the card data of the NFC card.

[0030] The memory other than the eSE may be an internal memory of the mobile terminal or an external memory of the mobile terminal, and this embodiment of the present application does not specifically limit this.

[0031] Regarding the memory of the mobile terminal, in an optional embodiment, the memory includes one or more of the following:

[0032] Main memory, Subscriber Identity Module (SIM) card, SD Secure Digital Card (SD) card.

[0033] It can be understood that when the memory is the main memory of the mobile terminal, the routing information corresponding to the memory is HCE, when the memory is a SIM card inserted into the mobile terminal, the routing information corresponding to the memory is SIM, and when the memory is an SD card of the mobile terminal, the routing information corresponding to the memory is SD.

[0034] The above-mentioned memory may be a main memory, one or more of a SIM card and an SD card, and this embodiment of the present application does not specifically limit this.

[0035] In addition, since each storage location in the mobile terminal corresponds to routing information, here, when the card information of the NFC card is stored in the eSE or a memory other than the eSE, the routing information corresponding to the eSE or the memory is determined as the routing information of the card information of the NFC card.

[0036] S102: Responding to a read / write signal of the card information of the NFC card based on the configuration information of the NFC card.

[0037] That is to say, after obtaining the storage location of the NFC card information and the routing information of the NFC card information, you can respond to the read and write signal of the NFC card information based on the storage location of the NFC card information and the routing information of the NFC card information.

[0038] For example, when the mobile terminal receives the read and write signal of the card information of the access control card, the storage location of the card information of the access control card is obtained from the configuration information of the NFC card as a memory other than the main eSE, and the routing information of the card information of the access control card is HCE. The read and write signal of the card information of the access control card is responded to based on the main memory and HCE, thereby realizing the card simulation of the access control card.

[0039] In this way, the preset NFC card configuration information is used to store the card information of the NFC card in a storage location corresponding to a security index that is positively correlated with the security index of the card information, so that an NFC card with a higher security index can store the card information in a storage location with a higher security index, thereby improving the security of the NFC card.

[0040] In order to obtain the configuration information of the NFC card, the developer can configure it according to the positive correlation between the security index of the NFC card and the security index of the storage location of the card information of the NFC card, or the security index of the NFC card of the mobile terminal and the security index of the storage location of the card information of the NFC card. Here, the embodiments of the present application do not make specific limitations on this.

[0041] Furthermore, in order to improve the security of the NFC card, in an optional embodiment, the above method further includes:

[0042] Determine the security index of the card information of the NFC card;

[0043] According to the security index of the card information of the NFC card, a storage location of the card information of the NFC card is selected from the eSE of the mobile terminal and a memory other than the eSE.

[0044] Here, the security index of the NFC card information is first determined, that is, the NFC card is measured according to its security for the user, and the security index of the NFC card is determined, thereby obtaining the security index of the NFC card information. In determining the security index of the NFC card information, the security index of the NFC card information can be determined according to the user's requirements for the confidentiality of the NFC card. For example, when the security index is divided into high and low levels, the security index of bank cards, access cards, digital car keys and digital ID cards can be determined as high levels, and the security index of bus cards and elevator cards can be determined as low levels.

[0045] Among them, in determining the security index of the card information of the NFC card, it can be determined in a way pre-set by the developer, or it can be determined based on a preset mapping relationship, or it can be determined using preset rules, or it can be determined in an interface interaction way. Here, the embodiments of the present application do not make specific limitations on this.

[0046] After determining the security index of the NFC card's card information, the storage location of the NFC card's card information can be selected from the eSE and the memory according to the security index of the NFC card's card information. That is, based on the positive correlation between the security index of the NFC card's card information and the security index of the storage location of the NFC card's card information, it can be determined whether to store the NFC card's card information in the eSE with a high security index or in the memory with a low security index, thereby ensuring the security of the NFC card.

[0047] Regarding the determination based on the preset mapping relationship, in an optional embodiment, determining the security index of the card information of the NFC card includes:

[0048] Based on a preset mapping relationship between NFC cards and security indices, the security index of the card information of the NFC card is determined.

[0049] It can be understood that a mapping relationship between NFC cards and security indexes is pre-stored in the electronic device. For example, the security index corresponding to a bank card is a high level, and the security level corresponding to a bus card is a low level. Then, based on the mapping relationship, the security index of the NFC card can be determined, and then the storage location of the NFC card information can be determined according to the security index of the NFC card.

[0050] In determining the security index of the card information of the NFC card by using an interface interaction method, in an optional embodiment, determining the security index of the card information of the NFC card includes:

[0051] When the NFC configuration interface displays an option for the security index of the card information of the NFC card, in response to a selection operation of the option for the security index of the card information of the NFC card, the security index of the card information of the NFC card is determined.

[0052] It can be understood that an NFC configuration interface is provided in the mobile terminal, and the configuration interface displays options for the security index of the card information of the NFC card, wherein, exemplarily, the security index options may include a high level and a low level. When the NFC card configuration interface is displayed on the mobile terminal, the user sends a selection operation for the option of the security index of the card information of the NFC card to the configuration interface, and the mobile terminal responds to the selection operation, thereby determining the security index of the card information of the NFC card.

[0053] For example, the configuration interface of the NFC card has options of a high security index and a low security level. The user selects the option with a high security index, so that the mobile terminal receives the selection operation of the security index of the card information of the NFC card. The mobile terminal determines that the security index of the card information of the NFC card is high, and then selects the storage location of the NFC card with a high security index as eSE from the eSE and the memory.

[0054] In this way, the security index of the NFC card is determined by using interface interaction, so that the user can use the interface to determine the security index of the NFC card information according to his own needs, so that the storage location of the NFC card information can be flexibly determined according to the security index set by the user, thereby improving the security of the NFC card.

[0055] Furthermore, to improve the security of the NFC card, in an optional embodiment, when the security index of the NFC card information includes a high level and a low level, selecting a storage location for the NFC card information from the eSE and the memory according to the security index of the NFC card information includes:

[0056] When the security index of the card information of the NFC card is a high level, determining that the storage location of the card information of the NFC card is eSE;

[0057] When the security index of the card information of the NFC card is a low level, the storage location of the card information of the NFC card is determined to be a memory.

[0058] It can be understood that since the eSE has a high security index and is not easily cracked or hacked, the storage location of the card information of the NFC card with a high security index is determined to be the eSE, and the storage location of the card information of the NFC card with a low security index is determined to be a memory outside the eSE. In this way, the card information of the NFC card with a high security index is stored in the high-security eSE, and the card information of the NFC card with a low security index is stored in the memory outside the eSE, thereby ensuring the security of the NFC card.

[0059] In the design of some operating systems, NFC cards stored in memory other than eSE can only work when the mobile terminal screen is on. When the mobile terminal screen is off, the card emulation function cannot be implemented for NFC cards stored in memory other than eSE. In order to enable the card emulation function of NFC cards stored in memory other than eSE in the mobile terminal when the screen is off, in an optional embodiment, the above method may further include:

[0060] When the storage location of the card information of the NFC card is the memory, the routing function corresponding to the routing information corresponding to the memory of the mobile terminal is set to be available when the screen is turned off.

[0061] It can be understood that when the storage location of the card information of the NFC card is a memory other than the eSE in the mobile terminal, the routing function corresponding to the routing information corresponding to the memory is set to be available when the screen is off. In this way, the routing function corresponding to the routing information corresponding to the memory is available when the screen is off. Then, when the screen is off, when the mobile terminal receives the read and write signal for the card information of the NFC card, it can still respond to the read and write signal of the card information of the NFC card, thereby realizing the card emulation function of the NFC card stored in the memory when the screen is off.

[0062] In addition, when the mobile terminal is turned off, since the eSE is usually available when the mobile terminal is turned off, the card information of the NFC card stored in the eSE can respond to the read and write signals of the NFC card card information. However, for the memory other than the eSE, the NFC card stored in the memory other than the eSE of the mobile terminal cannot be used when the mobile terminal is turned off. In order to prevent such cards from being unable to realize the card emulation function when the mobile terminal is turned off, in an optional embodiment, the above method may further include:

[0063] Before executing the shutdown function of the mobile terminal, if it is determined that the NFC card is an activated card and the storage location of the NFC card information is the memory, the card information of the NFC card is moved from the memory to the eSE of the NFC chip of the mobile terminal.

[0064] It should be noted that the above-mentioned shutdown function of the mobile terminal can be a shutdown function triggered by receiving a shutdown command, or it can be a shutdown function of the mobile terminal triggered by detecting the power level in the mobile terminal when the detected power level is lower than a preset threshold. Here, the embodiment of the present application does not make specific limitations on this.

[0065] Here, before the mobile terminal executes the shutdown function, the NFC card is activated and the card information of the NFC card is stored in a memory other than eSE. The card information of the NFC card is moved from the memory to eSE. In this way, after the shutdown, the card information of the NFC card is stored in eSE, and eSE is available when the phone is shut down. Therefore, the activated card is still available when the phone is shut down by moving it before shutdown. In this way, the use of the activated NFC card is not affected when the phone is shut down.

[0066] Furthermore, in addition to storing the card information of the NFC card in a memory other than the eSE, the card data of the NFC card may also be stored in a memory other than the eSE. In an optional embodiment, the method may further include:

[0067] Select a storage location for the NFC card data from the eSE of the mobile terminal and a memory other than the eSE;

[0068] Determine the routing information corresponding to the storage location of the card data of the NFC card as the routing information of the card data of the NFC card;

[0069] The storage location of the NFC card's card data and the routing information of the NFC card are added to the configuration information of the NFC card.

[0070] It can be understood that the storage location of the NFC card's card data is selected from the eSE and the memory outside the eSE, and the routing information corresponding to the storage location is determined as the routing information of the NFC card's card data, wherein the card data is the data generated in response to the read and write signals of the NFC card's card information; the storage location of the NFC card's card data and the routing information of the NFC card are added to the configuration information of the NFC card. In this way, the configuration information of the NFC card not only includes the storage location and routing information of the NFC card's card information, but also includes the storage location and routing information of the NFC card's card data.

[0071] In this way, the card information and card data of the NFC card can be stored not only in the eSE, but also in a memory outside the eSE.

[0072] Furthermore, in order to ensure the security of the card data of the NFC card, in an optional embodiment, selecting a storage location of the card data of the NFC card from the eSE and the memory includes:

[0073] Determine the security index of the card data of the NFC card;

[0074] According to the security index of the card data of the NFC card, a storage location of the card data of the NFC card is selected from the eSE and the memory.

[0075] That is to say, the above-mentioned determination of the security index of the card data of the NFC card and the selection of the storage location of the card data of the NFC card from the eSE and the memory according to the security index of the card data of the NFC card are similar to the method of determining the security index of the card information of the NFC card and the selection of the storage location of the card information of the NFC card from the eSE and the memory according to the security index of the card information of the NFC card, and are not repeated here.

[0076] Considering the security of the card data stored in the memory outside the eSE, in an optional embodiment, the above method may further include:

[0077] When the storage location of the card data generated in response to the read / write signal of the card information of the NFC card is a memory, encrypting the card identifier of the NFC card to obtain an encrypted card identifier;

[0078] The mapping relationship between the encrypted card identification and the generated card data is stored in the storage location of the generated card data.

[0079] It can be understood that when the storage location of the card data generated in response to the read and write signals of the card information of the NFC card is a memory other than the eSE, that is, for the card data stored in the memory other than the eSE, the card identifier of the NFC card can be encrypted to obtain the encrypted card identifier, and then a mapping relationship is formed between the encrypted card identifier and the card data, and the mapping relationship is stored in the memory.

[0080] In this way, important card data stored in the memory is prevented from being stolen and affecting the security of the corresponding NFC card.

[0081] The following examples are used to describe the NFC card reading and writing method in one or more of the above embodiments.

[0082] Figure 2 A schematic diagram of the structure of an optional mobile terminal example provided in an embodiment of the present application, such as Figure 2As shown, the mobile terminal may include: a battery 21, a low dropout regulator (Low Dropout Regulator, LDO) 22, a processor 23, a main memory Flash 24 and an NFC chip 25, wherein the NFC chip 25 includes an eSE 251.

[0083] Based on the above structure, taking a mobile phone as an example, this example proposes a method for dynamically managing NFC card storage to alleviate the storage shortage problem. The details are as follows:

[0084] For NFC cards, card information is divided into different security levels (equivalent to the above-mentioned security index), which may include: high security level and low security level. For example, bank cards, access cards, digital car keys and digital ID cards are high security levels, while bus cards and elevator cards are low security levels. Card data is also divided into high security levels and low security levels. For example, for bank cards, the card balance in the card data is a high security level, while the card transaction record is a low security level.

[0085] In this example, the card information and card data of a high security level are stored in the eSE of the NFC chip 25, while the card information and card data of a low security level are stored in the main memory Flash 24 in the mobile terminal.

[0086] Taking a mobile phone using the Android system as an example, according to the NFC card simulation architecture, when NFC is started, the card simulation route needs to be set. For example, when the card information is stored in the main memory Flash24 of the mobile terminal, the card simulation route needs to be set to HCE; when the card information is stored in eSE, the card simulation route needs to be set to eSE.

[0087] The following is an example of a partial log screenshot when NFC is turned on. Figure 3 This is a partial log screenshot of an optional NFC enabled device provided in the embodiment of the present application, such as Figure 3 As shown, Figure 3 Some cards have Route: 00, and some have Route: C0. Route 00 means the card simulates routing as HCE, and Route C0 means the card simulates routing as eSE.

[0088] Here, the low-security card information is stored in the phone's main memory Flash 24, and during the NFC activation process, this type of card information is routed to the HCE. When a user activates this type of low-security NFC card for the first time, the card information is automatically stored in the phone's main memory Flash 24.

[0089] It should be noted that in the default Android settings, HCE only works when the phone's screen is on. That is, when the phone's screen is on, you can use the card information in the HCE router to swipe the card. However, when the phone's screen is off or turned off, the card information in the HCE router cannot be used. Therefore, you need to change the Android default settings and enable the off-screen swiping function in the HCE router. That is, set bits pos 3 and pos 5 below to 1.

[0090] #bit pos 0=Switch On

[0091] #bit pos 1=Switch Off

[0092] #bit pos 2=Battery Off

[0093] #bit pos 3=Screen off unlock

[0094] #bit pos 4=Screen On lock

[0095] #bit pos 5=Screen Off lock

[0096] Among them, setting the above bit pos 3 and bit pos 5 to 1 indicates that the HCE routing function is available when the screen is unlocked (Screen off unlock) and the HCE routing function is available when the screen is locked (Screen Off lock).

[0097] It should be noted that when the phone is turned off, the eSE inside the NFC chip can still be powered by the phone's battery. Therefore, the highly secure card information stored in the eSE can still be used for card swiping. However, when the phone is turned off, the phone's main memory Flash is out of power, and the card information stored there is inoperative. To enable NFC card swiping in the off scenario, the card to be swiped must be moved to the eSE in advance.

[0098] In order to make the activated NFC card stored in the memory outside the eSE available when the device is turned off, Figure 4 To explain the reading and writing methods of the above NFC card, Figure 4 The flowchart of an example of an optional NFC card reading and writing method provided in the embodiment of the present application is as follows: Figure 4 As shown, the NFC card reading and writing method may include:

[0099] S401: Power detection;

[0100] S402: Determine whether the power level is lower than the threshold. If yes, execute S404; if no, execute S401.

[0101] S403: Manually shut down the device and execute S404;

[0102] Among them, the following two scenarios are considered: one is that the user manually turns off the mobile phone, which is equivalent to the manual shutdown in S403, that is, the user issues a shutdown operation, and the mobile phone executes S403 manual shutdown; the other is that the mobile phone automatically shuts down due to low battery, which is equivalent to S401 and S402. First, the battery level of the mobile phone is detected, and then it is determined whether the detected battery level is lower than the preset threshold. If it is lower, S404 is executed, otherwise, S401 is executed and the battery level detection continues.

[0103] S404: Determine whether the currently activated card has a low security level. If yes, execute S405; if no, execute S406;

[0104] S405: Migrate the card information from the mobile phone main memory Flash to the eSE;

[0105] S406: Shut down.

[0106] Understandably, before shutting down the device, a step is added to determine the currently activated card in the e-wallet (although there are usually multiple NFC cards in the e-wallet, only the selected NFC card is activated, and the other NFC cards are in deactivated state. When swiping the card, only the activated card can be swiped). If the currently activated card is a high-security NFC card, it means that the NFC card has been stored in the eSE, and there is no need for additional relocation. The normal shutdown process can be followed.

[0107] If the currently activated card is an NFC card with a low security level, it means that the NFC card is not stored in the eSE. During the shutdown process, an NFC card information migration process is added to migrate the card information from the phone's main memory Flash to the eSE, and then the shutdown process is executed.

[0108] In addition, after the phone is turned on, the card information previously moved to eSE is moved back to the phone's main memory.

[0109] In this example, the problem of insufficient eSE storage capacity in the NFC chip is solved by dynamically managing NFC cards. At the same time, card swiping operations in screen-off and power-off scenarios are taken into account without reducing the user experience.

[0110] It should be noted that the card information of the above-mentioned high-security NFC card is stored in eSE, but its transaction record data is stored in the mobile phone's main memory Flash as low-security data. For security reasons, the association between the card information and transaction records of this NFC card should not be directly mapped through the card ID. The mapping and association can be achieved by generating a random code, or the card ID of the NFC card can be encrypted and then mapped and associated with the transaction record.

[0111] An embodiment of the present application provides a method for reading and writing an NFC card, which is applied to a mobile terminal, wherein the NFC card is a card recorded by the mobile terminal through NFC, comprising: when a read / write signal for the card information of the NFC card is received, obtaining configuration information of the NFC card, and responding to the read / write signal of the card information of the NFC card based on the configuration information of the NFC card, wherein the security index of the storage location of the card information of the NFC card in the configuration information of the NFC card is positively correlated with the security index of the NFC card; that is, in an embodiment of the present application, the security index of the NFC card is positively correlated with the security index of the storage location of the card information of the NFC card to configure the configuration information of the NFC card, and responding to the read / write signal of the card information of the received NFC card based on the configured NFC card configuration information, so that NFC cards with higher security indexes are stored in storage locations with higher security indexes, thereby avoiding security issues caused by random configuration of the configuration information of the NFC card, thereby improving the security of the NFC card.

[0112] Based on the same inventive concept as the above embodiments, the embodiments of the present application provide a mobile terminal, which is used to read and write NFC cards. The NFC card is a card that is recorded by the mobile terminal through NFC. Figure 5 A schematic diagram of the structure of an optional mobile terminal provided in an embodiment of the present application is shown as follows: Figure 5 As shown, the mobile terminal includes:

[0113] The acquisition module 51 is configured to acquire configuration information of the NFC card upon receiving a read / write signal for the card information of the NFC card;

[0114] A response module 52 is configured to respond to a read / write signal of the NFC card's card information based on the configuration information of the NFC card;

[0115] The security index of the storage location of the NFC card information in the configuration information of the NFC card is positively correlated with the security index of the NFC card.

[0116] In an optional embodiment, the mobile terminal is further configured to:

[0117] Determine the security index of the card information of the NFC card;

[0118] Selecting a storage location for the NFC card information from the eSE of the mobile terminal and a memory other than the eSE according to a security index of the NFC card information;

[0119] Determine the routing information corresponding to the storage location of the NFC card information as the routing information of the NFC card;

[0120] The configuration information of the NFC card is formed by utilizing the storage location of the card information of the NFC card and the routing information of the NFC card.

[0121] In an optional embodiment, the mobile terminal determines the security index of the card information of the NFC card, including:

[0122] Based on a preset mapping relationship between NFC cards and security indices, the security index of the card information of the NFC card is determined.

[0123] In an optional embodiment, the mobile terminal determines the security index of the card information of the NFC card, including:

[0124] When the NFC configuration interface displays an option for the security index of the card information of the NFC card, in response to a selection operation of the option for the security index of the card information of the NFC card, the security index of the card information of the NFC card is determined.

[0125] In an optional embodiment, when the security index of the card information of the NFC card includes a high level and a low level, the mobile terminal selects, based on the security index of the card information of the NFC card, a storage location of the card information of the NFC card from the eSE and a memory other than the eSE of the mobile terminal, including:

[0126] When the security index of the card information of the NFC card is a high level, determining that the storage location of the card information of the NFC card is eSE;

[0127] When the security index of the card information of the NFC card is a low level, the storage location of the card information of the NFC card is determined to be a memory.

[0128] In an optional embodiment, the mobile terminal is further configured to:

[0129] When the storage location of the card information of the NFC card is the memory, the routing function corresponding to the routing information corresponding to the memory of the mobile terminal is set to be available when the screen is turned off.

[0130] In an optional embodiment, the mobile terminal is further configured to:

[0131] Before executing the shutdown function of the mobile terminal, if it is determined that the NFC card is an activated card and the storage location of the card information of the NFC card is the memory, the card information of the NFC card is moved from the memory to the mobile terminal eSE.

[0132] In an optional embodiment, the mobile terminal is further configured to:

[0133] Select a storage location for the NFC card data from the eSE of the mobile terminal and a memory other than the eSE;

[0134] Determine the routing information corresponding to the storage location of the card data of the NFC card as the routing information of the card data of the NFC card;

[0135] Add the storage location of the NFC card data and the routing information of the NFC card to the configuration information of the NFC card;

[0136] The card data is data generated in response to a read / write signal of the card information of the NFC card.

[0137] In an optional embodiment, the mobile terminal selects a storage location of the card data of the NFC card from the eSE and memory of the mobile terminal, including:

[0138] Determine the security index of the card data of the NFC card;

[0139] According to the security index of the chip data of the NFC card, a storage location of the card data of the NFC card is selected from the eSE and the memory.

[0140] In an optional embodiment, the mobile terminal is further configured to:

[0141] When the storage location of the card data generated in response to the read / write signal of the card information of the NFC card is a memory, encrypting the card identifier of the NFC card to obtain an encrypted card identifier;

[0142] The mapping relationship between the encrypted card identification and the generated card data is stored in the storage location of the generated card data.

[0143] In an optional embodiment, the memory includes one or more of the following: main memory, SIM card, SD card.

[0144] In practical applications, the acquisition module 51 and the response module 52 may be implemented by a processor located on the mobile terminal, specifically a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA).

[0145] Figure 6 A schematic diagram of another optional mobile terminal structure provided in an embodiment of the present application, such as Figure 6 As shown, an embodiment of the present application provides a mobile terminal 600, including:

[0146] A processor 61 and a storage medium 62 storing instructions executable by the processor 61, wherein the storage medium 62 relies on the processor 61 to perform operations through a communication bus 63. When the instructions are executed by the processor 61, the NFC card reading and writing method executed in one or more of the above embodiments is executed.

[0147] It should be noted that in actual application, the various components in the terminal are coupled together through the communication bus 63. It is understood that the communication bus 63 is used to realize the connection and communication between these components. In addition to the data bus, the communication bus 63 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 6 Various buses are labeled as communication buses 63.

[0148] An embodiment of the present application provides a computer storage medium storing executable instructions. When the executable instructions are executed by one or more processors, the processors execute the NFC card reading and writing method as described in one or more of the above embodiments, which is executed by the control device.

[0149] Among them, the computer-readable storage medium can be a magnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory (Flash Memory), a magnetic surface storage device, an optical disc, or a compact disc read-only memory (CD-ROM) and other memories.

[0150] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) containing computer-usable program code.

[0151] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0152] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0153] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0154] The above description is merely a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application.

Claims

1. A method for reading and writing an NFC card, characterized in that: The method is applied to a mobile terminal, wherein the NFC card is a card recorded by the mobile terminal via NFC, and includes: When receiving a read / write signal for the card information of the NFC card, obtaining configuration information of the NFC card; Responding to a read / write signal of the card information of the NFC card based on the configuration information of the NFC card; The security index of the storage location of the card information of the NFC card in the configuration information of the NFC card is positively correlated with the security index of the NFC card; The method further comprises: Before executing the shutdown function of the mobile terminal, when it is determined that the NFC card is an activated card and the storage location of the card information of the NFC card is a memory other than the eSE of the mobile terminal, the card information of the NFC card is moved from the memory to the eSE.

2. The method according to claim 1, characterized in that The method further comprises: Determining a security index of the card information of the NFC card; selecting, according to a security index of the card information of the NFC card, a storage location of the card information of the NFC card from an eSE of the mobile terminal and a memory other than the eSE; Determine the routing information corresponding to the storage location of the card information of the NFC card as the routing information of the NFC card; The configuration information of the NFC card is formed by using the storage location of the card information of the NFC card and the routing information of the NFC card.

3. The method according to claim 2, characterized in that The determining the security index of the card information of the NFC card includes: Based on a preset mapping relationship between NFC cards and security indices, the security index of the card information of the NFC card is determined.

4. The method according to claim 2, characterized in that The determining the security index of the card information of the NFC card includes: When the NFC configuration interface displays an option for the security index of the card information of the NFC card, in response to a selection operation of the option for the security index of the card information of the NFC card, the security index of the card information of the NFC card is determined.

5. The method according to any one of claims 2 to 4, characterized in that When the security index of the card information of the NFC card includes a high level and a low level, selecting, according to the security index of the card information of the NFC card, a storage location of the card information of the NFC card from the eSE of the mobile terminal and a memory other than the eSE, includes: When the security index of the card information of the NFC card is a high level, determining that the storage location of the card information of the NFC card is the eSE; When the security index of the card information of the NFC card is a low level, the storage location of the card information of the NFC card is determined to be the memory.

6. The method according to claim 1, wherein The method further comprises: When the storage location of the card information of the NFC card is a memory other than the eSE of the mobile terminal, the routing function corresponding to the routing information corresponding to the memory is set to be available when the mobile terminal is turned off.

7. The method according to claim 1, characterized in that The method further comprises: Selecting a storage location of the card data of the NFC card from the eSE of the mobile terminal and a memory other than the eSE; Determining routing information corresponding to the storage location of the card data of the NFC card as routing information of the card data of the NFC card; Adding the storage location of the card data of the NFC card and the routing information of the card data of the NFC card to the configuration information of the NFC card; The card data is data generated in response to a read / write signal of the card information of the NFC card.

8. The method according to claim 7, characterized in that The selecting a storage location of the card data of the NFC card from the eSE of the mobile terminal and a memory other than the eSE includes: Determining a security index of card data of the NFC card; A storage location of the card data of the NFC card is selected from the eSE and the memory according to a security index of the chip data of the NFC card.

9. The method according to claim 7, characterized in that The method further comprises: When the storage location of the card data generated in response to the read / write signal of the card information of the NFC card is the memory, encrypting the card identifier of the NFC card to obtain an encrypted card identifier; The mapping relationship between the encrypted card identification and the generated card data is stored in the storage location of the generated card data.

10. The method according to claim 2, characterized in that The memory includes one or more of the following: main memory, SIM card, SD card.

11. A mobile terminal, characterized in that: The mobile terminal is used to read and write an NFC card, and the NFC card is a card recorded by the mobile terminal via NFC, including: an acquisition module, configured to acquire configuration information of the NFC card when receiving a read / write signal for card information of the NFC card; A response module, configured to respond to a read / write signal of the card information of the NFC card based on the configuration information of the NFC card; The security index of the NFC card in the configuration information of the NFC card is positively correlated with the security index of the storage location of the card information of the NFC card; Wherein, the mobile terminal is further used for: Before executing the shutdown function of the mobile terminal, when it is determined that the NFC card is an activated card and the storage location of the card information of the NFC card is a memory other than the eSE of the mobile terminal, the card information of the NFC card is moved from the memory to the eSE.

12. A mobile terminal, characterized in that: include: A processor and a storage medium storing instructions executable by the processor, wherein the storage medium relies on the processor to perform operations through a communication bus, and when the instructions are executed by the processor, the NFC card reading and writing method according to any one of claims 1 to 10 is executed.

13. A computer storage medium, characterized in that Executable instructions are stored, and when the executable instructions are executed by one or more processors, the processors execute the NFC card reading and writing method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Method and apparatus for transmitting near field communication data

    CN106470386A