NFC card simulation method and device, chip, electronic equipment and storage medium

By using NFC chips in low-end electronic devices for near-field communication with external NFC cards, obtaining and storing non-connected parameters, and generating NFC simulated cards, the problem that low-end electronic devices cannot simulate NFC cards is solved, and the application scenarios are expanded Effect.

CN119519760APending Publication Date: 2025-02-25GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310998638.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-08
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

Low-end electronic devices cannot simulate NFC cards because there is no embedded security unit installed inside the NFC chip, resulting in the inability to support access control cards, bus cards and other functions, and the application scenarios are limited.

Method used

Near-field communication with external NFC cards is performed through the NFC chip, non-connection parameters are obtained, and stored in the host database of electronic devices to generate NFC simulation cards to realize the simulation of NFC cards.

Benefits of technology

Without relying on embedded security units, low-end electronic devices can also support access control cards, bus cards and other functions, expanding application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119519760A_ABST
    Figure CN119519760A_ABST
Patent Text Reader

Abstract

The invention discloses an NFC (near field communication) card simulation method and device, a chip, electronic equipment and a storage medium, the method is applied to the electronic equipment, and the electronic equipment comprises an NFC chip used for performing near field communication with a first NFC card outside the electronic equipment; the method comprises the following steps: acquiring a non-contact parameter of the first NFC card through near field communication between the NFC chip and the first NFC card; the non-contact parameters of the first NFC card are stored in a host database outside the NFC chip; generating a first NFC simulation card in a first application of the electronic equipment according to the non-contact parameter of the first NFC card; wherein the first NFC simulation card is a simulation card of the first NFC card.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communication technology, and more specifically, to a method and device for simulating an NFC card, a chip, an electronic device, and a storage medium. Background Art

[0002] With the continuous improvement of near field communication (NFC) technology, when simulating NFC cards such as bus cards and access cards, electronic devices with NFC functions usually store the card information of these NFC cards in the embedded secure element (ESE) inside the NFC chip of the electronic device to protect data security. However, there are still some low-end electronic devices whose NFC chips do not have an embedded secure element, resulting in the electronic device not having the NFC card simulation function, so that the electronic device cannot support functions such as access cards and bus cards, and there is a problem of limited application scenarios of electronic devices. Summary of the invention

[0003] The embodiments of the present application provide a method and device for simulating an NFC card, a chip, an electronic device, and a storage medium. The various aspects involved in the embodiments of the present application are introduced below.

[0004] In a first aspect, a method for simulating an NFC card is provided, the method being applied to an electronic device, the electronic device comprising: an NFC chip for performing near field communication with a first NFC card outside the electronic device; the method comprising: obtaining contactless parameters of the first NFC card through near field communication between the NFC chip and the first NFC card; storing the contactless parameters of the first NFC card in a host database of the electronic device; generating a first NFC simulation card in a first application of the electronic device according to the contactless parameters of the first NFC card; wherein the first NFC simulation card is a simulation card of the first NFC card.

[0005] In a second aspect, a simulation device for an NFC card is provided, the device being applied to an electronic device, the electronic device comprising: an NFC chip, for performing near field communication with a first NFC card outside the electronic device; the device comprising: an acquisition module, for acquiring contactless parameters of the first NFC card through near field communication between the NFC chip and the first NFC card; a storage module, for storing the contactless parameters of the first NFC card in a host database of the electronic device; a generation module, for generating a first NFC simulation card in a first application of the electronic device according to the contactless parameters of the first NFC card; wherein the first NFC simulation card is a simulation card of the first NFC card.

[0006] In a third aspect, a chip is provided, comprising: a processor, configured to call and run a computer program from a memory, so that a device equipped with the chip executes the method described in the first aspect.

[0007] In a fourth aspect, an electronic device is provided, comprising a processor, a memory and a transceiver, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to control the electronic device to execute the method described in the first aspect.

[0008] According to a fifth aspect, a computer-readable storage medium is provided, on which executable code is stored. When the executable code is executed, the method described in the first aspect can be implemented.

[0009] The embodiment of the present application provides a simulation method of an NFC card, which is applied to an electronic device, wherein the electronic device includes: an NFC chip for performing near field communication with a first NFC card outside the electronic device; the method includes: obtaining the contactless parameters of the first NFC card through near field communication between the NFC chip and the first NFC card; storing the contactless parameters of the first NFC card in a host database of the electronic device; generating a first NFC simulation card in a first application of the electronic device according to the contactless parameters of the first NFC card; wherein the first NFC simulation card is a simulation card of the first NFC card. Compared with the traditional solution that relies on the ESE chip to store NFC card information, this solution does not rely on the ESE chip during the NFC card simulation process, but stores the contactless parameters of the first NFC card in the host database of the electronic device to realize NFC card simulation. In this way, even low-end electronic devices (such as electronic devices including NFC chips but not including ESE chips) can support functions such as access control cards and bus cards, thereby helping to improve the application scenarios of electronic devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is a schematic diagram of an application scenario of an NFC simulation card in the related art.

[0011] Figure 2 It is a flowchart of a method for simulating an NFC card provided in an embodiment of the present application.

[0012] Figure 3 It is a flowchart of a method for simulating an NFC card provided in another embodiment of the present application.

[0013] Figure 4 It is a structural diagram of a wallet application including multiple NFC simulated cards provided in an embodiment of the present application.

[0014] Figure 5It is a flowchart of a method for switching an NFC simulated card provided in an embodiment of the present application.

[0015] Figure 6 It is a flowchart of an application switching method provided in an embodiment of the present application.

[0016] Figure 7 It is a structural schematic diagram of an NFC card simulation device provided in an embodiment of the present application.

[0017] Figure 8 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0018] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0019] Near Field Communication (NFC), also known as Near Field Communication (NFC), is a high-frequency wireless communication technology used to achieve contactless data transmission between devices. With the continuous improvement of NFC technology, the application of NFC technology in electronic devices has become popular. When NFC-enabled electronic devices simulate NFC cards such as bus cards and access control cards, they usually store the card information of these NFC cards in the embedded security unit inside the NFC chip of the electronic device to protect data security. Figure 1 The application scenarios of NFC simulation cards in related technologies are explained.

[0020] Figure 1 It is an application scenario diagram of near field communication interaction based on NFC card in related technology, such as Figure 1 As shown, it includes an electronic device 110 and a card reader 120. An NFC chip 111 may be provided in the electronic device 110, and an embedded security unit 112 may be provided inside the NFC chip 111. When the electronic device 110 simulates a bus card, an access card and a bank card, the card information of these NFC cards is usually stored in the embedded security unit 112. Then, the corresponding NFC simulation card can be generated in the application (application, APP) of the electronic device 110. Of course, the electronic device 110 can manage these NFC cards through this application, including related operations such as simulating cards and deleting simulated cards. Then, the embedded security unit 112 in the electronic device 110 can perform near-field data interaction with the card reader 120 through the NFC chip 111, so that the electronic device 110 can be used to implement functions such as access cards and bus cards.

[0021] It should be understood that an NFC card swiping system can be set in the card reader device 120, so that the card reader device 120 can realize near-field communication interaction with the electronic device 110 with an NFC simulated card based on the NFC card swiping system. The NFC card swiping system set in the card reader device 120 can be a public transportation system, a payment system, an access control system, etc. This application does not limit the specific NFC card swiping system in the card reader device 120.

[0022] However, there are still some low-end electronic devices whose NFC chips do not have an embedded security unit, resulting in the electronic devices not having the NFC card emulation function, and thus making the electronic devices unable to support functions such as access control cards and bus cards. As a result, the application scenarios of electronic devices that include NFC chips but do not include ESE chips are limited.

[0023] In order to solve the above problems, the embodiment of the present application provides a simulation method of an NFC card, which is applied to an electronic device, and the electronic device includes: an NFC chip for performing near-field communication with a first NFC card outside the electronic device; the method includes: obtaining the contactless parameters of the first NFC card through near-field communication between the NFC chip and the first NFC card; storing the contactless parameters of the first NFC card in the host database of the electronic device; generating a first NFC simulation card in the first application of the electronic device according to the contactless parameters of the first NFC card; wherein the first NFC simulation card is a simulation card of the first NFC card. Compared with the traditional solution that relies on the ESE chip to store NFC card information, this solution does not rely on the ESE chip during the NFC card simulation process, but stores the contactless parameters of the first NFC card in the host database of the electronic device to realize NFC card simulation. In this way, even low-end electronic devices (such as electronic devices including NFC chips but not including ESE chips) can support functions such as access control cards and bus cards, thereby helping to improve the application scenarios of electronic devices.

[0024] It should be noted that the electronic device in the embodiments of the present application may refer to a mobile electronic device including an NFC chip but not including an ESE chip. The electronic device may be, for example, a mobile phone, a tablet computer, a PDA, a mobile internet device (MID), a wearable device, etc., and the present application does not make any specific restrictions on this.

[0025] It should be understood that the NFC card simulation method in the embodiment of the present application can also be applied to a portable electronic device including an NFC chip and an ESE chip, thereby expanding the storage space of the card information of the NFC card and avoiding the problem that the storage space of the ESE chip is limited and the NFC card simulation cannot be performed.

[0026] Combined with the following Figure 2 The simulation method of the NFC card in the embodiment of the present application is described in detail. Figure 2 As shown, the NFC card simulation method 200 can be used in an electronic device, and it should be understood that the electronic device can refer to any type of electronic device mentioned above. The NFC card simulation method 200 can include steps: S210-S230.

[0027] In step S210, the contactless parameters of the first NFC card are acquired through near field communication between the NFC chip and the first NFC card.

[0028] In some embodiments, the first NFC card may refer to an NFC physical card, and the first NFC card may be, for example, a physical NFC access card, an NFC bus card, an NFC bank card, etc. The electronic device may include an NFC chip, and the electronic device may perform near field communication with the first NFC card through the NFC chip to obtain card information of the first NFC card, and the card information may include contactless parameters of the first NFC card.

[0029] In some embodiments, the contactless parameters of the first NFC card may include: a unique identifier (UID) of the NFC card, a select acknowledgement (SAK), an answer to select (ATS), an answer to request (ATQ), etc. The answer to request ATQ may be, for example, an answer to request ATQA of a Class A card.

[0030] In step S220, the contactless parameters of the first NFC card are stored in a host database outside the NFC chip.

[0031] The host database outside the NFC chip may refer to a database storing application data corresponding to the application layer in the electronic device. The host database may be an application database of the first application, that is, the host database outside the NFC chip may refer to a database under the application directory of the first application. The first application may refer to an application for managing NFC analog cards in the electronic device, and the first application may be, for example, a wallet application.

[0032] In some embodiments, after generating card information of the first NFC card using the first application (the card information includes contactless parameters of the first NFC card), the card information can be stored in an application database of the first application without relying on the memory of the ESE chip, thereby helping to improve the application scenarios of the electronic device.

[0033] In step S230, a first NFC simulated card is generated in a first application of the electronic device according to the contactless parameters of the first NFC card, wherein the first NFC simulated card may refer to a simulated card of the first NFC card.

[0034] The user can display one or more NFC simulated cards through the UI interface of the first application. The one or more NFC simulated cards can be managed through the first application, for example, a new NFC simulated card can be added through the first application, and an NFC simulated card can also be deleted through the first application.

[0035] The first NFC simulation card can be, for example, a bus NFC simulation card, a door access NFC simulation card, a bank NFC simulation card, etc., and this application does not make any specific restrictions on this.

[0036] In some embodiments, after the user generates a first NFC simulated card in a first application, the user can use the first application to send a first activation instruction to the NFC chip, and the first activation instruction may include information such as contactless parameters of the first NFC simulated card; then, according to the first activation instruction, the contactless parameters in the NFC chip can be set to the contactless parameters of the first NFC simulated card to activate the first NFC simulated card.

[0037] It should be noted that, in the process of generating the first NFC simulated card, an application identifier (AID) may be allocated to the first NFC simulated card by using the first application, and the application identifier AID of the first NFC simulated card may refer to the identity identifier of the first NFC simulated card in the first application. The application identifier and the contactless parameters of the first NFC simulated card are both card information of the first NFC simulated card.

[0038] In some embodiments, the first activation instruction may refer to an activation instruction of the first NFC simulated card triggered by the user through the UI interface of the first application.

[0039] In some embodiments, the first application may further include a second NFC simulation card, and the first NFC simulation card and the second NFC simulation card are different NFC simulation cards. For example, the first NFC simulation card may be a door access NFC simulation card, and the second NFC simulation card may be a bus NFC simulation card. A first switching instruction may be triggered in the UI interface of the first application, and the first switching instruction may be used to instruct to switch from the first NFC simulation card to the second NFC simulation card; in response to the first switching instruction, the electronic device may call the contactless parameters of the second simulation card from the host database; and the contactless parameters in the register of the NFC chip may be set to the contactless parameters of the second NFC simulation card using the NFC chip to activate the second NFC simulation card.

[0040] In some embodiments, in response to the first switching instruction, the electronic device may use the first function to call the contactless parameters of the second simulated card from the host database; according to the first function, the contactless parameters in the register of the NFC chip may be set to the contactless parameters of the second NFC simulated card using the NFC chip to activate the second NFC simulated card. The first function may carry the contactless parameters of the second NFC simulated card, and the first function may refer to the calling function of the contactless parameters of the second simulated card, and the first function may be, for example, setHceCardPara().

[0041] In some embodiments, the contactless parameters of the second NFC card may include: a unique identifier UID of the NFC card, a selection confirmation SAK, a selection response ATS, a request response ATQA, etc., and this application does not impose any specific restrictions on this.

[0042] In some embodiments, the electronic device further includes an NFC process service layer and an NFC controller interface (NFCcontroller interface, NCI) layer. The NFC controller interface layer may be located between the NFC process service layer and the NFC chip, and data transmission between the NFC process service layer and the NFC chip may be realized through the NFC controller interface layer. A first application may be used to send a first switching instruction to the NFC process service layer, and the NFC process service layer may be used to send the first switching instruction to a register in the NFC chip through the NFC controller interface layer; then, the contactless parameters in the register may be set to the contactless parameters of the second NFC simulation card to activate the second NFC simulation card.

[0043] In some embodiments, in response to the first switching instruction, the electronic device may use the first function to call the contactless parameters of the second simulated card from the host database; according to the first function, the second function may be generated in the NFC process service layer; the second function may be sent to the register in the NFC chip through the NFC controller interface layer by the NFC process service layer; then, according to the second function, the contactless parameters in the register may be set to the contactless parameters of the second NFC simulated card to activate the second NFC simulated card. The second function may include the contactless parameters of the second simulated card, and the second function may refer to a setting function inside the NFC chip. The contactless parameters stored in the register of the NFC chip may be set by using the second function, and the second function may be, for example, setHceCardParaInternal().

[0044] In some embodiments, the electronic device may further include a second application, which may refer to an application different from the first application. The first application may be, for example, a wallet application, and the second application may be, for example, an Alipay application or a JD application. The user may trigger a second switching instruction in the UI interface of the electronic device, and the second switching instruction may be used to instruct to switch from the first application to the second application. After switching from the first application to the second application, the NFC chip may monitor changes in the application database. In response to changes in the database, the default contactless parameters in the NFC chip may be called from the registers of the NFC chip; and the contactless parameters in the NFC chip may be set to the default contactless parameters, so that the NFC card in the second application can be used normally.

[0045] In some embodiments, after switching from the first application to the second application, the NFC chip can monitor the changes in the application database. In response to the database changes, the third function can be used to call the default contactless parameters in the NFC chip from the register of the NFC chip; and the contactless parameters in the NFC chip are set to the default contactless parameters, so that the NFC card in the second application can be used normally. Among them, the third function can include the default contactless parameters of the NFC chip, and the third function can refer to the setting function inside the NFC chip. The third function can be used to set the contactless parameters stored in the register of the NFC chip. The third function can be, for example, restorePara().

[0046] It should be noted that the NFC card in the second application may use the default contactless parameters for data interaction. For example, the contactless parameter SAK selected for confirmation is a hexadecimal number starting with 08 in the first application, while it is a hexadecimal number starting with 02 in the second application. The SAK in the default contactless parameters is a hexadecimal number starting with 02. Therefore, when switching from the first application to the second application, the contactless parameters in the NFC chip need to be set to the default contactless parameters to ensure the normal use of the NFC card in the second application.

[0047] The NFC card simulation method in the embodiment of the present application has low data security because its non-contact parameter data is stored in the application database of the first application. Therefore, the fingerprint unlocking function can be used to improve data security. Before using the first NFC simulation card to interact with the external card reader device for data, the electronic device can be unlocked first. When the electronic device is in the unlocked state, the first NFC simulation card can be used to interact with the external card reader device for data to ensure the security and reliability of NFC communication. It should be understood that the card reader device can refer to the card reader device 120 mentioned above.

[0048] In order to deepen the understanding of the NFC card simulation method in the embodiment of the present application, the following takes the first NFC card as an access control NFC card as an example. Figure 3 The simulation method of the NFC card is described in detail with examples.

[0049] Figure 3 Another embodiment of the present application provides a method for simulating an NFC card. Figure 3 As shown, the method may include steps: S301 to S306.

[0050] In step S301: a first application is triggered to add an instruction for adding a simulated card of a first NFC card.

[0051] In step S302: utilizing near field communication between the NFC chip and the first NFC card, the card information of the first NFC card is read, wherein the card information includes contactless parameters of the first NFC card.

[0052] In step S303: according to the card information of the first NFC card, a first NFC simulated card is generated in the first application. The first NFC simulated card is a simulated card of the first NFC card.

[0053] In step S304: a first activation instruction is sent to the NFC chip through the first application, where the first activation instruction includes contactless parameters of the first NFC simulated card.

[0054] In step S305: according to the first activation instruction, the first NFC simulated card is activated using the NFC chip.

[0055] In step S306: end the current process.

[0056] The above mainly introduces the simulation method of NFC card. It should be understood that based on the simulation method of NFC card, multiple NFC simulation cards can be generated in the first application. It should be understood that the multiple NFC simulation cards can be different types of NFC simulation cards. For example, the multiple NFC simulation cards can include bus NFC simulation cards, access control NFC simulation cards, bank NFC simulation cards, etc.; the multiple NFC simulation cards can also be the same type of NFC simulation cards. For example, the multiple NFC simulation cards can include 1# access control NFC simulation card, 2# access control NFC simulation card, 3# access control NFC simulation card, etc. The following takes the first application as an example of a wallet application, combined with Figure 4 This section describes an example of multiple NFC simulated cards in a wallet application.

[0057] Figure 4 This is a schematic diagram of the structure of multiple NFC simulated cards in the wallet application. Figure 4 As shown, through the above NFC card simulation method, three access control NFC simulation cards can be added to the wallet application, which can be 1# access control NFC simulation card, 2# access control NFC simulation card, and 3# access control NFC simulation card.

[0058] It is understandable that the contactless parameters of the three access control NFC simulation cards can be stored in the database of the wallet application, which is a database under the application directory of the wallet application. The contactless parameters of the 1# access control NFC simulation card may include the unique identifier UID, selection confirmation SAK, and request response ATQA of the 1# access control NFC simulation card, wherein the UID may be A1B1C1D1, the SAK may be 0x08 / 0x18, and the ATQA may be 0x0400. The contactless parameters of the 2# access control NFC simulation card may include the unique identifier UID, selection confirmation SAK, and request response ATQA of the 2# access control NFC simulation card, wherein the UID may be A2B2C2D2, the SAK may be 0x08 / 0x18, and the ATQA may be 0x0400. The contactless parameters of the 3# access control NFC simulation card may include the unique identifier UID, selection confirmation SAK, and request response ATQA of the 3# access control NFC simulation card, wherein the UID may be A3B3C3D3, the SAK may be 0x08 / 0x18, and the ATQA may be 0x0400.

[0059] In some embodiments, the first application may include multiple NFC simulation cards, and the multiple NFC simulation cards may include a first NFC simulation card and a second NFC simulation card. The first NFC simulation card and the second NFC simulation card are different NFC simulation cards. For example, the first NFC simulation card may be a door access NFC simulation card, and the second NFC simulation card may be a bus NFC simulation card. There is a scenario where multiple NFC simulation cards can be switched to each other. The following takes switching from the first NFC simulation card to the second NFC simulation card as an example. Figure 5 A detailed example is given to illustrate the method of switching between NFC simulated cards.

[0060] Figure 5 The following is a flow chart of a method for switching an NFC simulated card provided in an embodiment of the present application. Figure 5 As shown, the switching method may include steps: S501 to S506.

[0061] In step S501: a first switching instruction may be triggered on a UI interface of a first application, and the first switching instruction may be used to instruct switching from a first NFC simulated card to a second NFC simulated card;

[0062] In step S502: in response to the first switching instruction, the electronic device may use a first function to call the contactless parameters of the second simulated card from the host database. The first function may carry the contactless parameters of the second NFC simulated card, and the first function may be, for example, setHceCardPara().

[0063] In step S503: according to the first function, a second function may be generated in the NFC process service layer. The second function may carry contactless parameters of the second NFC simulated card, and the second function may be, for example, setHceCardParaInternal().

[0064] In step S504: the second function is sent to the register in the NFC chip via the NFC controller interface layer using the NFC process service layer.

[0065] In step S505: according to the second function, the contactless parameters in the register may be set to the contactless parameters of the second NFC simulated card to activate the second NFC simulated card.

[0066] In step S506: end the current process.

[0067] In some embodiments, the electronic device may include multiple applications, which may include, for example, a first application and a second application, where the first application and the second application are different applications. The first application may be, for example, a wallet application, and the second application may be, for example, an Alipay application or a JD application. There are scenarios where multiple applications can be switched to each other. Figure 6 A detailed example is given to illustrate the method of switching between applications.

[0068] Figure 6 The flowchart of the switching method of the application provided in the embodiment of the present application is as follows. Figure 6 As shown, the switching method may include steps: S601 to S605.

[0069] In step S601: the user switches the first application to the second application. The user can trigger a second switching instruction in the UI interface of the electronic device, and the second switching instruction can be used to instruct to switch from the first application to the second application.

[0070] In step S602: in response to the change of the application database, the NFC process service layer uses a third function to call the default contactless parameters in the NFC chip from the register of the NFC chip. The third function may include the default contactless parameters of the NFC chip. The third function may refer to a setting function inside the NFC chip, and the third function may be, for example, restorePara().

[0071] In some embodiments, the NFC process service using the NFC chip can monitor the changes of the application database.

[0072] In step S603: the third function is sent to the NFC chip through the NCI layer.

[0073] In step S604: according to the third function, the contactless parameters in the register of the NFC chip are set to default contactless parameters.

[0074] In step S605: end the current process.

[0075] According to the above content, the NFC card emulation solution based on the host database will switch the contactless parameters while switching the NFC emulation card to ensure the normal use of the activated card. In addition, after switching the application, this solution will also modify the contactless parameters in the NFC chip to the default contactless parameters, so as to ensure that the switched application can be used normally.

[0076] Combination of the above Figures 1 to 6 The method embodiment of the present application is described in detail. Figures 7 and 8 The device embodiment of the present application is described in detail. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment, so the parts not described in detail can refer to the previous method embodiment.

[0077] Figure 7 FIG. 1 is a schematic diagram of a structure of an NFC card simulation device provided by an embodiment of the present application. The NFC card simulation device can be applied to an electronic device, wherein the electronic device comprises: an NFC chip for performing near field communication with a first NFC card outside the electronic device; the device 700 comprises: an acquisition module 710, a storage module 720 and a generation module 730.

[0078] The acquisition module 710 is configured to acquire contactless parameters of the first NFC card through near field communication between the NFC chip and the first NFC card.

[0079] The storage module 720 is used to store the contactless parameters of the first NFC card in a host database outside the NFC chip.

[0080] The generating module 730 is configured to generate a first NFC simulated card in a first application of the electronic device according to the contactless parameters of the first NFC card; wherein the first NFC simulated card is a simulated card of the first NFC card.

[0081] Optionally, the device 700 also includes: a first sending module, used to send a first activation instruction to the NFC chip through the first application after generating the first NFC simulated card in the first application of the electronic device, the first activation instruction including the contactless parameters of the first NFC simulated card; a first activation module, used to set the contactless parameters in the NFC chip to the contactless parameters of the first NFC simulated card according to the first activation instruction to activate the first NFC simulated card.

[0082] Optionally, the first application also includes a second NFC simulated card, and the electronic device also includes: a second sending module, used to send a first switching instruction to the NFC chip through the first application, the first switching instruction being used to instruct switching from the first NFC simulated card to the second NFC simulated card; a calling module, used to respond to the first switching instruction and use a first function to call the contactless parameters of the second simulated card from the host database; and a second activation module, used to set the contactless parameters in the NFC chip to the contactless parameters of the second NFC simulated card to activate the second NFC simulated card.

[0083] Optionally, the electronic device also includes an NFC process service layer and an NFC controller interface layer, and the second activation module is used to: generate a second function in the NFC process service layer according to the first function, the second function including contactless parameters of the second simulated card; send the second function to a register in the NFC chip through the NFC controller interface layer; and set the contactless parameters in the register to the contactless parameters of the second NFC simulated card according to the second function to activate the second NFC simulated card.

[0084] Optionally, the electronic device also includes a second application, and the device 700 also includes: a switching module, used to switch from the first application to the second application; a calling module, used to call the default contactless parameters in the NFC chip from the register of the NFC chip using a third function; and a setting module, used to set the contactless parameters in the NFC chip to the default contactless parameters.

[0085] Optionally, the device 700 further includes: a data transmission module, configured to, after activating the first NFC simulation card and in response to the electronic device being in an unlocked state, perform data interaction with an external card reader using the first NFC simulation card.

[0086] Optionally, the host database is a database under an application directory of the first application.

[0087] Combine the following Figure 8 The electronic device 800 in the embodiment of the present application is introduced. The electronic device 800 can be used to implement the method described in the above method embodiment.

[0088] It should be understood that the electronic device 800 can be applied to any type of electronic device mentioned above.

[0089] The electronic device 800 may include one or more processors 810. The processor 810 may support the electronic device 800 to implement the method described in the foregoing method embodiment.

[0090] The processor 810 may be a general-purpose processor or a special-purpose processor. For example, the processor may be a central processing unit (CPU). Alternatively, the processor may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0091] The electronic device 800 may further include one or more memories 820. The memory 820 stores a program, which can be executed by the processor 810 to control the electronic device 800 to execute the method described in the above method embodiment. The memory 820 may be independent of the processor 810 or integrated in the processor 810.

[0092] The memory 820 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, the memory 820 may also be various types of random access memory (RAM), such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous-link DRAM (SLDRAM) and direct ram-bus RAM (DR RAM).

[0093] The electronic device 800 may further include a transceiver 830. The processor 810 may communicate with other devices through the transceiver 830. For example, the processor 810 may perform data transmission and reception with other devices through the transceiver 830.

[0094] The present application also provides a chip in an embodiment, including a processor, which can be used to call and run a computer program from a memory, so that a device equipped with the chip performs the method described in the above method embodiment. It is understood that the processor can be any type of processor mentioned above. It is understood that the memory can be independent of the chip or integrated in the chip.

[0095] The embodiment of the present application also provides a machine-readable storage medium for storing a program, and the program enables a computer to execute the method in each embodiment of the present application.

[0096] The embodiment of the present application also provides a computer program product. The computer program product includes a program. The program enables a computer to execute the method in each embodiment of the present application.

[0097] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present disclosure is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a machine-readable storage medium, or transmitted from one machine-readable storage medium to another machine-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The machine-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0098] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments of the present disclosure can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present disclosure.

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

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

[0101] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0102] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A method for simulating an NFC card, characterized in that: The method is applied to an electronic device, and the electronic device comprises: An NFC chip, used for performing near field communication with a first NFC card outside the electronic device; The method comprises: Acquiring contactless parameters of the first NFC card through near field communication between the NFC chip and the first NFC card; storing the contactless parameters of the first NFC card in a host database outside the NFC chip; Generate a first NFC simulated card in a first application of the electronic device according to the contactless parameters of the first NFC card; The first NFC simulated card is a simulated card of the first NFC card.

2. The method according to claim 1, characterized in that: After generating the first NFC simulated card in the first application of the electronic device, the method further includes: Sending a first activation instruction to the NFC chip through the first application, where the first activation instruction includes contactless parameters of the first NFC simulation card; According to the first activation instruction, the contactless parameters in the NFC chip are set to the contactless parameters of the first NFC simulation card to activate the first NFC simulation card.

3. The method according to claim 1, characterized in that The first application also includes a second NFC simulated card, and the method further includes: Sending a first switching instruction to the NFC chip through the first application, where the first switching instruction is used to instruct switching from the first NFC simulated card to the second NFC simulated card; In response to the first switching instruction, calling the contactless parameters of the second simulated card from the host database; The contactless parameters in the NFC chip are set to the contactless parameters of the second NFC simulation card to activate the second NFC simulation card.

4. The method according to claim 3, characterized in that The electronic device further includes an NFC process service layer and an NFC controller interface layer, and the step of setting the contactless parameters in the NFC chip to the contactless parameters of the second NFC simulation card to activate the second NFC simulation card includes: Sending the first switching instruction to the NFC process service layer; Sending the first switching instruction to a register in the NFC chip through the NFC controller interface layer; The contactless parameters in the register are set to the contactless parameters of the second NFC simulation card to activate the second NFC simulation card.

5. The method according to claim 1, characterized in that The electronic device further includes a second application, and the method includes: Switching from the first application to the second application; Calling default contactless parameters in the NFC chip from a register of the NFC chip; The contactless parameters in the NFC chip are set to the default contactless parameters.

6. The method according to claim 2, characterized in that After activating the first NFC simulated card, the method includes: In response to the electronic device being in an unlocked state, the first NFC simulated card is used to perform data interaction with an external card reader.

7. The method according to any one of claims 1 to 6, characterized in that The host database is a database under the application directory of the first application.

8. A NFC card simulation device, characterized in that: The device is applied to an electronic device, and the electronic device comprises: An NFC chip, used for performing near field communication with a first NFC card outside the electronic device; The device comprises: an acquisition module, configured to acquire contactless parameters of the first NFC card through near field communication between the NFC chip and the first NFC card; A storage module, used for storing the contactless parameters of the first NFC card in a host database outside the NFC chip; A generating module, configured to generate a first NFC simulation card in a first application of the electronic device according to the contactless parameters of the first NFC card; The first NFC simulated card is a simulated card of the first NFC card.

9. A chip, characterized in that: include: A processor, configured to call and run a computer program from a memory, so that a device equipped with the chip executes a method as claimed in any one of claims 1 to 7.

10. An electronic device, characterized in that: include: A processor, a memory and a transceiver, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to control the electronic device to execute the method as described in any one of claims 1 to 7.

11. A computer-readable storage medium having executable code stored thereon, characterized in that: The code is used to implement the method according to any one of claims 1 to 7.