[go: up one dir, main page]

CN115022886B - NFC card reading and writing method, mobile terminal and computer storage medium - Google Patents

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

Info

Publication number
CN115022886B
CN115022886B CN202210588646.0A CN202210588646A CN115022886B CN 115022886 B CN115022886 B CN 115022886B CN 202210588646 A CN202210588646 A CN 202210588646A CN 115022886 B CN115022886 B CN 115022886B
Authority
CN
China
Prior art keywords
card
nfc
information
nfc card
mobile terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210588646.0A
Other languages
Chinese (zh)
Other versions
CN115022886A (en
Inventor
陈华星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202210588646.0A priority Critical patent/CN115022886B/en
Publication of CN115022886A publication Critical patent/CN115022886A/en
Application granted granted Critical
Publication of CN115022886B publication Critical patent/CN115022886B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/30Security of mobile devices; Security of mobile applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/009Security arrangements; Authentication; Protecting privacy or anonymity specially adapted for networks, e.g. wireless sensor networks, ad-hoc networks, RFID networks or cloud networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/30Security of mobile devices; Security of mobile applications
    • H04W12/37Managing security policies for mobile devices or for controlling mobile applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)
  • Telephone Function (AREA)

Abstract

本申请实施例公开了一种NFC卡的读写方法,该方法应用于移动终端中,该NFC卡为移动终端通过NFC录入的卡,包括:当接收到针对NFC卡的卡片信息的读写信号时,获取NFC卡的配置信息,基于NFC卡的配置信息,响应NFC卡的卡片信息的读写信号,其中,NFC卡的配置信息中NFC卡的卡片信息的存储位置的安全指数与NFC卡的安全指数正相关。本申请实施例还同时提供了一种移动终端及计算机存储介质。

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.

Description

NFC card reading and writing method, mobile terminal and computer storage medium
Technical Field
The present application relates to a technology for implementing a card simulation function by a mobile terminal having 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
Currently, when a mobile terminal with NFC functions simulates a bus card, an access control card and a bank card, card information of the NFC cards is usually stored in an embedded secure element (eSE, embedded Secure Element) inside an NFC chip of the mobile terminal, and a user can manage the NFC cards through an Application (APP) in the mobile terminal, which includes related operations such as copying the card, opening a new card, deleting the card, recharging the card, and the like.
However, as more analog cards are used in the mobile terminal, the memory space of the eSE is limited, and the security of the NFC card is threatened when the memory other than the eSE is used for storing the NFC card in the mobile terminal, so that it can be seen that the security problem exists in the NFC card in the existing mobile terminal.
Disclosure of Invention
The embodiment of the application provides a read-write method of an NFC card, a mobile terminal and a computer storage medium, which can improve the safety of the NFC card in the mobile terminal.
The technical scheme of the application is realized as follows:
The embodiment of the application provides a read-write method of an NFC card, which is applied to a mobile terminal, wherein the NFC card is a card input by the mobile terminal through NFC and comprises the following steps:
Acquiring configuration information of the NFC card when receiving a read-write signal aiming at card information of the NFC card;
Responding to read-write signals of card information of the NFC card based on configuration information of the NFC card;
The security index of the storage position 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 embodiment of the application provides a mobile terminal, which is used for reading and writing an NFC card, wherein the NFC card is a card input by the mobile terminal through NFC and comprises the following components:
the acquisition module is used for acquiring the configuration information of the NFC card when receiving a read-write signal aiming at the card information of the NFC card;
The response module is used for responding to read-write signals of card information of the NFC card based on the configuration information of the NFC card;
The security index of the storage position 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.
An embodiment of the present application provides a mobile terminal, including:
A processor and a storage medium storing instructions executable by the processor, the storage medium performing operations in dependence on the processor through a communication bus, when the instructions are executed by the processor, the method for reading and writing an NFC card described in one or more embodiments above is performed.
Embodiments of the present application provide a computer storage medium storing executable instructions that, when executed by one or more processors, perform a method for reading and writing an NFC card according to one or more embodiments.
The embodiment of the application provides a read-write method of an NFC card, a mobile terminal and a computer storage medium, wherein the method is applied to the mobile terminal, the NFC card is a card input by the mobile terminal through NFC, and comprises the steps of acquiring configuration information of the NFC card when a read-write signal of card information of the NFC card is received, 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 a storage position 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, the configuration information of the NFC card is configured by positively correlated with the security index of the storage position of the card information of the NFC card, and the received read-write signal of the card information of the NFC card is responded based on the configuration information of the NFC card, so that the NFC card with higher security index is stored to the storage position with higher security index, thereby avoiding the security problem caused by randomly configuring the configuration information of the NFC card, and further improving the security of the NFC card.
Drawings
Fig. 1 is a schematic flow chart of an alternative method for reading and writing an NFC card according to an embodiment of the present application;
Fig. 2 is a schematic structural diagram of an example of an alternative mobile terminal according to an embodiment of the present application;
fig. 3 is a partial Log screenshot when an optional NFC is turned on according to an embodiment of the present application;
Fig. 4 is a flowchart illustrating an example of an optional method for reading and writing an NFC card according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an alternative mobile terminal according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another alternative mobile terminal according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.
The embodiment of the application provides a read-write method of an NFC card, which is applied to a mobile terminal, wherein the NFC card is a card recorded by the mobile terminal through NFC, and FIG. 1 is a schematic flow chart of an alternative read-write method of the NFC card, as shown in FIG. 1, the read-write method of the NFC card can comprise the following steps:
s101, when a read-write signal of card information aiming at an NFC card is received, acquiring configuration information of the NFC card;
At present, when the mobile terminal utilizes NFC to realize a card simulation function, card information of the NFC card is usually stored in an eSE and a main memory, however, when the NFC card is stored by using a memory other than the eSE in the mobile terminal, the security of the NFC card is threatened, so that the security problem of the NFC card exists.
In order to improve the security of the NFC card, when the configuration information of the NFC card is configured, 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, the storage location of the card information of the NFC card 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 as the storage location with a high security index, such as eSE, the storage location of the card information of the NFC card with a low security index is determined as the 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, such as eSE, and the routing information corresponding to the memory is Host-based card simulation (Host-based Card Emulation, HCE), that is, the card information of the NFC card is stored to the storage location corresponding to the security index positively correlated with the security index of the card information.
It should be noted that, the configuration information of the NFC card may include a storage location of card information of the NFC card, routing information of card information of the NFC card, a storage location of card data of the NFC card and routing information of card data of the NFC card, where, because each storage location corresponds to the routing information, the storage location of card information of the NFC card corresponds to the routing information of card information of the NFC card, and the storage location of card data of the NFC card corresponds to the routing information of card data of the NFC card.
The memory other than the eSE may be an internal memory of the mobile terminal or an external memory of the mobile terminal, which is not particularly limited in the embodiment of the present application.
In an alternative embodiment, the memory of the mobile terminal includes one or more of the following:
main memory, subscriber identity Module (Subscriber Identity Module, SIM) card, SD Secure digital card (Secure DIGITAL CARD, SD) card.
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 the SIM card inserted into the mobile terminal, the routing information corresponding to the memory is SIM, and when the memory is the SD card of the mobile terminal, the routing information corresponding to the memory is SD.
The memory may be one or more of a main memory, a SIM card and an SD card, which is not particularly limited in this embodiment of the present application.
In addition, since the mobile terminal has the routing information corresponding to each storage location, 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.
S102, responding to read-write signals of card information of the NFC card based on configuration information of the NFC card.
That is, after the storage location of the card information of the NFC card and the routing information of the card information of the NFC card are acquired, the read/write signal of the card information of the NFC card may be responded based on the storage location of the card information of the NFC card and the routing information of the card information of the NFC card.
When the mobile terminal receives the read-write signal of the card information of the access card, the memory of the card information of the access card is obtained from the configuration information of the NFC card, wherein the memory is a memory except for the main eSE, the route information of the card information of the access card is HCE, and the read-write signal of the card information of the access card is responded based on the main memory and the HCE, so that the card simulation of the access card is realized.
In this way, the card information of the NFC card is stored to the storage position corresponding to the security index positively correlated to the security index of the card information by utilizing the preset configuration information of the NFC card, so that the NFC card with higher security index can store the card information to the storage position with higher security index, and the security of the NFC card is improved.
In order to obtain the configuration information of the NFC card, the developer may be configured according to 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 may be configured according to positive correlation between 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, where the embodiment of the present application is not limited specifically.
Further, in order to improve the security of the NFC card, in an alternative embodiment, the method further includes:
determining a security index of card information of the NFC card;
and selecting the storage position of the card information of the NFC card from the memory except the eSE and the eSE of the mobile terminal according to the security index of the card information of the NFC card.
Here, the security index of the card information of the NFC card is determined first, that is, the security index of the NFC card is determined according to the security of the NFC card to the user, so as to obtain the security index of the card information of the NFC card, where in determining the security index of the card information of the NFC card, the security index of the card information of the NFC card may be determined according to the confidentiality requirement of the user on the NFC card, and for example, when the security index is classified into a high level and a low level, the security indexes of the bank card, the access card, the digital car key, and the digital identification card may be determined as a high level, and the security indexes of the bus card and the elevator card may be determined as a low level.
In determining the security index of the card information of the NFC card, the security index may be determined in a preset manner by a developer, may be determined based on a preset mapping relationship, may be determined by a preset rule, and may be determined in an interface interaction manner, where the embodiment of the present application is not limited in particular.
After determining the security index of the card information of the NFC card, the storage location of the card information of the NFC card may be selected from the eSE and the memory according to the security index of the card information of the NFC card, that is, according to the characteristic that the security index of the card information of the NFC card is positively correlated with the security index of the storage location of the card information of the NFC card, whether to store the card information of the NFC card to the eSE with a high security index or to the memory with a low security index is determined, so as to ensure the security of the NFC card.
For determining based on the preset mapping relationship, in an alternative embodiment, determining the security index of the card information of the NFC card includes:
And determining the security index of card information of the NFC card based on a preset mapping relation between the NFC card and the security index.
It can be understood that, a mapping relationship between the NFC card and the security index is stored in the electronic device in advance, for example, the security index corresponding to the bank card is high level, and the security index corresponding to the bus card is low level, so that the security index of the NFC card can be determined based on the mapping relationship, and then the storage position can be determined for the card information of the NFC card according to the security index of the NFC card.
In determining the security index of the card information of the NFC card by adopting the interface interaction manner, in an alternative embodiment, determining the security index of the card information of the NFC card includes:
When the configuration interface of the NFC displays the option of the security index of the card information of the NFC card, the security index of the card information of the NFC card is determined in response to the selection operation of the option of the security index of the card information of the NFC card.
It may be appreciated that the configuration interface of NFC is provided in the mobile terminal, where the configuration interface displays options of the security index of the card information of the NFC card, where the options of the security index may include, for example, a high level and a low level, and when the configuration interface of NFC card is displayed on the mobile terminal, the user sends a selection operation of the options of the security index of the card information of the NFC card to the configuration interface, and the mobile terminal determines the security index of the card information of the NFC card in response to the selection operation.
In an exemplary embodiment, the user sends an operation of selecting the option with the high security index to the mobile terminal, so that the mobile terminal receives the operation of selecting the security index of the card information of the NFC card, determines that the security index of the card information of the NFC card is high, and further selects a storage location from the eSE and the memory for the NFC card with the high security index as the eSE.
Therefore, the security index of the NFC card is determined by utilizing interface interaction, so that a user can determine the security index of the card information of the NFC card according to the self requirement by utilizing the interface, the storage position of the card information of the NFC card can be flexibly determined according to the security index set by the user, and the security of the NFC card is improved.
Further, in order to improve the security of the NFC card, in an alternative embodiment, 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 and the memory, includes:
When the security index of the card information of the NFC card is high-grade, determining the storage position of the card information of the NFC card as eSE;
And when the security index of the card information of the NFC card is low, determining the storage position of the card information of the NFC card as a memory.
As can be appreciated, since the eSE is of a high security index and is not easily broken or hacked, the storage location of the card information of the NFC card of a high security index is determined as the eSE, and the storage location of the card information of the NFC card of a low security index is determined as a memory other than the eSE.
In some designs of the operating system, the NFC card stored in the memory other than the eSE may only work in a scene of the mobile terminal lighting up, when the mobile terminal is off, the card simulation function of the NFC card stored in the memory other than the eSE cannot be implemented, so that, in order to enable the NFC card stored in the memory other than the eSE in the mobile terminal to still implement the card simulation function when the NFC card is off, in an alternative embodiment, the method may further include:
when the storage position of the card information of the NFC card is a memory, setting a routing function corresponding to the routing information corresponding to the memory under the screen extinction of the mobile terminal to be available.
It can be understood that when the storage position of the card information for 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 under the screen-off condition of the mobile terminal, so that the routing function corresponding to the routing information corresponding to the memory is available under the screen-off condition, and when the mobile terminal receives the read-write signal of the card information for the NFC card during the screen-off condition, the mobile terminal can still respond to the read-write signal of the card information of the NFC card, thereby realizing the card simulation function of the NFC card stored in the memory under the screen-off condition.
In addition, since the eSE is generally available when the mobile terminal is powered off, the card information of the NFC card stored on the eSE is responsive to the read/write signal of the card information of the NFC card, and 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 powered off, in order to prevent such card from failing to implement the card emulation function when the mobile terminal is powered off, in an alternative embodiment, the method may further include:
And before the shutdown function of the mobile terminal is executed, determining that the NFC card is an activated card and the storage position of the card information of the NFC card is a memory, and moving the card information of the NFC card from the memory to the eSE of the NFC chip of the mobile terminal.
It should be noted that, the above-mentioned executing the shutdown function of the mobile terminal may be the shutdown function triggered by receiving the shutdown instruction, or may be the shutdown function of the mobile terminal triggered by detecting the electric quantity in the mobile terminal when the detected electric quantity is lower than a preset threshold, which is not limited in particular in the embodiment of the present application.
Here, before the mobile terminal executes the shutdown function, the card information of the NFC card is an activated card, and the card information of the NFC card is stored in a memory other than the eSE, and the card information of the NFC card is moved from the memory to the eSE, so that after shutdown, the card information of the NFC card is stored to the eSE, and the eSE is available under the shutdown condition, so that the card that has been activated is still available under the shutdown condition in a manner of being moved before the shutdown, and thus, the use of the activated NFC card is not affected under the shutdown condition.
Further, in addition to storing the card information of the NFC card into a memory other than the eSE, the card data of the NFC card may also be stored in a memory other than the eSE, and in an alternative embodiment, the method may further include:
selecting a storage position of card data of the NFC card from the eSE and a memory except the eSE of the mobile terminal;
Determining routing information corresponding to a storage position of card data of the NFC card as the routing information of the card data of the NFC card;
and adding the storage position of the card data of the NFC card and the routing information of the NFC card into the configuration information of the NFC card.
It can be understood that the memory location of the card data of the NFC card is selected from the memory other than the eSE and the eSE, the routing information corresponding to the memory location is determined as the routing information of the card data of the NFC card, wherein the card data is generated when responding to the read-write signal of the card information of the NFC card, and the memory location of the card data of the NFC card and the routing information of the NFC card are added to the configuration information of the NFC card, so that the configuration information of the NFC card not only includes the memory location and the routing information of the card information of the NFC card, but also includes the memory location and the routing information of the card data of the NFC card.
In this way, both the card information and the card data of the NFC card can be stored not only in the eSE but also in a memory other than the eSE.
Further, in order to ensure the security of the card data of the NFC card, in an alternative embodiment, selecting a storage location of the card data of the NFC card from the eSE and the memory includes:
Determining a security index of card data of the NFC card;
and selecting the storage position 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.
That is, the above-mentioned method for determining the security index of the card data of the NFC card is similar to the method for determining the security index of the card information of the NFC card from the eSE and the memory according to the security index of the card data of the NFC card, and selecting 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 is not described here again.
For security reasons for card data stored in a memory external to the eSE, in an alternative embodiment, the method may further comprise:
When the storage position of the card data generated when the read-write signal of the card information of the NFC card is responded is a memory, encrypting the card identifier of the NFC card to obtain an encrypted card identifier;
And storing the mapping relation between the encrypted card identifier and the generated card data to a storage position of the generated card data.
It can be understood that, 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 other than the eSE, that is, the card identifier of the NFC card may be encrypted with respect to the card data stored in the memory other than the eSE, so as to obtain an encrypted card identifier, and then the encrypted card identifier and the card data form a mapping relationship, and the mapping relationship is stored in the memory.
In this way, important card data stored in the memory is prevented from being stolen to affect the security of the corresponding NFC card.
The following describes, by way of example, a method for reading and writing an NFC card in one or more embodiments described above.
Fig. 2 is a schematic structural diagram of an example of an alternative mobile terminal according to an embodiment of the present application, and as shown in fig. 2, the mobile terminal may include a battery 21, a low dropout regulator (Low Dropout Regulator, LDO) 22, a processor 23, a main memory Flash24, and an NFC chip 25, where the NFC chip 25 includes an eSE251.
Based on the above structure, taking the mobile terminal as an example of a mobile phone, a method for dynamically managing storage of an NFC card is provided in this example, so as to alleviate the problem of storage tension. The method comprises the following steps:
For the NFC card, the card information distinguishes between different security levels (corresponding to the above-mentioned security index), which may include a high security level and a low security level, for example, a high security level for a bank card, an access card, a digital car key, and a digital identification card, a low security level for a bus card, and a low security level for an elevator card, and a high security level and a low security level for card data, for example, a high security level for a balance of a card in the card data, and a low security level for a card transaction record.
In this example, card information and card data of a high security level are stored in the eSE of the NFC chip 25, while card information and card data of a low security level are stored in the main memory Flash24 in the mobile terminal.
Taking Android system (Android) as an example, according to the simulation architecture of an NFC card, when NFC is started, a card simulation route needs to be set, for example, when card information is stored in a main memory Flash24 of a mobile terminal, the card simulation route needs to be set as an HCE, and when the card information is stored in an eSE, the card simulation route needs to be set as the eSE.
Taking a partial Log (Log) screenshot when NFC is turned on as an example, fig. 3 is an optional partial Log screenshot when NFC is turned on, as shown in fig. 3, some cards with Route (Route): 00 in fig. 3, some cards with Route: C0 in fig. 3, where Route 00 represents a card analog Route as HCE, and Route C0 represents a card analog Route as eSE.
Here, card information of a low security level is stored in the main memory Flash24 in the mobile phone, and the route of this kind of card information is set to the HCE in the NFC-on process. When a user opens such a low security NFC card for the first time, card information is automatically stored in the mobile phone main memory Flash 24.
It should be noted that, in the setting of Android default, the HCE can only work in the scene of the mobile phone with a bright screen, that is, when the mobile phone with a bright screen, the card information in the HCE route can be used to perform the card swiping action, and when the mobile phone is turned off or turned off, the card information in the HCE route cannot be used. Therefore, the default setting of Android needs to be changed, and the screen-quenching card swiping function under the HCE route is opened, namely, the following bit pos 3 and bit pos 5 are set to be 1.
#bit pos 0=Switch On
#bit pos 1=Switch Off
#bit pos 2=Battery Off
#bit pos 3=Screen off unlock
#bit pos 4=Screen On lock
#bit pos 5=Screen Off lock
The setting of the bit pos 3 and the bit pos 5 to 1 indicates that the HCE routing function is available when the Screen (Screen Off unlock) is unlocked and the HCE routing function is available when the Screen (Screen Off lock) is locked.
It should be noted that, when the mobile phone is turned off, the eSE inside the NFC chip can still be powered by the mobile phone battery, so that the card information with high security level stored in the eSE can still realize the card swiping function. However, when the mobile phone is powered off, the main memory Flash of the mobile phone is not powered on, and the card information stored in the main memory Flash cannot work, so that in order to realize the card swiping function of the NFC card in the power off scene, the card needing to be swiped needs to be moved into the eSE in advance.
In order to implement that the activated NFC card stored in the memory other than the eSE is available in the power-off condition, the method for reading and writing the NFC card described above is described with reference to fig. 4, and fig. 4 is a schematic flow chart of an example of an alternative method for reading and writing the NFC card according to an embodiment of the present application, and as shown in fig. 4, the method for reading and writing the NFC card may include:
S401, detecting electric quantity;
S402, judging whether the electric quantity is lower than a threshold or not, if yes, executing S404, if not, executing S401;
S403, manual shutdown is performed, and S404 is executed;
The method comprises the following two situations that firstly, a user manually shuts down a mobile phone, namely, the user sends out a shutdown operation, and the mobile phone executes S403 manual shutdown, secondly, the mobile phone automatically shuts down when the electric quantity of the mobile phone is too low, namely, the mobile phone is S401 and S402, the electric quantity of the mobile phone is detected firstly, then whether the detected electric quantity is lower than a preset threshold is judged, if the detected electric quantity is lower than the preset threshold, S404 is executed, otherwise, S401 is executed, and electric quantity detection is continued.
S404, judging whether the currently activated card is of a low security level or not, if yes, executing S405, if not, executing S406;
S405, transferring card information from a mobile phone main memory Flash to an eSE;
S406, shutting down.
It can be understood that, before the electronic wallet is powered off, a judging link of the currently activated card in the electronic wallet is added (although a plurality of NFC cards are usually arranged in the electronic wallet, only the selected NFC card is in an activated state, and other NFC cards are in a deactivated state, and only the activated card can be used for swiping the card when the card is swiped), if the currently activated card is an NFC card with a high security level, it indicates that the NFC card is already stored in the eSE, and no additional movement is needed, and the normal power off process is performed.
If the current active card is an NFC card with low security level, indicating that the NFC card is not stored in the eSE, adding a card information moving flow of the NFC card in the shutdown process, moving the card information from the Flash of the mobile phone main memory to the eSE, and then executing the shutdown flow.
In addition, after the mobile phone is started, the card information which is moved into the eSE before is moved back into the main memory of the mobile phone.
In the embodiment, the problem of insufficient storage capacity of eSE in the NFC chip is solved by dynamically managing the NFC card, and card swiping operation under the screen extinction and shutdown scenes is considered, so that user experience is not reduced.
It should be noted that, the card information of the NFC card with the high security level is stored in the eSE, but the transaction record data is stored as data with the low security level in the mobile phone main memory Flash, and for security reasons, the association between the card information of the NFC card and the transaction record is not directly mapped by the card identifier, and the mapping association can be performed by generating a random code, or the mapping association is performed by encrypting the card identifier of the NFC card and then mapping association with the transaction record.
The embodiment of the application provides a read-write method of an NFC card, which is applied to a mobile terminal, wherein the NFC card is a card which is recorded by the NFC through the mobile terminal, and comprises the steps of acquiring configuration information of the NFC card when a read-write signal of card information of the NFC card is received, 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 a storage position 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 the embodiment of the application, the configuration information of the NFC card is configured by positively correlated with the security index of the storage position of the card information of the NFC card, and the read-write signal of the card information of the NFC card is responded based on the configuration information of the NFC card which is configured, so that the NFC card with higher security index is stored to the storage position with higher security index, thereby avoiding the security problem caused by randomly configuring the configuration information of the NFC card, and further improving the security of the NFC card.
Based on the same inventive concept as the foregoing embodiments, the embodiments of the present application provide a mobile terminal, where the mobile terminal is used for reading and writing an NFC card, where the NFC card is a card that is recorded by the mobile terminal through NFC, and fig. 5 is a schematic structural diagram of an optional mobile terminal provided by the embodiments of the present application, and as shown in fig. 5, the mobile terminal includes:
An obtaining module 51, configured to obtain configuration information of the NFC card when receiving a read-write signal of card information for the NFC card;
A response module 52, configured to respond to a read-write signal of card information of the NFC card based on configuration information of the NFC card;
The security index of the storage position 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.
In an alternative embodiment, the mobile terminal is further configured to:
determining a security index of card information of the NFC card;
selecting a storage position of card information of the NFC card from the eSE and a memory except the eSE of the mobile terminal according to the security index of the card information of the NFC card;
Determining routing information corresponding to a storage position of card information of the NFC card as the routing information of the NFC card;
And forming the configuration information of the NFC card by using the storage position of the card information of the NFC card and the routing information of the NFC card.
In an alternative embodiment, the mobile terminal determines the security index of the card information of the NFC card, including:
And determining the security index of card information of the NFC card based on a preset mapping relation between the NFC card and the security index.
In an alternative embodiment, the mobile terminal determines the security index of the card information of the NFC card, including:
When the configuration interface of the NFC displays the option of the security index of the card information of the NFC card, the security index of the card information of the NFC card is determined in response to the selection operation of the option of the security index of the card information of the NFC card.
In an alternative 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, 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 a memory other than an eSE and an eSE of the mobile terminal, including:
When the security index of the card information of the NFC card is high-grade, determining the storage position of the card information of the NFC card as eSE;
And when the security index of the card information of the NFC card is low, determining the storage position of the card information of the NFC card as a memory.
In an alternative embodiment, the mobile terminal is further configured to:
when the storage position of the card information of the NFC card is a memory, setting a routing function corresponding to the routing information corresponding to the memory under the screen extinction of the mobile terminal to be available.
In an alternative embodiment, the mobile terminal is further configured to:
and before the shutdown function of the mobile terminal is executed, determining that the NFC card is an activated card and the storage position of the card information of the NFC card is a memory, and moving the card information of the NFC card from the memory to the eSE of the mobile terminal.
In an alternative embodiment, the mobile terminal is further configured to:
selecting a storage position of card data of the NFC card from the eSE and a memory except the eSE of the mobile terminal;
Determining routing information corresponding to a storage position of card data of the NFC card as the routing information of the card data of the NFC card;
Adding the storage position of card data of the NFC card and the routing information of the NFC card into the configuration information of the NFC card;
The card data is data generated when the card information of the NFC card is read-write signals.
In an alternative embodiment, the mobile terminal selects a storage location of card data of the NFC card from an eSE and a memory of the mobile terminal, and includes:
Determining a security index of card data of the NFC card;
And selecting the storage position of 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.
In an alternative embodiment, the mobile terminal is further configured to:
When the storage position of the card data generated when the read-write signal of the card information of the NFC card is responded is a memory, encrypting the card identifier of the NFC card to obtain an encrypted card identifier;
And storing the mapping relation between the encrypted card identifier and the generated card data to a storage position of the generated card data.
In an alternative embodiment, the memory includes one or more of a main memory, a SIM card, and an SD card.
In practical applications, the acquiring module 51 and the responding module 52 may be implemented by a processor located on the mobile terminal, specifically, a central Processing unit (CPU, central Processing Unit), a microprocessor (MPU, microprocessor Unit), a digital signal processor (DSP, digital Signal Processing), or a field programmable gate array (FPGA, field Programmable GATE ARRAY), etc.
Fig. 6 is a schematic structural diagram of another alternative mobile terminal according to an embodiment of the present application, and as shown in fig. 6, an embodiment of the present application provides a mobile terminal 600, including:
A processor 61 and a storage medium 62 storing instructions executable by the processor 61, the storage medium 62 performing operations in dependence on the processor 61 through a communication bus 63, when the instructions are executed by the processor 61, the read-write method of the NFC card performed in one or more embodiments described above is performed.
In practical use, the components in the terminal are coupled together via the communication bus 63. It is understood that the communication bus 63 is used to enable connected communication between these components. The communication bus 63 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration the various buses are labeled as communication bus 63 in fig. 6.
Embodiments of the present application provide a computer storage medium storing executable instructions that, when executed by one or more processors, perform a method for reading and writing an NFC card as described in one or more embodiments and executed by a control device.
The computer readable storage medium may be a magnetic random access Memory (ferromagnetic random access Memory, FRAM), read Only Memory (ROM), programmable Read Only Memory (Programmable Read-Only Memory, PROM), erasable programmable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable programmable Read Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM), flash Memory (Flash Memory), magnetic surface Memory, optical disk, or Read Only optical disk (Compact Disc Read-Only Memory, CD-ROM), etc.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the present application.

Claims (13)

1. The reading and writing method of the NFC card is characterized in that the method is applied to a mobile terminal, the NFC card is a card input by the mobile terminal through NFC, and the method comprises the following steps:
Acquiring configuration information of the NFC card when receiving a read-write signal aiming at card information of the NFC card;
Responding to read-write signals of card information of the NFC card based on configuration information of the NFC card;
Wherein, the security index of the storage position 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;
wherein the method further comprises:
And before the shutdown function of the mobile terminal is executed, determining that the NFC card is an activated card and the storage position of card information of the NFC card is a memory except for eSE of the mobile terminal, and moving the card information of the NFC card from the memory to the eSE.
2. The method according to claim 1, wherein the method further comprises:
determining a security index of card information of the NFC card;
Selecting a storage position of card information of the NFC card from an eSE of the mobile terminal and a memory except the eSE according to the security index of the card information of the NFC card;
Determining routing information corresponding to a storage position of card information of the NFC card as the routing information of the NFC card;
And forming the configuration information of the NFC card by using the storage position of the card information of the NFC card and the routing information of the NFC card.
3. The method of claim 2, wherein the determining the security index of the card information of the NFC card comprises:
And determining the security index of card information of the NFC card based on a preset mapping relation between the NFC card and the security index.
4. The method of claim 2, wherein the determining the security index of the card information of the NFC card comprises:
And when the NFC configuration interface displays options of the security index of the card information of the NFC card, determining the security index of the card information of the NFC card in response to a selected operation of the options of the security index of the card information of the NFC card.
5. The method according to any one of claims 2 to 4, wherein when the security index of the card information of the NFC card includes a high level and a low level, the 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 an 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 high-grade, determining the storage position of the card information of the NFC card as the eSE;
And when the security index of the card information of the NFC card is low-grade, determining the storage position of the card information of the NFC card as the memory.
6. The method according to claim 1, wherein the method further comprises:
when the storage position of the card information of the NFC card is a memory except for eSE of the mobile terminal, setting a routing function corresponding to the routing information corresponding to the memory to be available under the condition that the mobile terminal is turned off.
7. The method according to claim 1, wherein the method further comprises:
Selecting a storage position of card data of the NFC card from an eSE of the mobile terminal and a memory except the eSE;
Determining routing information corresponding to a storage position of card data of the NFC card as the routing information of the card data of the NFC card;
adding the storage position of the card data of the NFC card and the routing information of the card data of the NFC card into the configuration information of the NFC card;
The card data are data generated when the read-write signals of the card information of the NFC card are responded.
8. The method of claim 7, wherein selecting the memory location of the card data of the NFC card from the eSE of the mobile terminal and a memory other than the eSE comprises:
Determining a security index of card data of the NFC card;
And selecting a storage position of 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.
9. The method of claim 7, wherein the method further comprises:
When the storage position of the card data generated when the read-write signal of the card information of the NFC card is responded is the memory, encrypting the card identifier of the NFC card to obtain an encrypted card identifier;
And storing the mapping relation between the encrypted card identifier and the generated card data to a storage position of the generated card data.
10. The method of claim 2, wherein the memory comprises one or more of a main memory, a SIM card, and an SD card.
11. The mobile terminal is characterized in that the mobile terminal is used for reading and writing an NFC card, wherein the NFC card is a card input by the mobile terminal through NFC, and the mobile terminal comprises:
the acquisition module is used for acquiring the configuration information of the NFC card when receiving a read-write signal aiming at the card information of the NFC card;
The response module is used for responding to read-write signals of 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 position of the card information of the NFC card;
Wherein, the mobile terminal is further used for:
And before the shutdown function of the mobile terminal is executed, determining that the NFC card is an activated card and the storage position of card information of the NFC card is a memory except for eSE of the mobile terminal, and moving the card information of the NFC card from the memory to the eSE.
12. A mobile terminal, comprising:
A processor and a storage medium storing instructions executable by the processor, the storage medium performing operations in dependence on the processor through a communication bus, the instructions, when executed by the processor, performing the method of reading from and writing to NFC cards according to any of claims 1 to 10.
13. A computer storage medium storing executable instructions which, when executed by one or more processors, perform the method of reading from and writing to NFC cards according to any of claims 1 to 10.
CN202210588646.0A 2022-05-26 2022-05-26 NFC card reading and writing method, mobile terminal and computer storage medium Active CN115022886B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210588646.0A CN115022886B (en) 2022-05-26 2022-05-26 NFC card reading and writing method, mobile terminal and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210588646.0A CN115022886B (en) 2022-05-26 2022-05-26 NFC card reading and writing method, mobile terminal and computer storage medium

Publications (2)

Publication Number Publication Date
CN115022886A CN115022886A (en) 2022-09-06
CN115022886B true CN115022886B (en) 2025-09-23

Family

ID=83070316

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210588646.0A Active CN115022886B (en) 2022-05-26 2022-05-26 NFC card reading and writing method, mobile terminal and computer storage medium

Country Status (1)

Country Link
CN (1) CN115022886B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106470386A (en) * 2015-08-19 2017-03-01 中兴通讯股份有限公司 A kind of near-field communication data transmission method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8862767B2 (en) * 2011-09-02 2014-10-14 Ebay Inc. Secure elements broker (SEB) for application communication channel selector optimization
WO2013112839A1 (en) * 2012-01-26 2013-08-01 Digital Life Technologies Llc Portable e-wallet and universal card
WO2013130651A2 (en) * 2012-02-27 2013-09-06 Sequent Software Inc. System for storing one or more passwords in a secure element
KR101533885B1 (en) * 2013-10-15 2015-07-03 주식회사 엘지유플러스 Termial providing near field communication service and method for operating terminal
FR3040226B1 (en) * 2015-08-17 2018-06-08 Stmicroelectronics (Rousset) Sas NFC DEVICE HAVING MULTIPLE SECURE ELEMENTS
CN107423640A (en) * 2017-03-16 2017-12-01 努比亚技术有限公司 A kind of method, apparatus and terminal of wirelessly transmitting data storage
CN109426324B (en) * 2017-08-30 2021-01-29 华为技术有限公司 Power-on control method, AP chip and mobile terminal
CN111107525B (en) * 2019-04-26 2022-01-14 华为技术有限公司 Automatic routing method of SE (secure element) and electronic equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106470386A (en) * 2015-08-19 2017-03-01 中兴通讯股份有限公司 A kind of near-field communication data transmission method and device

Also Published As

Publication number Publication date
CN115022886A (en) 2022-09-06

Similar Documents

Publication Publication Date Title
US20130339166A1 (en) User-configurable activation of card applets
CN105678192B (en) A kind of key application method and application apparatus based on smart card
CN103069384A (en) Host device and method for securely booting the host device with operating system code loaded from a storage device
US11096042B2 (en) Preprocessing method and device for configuring NFC smart card
CN113570377A (en) Verification method, device and equipment
WO2016202108A1 (en) Nfc payment method, nfc payment system and mobile terminal
WO2017008415A1 (en) Apparatus and method for launching mobile applications from a lock screen
JP7686635B2 (en) SYSTEM, METHOD, AND COMPUTER-ACCESSIBLE MEDIUM FOR BLOCKING MALICIOUS EMV TRANSACTIONS - Patent application
CN106484796A (en) File management method, document management apparatus and mobile terminal
CN108875396A (en) File operation method, usim card, terminal and readable storage medium storing program for executing
US20250117776A1 (en) Smart payment card, and computing systems and methods for configuring smart payment card and processing transactions involving smart payment card
US8190813B2 (en) Terminal apparatus with restricted non-volatile storage medium
KR20190033930A (en) Electronic device for encrypting security information and method for controlling thereof
CN115022886B (en) NFC card reading and writing method, mobile terminal and computer storage medium
US20240015242A1 (en) Systems, methods, and computer-accessible mediums for repressing or turning off the read of a digital tag
JP2009245079A (en) Information terminal device and information processing method
WO2017182600A1 (en) Selecting an application on a card
KR101629740B1 (en) Apparatus and Method of Information Storage with Independent Operating System
JP2013037430A (en) Ic chip, processing method in ic chip, and processing program in ic chip
CN104134025A (en) Mobile terminal locking method and device based on SIM cards and mobile terminal
JP4734838B2 (en) Information recording medium, program, and command execution control method
CN109447629B (en) Identification card identification method, device and system and readable storage medium
US11205020B2 (en) Memory management of a security module
JP6394328B2 (en) IC card and display control method thereof
CN118427838A (en) USB storage device starting method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant