NFC card duplication method and related apparatus
By exchanging authentication information between electronic devices and NFC devices, the security risks of arbitrary devices copying NFC card data in existing technologies are resolved, and a safe and reliable method for copying NFC card data is realized, ensuring that only authenticated devices can obtain card data.
Patent Information
- Application Number
- PCT/CN2025/108646
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-19
- Filing Date
- 2025-07-15
- Publication Date
- 2026-01-22
AI Technical Summary
In existing technologies, any electronic device can copy NFC card data, posing a security risk and failing to effectively protect the security of card data.
By exchanging authentication information between electronic devices and NFC devices, the electronic device is ensured to verify the authentication information entered by the user before acquiring NFC card data, including authentication passwords, check values, or authentication keys, and the card data is only sent after successful authentication.
It improves the security of the NFC card data copying process, prevents unauthorized devices from copying card data, and protects the security and integrity of the data.
Smart Images

Figure CN2025108646_22012026_PF_FP_ABST
Abstract
Description
NFC card copying method and related device
[0001] The present application claims priority from the Chinese patent application No. 202410978961.3 filed on July 19, 2024, and entitled "NFC card copying method and related device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the technical field of wireless communication, in particular to an NFC card copying method and related device. BACKGROUND
[0003] Currently, a proximity integrated circuit card (PICC) can interact with a proximity coupling device (PCD), and the PCD can implement corresponding services based on card data of the PICC. With the advancement of technology, more and more electronic devices support NFC technology. An electronic device supporting NFC technology can copy card data of a PICC when in contact with the PICC, and simulate the PICC based on the card data of the PICC to interact with the PCD as the PICC. However, since any electronic device can copy the card data of the PICC, there is a security risk. SUMMARY
[0004] The present application provides an NFC card copying method and related device, which realizes the function of copying an NFC card from other NFC devices by an electronic device.
[0005] In a first aspect, the present application provides a NFC card copying method applied to an electronic device, the method comprising: receiving a first input of copying a NFC card; in response to the first input, sending a first command to a NFC device through NFC, the first command being used to indicate that the electronic device supports a first NFC protocol; receiving a first response sent by the NFC device through NFC, the first response being used to indicate that the first NFC device supports the first NFC protocol; in response to the first response, displaying a first prompt information, the first prompt information being used to prompt a user to input authentication information; receiving the first authentication information input by the user; after the first authentication information is authenticated, receiving first card data sent by the NFC device; and based on the first card data, opening a first NFC simulated card. In this way, the electronic device can determine that the electronic device and the NFC device both support the first NFC protocol, and then the electronic device can copy the content of the NFC device based on the first authentication information, open the first NFC simulated card based on the first card data obtained from the NFC device, and realize the card swiping business of the NFC device. Since the NFC device will authenticate the first authentication information, the electronic device needs the user to input the correct first authentication information, and then the electronic device can obtain the first card data from the NFC device. Therefore, when other users without the first authentication information obtain the NFC device, they cannot pass the authentication of the NFC device, and cannot copy the data of the NFC device, so that the process of copying the data of the NFC device is more secure and reliable.
[0006] In a possible implementation, the first authentication information comprises a first authentication password; after the first authentication information is authenticated, the first card data sent by the NFC device is received, specifically comprising: generating a first check value based on the first authentication password; sending the first check value to the NFC device; and receiving the first card data sent by the NFC device. In this way, the NFC device can determine whether to send the first card data to the electronic device 100 according to the first check value, and the NFC device can determine whether the electronic device has the permission to copy the first card data of the NFC device according to the first check value, so that other electronic devices without the first check value cannot copy the first card data of the NFC device, and the security of the first card data is protected. Moreover, the electronic device sends the first check value generated based on the first authentication password to the NFC device, which can also avoid other electronic devices from obtaining the first authentication password.
[0007] In a possible implementation, the first authentication information comprises a first authentication password; after the first authentication information is authenticated, the first card data sent by the NFC device is received, specifically comprising: sending the first authentication password to the NFC device; and receiving the first card data sent by the NFC device. In this way, the electronic device can directly send the first authentication password to the NFC device, and the NFC device can directly verify the first authentication password.
[0008] In a possible implementation, the first card data sent by the NFC device is received, specifically including: the first encrypted data sent by the NFC device is received; and the first encrypted data is decrypted based on the first authentication password to obtain the first card data. In this way, the NFC device can encrypt the first card data based on the first authentication password, and since the electronic device needs to obtain the first card data from the NFC device based on the first authentication password, the first card data is encrypted using the first authentication password, so that the security of the first card data is guaranteed, and the electronic device with the first authentication password can also decrypt the first encrypted data.
[0009] In a possible implementation, the first authentication information includes the first authentication password and the first serial number; after the first authentication information is authenticated, the first card data sent by the NFC device is received, specifically including: the first authentication password and the first serial number are sent to the server; the first authentication key sent by the server is received; the first check value is generated based on the first serial number and the first authentication key; the first check value is sent to the NFC device; and the first card data sent by the NFC device is received. In this way, the electronic device can obtain the first authentication key from the server based on the first authentication password and the first serial number. The server can manage the first authentication key, limit the number of times or the time of copying the data of the NFC device by the electronic device, and avoid the situation that the security factor of the data of the NFC device is reduced because the NFC device is copied too many times.
[0010] In a possible implementation, the first card data sent by the NFC device is received, specifically including: the first encrypted data sent by the NFC device is received by the electronic device; and the first encrypted data is decrypted based on the first authentication key by the electronic device to obtain the first card data. In this way, the NFC device can encrypt the first card data using the first authentication key to protect the security of the first card data. After the electronic device obtains the first authentication key from the server, the first encrypted data can be directly decrypted based on the first authentication key to obtain the first card data.
[0011] In a possible implementation, after the first NFC simulation card is opened based on the first card data, the method further includes: displaying second prompt information, the second prompt information being used to prompt the user that the electronic device successfully copies the first card data of the NFC device. In this way, the electronic device can prompt the user that the NFC device is successfully copied through the second prompt information, and the user can realize the card swiping business of the NFC device through the electronic device.
[0012] In a possible implementation, after the first input of copying the NFC card is received, the method further includes: in response to the first input, displaying third prompt information, the third prompt information being used to prompt the user to move the NFC device into the radio frequency field generated by the electronic device. In this way, the electronic device can perform signaling interaction with the NFC device through NFC.
[0013] In a possible implementation, after the first NFC analog card is opened based on the first card data, the method further includes: after entering a radio frequency field generated by the NFC card reading device, completing a card swiping service of the NFC device based on the first card data. In this way, after the first NFC analog card is opened, the electronic device can serve as the NFC device to implement the card swiping service of the NFC device.
[0014] In a possible implementation, the first NFC analog card is opened based on the first card data, and specifically includes: generating a first dedicated file (DF), the first DF including the first card data, and the first DF being used to implement the card swiping service of the NFC device. In this way, the electronic device can store the first card data in the DF, so that the electronic device can implement the card swiping service of the NFC device.
[0015] In a second aspect, the present application provides another method for copying a near field communication (NFC) card, including: receiving a first command sent by an electronic device, the first command being used to indicate that the electronic device supports a first NFC protocol; in response to the first command, sending a first response to the electronic device, the first response being used to indicate that the NFC device supports the first NFC protocol; receiving first information sent by the electronic device; based on the first information, sending stored first card data to the electronic device, the first card data being used to open a first NFC analog card by the electronic device. In this way, the NFC device supporting the first NFC protocol can verify the first information sent by the electronic device supporting the first NFC protocol, and after the first information is verified to be correct, the first card data is sent to the electronic device, so that the electronic device can open the first NFC analog card based on the first card data. Other electronic devices that do not support the first NFC protocol cannot obtain the first card data of the NFC device.
[0016] In a possible implementation, the first information of the electronic device includes first authentication information input by a user or a first check value obtained by the electronic device based on the first authentication information input by the user. In this way, when other users without the first authentication information obtain the NFC device, the users cannot input correct first authentication information, and the electronic devices of the users without the first authentication information cannot send correct first information to the NFC device, so that the process of copying the data of the NFC device is more secure and reliable.
[0017] In a possible implementation, the first information includes a first authentication password, and the NFC device stores a second authentication password; based on the first information, the first card data is sent to the electronic device, specifically including: determining that the first authentication password is the same as the second authentication password, and then sending the first card data to the electronic device. In this way, after the NFC device receives the first authentication password sent by the electronic device, the NFC device can determine whether to send the first card data to the electronic device based on the stored second authentication password.
[0018] In a possible implementation, the first information includes a first check value, and the NFC device stores a second authentication password; based on the first information, the stored first card data is sent to the electronic device, specifically including: a second check value is generated based on the second authentication password; when it is determined that the first check value is the same as the second check value, the first card data is sent to the electronic device. In this way, after the electronic device receives the first check value, the electronic device can generate a second check value based on the stored second authentication password, and verify whether to send the first card data to the electronic device based on the first check value and the second check value. Since the electronic device and the NFC device use the same algorithm to generate the check value, as long as the first authentication password of the electronic device is the same as the second authentication password of the NFC device, the first card data can be successfully acquired.
[0019] In a possible implementation, the first card data is sent to the electronic device, specifically including: the first card data is encrypted based on the second authentication password to obtain first encrypted data; and the first encrypted data is sent to the electronic device. In this way, when the NFC device determines that the first authentication password of the electronic device is the same as the stored second authentication password, the second authentication password can be used to encrypt the first card data, and the first card data can be sent to the electronic device or the security of the first card data can be protected.
[0020] In a possible implementation, the first information includes a first check value, and the NFC device stores a second check value; based on the first information, the stored first card data is sent to the electronic device, specifically including: when it is determined that the first check value is the same as the second check value, the first card data is sent to the electronic device. In this way, the NFC device can store the second check value, so that the NFC device can directly determine whether the first check value sent by the electronic device is the same as the stored second check value without generating the second check value by itself.
[0021] In a possible implementation, before receiving the first command sent by the electronic device, the method further includes: receiving a first authentication key sent by a server; and sending the stored first card data to the electronic device, specifically including: encrypting the first card data based on the first authentication key to obtain first encrypted data; and sending the first encrypted data to the electronic device. In this way, the NFC device can encrypt the first card data based on the stored first authentication key, and since the NFC device verifies that the first information of the electronic device is passed, it is determined that the electronic device has acquired the first authentication key, and therefore the first card data is encrypted using the first authentication key, so that the first card data can be sent to the electronic device or the security of the first card data can be protected.
[0022] In a third aspect, the present application provides a communication system, comprising: an electronic device and an NFC device; wherein the electronic device is configured to perform the NFC card copying method in the first aspect and any possible implementation of the first aspect; and the NFC device is configured to perform the NFC card copying method in the second aspect and any possible implementation of the second aspect. In this way, the electronic device can send the first information to the NFC device after receiving the first authentication information. The first information comprises the first authentication information input by the user or the first check value obtained by the electronic device based on the first authentication information input by the user. The NFC device can authenticate the identity of the electronic device based on the first information, so that the user with the first authentication information can copy the data of the NFC device through the electronic device to open the first NFC simulation card.
[0023] When other users without the first authentication information take the NFC device, if the electronic device of the user without the first authentication information does not support the first NFC protocol, the data of the NFC device cannot be copied. If the user without the first authentication information cannot input the correct first authentication information on the electronic device held by the user, the electronic device of the user without the first authentication information cannot send the correct first information to the NFC device, and the data of the NFC device cannot be copied, so that the process of copying the data of the NFC device is more secure and reliable.
[0024] In a fourth aspect, the present application provides an electronic device, comprising one or more processors, one or more memories, and a transceiver. The transceiver, the one or more memories, and the one or more processors are coupled, and the one or more memories are configured to store a computer program. When the one or more processors execute the computer program, the NFC card copying method in the first aspect and any possible implementation of the first aspect is performed.
[0025] In a fifth aspect, the present application provides an NFC device, comprising one or more processors, one or more memories, and a transceiver. The transceiver, the one or more memories, and the one or more processors are coupled, and the one or more memories are configured to store a computer program. When the one or more processors execute the computer program, the NFC card copying method in the second aspect and any possible implementation of the second aspect is performed.
[0026] In the fifth aspect, the NFC device can be an electronic device or an NFC tag card.
[0027] In a sixth aspect, the present application provides a computer storage medium, storing a computer program. When the computer program is executed by a processor, the NFC card copying method in the first aspect and any possible implementation of the first aspect is implemented.
[0028] In a seventh aspect, the present application provides a computer storage medium, storing a computer program, which when executed by a processor, implements the NFC card copying method in the second aspect and any possible implementation of the second aspect.
[0029] In an eighth aspect, the present application provides a computer program product, including a computer program, which when executed by a processor, implements the NFC card copying method in the first aspect and any possible implementation of the first aspect.
[0030] In a ninth aspect, the present application provides a computer program product, including a computer program, which when executed by a processor, implements the NFC card copying method in the second aspect and any possible implementation of the second aspect.
[0031] In a tenth aspect, the present application provides a chip system, including a processing circuit and an interface circuit, the interface circuit is configured to receive code instructions and transmit to the processing circuit, and the processing circuit is configured to run the code instructions to execute the NFC card copying method in the first aspect and any possible implementation of the first aspect.
[0032] In an eleventh aspect, the present application provides a chip system, including a processing circuit and an interface circuit, the interface circuit is configured to receive code instructions and transmit to the processing circuit, and the processing circuit is configured to run the code instructions to execute the NFC card copying method in the second aspect and any possible implementation of the second aspect.
[0033] The beneficial effects of the third aspect to the eleventh aspect and any possible implementation of the third aspect to the eleventh aspect can refer to the beneficial effects of the first aspect, the second aspect, any possible implementation of the first aspect, and any possible implementation of the second aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0034] FIG. 1 is a schematic diagram of an NFC working principle provided by an embodiment of the present application;
[0035] FIG. 2 is a schematic diagram of a card swiping scenario provided by an embodiment of the present application;
[0036] FIG. 3A is a structural schematic diagram of an electronic device provided by an embodiment of the present application;
[0037] FIG. 3B is a schematic diagram of an NFC protocol stack provided by an embodiment of the present application;
[0038] FIGS. 4A-4K are a set of interface schematic diagrams of copying data of an NFC device 300 provided by an embodiment of the present application;
[0039] FIG. 5 is a flow diagram of a method for duplicating an NFC card according to an embodiment of the present application;
[0040] FIG. 6 is a schematic diagram of an interface according to an embodiment of the present application;
[0041] FIG. 7 is a flow diagram of another method for duplicating an NFC card according to an embodiment of the present application;
[0042] FIG. 8 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application;
[0043] FIG. 9 is a flow diagram of another method for duplicating an NFC card according to an embodiment of the present application;
[0044] FIG. 10 is a schematic diagram of a structure of a communication apparatus according to an embodiment of the present application;
[0045] FIG. 11 is a schematic diagram of a structure of another communication apparatus according to an embodiment of the present application;
[0046] FIG. 12 is a schematic diagram of a structure of another communication apparatus according to an embodiment of the present application;
[0047] FIG. 13 is a schematic diagram of a structure of another communication apparatus according to an embodiment of the present application. DETAILED DESCRIPTION
[0048] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B; "and / or" in the text only means a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0049] Hereinafter, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more features, and in the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" is two or more than two.
[0050] The working principle of NFC in the embodiments of the present application will be described below.
[0051] FIG. 1 shows a schematic diagram of the working principle of NFC according to an embodiment of the present application.
[0052] As shown in FIG. 1, two parties that communicate using NFC technology can include a proximity coupling device (PCD) (also referred to as an NFC card reader) and a proximity intelligent card (PICC). The PCD can achieve proximity contactless communication with the PICC. The PCD and the PICC can allow near field communication at a specific data rate (e.g., 106 kilobits per second (kbit / s), 212 kbit / s, 424 kbit / s, 847 kbit / s, etc.).
[0053] The PCD can generate high-frequency alternating current to generate a radio frequency field at a specified frequency (e.g., 13.56 MHz) and transmit data to the PICC through the radio frequency field. After the PICC approaches the PCD, the PICC can induct the radio frequency field emitted by the PCD. The PICC can obtain energy from the radio frequency field of the PCD by electromagnetic induction after entering the radio frequency field emitted by the PCD, and generate power by the obtained energy to drive the circuit inside the PICC, analyze the data transmitted by the PCD through the radio frequency field, so as to realize data transmission from the PCD to the PICC. The PICC can also send data to the PCD by modulating the radio frequency field, realizing data transmission from the PICC to the PCD.
[0054] In an embodiment of the present application, the PICC can be a physical NFC tag card, and some electronic devices (e.g., mobile phones, tablets, smart watches, etc.) can also simulate themselves as PICC that conforms to NFC related standards by simulating the data of NFC card, to realize the function of PICC and NFC communication with the PCD.
[0055] The NFC card reader can perform a card verification process based on card information of the PICC. The NFC card reader can send a card verification result to the PICC through NFC command interaction. The card information of the PICC can include, but is not limited to, one or more of access control information, key information, transaction account information, electronic ticket information, etc. The access control information can include one or more of a card number, a validity period of the card number, etc. The key information can include one or more of a key code, a validity period of the key code, etc. The transaction account information can include one or more of a transaction account identifier, a remaining amount of the transaction account, etc. The electronic ticket information can include one or more of an electronic ticket code, a ticket checking time of the electronic ticket, a validity period of the electronic ticket, etc.
[0056] The device type of the NFC card reading device can be any one of a mobile phone, a tablet computer, a handheld computer, a desktop computer, a laptop computer, an ultra-mobile personal computer, a netbook, a cellular phone, a personal digital assistant, and a smart home device such as a smart large screen, a smart sound box, a wearable device such as a smart bracelet, a smart watch, and smart glasses, an extended reality device such as an augmented reality, a virtual reality, and a mixed reality, a vehicle, an access control device, a smart door lock, a card swiping device, a payment terminal, a ticket buying and / or checking terminal, a bank service terminal, and an identification card reading device.
[0057] In some application scenarios, the card writing device 200 can write card information into the NFC device 300. The administrator of the card writing device 200 can also store card information of a plurality of NFC devices (for example, the NFC device 300) in one or more NFC card reading devices, including the NFC card reading device 400. When the NFC device 300 approaches the card swiping area of the NFC card reading device 400, the NFC card reading device 400 can read the card information of the NFC device 300, and determine a card swiping result based on the card information obtained from the NFC device 300. The NFC card reading device 400 can output a card swiping success result when it is determined that the same card information as the card information obtained from the NFC device 300 exists in the stored card information. The NFC card reading device 400 can output a card swiping failure result when it is determined that the same card information as the card information obtained from the NFC device 300 does not exist in the stored card information. In this way, the administrator of the card writing device 200 and the NFC card reading device 400 can write card information into the NFC device and the NFC card reading device 400, so that the user can pass through the NFC card reading device 400 by using the card. However, after the user loses the NFC device, other people can copy the data of the NFC device, which brings security problems through the NFC card reading device 400.
[0058] In some examples, the card information of the NFC device 300 includes access control information, and the NFC card reading device 400 is an access control device. When the NFC device 300 successfully swipes a card, the NFC card reading device 400 can switch from a closed state to an open state, and the user holding the NFC device 300 can pass through the NFC card reading device 400. When the NFC device 300 fails to swipe a card, the NFC card reading device 400 can remain in the closed state, and the user holding the NFC device 300 cannot pass through the NFC card reading device 400.
[0059] It should be noted that the one or more NFC card reading devices can also store the correspondence between the card information and the permission information, not limited to the card information. The permission information can be used to indicate the permission corresponding to the card information (for example, the permission to pass through a certain access control device, the permission to prohibit passing through a certain access control device, etc.). When the NFC device 300 is determined from the stored correspondence between the card information and the access control permission that the permission information corresponding to the card information of the NFC device 300 indicates that the NFC device 300 is allowed to pass through the NFC card reading device 400, the NFC card reading device 400 can be switched from the closed state to the open state. When the NFC device 300 is determined from the stored correspondence between the card information and the access control permission that the permission information corresponding to the card information of the NFC device 300 indicates that the NFC device 300 is prohibited to pass through the NFC card reading device 400, the NFC card reading device 400 can remain in the closed state. In this way, the administrator of the one or more NFC card reading devices can set different access control permissions for different card information (i.e., NFC cards), so that users holding different NFC cards can pass through different access control devices, and the administrator does not need to confirm the access control devices through which the user holding the NFC card can pass, and write the card information into the access control devices that can pass, reducing the cumbersome degree of the administrator operating the access control device.
[0060] In some other application scenarios, the administrator of the card writing device 200 and the one or more NFC card reading devices (for example, the one or more NFC card reading devices include the NFC card reading device 400) can write the card information and the authentication key into the NFC device (for example, the NFC device 300) and the one or more NFC card reading devices, so that the user can pass through the card to realize the card swiping business on the corresponding NFC card reading device. When the NFC device 300 approaches the card swiping area of the NFC card reading device 400, the NFC device 300 can confirm whether to send the card information of the NFC device 300 to the NFC card reading device 400 based on the stored authentication key and the authentication key stored by the NFC card reading device 400. When it is determined that the card information of the NFC device 300 is sent to the NFC card reading device 400, the NFC device 300 can send the card information to the NFC card reading device 400. The NFC card reading device 400 can determine the card swiping result based on the card information obtained from the NFC device 300. For details, please refer to the above embodiments. In this way, the NFC device 300 can authenticate the NFC card reading device through the authentication key, and the NFC card reading device 400 can determine the card swiping result through the card information of the NFC device 300. After the user loses the NFC device 300, other personnel do not have the authentication key and cannot copy the card information of the NFC device. However, the user cannot copy the card information of the NFC device 300 through the electronic device 100, and it is inconvenient to carry when the user has multiple NFC cards.
[0061] In some examples, the NFC device 300 can generate a random number. The NFC reader 400 can obtain the random number from the NFC device 300. The NFC reader 400 can encrypt the random number using an authentication key to obtain authentication ciphertext. The NFC reader 400 can send the authentication ciphertext to the NFC device 300. The NFC device 300 can decrypt the authentication ciphertext using the stored authentication key to obtain the random number. The NFC device 300 can send card information of the NFC device 300 to the NFC reader 400 when it is determined that the decrypted random number is the same as the generated random number. The NFC reader 400 can determine whether to turn on the NFC reader 400 based on the received card information of the NFC device 300. It can be understood that the NFC device 300 can not send the card information of the NFC device 300 to the NFC reader 400 when it is determined that the decrypted random number is not the same as the generated random number. In this way, the NFC device 300 can confirm whether to send the card information of the NFC device 300 to the NFC reader 400 based on the stored authentication key and the authentication key stored by the NFC reader 400.
[0062] In some examples, the NFC device 300 can encrypt the random number and the card information using the authentication key to obtain encrypted data when it is determined that the decrypted random number is the same as the generated random number. The NFC device 300 can send the encrypted data to the NFC reader 400. The NFC reader 400 can decrypt the encrypted data based on the authentication key to obtain the card information after receiving the encrypted data. In this way, since the random number generated by the NFC device 300 is different, the encrypted data sent by the NFC device 300 to the NFC reader 400 is also different, and other devices can be prevented from obtaining the card information.
[0063] In some examples, the administrator of the card writing device 200 and the access control device can manage different authentication keys, and set different authentication keys in the NFC device for the residents living in different areas (e.g., different buildings, different floors). For example, the authentication keys of the NFC device held by the residents of different buildings are different, and the authentication keys of the NFC device held by the residents of the same building are the same. The access control device at the gate can include the authentication keys of the NFC device of all the residents of the buildings, so that the residents living in the community can enter the interior of the community. The access control device at the building can include the authentication keys of the NFC device of the residents of the building, so that the residents living in the building can enter the building. Alternatively, the administrator of the card writing device 200 and the access control device can set different authentication keys for the access control devices in different areas, and the administrator can set the authentication keys of the areas that can be passed in the NFC device for the residents living in different areas, for example, the authentication keys of the building where the residents live and the authentication keys of the gate of the community. In this way, the NFC device can avoid sending card information to the access control device that cannot be passed, and the security of the card information is protected.
[0064] The embodiment of the present application provides a NFC card copying method. The NFC device 300 includes first card data, and the first card data includes card information and an authentication password. The electronic device 100 can receive an input of copying a card from a user, and in response to the input, send a first command to the NFC device 300 through NFC. The NFC device 300 can send a first response to the electronic device 100 when receiving the first command. The electronic device 100 can display prompt information for prompting the user to input the authentication password after receiving the first response. The electronic device 100 can receive the authentication password input by the user, and read the first card data from the NFC device 300 based on the authentication password. The electronic device 100 can open the NFC analog card corresponding to the NFC device 300 based on the first card data.
[0065] In this way, only the manager and the holder of the NFC device 300 have the authentication password, and the electronic device 100 needs the authentication password input by the user to copy the data of the NFC device 300 and successfully simulate the NFC device 300, thereby ensuring the security of the data of the NFC device 300. The electronic device 100 can simulate the card data of multiple NFC devices through the NFC card copying method, reduce the carrying of physical cards, and be more convenient.
[0066] In some examples, the electronic device 100 can generate a dedicated file (DF) based on the first card data after reading the first card data, the DF includes the first card data, and the DF can be used to implement the card swiping business of the NFC device 300.
[0067] In some examples, when the NFC device 300 does not store the card information, the NFC device 300 can obtain the first card data from the card writing device 200 when the NFC device 300 is attached to the card writing area of the card writing device 200. Specifically, the card writing device 200 can receive the input authentication password and write the first card data into the NFC device 300.
[0068] For example, as shown in FIG. 2, the card writing device 200 can receive the input authentication password and write the first card data including the authentication password and the card information into the NFC device 300 through NFC when the NFC device 300 is attached to the card writing device 200. For example, if the card information includes access control information, the NFC card reading device 400 is an access control device including the access control information. When the NFC device 300 in which the first card data is written is attached to the card swiping area of the NFC card reading device 400, the NFC card reading device 400 can be triggered to switch from the closed state to the open state.
[0069] The electronic device 100 with the NFC function enabled includes a PCD mode and a PICC mode. In the PCD mode, the electronic device 100 can communicate with the PICC as a PCD by emitting a radio frequency field. In the PICC mode, the electronic device 100 can passively receive the radio frequency field emitted by the PCD and communicate with the PCD through load modulation technology. In the embodiments of the present application, the electronic device 100 supports both the PCD mode and the PICC mode. After the NFC function is enabled, the electronic device 100 can switch between the PICC mode and the PCD mode. Here, the electronic device 100 in the PCD mode can open the NFC analog card corresponding to the NFC device 300 after obtaining the first card data of the NFC device 300. The electronic device 100 in the PICC mode can simulate the NFC device 300 and perform the card swiping verification process with the NFC card reading device 400 when the electronic device 100 contacts the card swiping area of the NFC card reading device 400.
[0070] In the embodiments of the present application, the device type of the electronic device 100 can be any one of a mobile phone, a tablet computer, a handheld computer, a desktop computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), and a smart large screen, a smart speaker, and the like smart home device, a smart bracelet, a smart watch, smart glasses, and the like wearable device, an augmented reality (AR), a virtual reality (VR), a mixed reality (MR), and the like extended reality (XR) device, a vehicle-mounted device or a smart city device, and the like.
[0071] It should be noted that the NFC device 300 can refer to the NFC tag card of the entity, or can be an electronic device that simulates itself as a PICC conforming to the NFC related standard by using the data of the NFC emulation card, and the electronic device can implement the function of the PICC. It should also be noted that when the NFC device 300 refers to the NFC tag card of the entity, the electronic device 100 can copy the card data in the NFC device 300 by using the NFC card copying method provided in the embodiments of the present application. When the NFC device 300 refers to the electronic device that simulates itself as a PICC conforming to the NFC related standard by using the data of the NFC emulation card, the electronic device 100 can copy the card data of the NFC emulation card corresponding to the PICC being simulated by the NFC device 300 by using the NFC card copying method provided in the embodiments of the present application. In the embodiments of the present application, the NFC card includes the NFC tag card and the NFC emulation card.
[0072] Next, a structure schematic diagram of an electronic device 100 provided in the embodiments of the present application is introduced.
[0073] FIG. 3A shows a structure schematic diagram of an electronic device 100 provided in the embodiments of the present application.
[0074] As shown in FIG. 3A, the electronic device 100 can include a processor 101 and an NFC module 102. Among them, one or more applications can be run in the processor 101. Among them, one or more applications can include one or more of an application (for example, a wallet application) for managing an NFC analog card, one or more host-based card emulation (HCE) applications, and the like. Optionally, the electronic device 100 can also include a secure element (SE) 103 and / or a subscriber identity module (SIM) card 104. The processor 101 can be connected with the NFC module 102, the SE 103, and the SIM card 104, respectively. The NFC module 102 can also be connected with the SE 103 and the SIM card 104.
[0075] The NFC module 102 can include an NFC controller (not shown in FIG. 3A), an NFC transceiver (not shown in FIG. 3A), and an NFC memory (not shown in FIG. 3A). Among them, the NFC controller can be connected with the processor 101, and the NFC controller can also be connected with the NFC transceiver and the NFC memory, respectively.
[0076] The NFC controller is mainly used for the modulation and demodulation of non-contact communication signals, controls the input and output of data in the NFC memory, and interacts with the processor 101. The NFC transceiver is used to realize the sending and receiving of NFC signals (for example, 13.56MHz radio frequency signals), which can include an electromagnetic compatibility (EMC) filter circuit, a matching circuit, a receiving circuit, and an NFC antenna, etc., wherein the NFC antenna can be a loop antenna, which is used to realize the proximity-based non-contact communication capability of the NFC module 102. The NFC memory can be used to store data sent by the NFC module 102 to the NFC card reading device, and data received from the NFC card reading device. In some embodiments, the NFC memory can be one memory, which can be shared by the above components in the NFC module 102, for example, some data in the NFC memory can be called by the NFC controller, and other data can be called by the SE 103.
[0077] In some embodiments, the NFC memory can also store routing information. In some embodiments, the routing information can be controlled or managed by the NFC controller. The routing information can include a routing table, which is composed of a list of routing rules. Each routing rule can include an applet identifier (AID) and a destination. The destination can be where the applet that implements the business logic of the NFC emulation card is running. The destination can include a HCE application running in the processor 101 of the electronic device 100, or the SE 103 or the SIM card 104 connected to the NFC controller.
[0078] In some embodiments, the NFC memory can also store routing information. In some embodiments, the routing information can be controlled or managed by the NFC controller. The routing information can include a routing table, which is composed of a list of routing rules. Each routing rule can include an applet identifier (AID) and a destination. The destination can be where the applet that implements the business logic of the NFC emulation card is running. The destination can include a HCE application running in the processor 101 of the electronic device 100, or the SE 103 or the SIM card 104 connected to the NFC controller.
[0079] The SE 103 and the NFC module 102 can be two independent chips. Alternatively, the SE 103 and the NFC module 102 can be packaged in one chip.
[0080] The electronic device 100 can open one or more NFC emulation cards in an application according to the user's input, so that the electronic device 100 supports one or more NFC services. The business processing logic of the NFC emulation card in the electronic device 100 is implemented by an applet. The applet can be stored and run in the hardware device or software module (e.g., HCE application, SIM card, SE, etc.) corresponding to the NFC emulation card.
[0081] The NFC emulation mode on the electronic device 100 can be divided into a hardware-based virtual card mode and a software-based HCE mode. Among them,
[0082] 1. In the hardware-based virtual card mode, the electronic device 100 can provide a running environment of an Applet corresponding to an NFC emulation card and storage and processing of service data of the NFC emulation card through the SE 103 or the SIM card 104. The NFC module 102, as a front end of contactless communication, forwards a command received from an external PCD to the SE 103 or the SIM card 104, and then the command is processed by an Applet in the SE 103 or the SIM card 104 and response data is sent to the external PCD through the NFC module 102. A user can open one or more NFC emulation cards in a wallet application, and the wallet application can write the Applet and card data of the one or more NFC emulation cards into the SE 103. Alternatively, the user can open one or more NFC emulation cards in a SIM card application. The SIM card application can write the Applet and card data of the one or more NFC emulation cards into the SIM card 104 for storage.
[0083] 2. In the software-based HCE mode, an HCE application running in the processor 101 can provide a running environment of an Applet corresponding to an NFC emulation card and storage and processing of service data of the NFC emulation card. After receiving a command sent by an external PCD, the NFC module 102 can send the command to the HCE application. The HCE application can process the command received by the NFC module through an Applet running in the HCE application or a cloud server, and generate response data for the PCD. The HCE application can send the response data to the NFC module 102. The NFC module 102 can send the response data to the external PCD. A user can open one or more NFC emulation cards in the HCE application, and the HCE application can run the Applet of the one or more NFC emulation cards and save the card data of the NFC emulation cards on a local storage of the electronic device 100 or on a cloud server.
[0084] Optionally, the processor 101 can also run an NFC basic service module. The NFC basic service module can be used to provide common management functions for one or more NFC services. Among them, the common management functions can include file management, card long activation, security management, service routing management and the like.
[0085] For example, in the scenario of copying NFC device data described above, after the electronic device 100 in PCD mode obtains the first card data of the NFC device 300, it can save the first card data in SE103 or SIM card 104. When the electronic device 100 in PICC mode receives the first command sent by the NFC card reader 400 through the NFC module 102, it can simulate the NFC device 300 based on the card information of the first card data stored in SE103 or SIM card 104. The electronic device 100 can send a first response to the NFC card reader 400 through the NFC module 102. Afterwards, the NFC card reader 400 can read the card information of the NFC device 300 simulated by the electronic device 100, and determine whether to open the NFC card reader 400 based on the card information obtained from the electronic device 100. For details, please refer to the above embodiments, which will not be repeated here.
[0086] The following describes an NFC protocol stack provided in an embodiment of this application.
[0087] Figure 3B illustrates an NFC protocol stack provided in an embodiment of this application.
[0088] As shown in Figure 3B, the NFC protocol stack can include a physical layer, a radio frequency layer, an access layer, a transport layer, and an application layer.
[0089] The physical layer can be used to implement the physical characteristics of NFC communication.
[0090] The radio frequency (RF) layer can be used to implement RF specifications for NFC communication, such as data rate and RF signal frequency.
[0091] The access layer can be used to implement functions such as polling and device discovery, service result notification, card conflict management, transmission protocol negotiation, timeout and retransmission mechanism, PICC / PCD mode switching, and converged card selection.
[0092] The transport layer includes a high-speed data transmission protocol, which enables data transmission between the PCD and PICC at the application layer.
[0093] The application layer can be used to implement one or more NFC services and one or more service management policies. The one or more NFC services may include codeless payment, electronic tickets, access control, digital ID cards, all-scenario contactless payment, and short-range data transmission. The one or more service management policies may include any one or more of the following: file management, card long-term activation, security management, and service routing management. The processing logic of the NFC services can be executed by Applets. In one possible implementation, the processing logic of the service management policies can be executed by the NFC basic service module.
[0094] In some examples, after receiving input from a user to copy an NFC card, electronic device 100 displays a prompt message asking the user to enter an authentication password. Upon receiving the user's authentication password, electronic device 100 can generate a first verification value based on the password. Electronic device 100 can send the first verification value to NFC device 300 via NFC. Upon receiving the first verification value, NFC device 300 can generate a second verification value based on a stored authentication password. If the first and second verification values match, NFC device 300 can send first card data to electronic device 100. Upon receiving the first card data, electronic device 100 can activate the NFC simulation card corresponding to NFC device 300 based on the first card data. In this way, electronic device 100 does not send the authentication password in plaintext to NFC device 300, preventing other devices from obtaining the plaintext authentication password.
[0095] Optionally, the NFC device 300 may send a message to the electronic device 100 indicating that the verification of the first verification value has failed when it determines that the first verification value and the second verification value are different. Upon receiving the message indicating that the verification of the first verification value has failed, the electronic device 100 may display a failure message, which may be used to inform the user that copying the NFC device 300 has failed and / or that the authentication password is incorrect. Alternatively, the NFC device 300 may not send the first card data to the electronic device 100 when it determines that the first verification value and the second verification value are different. If the electronic device 100 does not receive the first card data after a waiting period, it may display a failure message.
[0096] It should be noted that the determination of whether to send the first card data to the electronic device 100 is not limited to using a first verification value and a second verification value. The electronic device 100 can send the input authentication password to the NFC device 300 via NFC after receiving the user's input authentication password. The NFC device 300 can, after receiving the authentication password sent by the electronic device 100, determine whether the stored authentication password is the same as the authentication password sent by the electronic device 100. The NFC device 300 can send the first card data to the electronic device 100 if it determines that the stored authentication password is the same as the authentication password sent by the electronic device 100. This embodiment of the application does not limit this aspect.
[0097] The following section uses the NFC device 300 as an example of an access card to introduce a set of interface diagrams provided in the embodiments of this application.
[0098] For example, as shown in Figure 4A, the electronic device 100 displays a desktop 401. The desktop 401 may include multiple application icons (e.g., a wallet application icon 402, etc.). The wallet application icon 402 can be used to trigger the electronic device to display the wallet application interface, which can provide users with the function of managing (e.g., adding, deleting, etc.) simulated NFC cards. Optionally, a status bar 403 is also displayed above the desktop 401. The status bar 403 may include information such as an NFC indicator 403A, a communication signal strength indicator, battery level, and time. The NFC indicator 403A can be used to indicate that the electronic device 100 has its NFC function enabled. It should be noted that the wallet application is only an example; the electronic device 100 can also manage simulated NFC cards through other applications. For example, NFC applications, payment applications, simulated card management applications, etc., are not limited in this embodiment.
[0099] Since the NFC card reader 400 is an NFC card reader, when an electronic device 100 with NFC enabled is placed by a user in the card-swiping area of the NFC card reader 400 and is in PICC mode, the electronic device 100 can simulate a card stored in it. Here, since the electronic device 100 stores transit card information, it can simulate a transit card via NFC. However, since a transit card cannot activate the NFC card reader 400, the NFC card reader 400 remains closed after the electronic device 100 simulates a transit card. For example, when simulating a transit card, the electronic device 100 can also display interface 410 as shown in Figure 4B. As shown in Figure 4B, the electronic device 100 displays interface 410, which includes a card icon 411, indicating that the electronic device 100 is simulating a transit card via NFC.
[0100] It should be noted that the electronic device 100 storing card information of a transportation card is merely an example and is not limited to storing transportation card information. The electronic device 100 may not store card information from any NFC device, or it may store card information from one or more NFC devices other than the card corresponding to the NFC card reader 400. This application embodiment does not limit this. It is understood that the electronic device 100 storing card information from one or more NFC devices can simulate the corresponding NFC device. The electronic device 100 can simulate the NFC device with the highest priority according to the priority order of different NFC devices. For example, the electronic device 100 can determine the priority order of different NFC devices based on default settings or based on the correspondence between different stored locations and NFC devices, etc. When the electronic device 100 without stored card information has its NFC function enabled and is placed by the user in the card-swiping area of the NFC card reader 400, the electronic device 100 does not simulate an NFC device. Optionally, when the electronic device 100, which does not store card information, has its NFC function enabled and is placed by a user in the card-swiping area of the NFC card reader 400, it can also display the interface of a wallet application, such as the interface of a wallet application for adding cards.
[0101] After receiving input from a user to the wallet application icon 402 shown in Figure 4A, the electronic device 100 can respond to the input by displaying the interface 420 shown in Figure 4C.
[0102] As shown in Figure 4C, the interface 420 includes one or more icons, which can be used to trigger the electronic device 100 to display the interface corresponding to the icon. The one or more icons may include a wallet icon 421, a payment icon, a ride icon, and a door open icon, etc. The multiple icons include the wallet icon 421. Optionally, the interface 420 may also include one or more history entries. History entries can be used to represent the electronic device 100's operations on cards, such as adding cards, deleting cards, and topping up cards.
[0103] Upon receiving input from a user regarding the wallet icon 421, the electronic device 100 displays an interface 430 as shown in Figure 4D. As shown in Figure 4D, the interface 430 includes one or more card options. These card options can represent NFC analog cards that the electronic device 100 has added or is about to add. For example, these card options may include, but are not limited to, card option 431 and card option 432. Card option 431 can represent a transportation card that the electronic device 100 has already added. Card option 432 can represent an access card that the electronic device 100 can add. Card option 432 may include an add control 433, which can be used to trigger the electronic device 100 to display an interface for adding an access card.
[0104] Upon receiving input from the user onto the add control 433 shown in Figure 4D, the electronic device 100 can respond to the input by displaying the interface 440 shown in Figure 4E. As shown in Figure 4E, the interface 440 can be used to prompt the user that the electronic device 100 can simulate a physical access card. For example, the interface 440 may include a prompt message 441, which can be used to prompt the user to attach the NFC device 300 to the back of the electronic device 100. The prompt message 441 may include, but is not limited to, one or more of text-based prompts, animated prompts, image-based prompts, and voice-based prompts. For example, the prompt message 441 may include text-based prompts 441A: "Ready to read NFC device", text-based prompts 441B: "Please ensure that the phone has NFC enabled and attach the NFC device to the back of the phone", and image-based prompts 441C, etc. In other examples, if the electronic device 100 does not have NFC enabled, the electronic device 100 can respond to the user's input onto the add control 433 by enabling the NFC function.
[0105] After displaying interface 440 as shown in Figure 4E, electronic device 100 can display interface 450 as shown in Figure 4F when it detects that NFC device 300 is attached to the back of electronic device 100. Interface 450 includes an input box 451, a prompt message 452, and a confirmation control 453. The input box 451 can be used to input an authentication password. The prompt message 452 can be used to prompt the user to enter an authentication password. The confirmation control 453 can be used to trigger electronic device 100 to read data from the NFC device based on the authentication password in input box 451. Specifically, after receiving user input to the add control 433, electronic device 100, in PCD mode, can send a first command to NFC device 300 via NFC in response to the input. When NFC device 300 is attached to the card reader area of electronic device 100 (e.g., the top of the back of electronic device 100), NFC device 300 can send a first response to electronic device 100 after receiving the first command. After receiving the first response, electronic device 100 can display interface 450 as shown in Figure 4F. Optionally, the interface 450 may also include a keyboard area for the user to enter an authentication password, or the electronic device 100 may receive input from the user into the input box 451 and display a keyboard area for entering the authentication password.
[0106] It should be noted that, not limited to the input box 451 shown in Figures 4F and 4G, the electronic device 100 can also display other forms of input boxes. For example, when the authentication password includes N characters, the electronic device 100 can display N circles. Not limited to the confirmation control 453, the electronic device 100 can also display the interface 460 shown in Figure 4H and generate a first verification value when it detects that the number of characters entered by the user has reached the number of characters in the authentication password.
[0107] After receiving an authentication password input by the user, the electronic device 100 can display an input box 451 as shown in Figure 4G. The input box 451 includes the authentication password input by the user. Upon receiving input from the user to the confirmation control 453, the electronic device 100 can, in response to the input, display an interface 460 as shown in Figure 4H. As shown in Figure 4H, the interface 460 may include, but is not limited to, a prompt box 461, which can be used to inform the user that the electronic device 100 is reading data from the NFC device 300. For example, the prompt box 461 may include a text message such as "Reading, please wait...". Upon receiving input from the user to the confirmation control 453, the electronic device 100 can, in response to the input, also generate a first verification value based on the authentication password and send the first verification value to the NFC device 300. The NFC device 300 can generate a second verification value based on the stored authentication password. When the NFC device 300 determines that the first verification value and the second verification value are the same, it sends the first card data to the electronic device 100.
[0108] After receiving complete first card data via NFC, electronic device 100 can activate the NFC simulation card corresponding to NFC device 300 based on the first card data. After activating the NFC simulation card corresponding to NFC device 300, electronic device 100 can display interface 470 as shown in Figure 4I. Interface 470 can be used to prompt the user that electronic device 100 has successfully copied NFC device 300. As shown in Figure 4I, interface 470 can include prompt information 471 and prompt information 473. For example, prompt information 471 can be a text prompt: "Card reading successful." Prompt information 473 can be an image prompt indicating that electronic device 100 has successfully read the card. Optionally, interface 470 can also include prompt information 472 to prompt the user to remove NFC device 300. For example, prompt information 472 can be a text prompt: "You can remove the NFC device."
[0109] In some examples, when electronic device 100 displays interface 470 as shown in FIG4I, it may, in response to receiving user input to return to the previous page (e.g., input swiping inward from the edge of interface 470), display interface 480 as shown in FIG4J. Alternatively, electronic device 100 may display interface 480 as shown in FIG4J after displaying interface 470 as shown in FIG4I for a preset display duration. As shown in FIG4J, interface 480 includes a card icon 481. Card icon 481 can be used to indicate that electronic device 100 has successfully copied NFC device 300 and activated the NFC emulation card corresponding to NFC device 300.
[0110] Optionally, the interface 480 may also include one or more functional controls, which can be used to manage the NFC simulated card corresponding to the NFC device 300. For example, these one or more functional controls may include, but are not limited to, a swipe control, an edit control, a set-default-card control, and a delete control. The swipe control can be used to trigger the electronic device 100 to simulate the NFC device 300, allowing the user to perform a swipe verification process with the NFC card reader 400 via the electronic device 100. The edit control can be used to trigger the electronic device 100 to display an interface for editing the NFC simulated card corresponding to the NFC device 300. For example, this interface can provide functions such as modifying the name of the NFC simulated card and the color of the card icon 481. The set-default-card control can be used to set the NFC simulated card corresponding to the NFC device 300 as the default card. After the electronic device 100 sets the NFC simulated card corresponding to the NFC device 300 as the default card, when the electronic device 100 with NFC enabled comes into contact with an NFC card reader (e.g., NFC card reader 400), it can first simulate the NFC device 300. The delete control can be used to delete the NFC simulated card corresponding to the NFC device 300.
[0111] After the electronic device 100 successfully copies the NFC device 300, when the NFC-enabled electronic device 100 comes into contact with the card-swiping area of the NFC card reader 400, the electronic device 100 can display the interface 490 shown in Figure 4K, and trigger the NFC card reader 400 to switch from a closed state to an open state, allowing the holder of the electronic device 100 to use the NFC card reader 400. Specifically, the description of the electronic device 100 simulating the NFC device 300 and successfully using the NFC card reader 400 can be found in the above embodiments and will not be repeated here.
[0112] For example, as shown in Figure 4K, interface 490 includes a card icon 491, which may indicate that electronic device 100 is simulating NFC device 300. Optionally, the card icon 491 may also include a prompt message 492, which may be used to notify the user that the electronic device 100 has successfully swiped a card on NFC card reader 400. For example, prompt message 492 may include a text message such as "Door opened successfully".
[0113] The following is a flowchart illustrating the NFC card copying method provided in this application embodiment.
[0114] For example, as shown in Figure 5, the NFC card copying method provided in this application embodiment includes the following steps:
[0115] S501. Card writing device 200 memory card information.
[0116] The card information can be used to perform a card swiping verification process on the NFC card reader 400 corresponding to the card writing device 200.
[0117] S502. The card writing device 200 receives the input authentication password.
[0118] The card writing device 200 can receive an authentication password input by the administrator of the card writing device 200. This authentication password can be used to copy data from the NFC device 300. The authentication password can be set by the holder of the NFC device, or by the administrator of the card writing device 200. Optionally, the card writing device 200 can randomly generate an authentication password.
[0119] S503. The card writing device 200 writes first card data into the NFC device 300. The first card data includes card information and authentication password.
[0120] When the NFC device 300 is placed on the writing area of the card writing device 200, the card writing device 200 can write the first card data into the NFC device 300 via NFC. The NFC device 300 that writes the first card data can then perform a card swiping transaction on the NFC card reader 400.
[0121] In other examples, the NFC device 300 is factory-configured with card information. The card writing device 200 can read the card information from the NFC device 300 and store it in a designated server (e.g., server 500). The designated server can store the card information from the NFC device 300 in one or more access control devices (e.g., NFC card reader 400), enabling the NFC device 300 to pass through the corresponding access control. The card writing device 200 can also write an input authentication password into the NFC device 300.
[0122] S504. Electronic device 100 receives input to copy NFC card.
[0123] S505. Electronic device 100 sends a first command to NFC device 300 via NFC.
[0124] S506. Electronic device 100 receives a first response sent by NFC device 300 via NFC.
[0125] S507. Electronic device 100 displays a prompt message to prompt the user to enter an authentication password.
[0126] When electronic device 100 receives input from a copying NFC device (e.g., input to the add control 433 shown in FIG. 4D), it can send a first command to NFC device 300 via NFC. The first command indicates that electronic device 100 supports a first NFC protocol. NFC device 300 can receive the first command sent by electronic device 100 via NFC after entering the radio frequency field generated by electronic device 100. NFC device 300 can respond to the first command by sending a first response to electronic device 100 via NFC. Upon receiving the first response from NFC device 300, electronic device 100 can respond to the first response by displaying a prompt message prompting the user to enter an authentication password. The first response can indicate that NFC device 300 supports the first NFC protocol.
[0127] In some examples, after receiving a request to copy an NFC device, electronic device 100 can send multiple requests in turn, including a first command and a second command, which are different. The second command is a request message sent by electronic device 100 to the NFC device that does not include an authentication password. If electronic device 100 receives a second response to the second command from NFC device 300 after sending the first and second commands, electronic device 100 skips steps S507 to S512 and reads the data from NFC device 300. Alternatively, electronic device 100 can display a message indicating that copying data from the NFC device failed when receiving a second response to the second command from NFC device 300. In this way, electronic device 100 does not prompt the user to enter an authentication password when copying an NFC device that does not include an authentication password, which is more in line with user habits.
[0128] It should be noted that the first and second commands can be used to indicate the NFC protocols supported by the NFC reader. Specifically, the first command can indicate that the NFC reader supports a first NFC protocol. The second command can indicate that the NFC reader supports a second NFC protocol, such as the ISO 14443 protocol.
[0129] In some examples, the first command can be a probe frame, and the first response can be a probe acknowledge (Probe ACK) frame.
[0130] The second command can be a request-type A command frame (REQA) or a wake-up-type A command frame (WUPA), and the second response can be an answer-to-request-type A frame (ATQA). Alternatively, the second command can be a request-type B command frame (REQB) or a wake-up-type B command frame (WUPB), and the second response can be an answer-to-request-type B frame (ATQB), and so on.
[0131] S508. Electronic device 100 receives the input authentication password.
[0132] S509. Electronic device 100 generates a first verification value based on the input authentication password.
[0133] After receiving the authentication password input by the user, electronic device 100 can generate a first verification value based on the authentication password. For example, electronic device 100 can use the authentication password as input to a specified algorithm to obtain the first verification value. For example, the specified algorithm can be Secure Hash Algorithm-256 (SHA-256), or the Chinese national cryptographic algorithm SM3, etc. In this way, when the authentication password is the authentication password set by the user of electronic device 100, the user of electronic device 100 can copy NFC device 300 by themselves using the authentication password. When the authentication password is the authentication password set by the administrator of NFC card reader device 400, the administrator of NFC card reader device 400 can inform the holder of NFC device 300, that is, the user of electronic device 100, of the authentication password. The user of electronic device 100 can then copy NFC device 300 through electronic device 100 based on the authentication password obtained from the administrator of NFC card reader device 400.
[0134] In some examples, NFC device 300 may send a random number to electronic device 100 when sending a first response. Electronic device 100 and NFC device 300 can then generate a checksum based on this random number. In this way, the checksums generated by NFC device 300 and electronic device 100 are different, and even if other electronic devices obtain the first checksum sent by electronic device 100 to NFC device 300, they will not be able to pass the verification by NFC device 300.
[0135] S510. Electronic device 100 sends a first verification value to NFC device 300.
[0136] After generating the first verification value, the electronic device 100 can send the first verification value to the NFC device 300 via NFC.
[0137] The S511.NFC device 300 generates a second verification value based on the stored authentication password.
[0138] The NFC device 300 may generate a second verification value based on the stored authentication password after receiving the first verification value, or after receiving the first command.
[0139] The S512 NFC device 300 determines whether the first check value and the second check value are the same.
[0140] After receiving the first verification value and generating the second verification value, the NFC device 300 can determine whether the first verification value and the second verification value are the same. When the NFC device 300 determines that the first verification value and the second verification value are the same, it can execute step S513. When the NFC device 300 determines that the first verification value and the second verification value are different, it can send a message to the electronic device 100 indicating that the first verification value verification has failed, or it can choose not to send a message to the electronic device 100.
[0141] S513.NFC device 300 sends first card data to electronic device 100.
[0142] The NFC device 300 determines that the first verification value and the second verification value are the same, and sends the first card data to the electronic device 100. The first card data includes card information.
[0143] In some examples, the first card data also includes an authentication key. The NFC device 300 can send the first card data, including the authentication key, to the electronic device 100 when it determines that the first checksum and the second checksum are the same. The card writing device 200 stores the authentication key, which is set by the administrator of the card writing device 200 and can write the authentication key into the NFC device 300. The NFC card reader 400 also stores this authentication key. The authentication key can be used to authenticate the identity of the NFC card reader 400, enabling the NFC device to send card information to the NFC card reader that possesses the authentication key, ensuring the security of the card information in the NFC device. Thus, after the electronic device 100 activates the NFC analog card corresponding to the NFC device 300 based on the first card data, it can determine whether to send card information to the corresponding NFC card reader based on the authentication key.
[0144] In other examples, after receiving the authentication password entered by the user, electronic device 100 can send the authentication password to NFC device 300 via NFC. NFC device 300 can send first card data to electronic device 100 if it determines that the stored authentication password matches the authentication password sent by electronic device 100. After receiving the first card data, electronic device 100 can activate the NFC analog card corresponding to NFC device 300 based on the first card data. For details, please refer to the description of copying data from NFC device 300 based on the first and second check values; it will not be repeated here.
[0145] In some examples, the NFC device 300 can encrypt the first card data based on an authentication password, generating encrypted data. The NFC device 300 can then send the encrypted data to the electronic device 100. After receiving the encrypted data, the electronic device 100 can decrypt it based on the authentication password to obtain the first card data. In this way, sending the encrypted first card data to the electronic device 100 by the NFC device 300 provides better security for the first card data.
[0146] Optionally, the NFC device 300 may not send the authentication password from the first card data to the electronic device 100.
[0147] S514. Electronic device 100 activates the first NFC simulation card based on the data from the first card.
[0148] After activating the first NFC simulated card based on the first card data, electronic device 100 can realize card-swiping services of NFC device 300. Specifically, electronic device 100 can generate a dedicated file and write the first card data into the dedicated file. Specifically, electronic device 100 can generate the dedicated file in response to a user's input of copying the NFC card, or it can generate the dedicated file upon receiving the first card data, or it can generate the dedicated file at any time between receiving the user's input of copying the NFC card and receiving the first card data. The dedicated file is a file provided by electronic device 100 for storing the card data of the NFC card. The data structure of the dedicated files corresponding to different NFC cards is the same. For example, electronic device 100 can store card information in the first storage area of the dedicated file and the authentication key in the second storage area of the dedicated file, facilitating the implementation of NFC card-swiping services by electronic device 100.
[0149] For example, electronic device 100 can write the first card data into a dedicated file on SE103 or SIM card 104. When electronic device 100 enables NFC, NFC module 102 can simulate NFC device 300 based on the contents of the dedicated file. When electronic device 100, simulating NFC device 300 via NFC module 102, is brought close to the card-swiping area of NFC card reader 400, electronic device 100 can determine whether to send the simulated NFC device 300 card information to NFC card reader 400 based on its stored authentication key and the authentication key stored in NFC card reader 400. When electronic device 100 determines that it needs to send the simulated NFC device 300 card information to NFC card reader 400, it sends the card information to NFC card reader 400. NFC card reader 400 can determine whether to turn on NFC card reader 400 based on the card information obtained from electronic device 100; for details, please refer to the above embodiments.
[0150] In this way, electronic device 100 can copy NFC device 300 through the above steps. Users no longer need to carry NFC device 300; they can directly use electronic device 100 to access NFC card reader 400, which is more convenient. Because other users do not have the authentication password, they cannot copy NFC device 300, thus protecting the data security of NFC device 300.
[0151] In other examples, the card writing device 200 can generate a second verification value based on the input authentication password. The card writing device 200 can write first card data, including the second verification value and card information, into the NFC device 300. After receiving the user-input authentication password, the electronic device 100 can generate the first verification value based on the authentication password. The electronic device 100 can send the first verification value to the NFC device 300 via NFC. After receiving the first verification value, the NFC device 300 can send the first card data to the electronic device 100 if it determines that the first verification value and the second verification value are the same. After receiving the first card data, the electronic device 100 can activate the NFC analog card corresponding to the NFC device 300 based on the first card data. In this way, the card writing device 200 directly writes the second verification value into the NFC device 300, so that the NFC device 300 does not need to calculate the verification value itself and can determine whether to send the first card data to the electronic device 100 more quickly.
[0152] In one possible implementation, server 500 and card writing device 200 store authentication keys. Card writing device 200 can receive an input serial number and authentication password. Card writing device 200 can generate a third verification value based on the serial number and authentication key. Card writing device 200 can write first card data, including the third verification value, card information, and authentication key, into NFC device 300. NFC device 300 can perform a card swiping process with NFC card reader 400 when it is brought close to the card swiping area of NFC card reader 400. Server 500 can receive the input serial number and authentication password of NFC device 300, and server 500 can store the correspondence between the serial number, authentication password, and authentication key.
[0153] Upon receiving input from a user requesting card copying, electronic device 100 can, in response, send a first command to NFC device 300 via NFC. Upon receiving the first command, NFC device 300 can send a first response to electronic device 100. After receiving the first response via NFC, electronic device 100 can display a prompt message asking the user to enter a serial number and authentication password. After receiving the user-inputted serial number and authentication password, electronic device 100 can read the authentication key from server 500 based on the serial number and authentication password. Electronic device 100 can generate a fourth verification value based on the authentication key and serial number. Electronic device 100 can send the fourth verification value to NFC device 300 via NFC. When NFC device 300 determines that the third and fourth verification values are the same, it can send first card data to electronic device 100. Based on the first card data, electronic device 100 can activate the NFC simulation card corresponding to NFC device 300.
[0154] The electronic device 100 can establish a secure transmission channel with the server 500. The server 500 can send the authentication key to the electronic device 100 through the secure transmission channel to ensure the security of the authentication key.
[0155] The serial number of the NFC device 300 can be used to identify the NFC device 300. For example, the serial number can be a string printed on the surface of the NFC device 300. Alternatively, the serial number can be a number assigned to the NFC device 300 by personnel in an organization.
[0156] In this way, when electronic device 100 copies data from NFC device 300, it first obtains an authentication key from server 500, and then retrieves card information from NFC device 300 based on the authentication key obtained from server 500 and the serial number entered by the user. Other electronic devices cannot obtain the authentication key from NFC device 300, which better protects the security of data on NFC device 300.
[0157] In some examples, server 500 can be used to set the number of times NFC device 300 is copied. When server 500 detects that the number of times the authentication key has been sent to an electronic device exceeds a preset number (e.g., 5 times), it can stop sending the authentication key to other electronic devices. This avoids the NFC device 300 being copied too many times, improving the security of the NFC device 300 data.
[0158] Optionally, server 500 can be used to set a time period for copying NFC device 300. When server 500 receives a message from electronic device (e.g., electronic device 100) within the set time period requesting an authentication key for NFC device 300, it can send the authentication key to that electronic device. When server 500 receives a message from electronic device (e.g., electronic device 100) outside the set time period requesting an authentication key for NFC device 300, it will not send the authentication key to that electronic device. In this way, each electronic device can copy data from the NFC device within the permitted time period.
[0159] For example, after displaying interface 440 as shown in FIG4E, electronic device 100 can display interface 610 as shown in FIG6 when it detects that NFC device 300 is attached to the card reader area of electronic device 100. Specifically, after receiving user input on add control 433, electronic device 100 can respond to the input by sending a first command to NFC device 300 via NFC. Upon receiving the first command, NFC device 300 can send a first response to electronic device 100. After receiving the first response, electronic device 100 can display interface 610 as shown in FIG6.
[0160] As shown in Figure 6, the interface 610 includes an input box 611, an input box 612, a prompt message 613, and a confirmation control 614. Input box 611 can be used to input a serial number, and input box 612 can be used to input an authentication password. The prompt message 613 prompts the user to input the serial number and authentication password. The confirmation control 614 triggers the electronic device 100 to read data from the NFC device based on the input content in input boxes 611 and 612. For specific details, please refer to the embodiment shown in Figure 4F, which will not be repeated here.
[0161] Electronic device 100 receives the authentication password and serial number input by the user. Then, after receiving input from the user to the confirmation control 614, electronic device 100 displays interface 460 as shown in Figure 4H in response to the input. Specifically, electronic device 100 can send the authentication password and serial number to server 500 in response to the user's input to the confirmation control 614. After receiving the authentication password and serial number from electronic device 100, server 500 can search for the authentication key corresponding to the authentication password and serial number in the stored data. Server 500 can send this authentication key to electronic device 100. Electronic device 100 can generate a fourth verification value based on the authentication key and serial number and send this fourth verification value to NFC device 300. When NFC device 300 determines that the fourth verification value is the same as the stored third verification value, it sends the first card data to electronic device 100. After activating the NFC simulation card corresponding to NFC device 300 based on the first card data, electronic device 100 displays interface 470 as shown in Figure 4I.
[0162] The following is a flowchart illustrating the NFC card copying method provided in this application embodiment.
[0163] For example, as shown in Figure 7, the NFC card copying method provided in this application embodiment includes the following steps:
[0164] S701. Server 500 and card writing device 200 store authentication keys.
[0165] The server 500 and the card writing device 200 store authentication keys for multiple NFC devices, including the first authentication key of the NFC device 300.
[0166] The NFC card reader 400 also stores this authentication key. The authentication key can be used to protect the security of card information.
[0167] In other examples, server 500 can send authentication keys to card writing device 200 and / or NFC card reader device 400. This allows administrators to send authentication keys to different NFC card readers and card writers via server 500, making the process more convenient.
[0168] Optionally, the card writing device 200 may not store the authentication key, and the server 500 may write the authentication key to the NFC device 300 through the card writing device 200.
[0169] S702. The card writing device 200 receives the first serial number.
[0170] The card writing device 200 can display a prompt message asking for the serial number of the NFC device 300 after receiving input to write card data to the NFC device 300. The card writing device 200 can receive a first serial number input by an administrator or user. Optionally, the server 500 generates the first serial number and sends it to the card writing device 200.
[0171] S703. The card writing device 200 generates a third verification value based on the first serial number and the first authentication key.
[0172] Specifically, the card writing device 200 can use the first serial number and the first authentication key as input to a specified verification value generation algorithm to generate a third verification value. For example, the card writing device 200 can use the first serial number and the first authentication key as input to a hash-based message authentication code (HMAC) algorithm to obtain the third verification value. Optionally, the description of how the card writing device 200 generates the third verification value based on the first serial number and the first authentication key can be found in the description of generating the first verification value based on the authentication password described above, and will not be repeated here.
[0173] S704. The card writing device 200 writes first card data into the NFC device 300. The first card data includes a third check value, card information, and a first authentication key.
[0174] After receiving the first serial number, the card writing device 200 generates a third verification value based on the first serial number and the first authentication key. The card writing device 200 may then write the first card data, including the third verification value, into the NFC device 300. The descriptions of the card information and the first authentication key can be found in the above embodiments and will not be repeated here.
[0175] It should be noted that the process is not limited to the card writing device 200 receiving the first serial number and writing a third verification value generated based on the first serial number and the first authentication key into the NFC device 300. The server 500 can receive the first authentication key and the first serial number input by the administrator, and generate a third verification value based on the first serial number and the first authentication key. The server 500 can write the third verification value into the NFC device 300 through the card writing device 200.
[0176] S705. Server 500 received the serial number and authentication password.
[0177] S706. Server 500 stores the correspondence between serial numbers, authentication passwords, and authentication keys.
[0178] Server 500 can receive serial numbers and authentication passwords input by administrators, and store the correspondence between serial numbers, authentication passwords, and authentication keys. The authentication password can be used by electronic devices that copy data from NFC devices to obtain authentication keys from server 500. The authentication password can be set by the holder of the NFC device, or by the administrator of card writing device 200. Optionally, server 500 can randomly generate authentication passwords. Thus, server 500 can store the correspondence between serial numbers, authentication passwords, and authentication keys of multiple NFC devices.
[0179] In this embodiment of the application, server 500 stores the correspondence between a first serial number, a first authentication password, and a first authentication key.
[0180] S707. Electronic device 100 receives input to copy NFC card.
[0181] S708. Electronic device 100 sends a first command to NFC device 300 via NFC.
[0182] S709. Electronic device 100 receives a first response sent by NFC device 300 via NFC.
[0183] S710. Electronic device 100 displays a prompt message to prompt the user to enter a serial number and authentication password.
[0184] When electronic device 100 receives input to copy an NFC card (e.g., input to the add control 433 shown in FIG4D), it can send a first command to NFC device 300 via NFC. If electronic device 100 receives a first response from NFC device 300 after sending the first command, electronic device 100 can display prompt information (e.g., prompt information 613 shown in FIG6) to prompt the user to enter the serial number and authentication password of NFC device 300.
[0185] S711. Electronic device 100 receives the input first serial number and first authentication password.
[0186] S712. Electronic device 100 sends the first serial number and the first authentication password to server 500.
[0187] After receiving the first serial number and first authentication password input by the user, the electronic device 100 can send the first serial number and first authentication password to the server 500. In this way, since only the administrator of the server 500 and the user know the first authentication password, other personnel cannot copy the NFC device 300.
[0188] In some examples, different NFC devices may correspond to different servers. For instance, if the NFC device is an access card, different access cards for different residential communities may correspond to different servers. Electronic device 100 can store multiple server addresses. Electronic device 100 can send the first serial number to multiple servers to determine the server 500 that stores the first serial number of NFC device 300.
[0189] It should be noted that the electronic device 100 is not limited to sending the first serial number to multiple servers. The wallet application of the electronic device 100 can prompt the user to select the management organization corresponding to the NFC device 300. The wallet application stores the correspondence between the management organization and the communication addresses of the management organization's servers. Based on the management organization selected by the user, the wallet application can send the first serial number and the first authentication password to the server indicated by the communication address corresponding to the management organization. For example, when the NFC device 300 is an access card, the electronic device 100 can provide multiple cell options. Different options correspond to different cell servers, and the server of a certain cell stores the correspondence between the serial number, authentication password, and authentication key of the NFC devices issued in that cell. After receiving the user's input of the cell option to which the NFC device 300 belongs, the electronic device 100 can send the first serial number and the first authentication password to the corresponding server 500. This embodiment of the application does not limit this.
[0190] S713. Server 500 determines the first authentication key corresponding to the received first serial number and first authentication password.
[0191] S714. Server 500 sends the first authentication key to electronic device 100.
[0192] After receiving the first serial number and first authentication password sent by the electronic device 100, the server 500 can determine the first authentication key corresponding to the first serial number and first authentication password sent by the electronic device 100 from the stored correspondence between serial numbers, authentication passwords and authentication keys. The server 500 can then send the determined first authentication key to the electronic device 100.
[0193] S715. Electronic device 100 generates a fourth verification value based on the first serial number and the first authentication key.
[0194] After receiving the first authentication key, electronic device 100 can generate a fourth verification value based on the first serial number and the first authentication key. For example, electronic device 100 can use the first serial number and the first authentication key as input to the HMAC algorithm to obtain the fourth verification value. It is understood that the algorithm used by electronic device 100 to generate the fourth verification value is the same as the algorithm used by card writing device 200 to generate the third verification value.
[0195] S716. Electronic device 100 sends a fourth verification value to NFC device 300 via NFC.
[0196] Electronic device 100 can send the generated fourth verification value to NFC device 300 via NFC.
[0197] The S717 NFC device 300 determines whether the third check value and the fourth check value are the same.
[0198] After receiving the fourth verification value, the NFC device 300 can determine whether the stored third verification value and the received fourth verification value are the same. If the NFC device 300 determines that the third verification value and the fourth verification value are the same, it can execute step S718. If the NFC device 300 determines that the third verification value and the fourth verification value are different, it can send a message to the electronic device 100 indicating that the verification value verification has failed, or it can choose not to send a message to the electronic device 100.
[0199] S718. Electronic device 100 receives first card data sent by NFC device 300 via NFC.
[0200] The NFC device 300 determines that the third and fourth verification values are the same and sends the first card data to the electronic device 100. The first card data includes the card information of the NFC device 300.
[0201] In some examples, if the NFC device 300 determines that the third and fourth check values are the same, it can send the card information from the first card data to the electronic device 100. In this way, the electronic device 100 obtains the authentication key from the NFC device 300 through the server 500, calculates the fourth check value that is the same as the third check value, and no longer needs to receive the authentication key and the third check value sent by the NFC device 300.
[0202] In some examples, NFC device 300 can encrypt the first card data using an authentication key to obtain encrypted data. NFC device 300 can then send the encrypted data to electronic device 100. Electronic device 100 can decrypt the encrypted data using an authentication key obtained from server 500 to obtain the first card data. In this way, NFC device 300 can send the encrypted first card data, protecting data security.
[0203] S719. Electronic device 100 activates the first NFC simulation card based on the data from the first card.
[0204] After activating the first NFC simulation card based on the first card data, the electronic device 100 with NFC function enabled can perform card swiping services on the NFC card reader 400 based on the card information of the activated first NFC simulation card when it is close to the card swiping area of the NFC card reader 400. For details, please refer to the above embodiments, which will not be repeated here.
[0205] The electronic device 100 can generate a dedicated file for the first NFC simulated card after receiving the first card data. The electronic device 100 can write the card information from the first card data into the dedicated file. Optionally, the electronic device 100 can also write the authentication key of the first card data into the dedicated file. Optionally, the electronic device 100 can also write the third verification value of the first card data into the dedicated file.
[0206] In some examples, the NFC device 300 can be an electronic device that emulates a PICC device compliant with NFC standards using first card data. When activating the first NFC emulated card, the NFC device 300 can obtain the first serial number of the first NFC emulated card from a server storing the first card data. This server storing the first card data can be a server of the management organization that creates the NFC tag cards storing the first card data. This first serial number can be used to identify the NFC tag card, for example, a serial number printed on the NFC tag card, or a number assigned to the NFC tag card by the management organization. Alternatively, the first serial number can be a number assigned to the first NFC emulated card of the NFC device 300 by the management organization, and so on. Thus, when the electronic device 100 copies an NFC card activated by another NFC device, it can also obtain the card data of the NFC emulated card based on the serial number of the NFC emulated card.
[0207] In other examples, the card writing device 200 and the server 500 store verification passwords. The card writing device 200 can generate a third verification value based on the serial number and the verification password. The server 500 can store the correspondence between the serial number, the authentication password, and the verification password. The electronic device 100 can obtain the first verification password of the NFC device 300 from the server 500 using the first serial number and the first authentication password. The electronic device 100 can generate a fourth verification value based on the first verification password and the first serial number, and read the first card data from the NFC device 300 based on the fourth verification value. In this way, the server 500 can control whether the user can copy the NFC device 300, and the server 500 does not need to send the first authentication key to the electronic device 100.
[0208] In other examples, the card writing device 200 or server 500 can randomly generate a third verification value. Electronic device 100 can obtain the third verification value from server 500 using a first serial number and a first authentication password. Server 500 can receive input from administrators to set the number of times the NFC device 300 can be copied. When server 500 detects that the number of times the third verification value has been sent to electronic devices exceeds a preset number (e.g., 5 times), it can stop sending a fourth verification value to other electronic devices. In this way, server 500 can control whether a user can copy the NFC device 300.
[0209] In one possible implementation, the authentication password can be the mobile phone number of the electronic device 100, the International Mobile Equipment Identity (IMEI), the International Mobile Subscriber Identification Number (IMSI), or the Mobile Subscriber International Integrated Service Digital Network Number (MSISDN), etc. This way, when applying for the NFC device 300, the user can register the authentication password with the administrator of the server 500. Since the authentication password is the user's mobile phone number, the probability of the user forgetting the authentication password is reduced, and it is easier for the user to copy the NFC device 300.
[0210] Optionally, the authentication password can be the mobile phone number of electronic device 100. Electronic device 100 can provide a function control to obtain its own mobile phone number, so that electronic device 100 does not need the user to manually enter the authentication password, but can obtain the authentication password by authorizing the use of its own mobile phone number, which is more convenient.
[0211] Figure 8 shows a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of this application.
[0212] The following description uses electronic device 100 as an example to illustrate the embodiment. It should be understood that the electronic device 100 shown in FIG8 is merely an example, and the electronic device 100 may have more or fewer components than shown in FIG8, may combine two or more components, or may have different component configurations. The various components shown in the figure can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0213] Electronic device 100 may include: processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include one or more of the following: pressure sensor 180A, gyroscope sensor 180B, barometric pressure sensor 180C, magnetic sensor 180D, accelerometer sensor 180E, distance sensor 180F, proximity sensor 180G, fingerprint sensor 180H, temperature sensor 180J, touch sensor 180K, ambient light sensor 180L, bone conduction sensor 180M, etc.
[0214] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0215] Processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. Processor 110 may also include memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that processor 110 has just used or is recurring. If processor 110 needs to reuse the instruction or data, it can directly retrieve it from the memory. This avoids repeated access, reduces the waiting time of processor 110, and thus improves system efficiency.
[0216] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0217] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0218] The charging management module 140 receives charging input from the charger. The power management module 141 connects to the battery 142, and the charging management module 140 connects to the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc.
[0219] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0220] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0221] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0222] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0223] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0224] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display panel can also be manufactured using organic light-emitting diodes (OLEDs), active-matrix organic light-emitting diodes (AMOLEDs), flexible light-emitting diodes (FLEDs), miniled, microled, micro-OLEDs, quantum dot light-emitting diodes (QLEDs), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0225] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0226] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The internal memory 121 can be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.). Furthermore, the internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0227] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0228] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. Gyroscope sensor 180B can be used to determine the motion posture of electronic device 100. Barometric pressure sensor 180C is used to measure air pressure. Magnetic sensor 180D includes a Hall sensor. Accelerometer sensor 180E can detect the magnitude of acceleration of electronic device 100 in various directions (generally three axes). Distance sensor 180F is used to measure distance. Proximity sensor 180G may include, for example, a light-emitting diode (LED) and a photodetector, such as a photodiode. Ambient light sensor 180L is used to sense ambient light intensity. Fingerprint sensor 180H is used to collect fingerprints. Temperature sensor 180J is used to detect temperature. Touch sensor 180K, also called a "touch panel". Touch sensor 180K can be set on display screen 194, and touch sensor 180K and display screen 194 form a touch screen, also called a "touch screen". Touch sensor 180K is used to detect touch operations applied to or near it. A touch sensor can transmit detected touch operations to an application processor to determine the type of touch event. Visual output related to the touch operation can be provided via display screen 194. In some embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194. Bone conduction sensor 180M can acquire vibration signals. Buttons 190 include a power button, volume buttons, etc. Motor 191 can generate vibration cues. Indicator 192 may be an indicator light, used to indicate charging status, battery level changes, or to indicate messages, missed calls, notifications, etc.
[0229] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0230] In some embodiments, the wireless communication module 160 can specifically be used to establish a short-range wireless communication link with the NFC card reader 400, so that the two can perform short-range wireless data transmission with each other. Exemplarily, the aforementioned short-range wireless communication link can be a Bluetooth link, a Wi-Fi link, an NFC link, etc. Therefore, the wireless communication module 160 can specifically include a Bluetooth communication module, a Wi-Fi communication module, or an NFC module. The NFC module can include any suitable components for enabling proximity-based contactless communication between the electronic device 100 and the NFC card reader 400, thereby providing NFC functionality to the electronic device 100. A description of the NFC module can be found in the embodiment shown in FIG3A above, and will not be repeated here.
[0231] Figure 9 shows a flowchart of an NFC card copying method provided in an embodiment of this application.
[0232] As shown in Figure 9, the method includes the following steps:
[0233] S901. The electronic device receives the first input of copying the NFC card.
[0234] S902. The electronic device sends a first command to the NFC device via NFC, the first command being used to indicate that the electronic device supports a first NFC protocol.
[0235] S903. After receiving the first command, the NFC device sends a first response to the electronic device via NFC. The first response is used to indicate that the first NFC device supports the first NFC protocol.
[0236] After the NFC device enters the radio frequency field generated by the electronic device, it receives the first command.
[0237] S904. After receiving the first response, the electronic device responds to the first response by displaying a first prompt message, which prompts the user to enter authentication information.
[0238] S905. The electronic device receives the first authentication information input by the user.
[0239] S906. After the first authentication information is successfully authenticated, the electronic device receives the first card data sent by the NFC device.
[0240] Specifically, after receiving the first authentication information, the electronic device sends the first information to the NFC device. Upon receiving the first information, the NFC device, based on the first information, sends the stored first card data to the electronic device.
[0241] In some examples, the first authentication information received by the electronic device includes a first authentication password. The electronic device sends first information to the NFC device, the first information including the first authentication password. The NFC device stores a second authentication password. The NFC device determines that the first authentication password and the second authentication password are the same, and sends the stored first card data to the electronic device.
[0242] In other examples, the first authentication information received by the electronic device includes a first authentication password. The electronic device generates a first verification value based on the first authentication password. The electronic device sends first information to the NFC device, the first information including the first verification value. The NFC device stores a second authentication password. The NFC device generates a second verification value based on the second authentication password, and the NFC device determines that the first verification value and the second verification value are the same, and then sends the stored first card data to the electronic device. Alternatively, the NFC device stores a second verification value, and the NFC device determines that the first verification value and the second verification value are the same, and then sends the stored first card data to the electronic device.
[0243] In other examples, the first authentication information received by the electronic device includes a first authentication password and a first serial number. Based on the first authentication password and the first serial number, the electronic device obtains a first authentication key from the server. Based on the first authentication key and the first serial number, the electronic device generates a first verification value. The electronic device sends first information to the NFC device, the first information including the first verification value. The NFC device stores a second verification value; if the NFC device determines that the first verification value and the second verification value are the same, it sends the stored first card data to the electronic device. Optionally, the NFC device stores a first authentication key. The NFC device encrypts the first card data based on the first authentication key to obtain first encrypted data, and sends the first encrypted data to the electronic device. After receiving the first encrypted data, the electronic device decrypts the first encrypted data based on the obtained first authentication key to obtain the first card data.
[0244] S907. The electronic device activates the first NFC simulation card based on the data from the first card.
[0245] For specific details, please refer to the embodiments described in Figures 1-8 above, which will not be repeated here.
[0246] The foregoing details the method provided in this application. In order to facilitate better implementation of the above-described solutions in the embodiments of this application, the embodiments of this application also provide corresponding devices or equipment.
[0247] This application embodiment can divide the electronic device 100 and NFC device 300 into functional modules according to the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0248] The communication device of the present application embodiment will now be described in detail with reference to Figures 10 to 13.
[0249] Referring to FIG10, which is a schematic diagram of the structure of a communication device 1000 provided in an embodiment of this application, the communication device 1000 can be the electronic device 100 in the above embodiments. Optionally, the communication device 1000 can be a chip / chip system, such as an NFC chip. As shown in FIG10, the communication device 1000 may include a transceiver unit 1010 and a processing unit 1020.
[0250] The transceiver unit 1010 can also be used to perform NFC sending and NFC receiving functions performed by the electronic device 100 in the above embodiments of this application.
[0251] Optionally, the processing unit 1020 can also be used to perform the functional steps related to NFC protocol parsing and encapsulation, NFC service processing flow, and display performed by the electronic device 100 in the above embodiments of this application.
[0252] It should be understood that the communication device 1000 in this design can perform the method steps performed by the electronic device 100 in the aforementioned embodiments, and for the sake of brevity, they will not be described again here.
[0253] Referring to FIG11, which is a schematic diagram of the structure of a communication device 1100 provided in an embodiment of this application, the communication device 1100 may be the NFC device 300 in the above embodiments. Optionally, the communication device 1100 may be the NFC device 300. As shown in FIG11, the communication device 1100 may include a transceiver unit 1110 and a processing unit 1120.
[0254] Optionally, the transceiver unit 1110 can also be used to perform NFC sending and NFC receiving functions performed by the NFC device 300 in the above embodiments of this application.
[0255] Optionally, the processing unit 1120 can also be used to execute the functional steps related to NFC protocol parsing and encapsulation and NFC service processing flow executed by the NFC device 300 in the above embodiments of this application.
[0256] It should be understood that the communication device 1100 in this design can perform the method steps performed by the NFC device 300 in the aforementioned embodiment, and for the sake of brevity, it will not be described again here.
[0257] The above describes the electronic device 100 and NFC device 300 of the embodiments of this application. It should be understood that any product with the functions of the electronic device 100 described in FIG10 above, or any product with the functions of the NFC device 300 described in FIG11 above, falls within the protection scope of the embodiments of this application.
[0258] As one possible product form, the electronic device 100 described in this application embodiment can be implemented using a general bus architecture.
[0259] Referring to Figure 12, Figure 12 is a schematic diagram of the structure of a communication device 1200 provided in an embodiment of this application. The communication device 1200 can be an electronic device 100, or a device therein. As shown in Figure 12, the communication device 1200 includes a processor 1201 and a transceiver 1202 internally connected and communicating with the processor 1201. The processor 1201 can be a general-purpose processor or a dedicated processor, etc. For example, it can be a central processing unit and / or an NFC controller, etc. The transceiver 1202 can be referred to as a transceiver unit, transceiver, or transceiver circuit, etc., and is used to implement transceiver functions. The transceiver 1202 can include a receiver and a transmitter. The receiver can be referred to as a receiver or receiving circuit, etc., and is used to implement a receiving function, such as an NFC receiving function; the transmitter can be referred to as a transmitter or transmitting circuit, etc., and is used to implement a transmitting function, such as an NFC transmitting function. Optionally, the communication device 1200 may also include an antenna 1203 and / or a radio frequency unit (not shown in Figure 12), for example, an NFC antenna, wherein the NFC antenna can be a coil-type antenna. The antenna 1203 and / or radio frequency unit may be located inside the communication device 1200 or separate from the communication device 1200, that is, the antenna 1203 and / or radio frequency unit may be deployed remotely or in a distributed manner.
[0260] Optionally, the communication device 1200 may include one or more memories 1204, which may store instructions, which may be computer programs, that can be executed on the communication device 1200 to cause the communication device 1200 to perform the method steps described in the above embodiments of this application. Optionally, the memory 1204 may also store data. The communication device 1200 and the memory 1204 may be provided separately or integrated together.
[0261] The processor 1201, transceiver 1202, and memory 1204 can be connected via a communication bus.
[0262] In one design, the communication device 1200 can be used to perform the functions of the electronic device 100 in the foregoing embodiments: the processor 1201 can be used to perform the functional steps related to NFC protocol parsing and encapsulation, NFC service processing flow and display performed by the electronic device 100 in the foregoing embodiments of this application and / or other processes used in the technology described herein; the transceiver 1202 can be used to perform the functional steps related to NFC sending and NFC receiving performed by the electronic device 100 in the foregoing embodiments of this application and / or other processes used in the technology described herein.
[0263] In any of the above designs, the processor 1201 may include a transceiver for implementing receiving and transmitting functions. For example, the transceiver may be a transceiver circuit, an interface, or an interface circuit. The transceiver circuit, interface, or interface circuit for implementing receiving and transmitting functions may be separate or integrated. The aforementioned transceiver circuit, interface, or interface circuit may be used for reading and writing code / data, or it may be used for transmitting or relaying signals.
[0264] In any of the above designs, the processor 1201 may store instructions, which may be computer programs. These computer programs, running on the processor 1201, cause the communication device 1200 to execute the method steps performed by the electronic device 100 in the above embodiments of this application. The computer program may be embedded in the processor 1201; in this case, the processor 1201 may be implemented in hardware.
[0265] In one implementation, the communication device 1200 may include circuitry capable of performing the functions of transmitting, receiving, or communicating as described in the aforementioned method embodiments. The processor and transceiver described in this application can be implemented on integrated circuits (ICs), analog ICs, radio frequency integrated circuits (RFICs), mixed-signal ICs, application-specific integrated circuits (ASICs), printed circuit boards (PCBs), electronic devices, etc. The processor and transceiver can also be manufactured using various IC process technologies, such as complementary metal-oxide-semiconductor (CMOS), n-metal-oxide-semiconductor (NMOS), p-type metal-oxide-semiconductor (PMOS), bipolar junction transistors (BJTs), bipolar CMOS (BiCMOS), silicon-germanium (SiGe), gallium arsenide (GaAs), etc.
[0266] The scope of the communication device described in this application is not limited thereto, and the structure of the communication device is not limited to that shown in Figure 12. The communication device 1200 can be a standalone device or part of a larger device. For example, the communication device 1200 can be:
[0267] (1) A standalone integrated circuit IC, or chip, or chip system or subsystem; (2) A collection of one or more ICs, optionally including storage components for storing data or computer programs; (3) An ASIC, such as an NFC chip; (4) A module that can be embedded in other devices; (5) A receiver, terminal, smart terminal, cellular phone, wireless device, handheld device, mobile unit, vehicle device, network device, cloud device, artificial intelligence device, etc.; (6) Others, etc.
[0268] As a possible product form, the NFC device 300 described in this application embodiment can be implemented using a general bus architecture.
[0269] Referring to Figure 13, Figure 13 is a schematic diagram of the structure of the communication device 1300 provided in an embodiment of this application. The communication device 1300 may be an NFC device 300, or a device thereof. As shown in Figure 13, the communication device 1300 includes a processor 1301 and a transceiver 1302 internally connected and communicating with the processor 1301. The processor 1301 may be a general-purpose processor or a dedicated processor, etc. For example, it may be an NFC controller. The transceiver 1302 may be referred to as a transceiver unit, transceiver, or transceiver circuit, etc., and is used to implement transceiver functions. The transceiver 1302 may include a receiver and a transmitter. The receiver may be referred to as a receiver or receiving circuit, etc., and is used to implement a receiving function; the transmitter may be referred to as a transmitter or transmitting circuit, etc., and is used to implement a transmitting function. Optionally, the communication device 1300 may also include an antenna 1303 and / or a radio frequency unit (not shown in the figure). The antenna 1303 and / or radio frequency unit may be located inside the communication device 1300 or separate from the communication device 1300, that is, the antenna 1303 and / or radio frequency unit may be deployed remotely or in a distributed manner.
[0270] Optionally, the communication device 1300 may include one or more memories 1304, which may store instructions, which may be computer programs, that can be executed on the communication device 1300 to cause the communication device 1300 to perform the method steps described in the above embodiments of this application. Optionally, the memory 1304 may also store data. The communication device 1300 and the memory 1304 may be provided separately or integrated together.
[0271] The processor 1301, transceiver 1302, and memory 1304 can be connected via a communication bus.
[0272] In one design, the communication device 1300 can be used to perform the functions of the NFC device 300 in the foregoing embodiments: the processor 1301 can be used to perform the functional steps related to NFC protocol parsing and encapsulation, NFC service processing flow, and / or other processes used in the technology described herein, performed by the NFC device 300 in the embodiment shown in FIG13; the transceiver 1302 can be used to perform the functional steps related to NFC sending and NFC receiving, and / or other processes used in the technology described herein, performed by the NFC device 300 in the embodiment shown in FIG13.
[0273] In any of the above designs, the processor 1301 may include a transceiver for implementing receive and transmit functions. For example, the transceiver may be a transceiver circuit, an interface, or an interface circuit. The transceiver circuit, interface, or interface circuit for implementing receive and transmit functions may be separate or integrated. The aforementioned transceiver circuit, interface, or interface circuit may be used for reading and writing code / data, or it may be used for transmitting or relaying signals.
[0274] In any of the above designs, the processor 1301 may store instructions, which may be computer programs. These computer programs, running on the processor 1301, cause the communication device 1300 to execute the method steps performed by the NFC device 300 in the above method embodiments. The computer program may be embedded in the processor 1301; in this case, the processor 1301 may be implemented in hardware.
[0275] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps performed by the electronic device 100 in the above-described method embodiments.
[0276] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps performed by the NFC device 300 in the above-described method embodiments.
[0277] This application also provides a computer program product, including a computing program, which, when run on a computer, enables the computer to perform the steps executed by the electronic device 100 in the above-described method embodiments.
[0278] This application also provides a computer program product, including a computing program, which, when run on a computer, enables the computer to perform the steps executed by the NFC device 300 in the above-described method embodiments.
[0279] This application also provides a chip, which includes a processing circuit interface circuit. The interface circuit receives code instructions and transmits them to the processing circuit. The processing circuit executes the code instructions to enable the chip system to perform the steps executed by the electronic device 100 in any method embodiment of this application. The chip system can be a single chip or a chip module composed of multiple chips.
[0280] This application also provides a chip, which includes a processing circuit interface circuit. The interface circuit receives code instructions and transmits them to the processing circuit. The processing circuit executes the code instructions to enable the chip system to perform the steps executed by the NFC device 300 in any method embodiment of this application. The chip system can be a single chip or a chip module composed of multiple chips.
[0281] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A near field communication (NFC) card copying method, characterized by, The method is applied to an electronic device, and the method comprises: receiving a first input of copying an NFC card; in response to the first input, sending a first command to an NFC device through NFC, the first command being used for indicating that the electronic device supports a first NFC protocol; receiving a first response sent by the NFC device through NFC, the first response being used for indicating that the first NFC device supports the first NFC protocol; in response to the first response, displaying first prompt information, the first prompt information being used for prompting a user to input authentication information; receiving first authentication information input by the user; after the first authentication information is authenticated, receiving first card data sent by the NFC device based on the first card data, and opening a first NFC simulated card. The first authentication information comprises a first authentication password; and after the first authentication information is authenticated, the first card data sent by the NFC device is received, and the receiving specifically comprises:
2. The method of claim 1, wherein, generating a first check value based on the first authentication password; sending the first check value to the NFC device; receiving the first card data sent by the NFC device. The first authentication information comprises a first authentication password; and after the first authentication information is authenticated, the first card data sent by the NFC device is received, and the receiving specifically comprises:
3. The method of claim 1, wherein, sending the first authentication password to the NFC device; receiving the first card data sent by the NFC device. The receiving the first card data sent by the NFC device specifically comprises:
4. The method according to claim 2 or 3, characterized in that, receiving first encrypted data sent by the NFC device; decrypting the first encrypted data based on the first authentication password to obtain the first card data. The first authentication information comprises a first authentication password and a first serial number; and after the first authentication information is authenticated, the first card data sent by the NFC device is received, and the receiving specifically comprises:
5. The method of claim 1, wherein, sending the first authentication password and the first serial number to a server; receiving a first authentication key sent by the server; generating a first check value based on the first serial number and the first authentication key; sending the first check value to the NFC device; receiving the first card data sent by the NFC device. The receiving the first card data sent by the NFC device specifically comprises:
6. The method of claim 5, wherein, the electronic device receives first encrypted data sent by the NFC device; the electronic device decrypts the first encrypted data based on the first authentication key to obtain the first card data. After the first NFC simulated card is opened based on the first card data, the method further comprises:
7. The method according to any one of claims 1 to 6, characterized in that, displaying second prompt information, the second prompt information being used for prompting the user that the electronic device successfully copies the first card data of the NFC device. After the first input of copying the NFC card is received, the method further comprises:
8. The method according to any one of claims 1-7, characterized in that, in response to the first input, displaying third prompt information, the third prompt information being used for prompting the user to move the NFC device into a radio frequency field generated by the electronic device. 9. The method according to any one of claims 1-8, characterized in that, After the first NFC analog card is opened based on the first card data, the method further comprises: After entering a radio frequency field generated by an NFC card reading device, completing a card swiping service of the NFC device based on the first card data.
10. The method according to any one of claims 1-9, characterized in that, The first NFC analog card is opened based on the first card data, and specifically comprises: A first dedicated file (DF) is generated, the first DF comprising the first card data, and the first DF being used to implement the card swiping service of the NFC device.
11. A near field communication (NFC) card copying method, characterized by, The method comprises: receiving a first command sent by an electronic device, the first command being used to indicate that the electronic device supports a first NFC protocol; in response to the first command, sending a first response to the electronic device, the first response being used to indicate that the NFC device supports the first NFC protocol; receiving first information sent by the electronic device; based on the first information, sending stored first card data to the electronic device, the first card data being used for the electronic device to open a first NFC analog card.
12. The method of claim 11, wherein, The first information comprises a first authentication password, and the NFC device stores a second authentication password; the first card data is sent to the electronic device based on the first information, and specifically comprises: determining that the first authentication password is the same as the second authentication password, and sending the first card data to the electronic device.
13. The method of claim 11, wherein, The first information comprises a first authentication password, and the NFC device stores a second authentication password; the first card data is sent to the electronic device based on the first information, and specifically comprises: generating a second check value based on the second authentication password; determining that the first check value is the same as the second check value, and sending the first card data to the electronic device.
14. The method according to claim 12 or 13, characterized in that, The first card data is sent to the electronic device, and specifically comprises: encrypting the first card data based on the second authentication password to obtain first encrypted data; sending the first encrypted data to the electronic device.
15. The method of claim 11, wherein, The first information comprises a first authentication password, and the NFC device stores a second authentication password; the first card data is sent to the electronic device based on the first information, and specifically comprises: determining that the first check value is the same as the second check value, and sending the first card data to the electronic device.
16. The method of claim 15, wherein, Before the first command sent by the electronic device is received, the method further comprises: receiving a first authentication key sent by a server; The first card data is sent to the electronic device, and specifically comprises: encrypting the first card data based on the first authentication key to obtain first encrypted data; sending the first encrypted data to the electronic device.
17. A near field communication (NFC) communication system, characterized by The method comprises: The electronic device is used to execute the method in any one of claims 1-10; The NFC device is used to execute the method in any one of claims 11-16.
18. An electronic device, comprising: The method comprises: One or more processors, one or more memories, and a transceiver, wherein the transceiver, the one or more memories, and the one or more processors are coupled, the one or more memories are configured to store a computer program, and when the one or more processors execute the computer program, perform the NFC card duplication method according to any one of claims 1-10.
19. An NFC device, characterized in that, Comprising: One or more processors, one or more memories, and a transceiver, wherein the transceiver, the one or more memories, and the one or more processors are coupled, the one or more memories are configured to store a computer program, and when the one or more processors execute the computer program, perform the NFC card duplication method according to any one of claims 11-16.
20. A computer-readable storage medium, characterized in that, A computer program is stored, and when the computer program is executed by a processor, the NFC card duplication method according to any one of claims 1-10 is implemented.
21. A computer-readable storage medium, characterized in that, A computer program is stored, and when the computer program is executed by a processor, the NFC card duplication method according to any one of claims 11-16 is implemented.
22. A computer program product, characterised in that, Comprising a computer program, when the computer program is executed by a processor, the NFC card duplication method according to any one of claims 1-10 is implemented.
23. A computer program product, characterised in that, Comprising a computer program, when the computer program is executed by a processor, the NFC card duplication method according to any one of claims 11-16 is implemented.
24. A chip system, characterized by Comprising processing circuitry and interface circuitry, the interface circuitry is configured to receive code instructions and transmit to the processing circuitry, and the processing circuitry is configured to run the code instructions to perform the NFC card duplication method according to any one of claims 1-10.
25. A chip system, characterized by Comprising processing circuitry and interface circuitry, the interface circuitry is configured to receive code instructions and transmit to the processing circuitry, and the processing circuitry is configured to run the code instructions to perform the NFC card duplication method according to any one of claims 11-16.
Citation Information
Patent Citations
Method and device for adding bank card
CN108604345A
Method and device for copying access control card by wearable device
CN109858578A
Method for copying smart card and electronic equipment
CN114172544A
Method for duplicating near field communication card and electronic device therefor
US20220038899A1