Near field communication method and device

By sending the first card search command when the NFC device authentication fails, the problem of NFC card swiping time and low success rate is solved, and a faster and more reliable card swiping process is achieved.

CN118659803BActive Publication Date: 2025-03-18YINWANG INTELLIGENT TECHNOLOGIES CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411132611.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2025-03-18
Estimated Expiration
2044-08-19

AI Technical Summary

Technical Problem

Existing NFC cards take a long time to swipe cards and have a low success rate.

Method used

When the NFC device authentication fails, a first card search instruction is sent to establish a communication connection between the NFC card reader and the NFC device, reducing user operations and improving success rate.

Benefits of technology

It reduces the time-consuming process of NFC card swiping, improves the success rate of card swiping, and improves the user's card swiping experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118659803B_ABST
    Figure CN118659803B_ABST
Patent Text Reader

Abstract

A near field communication method and device, relating to the field of near field communication technology. The method comprises: obtaining first information indicating that an NFC device authentication has failed, and sending a first card search instruction for establishing a communication connection between an NFC card reader and an NFC device. The above NFC-based method, in the case of an NFC device authentication failure, attempts to re-establish a communication connection between the NFC device and the NFC card reader by sending a first card search instruction, which enables the NFC device to establish a communication connection with the NFC card reader as quickly as possible, and from the user's perspective, the user will consider this to be a card swiping process, thereby increasing the success rate of the card swiping and further improving the user's card swiping experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of near field communication technology, and in particular to a near field communication method and device. Background Art

[0002] Near field communication (NFC) is a short-range wireless communication technology that features high security, low power consumption and low cost. It is widely used in access control, payment, public transportation or communication, etc. For example, using the card emulation mode of NFC, a mobile phone or electronic device that supports NFC can be used as a debit card, public transportation card or access control card. For another example, using the reader / writer mode of NFC, a mobile phone or electronic device that supports NFC can function as a card reader.

[0003] However, current NFC card swiping takes a long time and has a low success rate. Summary of the invention

[0004] The present application provides a near field communication method and device, and relates to the field of near field communication technology. The near field communication method provided by the present application can send a first card search instruction when an NFC device authentication failure is detected, so that the NFC device can continue to complete the authentication operation based on the first card search instruction without the user moving the NFC device to swipe the card again, thereby reducing the time consumption of NFC card swiping and improving the success rate of card swiping.

[0005] In a first aspect, the present application provides a near field communication method, applied to an NFC card reader, comprising: obtaining first information indicating that an NFC device authentication has failed, and sending a first card search instruction for establishing a communication connection between the NFC card reader and the NFC device.

[0006] In the present application, the NFC device can be an NFC electronic device with an emulated card set, or an NFC physical card. The first information is used to indicate that the NFC device authentication failed, for example, the NFC card reader receives the response information of the NFC device for a timeout, and for another example, the response information returned by the NFC device indicates that the NFC device authentication failed. It can be understood that the NFC device authentication failure can be understood as the NFC device card swiping failure, and the NFC device needs to re-enter the NFC radio frequency field of the NFC card reader and authenticate again. This process is cumbersome and easy to consume a lot of time. In the near field communication method provided by the present application, when the first information indicating the failure of the NFC device authentication is obtained, the NFC card reader will send a first card search instruction, and the first card search instruction is used to establish a communication connection between the NFC card reader and the NFC device, so as to complete the card swiping. Therefore, the near field communication method provided by the present application, on the one hand, does not need to execute the operation of the NFC device re-entering the NFC radio frequency field, which can greatly reduce the time consumption of card swiping. On the other hand, the NFC card reader sends the first card search instruction to allow the NFC device and the NFC card reader to try to establish a communication connection again. From the user's perspective, it will be considered that this is a card swiping process, thereby improving the success rate of card swiping, thereby improving the user's card swiping experience. In summary, the near field communication method provided by the present application has the characteristics of short card swiping time and high card swiping success rate.

[0007] Optionally, the first information is also used to instruct the NFC card reader to send a first card searching instruction.

[0008] In a possible implementation, the first card searching instruction is sent within a first time period.

[0009] In the above implementation, the starting time point of the first duration may be the time point when the NFC card reader obtains the first information, and the first duration is greater than 0s, for example, the first duration is 1s, 2s, 3s or 4s. Sending the first card search instruction within the first duration can be understood as continuously sending the first card search instruction within the time period represented by the first duration. By sending the first card search instruction within the first duration, on the one hand, it is used to ensure that the NFC device can receive the first card search instruction within the first duration and establish a communication connection between the NFC device and the NFC card reader, and on the other hand, it is used to allow the NFC card reader to stop sending the first card search instruction after sending the first card search instruction of the first duration, so as to avoid excessive energy consumption of the NFC card reader, or the phenomenon that the NFC card reader is damaged due to frequent first card search instructions.

[0010] In another possible implementation, the first time duration T satisfies the following relationship: 1s≤T≤4s.

[0011] In the above implementation, the first time duration T satisfies the following relationship: 1s≤ T ≤4s. On the one hand, it is used to ensure that the card swiping can be completed within the first time duration T. On the other hand, it is used to avoid the NFC card reader sending the first card search instruction for too long, resulting in a waste of resources.

[0012] In another possible implementation, the first card searching instruction is sent at a first frequency within a first duration.

[0013] In the above implementation, the first frequency is, for example, 5 times / s, 10 times / s or 20 times / s, etc. The first frequency can be set by the manufacturer of the NFC card reader at the factory, and can also be adjusted by updating parameters during the use of the card reader, and this application does not limit this. By setting the frequency of sending the first card search instruction, it is helpful to balance the relationship between the timeliness of the NFC device receiving the first card search instruction and the power consumption of the NFC card reader. For example, when the first frequency is too low, the time interval between the NFC card reader sending the first card search instruction twice will be too large, so that the NFC device cannot receive the first card search instruction in time, which may easily cause the problem of long card swiping time. If the first frequency is too high, the NFC card reader needs to send the first card search instruction frequently, which will cause the NFC card reader to consume too much power. In severe cases, it will also reduce the life of the NFC card reader or even damage the NFC card reader.

[0014] In another possible implementation, when the authentication of the NFC device is completed, sending the first card searching instruction is stopped.

[0015] In the above implementation, when the authentication of the NFC device is completed, stopping sending the first card search instruction helps to reduce the energy consumption of the NFC card reader and avoid unexpected problems caused by the NFC card reader continuing to send the first card search instruction, such as frequent locking and unlocking of the NFC device (hereinafter referred to as "ping-pong").

[0016] In another possible implementation, when the NFC device is authenticated and the NFC chip in the NFC card reader is in a state of waiting for a response polling, the sending of the first card search instruction is stopped.

[0017] In the above implementation, when the NFC card reader completes the authentication of the NFC device, it will also determine whether to stop sending the first card search instruction by reading the state of the NFC chip. For example, when the NFC chip in the NFC card reader is in a state of waiting for a response to polling, it is determined to stop sending the first card search instruction. Among them, the NFC chip is in a state of waiting for a response to polling, indicating that the NFC device and the NFC card reader are in a connected state, and the NFC device can communicate with the NFC card reader and transmit data. In the above implementation, by reading the state of the NFC chip, it is more accurately determined whether it is necessary to stop sending the first card search instruction, thereby avoiding the inability to authenticate other NFC devices due to stopping sending the first card search instruction. In addition, when the NFC device authentication is completed and the NFC chip in the NFC card reader is in a state of waiting for a response to polling, by stopping sending the first card search instruction, the "ping-pong" effect caused by the frequent sending of the first card search instruction can also be avoided.

[0018] Optionally, the NFC chip is also in a listening state, which indicates that the NFC card reader has not established a communication connection with any NFC device, and is waiting for other NFC devices to approach so as to read the information therein.

[0019] In another possible implementation, before acquiring the first information, the near field communication method further includes: sending a second card-searching instruction to the NFC device, where the second card-searching instruction is used to instruct the NFC device to wake up the first simulated card.

[0020] In the above embodiment, the second card search instruction is used to instruct the NFC device to wake up the first simulated card. The second card search instruction is, for example, a SELECT instruction, which is used to select a specific card for communication and data interaction operations. The second card search instruction may carry the identification information of the first simulated card, so that the NFC device can wake up the first simulated card based on the identification information of the first simulated card.

[0021] Optionally, the second card-searching instruction is used to instruct the NFC device to wake up the first simulated card. It can also be understood that the second card-searching instruction is used to instruct the NFC device to return relevant information of the first simulated card to establish a communication connection between the NFC device and the NFC reader, thereby completing the authentication of the NFC device.

[0022] Optionally, when multiple simulated cards are set in the NFC device, the second card search instruction is used to instruct the NFC device to wake up the first simulated card. It can also be understood that the second card search instruction is used to instruct the NFC device to switch cards. For example, the first simulated card and the second simulated card are set on the NFC device, and the second card search instruction is used to instruct the NFC device to switch the first simulated card to an activated state and the second simulated card to a dormant state.

[0023] In another possible implementation, the obtaining of the first information includes: when the time length for the NFC device to respond to the second card searching instruction is greater than a first threshold, obtaining the first information, the first information being used to indicate that the NFC device authentication has failed.

[0024] In the above implementation, when the time length of the NFC device responding to the second card search instruction is greater than the first threshold, the first information is obtained to indicate that the NFC device authentication fails, so that the NFC device authentication failure can be determined in time, so that the NFC card reader can perform subsequent related operations (for example, send the first card search instruction) in time, and then complete the authentication. The first threshold is, for example, 100ms or 200ms, and this application does not limit this.

[0025] In another possible implementation, the obtaining of the first information includes: receiving a first message from an NFC device, and obtaining the first information based on the first message, where the first information is used to indicate that the NFC device authentication fails.

[0026] In the above implementation, the NFC card reader receives a first message from the NFC device, and obtains the above first information based on the first message. The first message is, for example, a non-9000 message replied by the NFC device, which is used to indicate that the authentication key does not exist, the authentication key is wrong, or the data encryption standard (DES) encryption error occurs.

[0027] In another possible implementation, the first simulated card is any one of a first access card, a first bus card, a first car key or a first bank card.

[0028] In another possible implementation, the NFC device includes an electronic device with an NFC function or an NFC physical card.

[0029] In the above implementation, the electronic device with NFC function is, for example, a mobile phone, smart watch, smart bracelet or tablet computer with NFC function. An NFC physical card is a card with a built-in NFC chip, such as an access card, a transportation card, a car key or a bank card.

[0030] In another possible implementation, the first card search instruction includes a request command type A (request command type A, REQA), a request command type B (request command type B, REQB), a request command type F (request command type F, REQF) or a request command type V (request command type V, REQV), etc.

[0031] It is understandable that the first card search instruction is usually determined according to the function of the NFC card reader. For example, when the NFC card reader is used to read the information of type A cards, the first card search instruction is REQA. For another example, when the NFC card reader is used to read the information of type B cards, the first card search instruction is REQB.

[0032] In a second aspect, the present application provides a near field communication device, including an acquisition unit and a communication unit, wherein the acquisition unit is used to acquire first information, the first information is used to indicate that the NFC device authentication fails, and the first information is also used to instruct the near field communication device to send a first card search instruction.

[0033] The communication unit is used to send a first card-searching instruction, and the first card-searching instruction is used to establish a communication connection between the near field communication device and the NFC device.

[0034] In a possible implementation, the communication unit is specifically configured to send a first card searching instruction within a first time period.

[0035] In another possible implementation, the communication unit is specifically configured to send the first card searching instruction at a first frequency within a first duration.

[0036] In another possible implementation, the first time duration T satisfies the following relationship: 1s≤T≤4s.

[0037] In another possible implementation, when the authentication of the NFC device is completed, the communication unit is further configured to stop sending the first card searching instruction.

[0038] In another possible implementation, when the NFC device is authenticated and the NFC chip in the near field communication device is in a polling state waiting for a response, the communication unit is configured to stop sending the first card search instruction.

[0039] Optionally, the NFC chip is also in a listening state, which indicates that the NFC card reader has not established a communication connection with any NFC device, and is waiting for other NFC devices to approach so as to read the information therein.

[0040] In another possible implementation, before the acquiring unit acquires the first information, the communication unit is further configured to send a second card-searching instruction to the NFC device, where the second card-searching instruction is configured to instruct the NFC device to wake up the first simulated card.

[0041] Optionally, the second card-searching instruction is used to instruct the NFC device to wake up the first simulated card. It can also be understood that the second card-searching instruction is used to instruct the NFC device to return relevant information of the first simulated card to complete the authentication of the NFC device.

[0042] Optionally, when multiple simulated cards are set in the NFC device, the second card search instruction is used to instruct the NFC device to wake up the first simulated card. It can also be understood that the second card search instruction is used to instruct the NFC device to switch cards, for example, instructing the NFC device to switch the first simulated card to an active state and the second simulated card to a sleep state.

[0043] In another possible implementation, the acquisition unit is specifically configured to acquire first information when the time length for the NFC device to respond to the second card search instruction is greater than a first threshold, where the first information is used to indicate that the NFC device authentication fails.

[0044] In another possible implementation, the communication unit is further configured to obtain a first message from the NFC device. The obtaining unit is specifically configured to obtain first information based on the first message, where the first information is used to indicate that the NFC device authentication fails.

[0045] In another possible implementation, the first simulated card is any one of a first access card, a first bus card, a first car key or a first bank card.

[0046] In another possible implementation, the NFC device includes an electronic device with an NFC function or an NFC physical card.

[0047] In another possible implementation, the first card searching instruction includes REQA, REQB, REQF or REQV.

[0048] In a third aspect, the present application provides a terminal, comprising the near field communication device described in any one of the second aspects. Optionally, the terminal includes a smart phone, an access control card reader, a bus card reader, a contactless payment terminal, a vehicle, a robot, a drone, or a ship, etc., such as an intelligent terminal or a means of transportation.

[0049] In a fourth aspect, a terminal is provided, comprising: a processor, a memory, an NFC module and a touch screen, wherein the memory, the touch screen, the NFC module are coupled to the processor, the memory is used to store computer program code, the computer program code comprises computer instructions, and when the processor reads the computer instructions from the memory, the terminal implements a method as described in any one of the first aspects.

[0050] In a fifth aspect, a chip is provided, comprising a processor, and when the processor executes instructions, it implements any method as described in the first aspect.

[0051] In a sixth aspect, the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed by a computer, a method as described in any one of the first aspects is implemented.

[0052] In a seventh aspect, the present application provides a computer program product comprising instructions, wherein the computer program product comprises computer program codes, and when the computer program codes are executed on a computer, the method as described in any one of the first aspects is implemented.

[0053] In an eighth aspect, an embodiment of the present application provides a data interaction system, which may include an NFC device and an NFC card reader, and the NFC device and the NFC card reader may be used to execute any method in the above-mentioned first aspect.

[0054] The solutions provided in the second to eighth aspects are used to implement or cooperate with the corresponding methods provided in the first aspect, and therefore can achieve the same or corresponding beneficial effects as the corresponding methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0056] Figure 1A A schematic diagram of a communication system provided by the present application;

[0057] Figure 1B for Figure 1A A schematic diagram of the operation of the communication system shown;

[0058] Figure 2 A schematic diagram of an application scenario of an NFC card reader provided in this application;

[0059] Figure 3 A user interface diagram of a wallet application provided for this application;

[0060] Figure 4 A schematic diagram of a card cutting process provided in this application;

[0061] Figure 5 A schematic diagram of another card cutting process provided for this application;

[0062] Figure 6 A schematic diagram of the process of the first near field communication method provided in this application;

[0063] Figure 7 A schematic diagram of a second near field communication method provided in this application;

[0064] Figure 8 A schematic diagram of a third near field communication method provided in this application;

[0065] Fig. 9 A schematic diagram of a fourth near field communication method provided in this application;

[0066] Fig.10 A schematic block diagram of a first near field communication device provided in an embodiment of the present application;

[0067] Fig.11 A schematic block diagram of a second near field communication device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0068] In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

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

[0070] The "embodiment" mentioned in this article means that the specific features, structures or characteristics described in conjunction with the embodiment can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It can be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

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

[0072] The following is an explanation of some terms in this application. It should be noted that these explanations are for the convenience of understanding by those skilled in the art and are not intended to limit the scope of protection claimed in this application.

[0073] 1.NFC.

[0074] NFC is a short-range high-frequency wireless communication technology that allows contactless point-to-point data transmission between NFC devices within a distance of 10 cm. The transmission speed of NFC technology includes 106Kbit / s, 212Kbit / s or 424Kbit / s. At present, NFC technology has become a relevant international standard and is widely used. For example, NFC follows standards such as ISO 18092 (NFCIP-1) and ISO 21481 (NFCIP-2).

[0075] 2.NFC device.

[0076] In this application, NFC devices include electronic devices with NFC functions or NFC physical cards. Electronic devices with NFC functions refer to electronic devices with built-in NFC chips, which can perform NFC communication and implement NFC related functions, such as card simulation function, card reader function or point-to-point function, etc. Electronic devices with NFC functions include smart phones, smart bracelets, smart watches, tablet computers or laptops, etc. NFC physical cards include access cards, transportation cards, bank cards, car keys or campus cards, etc. In one possible implementation, electronic devices with NFC functions can be set with multiple simulation cards to simulate the information and functions of different NFC physical cards, which can improve the convenience of users' travel.

[0077] 3.NFC card reader.

[0078] An NFC reader is a device that can read and process information stored in a NFC device or tag. For example, an NFC reader can read text, URLs, or contact information in an NFC device. For another example, an NFC reader supports data writing operations and can write information into an NFC device or tag. NFC readers can be set up in access control systems (e.g., home doors, company doors, subway doors, or doors of various venues, etc.), payment systems (e.g., cash collection devices in stores or ATMs in banks, etc.), or vehicle door locking and unlocking systems, etc.

[0079] 4.NFC communication system.

[0080] See also Figure 1A , Figure 1AThe present application provides a communication system, which includes an NFC device 101 and an NFC card reader 102. The NFC device 101 can refer to the above-mentioned introduction about the NFC device, and the NFC card reader 102 can also refer to the above-mentioned introduction about the NFC card reader, which will not be repeated here. The NFC device 101 and the NFC card reader 102 can communicate within any appropriate short-range distance, such as 2 cm, 3 cm or 4 cm. For a detailed introduction to the communication between the NFC device 101 and the NFC card reader 102, please refer to Figure 1B .like Figure 1B As shown, the NFC reader 102 can generate an electromagnetic field of a specific frequency (also called the NFC electromagnetic field of the NFC reader 102). If the NFC device 101 enters the effective range of the NFC electromagnetic field, the induction coil in the NFC device 101 will receive the energy of the NFC electromagnetic field and convert it into electrical energy to power the NFC chip of the NFC device 101, thereby realizing communication between the NFC device 101 and the NFC reader 102.

[0081] The above explanations of terms may be applied hereinafter.

[0082] In order to better understand the near field communication method provided by the present application, an application scenario of the NFC card reader provided by the present application is first introduced below.

[0083] Figure 2 The following is a schematic diagram of an NFC card reader application scenario. In this example, the NFC card reader 102 is installed on the rearview mirror of a vehicle, so it is also called a vehicle-mounted near-field communication device. In addition, the NFC card reader 102 also includes a ship-mounted near-field communication device installed on a ship, and an airborne near-field communication device installed on a machine. Of course, the NFC card reader 102 can also be installed on access control and cash machines. In a possible example, Figure 2 As shown, when the user holds the NFC device 101 close to the NFC reader 102, the NFC reader 102 can communicate with the NFC device 101 and read the relevant information on the NFC device 101 to determine whether to unlock the door of the vehicle.

[0084] In a possible implementation, the NFC device 101 is an NFC physical card. It is understandable that the NFC device 101 is an NFC physical card and needs to complete the card swiping operation according to the NFC electromagnetic field provided by the NFC card reader 102. However, the NFC electromagnetic field is prone to instability, so that when the NFC device 101 swipes the card, the card swiping operation may fail or take a long time.

[0085] In another possible implementation, the NFC device 101 is an electronic device with an NFC function, and the wallet application on the NFC device 101 is used to manage multiple simulated cards. Next, taking a mobile phone as an example, the case where the NFC device 101 is an NFC electronic device and multiple simulated cards are set is exemplarily introduced.

[0086] See also Figure 3 , Figure 3 This is a schematic diagram of a user interface of a wallet application provided in the present application. The user interface 300 includes a status bar 310 , a card package, and a page switching bar 320 .

[0087] The status bar 310 includes information such as the current time, network status, and power level. Figure 3 As shown, the current time is 08:08, the network status includes wifi and NFC, and the black part of the power level can represent the remaining power of the NFC device 101. The NFC device 101 can simulate multiple simulated cards through the wallet application. For example, the simulated cards may include bank cards, bus cards, access cards, electronic ID cards, or smart door lock cards. In the embodiment of the present application, bank cards, bus cards, access cards, electronic ID cards, and smart door lock cards are all categories of simulated cards. For example, bank cards include bank card A and bank card B. Users can view the added simulated cards in the card bag page of the wallet application, such as Figure 3 As shown, the card package includes "bank card", "transportation card" and "key", where "bank card" includes "bank card A" and "bank card B"; "transportation card" includes "subway card C"; "key" includes "my home" and "my car". The page switching bar 320 includes multiple page switching buttons, which are used to switch between multiple pages in the wallet application. For example, Figure 3 As shown, the multiple page switching buttons include a "Home" button, a "Life" button, a "Card Bag" button, and a "My" button. For example, when the user clicks the "Card Bag" button, the NFC device 101 displays the card bag page. Although the NFC device 101 can simulate multiple simulated cards through the wallet application, only one simulated card can be activated at a time, that is, the NFC device 101 can only be used as one card at the same time. For example, the NFC device 101 can only be used as "My Home" or "Metro Card C" at the same time. The user can set the default card in the wallet application as the priority card to be activated. Figure 3 As shown, the user sets the access card "My Home" as the default card. However, when the NFC card reader 102 is used to read a non-default card (e.g., "Subway Card C"), the NFC device 101 needs to switch "My Home" to "Subway Card C" to complete the card swiping operation. For the process of the NFC device 101 switching the card, please refer to the following description.

[0088] For example, the card cutting process of the NFC device 101 can be completed by the user by selecting a designated card (eg Figure 4 As shown), it can also be completed by the NFC device 101 by automatically selecting a card (such as Figure 5 as shown).

[0089] See also Figure 4 Figures (a) to (d) in the figure, Figure 4 The figures (a) to (d) shown are, for example, Figure 3 For example, when the user holds the NFC device 101 close to the rearview mirror of the vehicle (with the NFC card reader 102 built in), the NFC device 101 will pop up a default card. For example, the user interface of the NFC device 101 pops up a default card "My Home", such as Figure 4 As shown in the middle figure (a). In this case, the user needs to switch from "my home" to "my car". For example, the user clicks the "car key" on the NFC device 101 to complete the card switch, as shown in FIG. Figure 4 As shown in Figure (b) in the figure. The user interface displayed when the NFC device 101 completes the card cutting is as follows: Figure 4 As shown in Figure (c) in FIG. It can be understood that after the NFC device 101 completes the card cutting, the NFC device 101 is used as a vehicle key to pass the authentication of the NFC card reader 102, thereby completing the unlocking of the vehicle. Figure 4 Figure (d) in FIG. 1 is a user interface of the NFC device 101 after the vehicle is unlocked. Figure 4 As can be seen from the description, Figure 4 The card cutting scheme shown requires user intervention to assist the NFC device 101 in completing the card cutting operation, which is cumbersome and has low card swiping efficiency. To this end, this application also provides an automatic card cutting scheme, see Figure 5 .

[0090] like Figure 5 As shown, Figure 5 The figures (a) to (c) shown are, for example, Figure 3 For example, when a user holds the NFC device 101 close to a vehicle rearview mirror (with a built-in NFC reader 102), the NFC device 101 will display Figure 5 In the interface shown in Figure (a), for example, the user interface of the NFC device 101 will display the words "Running Smart Flash Card...". Figure 5 In the case of the interface shown in the middle figure (a), the NFC device 101 will automatically cut the card according to the acquired unique identifier (UID). The user interface after the NFC device 101 completes the card cutting according to the UID is as follows: Figure 5 As shown in the middle figure (b). Further, the NFC device 101 is used as a vehicle key to pass the authentication of the NFC card reader 102, thereby completing the unlocking of the vehicle. Figure 5 Figure (c) in FIG. 1 is a user interface of the NFC device 101 after the vehicle is unlocked. Figure 5 As can be seen from the description, Figure 5 The card-cutting solution shown does not require user intervention, and can automatically complete a series of card-swiping operations such as card-cutting and authentication according to the acquired UID, which can improve the efficiency of card-swiping. However, the automatic card-cutting process of the NFC device 101 takes a long time, and is prone to stuck, wrong cutting, etc., which also leads to low card-swiping success rate and long card-swiping time.

[0091] In combination with the above description, it can be known that when the NFC device 101 is an NFC physical card, the NFC electromagnetic field is prone to instability, which makes it easy for the NFC device 101 to fail to swipe the card or the card swiping process is time-consuming. When the NFC device 101 is an NFC electronic device, whether the NFC device 101 automatically completes the card cutting or the NFC device 101 manually completes the card cutting, there are problems such as easy card cutting failure and slow card cutting speed, which leads to a low card swiping success rate and slow card swiping speed.

[0092] In view of this, the present application provides a near field communication method and device, which relates to the field of near field communication technology. When the NFC device authentication fails, a first card search instruction can be sent to complete the card swiping. On the one hand, it can effectively improve the success rate of the card swiping, and on the other hand, it can greatly reduce the time consumption of the card swiping.

[0093] See also Figure 6 , Figure 6 This is a flow chart of the first near field communication method provided by this application. It should be understood that Figure 6 For the convenience of description, the near field communication method shown is described in the order of step S601 to step S602, and is not intended to be limited to the execution in the above order. The embodiment of the present application does not limit the execution order, execution time, execution number, etc. of the above one or more steps. Steps S601 to S602 are as follows:

[0094] S601: An NFC card reader obtains first information.

[0095] Among them, the NFC card reader is for example the aforementioned Figure 1A The NFC card reader 102 shown in FIG. 1 is a NFC card reader. For the description of the NFC card reader, please refer to the introduction of the aforementioned content, which will not be repeated here. The first information is used to indicate that the NFC device authentication fails. The NFC device is, for example, the aforementioned Figure 1AFor the description of the NFC device 101 shown in FIG. 1 , reference can also be made to the introduction of the aforementioned content and will not be repeated here.

[0096] It should be noted that before the NFC card reader obtains the first information, the NFC card reader will send a second card search instruction to the NFC device, and the second card search instruction is used to instruct the NFC device to wake up the first simulated card. Among them, the second card search instruction is, for example, a SELECT instruction, which is used to select a specific card for communication and data interaction operations. The second card search instruction can carry the identification information of the first simulated card, so that the NFC device can wake up the first simulated card based on the identification information of the first simulated card. It can be understood that when the NFC device is a physical card, the above-mentioned first simulated card is the NFC device. When the NFC device is an electronic device with NFC function, the above-mentioned first simulated card can be any simulated card set in the NFC device. The above-mentioned "instructing the NFC device to wake up the first simulated card" can be understood as, when the NFC device is an NFC card, instructing the NFC device to send relevant information of the first simulated card to the NFC card reader. It can also be understood that when the NFC device is an electronic device with NFC function, the first simulated card set in the NFC device is adjusted to an activated state, and the relevant information of the first simulated card is sent to the NFC card reader. For the function of the second card search instruction and the related operations that the NFC device may perform after receiving the second card search instruction, please refer to the following Figure 7 The corresponding content in the introduction will not be described in detail here.

[0097] Optionally, the second card-searching instruction is also called a "card-selecting instruction".

[0098] Optionally, the first simulated card is any one of a first access card, a first bus card, a first car key or a first bank card.

[0099] In some scenarios, after receiving the second card search instruction from the NFC card reader, the NFC device usually sends a response message to the NFC card reader. For example, the response message includes a select acknowledgement (SAK) message, an answer to select (ATS) message, or an error response message. Among them, the "error response message" is used to indicate that the NFC device cannot establish a communication connection with the NFC card reader normally.

[0100] In other scenarios, after receiving the second card search instruction from the NFC card reader, the NFC device may not return a response message to the NFC card reader, or the waiting time for returning a response message to the NFC card reader may time out. For a detailed description of the above two scenarios, please refer to the subsequent Figure 8The near field communication method shown is not described in detail here.

[0101] In combination with the above description, the NFC card reader obtains the first information, including two possible situations, as shown below:

[0102] Case 1: The response message returned by the NFC device includes "error response information".

[0103] In a possible implementation, the NFC card reader receives a first message from the NFC device, and acquires first information based on the first message, where the first information is used to indicate that the NFC device authentication fails.

[0104] Exemplarily, when the NFC card reader receives a response message including "error response information" from the NFC device regarding the second card search instruction, the NFC card reader obtains first information according to the "error response information", where the first information is used to indicate that the NFC device authentication has failed.

[0105] Case 2: The NFC device returns a response message timeout, for example, the NFC returns a response message exceeding the first threshold.

[0106] In a possible implementation, when the time length for the NFC device to respond to the second card-searching instruction is greater than a first threshold, the NFC card reader obtains first information, where the first information is used to indicate that the NFC device authentication fails.

[0107] Exemplarily, when the NFC card reader sends the second card search instruction to the NFC device, it will establish a timestamp to record the time of sending the second card search instruction. Furthermore, the NFC card reader can determine whether the waiting time for the NFC card reader to receive the second card search instruction response message from the NFC device exceeds the first threshold value based on the timestamp, so as to determine whether the NFC device has timed out sending the response message of the second card search instruction. The first threshold value is, for example, 100ms or 200ms, which is not limited in this application. For example, if the first threshold value is 100ms, and the NFC card reader does not receive the response message of the second card search instruction within 100ms after sending the second card search instruction to the NFC device, it is considered that the time length for the NFC device to respond to the second card search instruction is greater than the first threshold value.

[0108] It should be noted that the second card search instruction can be combined with the following Figure 7 The “card selection instruction” shown in S704 can be understood.

[0109] Optionally, the first information is also used to instruct the NFC card reader to send a first card search instruction. The first card search instruction is used to establish a communication connection between the NFC card reader and the NFC device. Exemplarily, the first card search instruction may be a card search request instruction such as REQA / B / F / V.

[0110] S602: The NFC card reader sends a first card search instruction.

[0111] The first card search instruction is used to establish a communication connection between the NFC card reader and the NFC device. The first card search instruction can be a card search request instruction such as REQA / B / F / V. For a detailed introduction to the first card search instruction, please refer to the following Figure 7 For example, the NFC card reader can send a card search request instruction such as REQA / B / F / V through a radio frequency signal.

[0112] In a possible implementation, the NFC card reader sends the first card search instruction within a first duration, wherein the starting time point of the first duration may be the time point when the NFC card reader obtains the first information, and the first duration is greater than 0s, for example, the first duration is 1s, 2s, 3s or 4s.

[0113] Exemplarily, the first time length is 3s, and the time point when the NFC reader obtains the first information can be any time point. For example, the time point when the NFC reader obtains the first information is 00:00:00 on January 1, 2020, then the NFC reader will continuously send the first card search instruction in the time period from 00:00:00 on January 1, 2020 to 00:03 on January 1, 2020.

[0114] The above-mentioned implementation scheme sends the first card searching instruction within the first time period. On the one hand, it is used to ensure that the NFC device can receive the first card searching instruction within the first time period and establish a communication connection between the NFC device and the NFC reader. On the other hand, it is used to enable the NFC reader to stop sending the first card searching instruction after sending the first card searching instruction for the first time period, so as to avoid excessive energy consumption of the NFC reader, or damage to the NFC reader due to frequent issuance of the first card searching instruction.

[0115] Optionally, the first time duration T satisfies the following relationship: 1s≤ T ≤4s.

[0116] In another possible implementation, the NFC card reader sends a first card search instruction at a first frequency within a first duration. The first duration can be described with reference to the above description, and the first frequency is greater than 0.2 times / s, for example, the first frequency is 1 time / s, 5 times / s, 10 times / s or 20 times / s, etc. The first frequency can be set by the manufacturer of the NFC card reader at the factory, and can also be adjusted by updating parameters during the use of the card reader, which is not limited in this application.

[0117] Exemplarily, the first time length is 3s, the first frequency is 10 times / s, and the time point when the NFC reader obtains the first information is 00:00:00 on January 1, 2020. The NFC reader will continuously send the first card search instruction at a frequency of 10 times per second during the time period from 00:00:00 on January 1, 2020 to 00:00:03 on January 1, 2020. Alternatively, the NFC reader will send the first card search instruction every 100ms during the time period from 00:00:00 on January 1, 2020 to 00:00:03 on January 1, 2020.

[0118] The above implementation method helps to balance the relationship between the timeliness of the NFC device receiving the first card search instruction and the power consumption of the NFC card reader by setting the frequency of sending the first card search instruction. For example, when the first frequency is too low, the time interval between the NFC card reader sending the first card search instruction twice will be too long, so that the NFC device cannot receive the first card search instruction in time, which may easily cause the problem of long card swiping time. If the first frequency is too high, the NFC card reader needs to send the first card search instruction frequently, which will cause the NFC card reader to consume too much power. In severe cases, it will also reduce the life of the NFC card reader or even damage the NFC card reader.

[0119] Furthermore, when the NFC device in the NFC radio frequency field of the NFC card reader receives the first card searching instruction, it will return a response message of the first card searching instruction to establish a communication connection between the NFC card reader and the NFC device.

[0120] It should be noted that after the NFC card reader obtains the first information, no matter whether the NFC device is still in the NFC radio frequency field of the NFC card reader, the NFC card reader will still send the first card search instruction. Next, three specific scenarios will be further introduced.

[0121] Scenario 1: The NFC device is matched with the NFC card reader, and the NFC device is in the NFC radio frequency field of the NFC card reader. However, the field strength provided by the NFC card reader is unstable, the NFC device responds to the second card selection instruction timeout, and the communication process of the NFC card reader sending the second card selection instruction has errors, resulting in the inability to complete the card swiping operation in time.

[0122] The above-mentioned NFC device and NFC card reader are matched, which means that the NFC device and the NFC card reader can complete the card swiping operation under normal circumstances. For example, the NFC card reader is an NFC card reader set in a bank deposit and withdrawal machine, and the NFC device is a bank card.

[0123] Obviously, "Scenario 1" is a card swiping failure caused by some objective problems of the NFC card reader or NFC device. Usually, the user needs to operate the NFC device to re-enter the NFC radio frequency field of the NFC card reader to complete the card swiping operation. Figure 6 In the near field communication method shown, when the NFC card reader determines that the NFC device authentication fails, it will send a first card search instruction to try again to establish a communication connection between the NFC device and the NFC card reader, thereby completing the card swiping operation. This process will not be perceived by the user, and the user will think that this is a card swiping process, thereby increasing the success rate of the card swiping and thus improving the user's card swiping experience. In addition, due to Figure 6 The near field communication method shown does not require the NFC device to re-enter the NFC radio frequency field, thus significantly reducing the time consumption of card swiping.

[0124] Scenario 2: The NFC device matches the NFC card reader. However, the NFC device quickly leaves the NFC RF field of the NFC card reader, and the field strength provided by the NFC card reader is unstable, the NFC device times out in response to the second card selection instruction, and an error occurs in the communication process of the NFC card reader sending the second card selection instruction, resulting in the inability to complete the card swiping operation in time. In short, "Scenario 2" can be understood as a wrong card swiping scenario, and the NFC device and the NFC card reader fail to swipe the card in time due to objective reasons.

[0125] In "Scenario 2", even if the NFC card reader leaves the NFC radio frequency field provided by the NFC card reader in time due to an incorrect card swipe, the NFC card reader will still send the first card search instruction. Combined with the NFC card reader sending the first card search instruction in the first time, the resource waste in "Scenario 2" can be reduced.

[0126] Scenario 3: The NFC device and NFC reader do not match.

[0127] Combined with the description of S601 above, it can be known that before the NFC card reader obtains the first information, the NFC card reader will send a second card search instruction to the NFC device, and the second card search instruction is, for example, a SELECT instruction. It is understandable that when the NFC device and the NFC card reader do not match, the NFC card reader will not send the second card selection instruction to the NFC. For a detailed introduction to this part, please refer to the following Figure 7 For the introduction, no pixels are given here.

[0128] Combined with the introduction of the above “Scenario 3”, it can be known that when the NFC device and the NFC card reader do not match, the NFC card reader will not be triggered to send the first card selection instruction, so there is no waste of resources.

[0129] It can be seen that after the NFC card reader obtains the first information, no matter whether the NFC device is in the NFC radio frequency field provided by the NFC card reader or not, the NFC card reader will send the first card search instruction.

[0130] To better understand the above Figure 6 In S601, how the NFC card reader obtains the first information, the following first describes some interaction processes between the NFC card reader and the NFC device before the NFC card reader obtains the first information.

[0131] See also Figure 7 , Figure 7 The flowchart of the second near field communication method provided by the present application is as follows. It can be understood that the steps in the embodiment of the present application can be regarded as the above Figure 6 or, it can be understood that the near field communication method in the embodiment of the present application can also be regarded as an embodiment that can be executed independently, and the present application does not limit this. Figure 7 The near field communication method shown includes but is not limited to the following steps:

[0132] S701: The NFC card reader detects that an NFC device is approaching. For example, the NFC card reader can continuously monitor changes in the NFC electromagnetic field. The NFC card reader can also detect whether a card is approaching by sending a specific command. This application does not limit how the NFC card reader detects that an NFC device is approaching.

[0133] S702: The NFC card reader sends a request to obtain information to the NFC device. Correspondingly, the NFC device receives the request from the NFC card reader to obtain information.

[0134] Exemplarily, the NFC card reader sends a card search request instruction such as REQA / B / F / V to the NFC device, and correspondingly, the NFC device receives the card search request instruction such as REQA / B / F / V sent by the NFC card reader. For example, the NFC card reader can send a card search request instruction such as REQA / B / F / V to the NFC device through a radio frequency signal. Of course, in some implementations, the NFC card reader sends a card search request instruction such as REQA / B / F / V, which can be used to detect whether there is an NFC device close to the NFC card reader, and this application does not limit this.

[0135] Exemplarily, the request information is mainly used to obtain the response of the NFC device, paving the way for establishing a communication connection between the NFC device and the NFC card reader. The request information may include information on basic parameters such as the communication protocol and frequency supported by the NFC card reader.

[0136] S703: The NFC device sends a response message for requesting to obtain information to the NFC card reader. Correspondingly, the NFC card reader receives the response message for requesting to obtain information from the NFC device.

[0137] Exemplarily, the response message for requesting to obtain information may include response instructions such as ATQA / B / F / V. For example, if the request for obtaining information is REQA, then the response message for obtaining information is ATQA. For another example, if the request for obtaining information is REQB, then the response message for obtaining information is ATQB. Among them, the response message for requesting to obtain information may include basic information such as the type of NFC device and supported communication protocols, which is used to allow the NFC reader to initially understand the characteristics of the NFC device in order to determine subsequent communication methods and instructions. In order to more clearly describe the response message for requesting to obtain information, the response message for requesting to obtain information can be displayed in the form of a table, such as Table 1 which is an exemplary response message for requesting to obtain information.

[0138] Table 1 Response message to request information

[0139]

[0140] As shown in Table 1, the type of NFC device in the response message of the request to obtain information may include: "electronic device with NFC function" or "NFC physical card", and the communication protocol supported by the NFC device in the response message of the request to obtain information may include: "ISO 14443 Type A", "ISO 14443 Type B", "ISO 14443 Type F", "ISO 14443 Type V", "ECMA - 340 / ISO 18092 (NFCIP - 1)" or "ECMA - 352 / ISO 21481 (NFCIP - 2)". Of course, the response message of the request to obtain information may also include other information, which is not limited in this application. For example, the response message of the request to obtain information may also include information such as communication frequency or encoding method.

[0141] S704: The NFC card reader sends a card selection instruction to the NFC device, and correspondingly, the NFC device receives the card selection instruction from the NFC card reader.

[0142] Exemplarily, the card selection instruction may be a SELECT instruction. The card selection instruction is used to select a specified NFC card to establish subsequent communication and perform data addition, deletion, modification, and query. For example, the card selection instruction may include information such as the UID of the NFC card, and the identifier can be used to ensure that the NFC card reader communicates with the specified NFC card. Of course, the card selection instruction also has an anti-collision function, which is not limited in this application.

[0143] S705 (case 1): the NFC device sends a response message of the card selection instruction to the NFC card reader. Accordingly, the NFC card reader receives the response message of the card selection instruction from the NFC device.

[0144] The response message of the card selection instruction may include a select acknowledgement (SAK) message, an answer to select (ATS) message, or an error response message.

[0145] Among them, the "SAK information" is used to make a confirmation response to the SELECT command sent by the NFC card reader, indicating that the NFC card has been successfully selected and is ready for subsequent communication.

[0146] The "ATS information" is used to provide the NFC reader with detailed information about the characteristics and communication parameters of the NFC card so that the NFC reader can perform effective subsequent communication with the NFC device.

[0147] "Error response information" is used to indicate that the NFC card cannot establish a normal communication connection with the NFC card reader, which may include the following reasons: 1) The NFC card does not support the operation or function requested by the NFC card reader; 2) The NFC card is locked or protected, prohibiting the current card selection operation; 3) The card selection parameters provided by the NFC card reader are incorrect or incomplete, resulting in the NFC card being unable to recognize and respond; 4) The storage area of ​​the NFC device is damaged or malfunctioning, and the card selection operation cannot be completed and cannot respond normally; 5) During the communication between the NFC device and the NFC card reader, signal interference, transmission failure and other problems occur, resulting in errors in the relevant information transmitted. It can be understood that if the NFC device is an electronic device with NFC function, the above-mentioned NFC card may refer to the NFC simulated card in the NFC device. If the NFC device is an NFC physical card, the above-mentioned NFC card may refer to the NFC device.

[0148] Combined with the above description, it can be known that when the response message of the card selection instruction sent by the NFC device to the NFC card reader is "SAK information" and / or "ATS information", the NFC device and the NFC card reader can continue to communicate to complete subsequent authentication or data addition, deletion, modification, and query operations. However, when the response message of the card selection instruction is "error response information", the NFC device and the NFC card reader cannot complete subsequent communication.

[0149] S706 (Case 2): The NFC card reader detects that the response to the card selection instruction sent by the NFC device times out.

[0150] For the relevant introduction of the response message of the card selection instruction, please refer to the corresponding description in S705, which will not be repeated here.

[0151] Exemplarily, when the NFC card reader sends a card selection instruction to the NFC device, it will create a timestamp to record the time when the card selection instruction is sent. Further, the NFC card reader can determine whether the waiting time for the NFC card reader to receive the card selection instruction response message from the NFC device exceeds the first threshold value according to the timestamp, so as to determine whether the NFC device has timed out sending the card selection instruction response message. The first threshold value is, for example, 100ms or 200ms, which is not limited in this application.

[0152] Combined with the above description, it can be known that the near field communication method provided by the present application, on the one hand, can greatly reduce the time consumption of card swiping because there is no need to execute the operation of the NFC device re-entering the NFC radio frequency field, and on the other hand, the NFC card reader sends the first card search instruction to allow the NFC device and the NFC card reader to try to establish a communication connection again, which can effectively improve the success rate of card swiping. In short, the near field communication method provided by the present application has the characteristics of short card swiping time and high card swiping success rate.

[0153] It is understandable that the above Figure 6 In the near field communication method shown, when the NFC device and the NFC card reader establish communication and complete authentication based on the first card search instruction, the NFC card reader may still continue to send the first card search instruction, causing the NFC card reader to continuously recognize that the NFC device is completed, thereby presenting the phenomenon of the NFC card reader continuously presenting "unlock", "lock", "unlock", "lock" (i.e., "ping-pong" effect). In view of this phenomenon, the present application provides a near field communication method.

[0154] See also Figure 8 , Figure 8 This is a flow chart of the third near field communication method provided by the present application. It can be understood that the steps in the embodiment of the present application can be regarded as the above Figure 6 or, it can be understood that the near field communication method in the embodiment of the present application can also be regarded as an embodiment that can be executed independently, and the present application does not limit this. Figure 8 The near field communication method includes but is not limited to the following steps:

[0155] S801: The NFC card reader obtains first information. For a detailed description, please refer to the description of S601 above, which will not be repeated here.

[0156] S802: The NFC card reader sends a first card search instruction. For a detailed description, please refer to the description of S602 above, which will not be repeated here.

[0157] S803: After completing the authentication of the NFC device, the NFC card reader stops sending the first card search instruction.

[0158] As described in S705 above, it can be known that the response message of the card selection instruction sent by the NFC device to the NFC card reader may include SAK information, ATS information or "error response information", etc. Moreover, when the NFC device sends a response message of the card selection instruction to the NFC card reader within a preset waiting time, and the response message of the card selection instruction includes SAK information and / or ATS information, the NFC card reader and the NFC device can establish subsequent communication and complete related operations. Therefore, in this application, the NFC card reader completes the authentication of the NFC device, which may refer to "the NFC device sends a response message of the card selection instruction (first card search instruction) to the NFC card reader within a preset waiting time, and the response message of the card selection instruction (first card search instruction) includes SAK information and / or ATS information". In some implementations, the NFC card reader completes the authentication of the NFC device, which needs to meet one or more of the following: completing the identity authentication of the NFC device, completing the data integrity verification, or completing the authority verification, etc.

[0159] It is understandable that when the NFC reader completes authentication of the NFC device, stopping sending the first card search instruction helps reduce the energy consumption of the NFC reader and avoid unexpected problems caused by the NFC reader continuing to send the first card search instruction, such as the "ping-pong" effect.

[0160] In a possible implementation, when the NFC card reader completes authentication of the NFC device and the NFC chip in the NFC card reader is in a state of waiting for a response polling, the NFC card reader stops sending the first card search instruction.

[0161] Exemplarily, the status information of the NFC chip can be obtained in the following ways. Among them, the status information of the NFC chip includes the waiting response polling state or the listening state. The polling state is used to indicate that the NFC device and the NFC card reader are in a connected state, and the NFC device can communicate with the NFC card reader and transmit data. The listening state is used to indicate that the NFC card reader has not established a communication connection with any NFC device, and is waiting for other NFC devices to approach so as to read the information therein.

[0162] Method 1: You can obtain the status information of the NFC chip by reading the NFC application programming interface (API).

[0163] Method 2: The status information of the NFC chip can be obtained by reading the register of the NFC chip or related hardware identification.

[0164] For example, when the NFC card reader completes the authentication of the NFC device, it will continue to obtain the status information of the NFC chip, and stop sending the first card search instruction when the NFC chip is in the polling state. Of course, if the NFC chip is detected to be in the listening state, the NFC card reader can normally execute the above Figure 6 or Figure 7 The near field communication method shown.

[0165] The above implementation, on the one hand, can stop sending the first card search instruction in time when the NFC chip is in the polling state, so as to avoid unexpected problems caused by the NFC card reader continuing to send the first card search instruction, such as the "ping-pong" effect. On the other hand, when the NFC chip switches from the polling state to the listening state, the NFC card reader is allowed to send a card search instruction (for example, a card search request instruction such as REQA / B / F / V), so that the NFC card reader can establish a communication connection with other NFC devices in time, thereby improving the card swiping efficiency of the NFC card reader.

[0166] In summary, Figure 8 The near field communication method shown can more accurately judge the timing of the NFC card reader stopping sending the first card search instruction and allowing the NFC card reader to send the first card search instruction by reading the status information of the NFC chip, thereby avoiding the situation where the NFC card reader cannot establish a communication connection with other NFC devices in time due to the NFC card reader stopping sending the first card search instruction for a long time. In addition, when the NFC card reader completes the authentication of the NFC device and the NFC chip in the NFC card reader is in the state of waiting for a response polling, by stopping the NFC card reader from sending the first card search instruction, the "ping-pong" effect caused by the NFC card reader frequently sending the first card search instruction can also be avoided.

[0167] For a clearer introduction, the present application provides a near field communication method, and the present application provides a fourth near field communication method. Fig. 9 It can be understood that the steps in the embodiment of the present application can be regarded as the above Figure 6 , Figure 7 or Figure 8 or, it can be understood that the near field communication method in the embodiment of the present application can also be regarded as an embodiment that can be executed independently, and the present application does not limit this. Fig. 9 The near field communication method includes but is not limited to the following steps:

[0168] S901: The NFC card reader detects that an NFC device is approaching. For a detailed description, please refer to the description of S701 above, which will not be repeated here.

[0169] S902, the NFC card reader sends REQA / B / F / V to the NFC device, and correspondingly, the NFC device receives REQA / B / F / V from the NFC card reader. For a detailed description, please refer to the description of S702 above, which will not be repeated here.

[0170] S903, the NFC device sends ATQA / B / F / V to the NFC card reader, and accordingly, the NFC card reader receives REQA / B / F / V from the NFC device. For a detailed description, please refer to the description of S703 above, which will not be repeated here.

[0171] S904: The NFC card reader sends a SELECT command to the NFC device, and accordingly, the NFC device receives the SELECT command from the NFC card reader. For a detailed description, please refer to the description of S704 above, which will not be repeated here.

[0172] S905 (case 1), the NFC device sends a SELECT response message (including error response information) to the NFC card reader, and accordingly, the NFC card reader receives a SELECT response message (including error response information) from the NFC device. For a detailed description, please refer to the description of S705 above, which will not be repeated here.

[0173] S906 (Case 2): The NFC card reader detects that the response to the card selection instruction sent by the NFC device has timed out. For a detailed description, please refer to the description of S705 above, which will not be repeated here.

[0174] S907, the NFC reader sends REQA / B / F / V. It is understandable that when the NFC reader sends REQA / B / F / V, the NFC device may be in the NFC radio frequency field of the NFC reader or may not be in the NFC radio frequency field of the NFC reader. For the specific introduction of the NFC reader sending REQA / B / F / V, please refer to the introduction of S803 above, which will not be repeated here.

[0175] S908, the NFC device sends ATQA / B / F / V to the NFC card reader, and accordingly, the NFC card reader receives REQA / B / F / V from the NFC device. For a detailed description, please refer to the description of S703 above, which will not be repeated here.

[0176] In one possible scenario, the NFC device shown in S901 to S906 leaves the NFC radio frequency field of the NFC device when the NFC card reader sends REQA / B / F / V again. Another NFC card reader (referred to as the "target NFC device") enters the NFC radio frequency field of the NFC device. In this case, the target device can be used to perform the steps shown in S908 to S910. That is, the NFC devices shown in S901 to S906 are the same NFC device, and the NFC device shown in S908 to S910 is another NFC device (target NFC device).

[0177] S909, the NFC card reader sends a SELECT to the NFC device, and correspondingly, the NFC device receives the SELECT from the NFC card reader. For a detailed description, please refer to the description of S704 above, which will not be repeated here.

[0178] S910, the NFC device sends a SELECT response message (including SAK information and / or ATS information) to the NFC card reader, and accordingly, the NFC card reader receives a SELECT response message (including SAK information and / or ATS information) from the NFC device. For a detailed description, please refer to the description of S705 above, which will not be repeated here.

[0179] S911, the NFC card reader detects that the NFC chip is in the polling state, and stops sending ATQA / B / F / V. For a detailed description, please refer to the corresponding content in the above S803.

[0180] In summary, the near field communication method provided by the present application, when the NFC device authentication fails, attempts to establish the communication connection between the NFC device and the NFC card reader again by sending the first card search instruction, so that the NFC device can establish the communication connection with the NFC card reader as soon as possible, and from the user's perspective, it will be considered that this is a card swiping process, thereby improving the success rate of card swiping, and further improving the user's card swiping experience. In addition, the near field communication method provided by the present application can also more accurately judge the timing of the NFC card reader stopping sending the first card search instruction and allowing the NFC card reader to send the first card search instruction by reading the status information of the NFC chip, thereby avoiding the situation where the NFC card reader stops sending the first card search instruction for a long time, resulting in the inability to establish a communication connection with other NFC devices in time. Furthermore, when the NFC card reader completes the authentication of the NFC device and the NFC chip in the NFC card reader is in the state of waiting for a response polling, by stopping the NFC card reader from sending the first card search instruction, the "ping-pong" effect caused by the frequent first card search instructions of the NFC card reader can be avoided.

[0181] In the near field communication method provided in the above embodiment of the present application, the method provided in the embodiment of the present application is introduced from the perspective of the NFC card reader (also referred to as a near field communication device). In order to realize the functions in the method provided in the above embodiment of the present application, the NFC card reader may include a hardware structure and / or a software unit, and realize the above functions in the form of a hardware structure, a software unit, or a hardware structure plus a software unit. Whether one of the above functions is executed in the form of a hardware structure, a software unit, or a hardware structure plus a software unit depends on the specific application and design constraints of the technical solution.

[0182] Combination of the above Figures 6 to 9 The method provided in the embodiment of the present application is described in detail. Fig.10 The near field communication device provided by the embodiment of the present application is described in detail. It should be understood that the description of the device embodiment corresponds to the description of the method embodiment. Therefore, the contents not described in detail can refer to the description in the method embodiment above.

[0183] Fig.10 is a schematic block diagram of a first near field communication device provided in an embodiment of the present application, which is used to implement the above Figures 6 to 9 The near field communication method shown. For example, the near field communication device 1000 can be a software unit or a chip system. The chip system can be composed of a chip, or it can include a chip and other discrete devices. The near field communication device 1000 includes an acquisition unit 1001, and the acquisition unit 1001 is used to acquire data. For example, the acquisition unit 1001 is used to acquire first information, and the first information is used to indicate that the NFC device authentication fails. The first information is also used to instruct the near field communication device to send a first card search instruction. The near field communication device 1000 may also include a communication unit 1002, and the communication unit 1002 can communicate with the department. For example, a first card search instruction can be sent by the communication unit 1002, and the first card search instruction is used to establish a communication connection between the near field communication device and the NFC device. The communication unit 1002 can also be called a communication interface, a transceiver unit, an input / output interface, etc.

[0184] In a possible implementation, the communication unit 1002 is specifically configured to send a first card searching instruction within a first time period.

[0185] In another possible implementation, the communication unit 1002 is specifically configured to send the first card searching instruction at a first frequency within a first duration.

[0186] In another possible implementation, the first time duration T satisfies the following relationship: 1s≤T≤4s.

[0187] In another possible implementation, when the authentication of the NFC device is completed, the communication unit 1002 is further configured to stop sending the first card searching instruction.

[0188] In another possible implementation, when the NFC device authentication is completed and the NFC chip in the near field communication device is in a polling state waiting for a response, the communication unit 1002 is configured to stop sending the first card search instruction.

[0189] Optionally, the NFC chip is also in a listening state, which indicates that the NFC card reader has not established a communication connection with any NFC device, and is waiting for other NFC devices to approach so as to read the information therein.

[0190] In another possible implementation, before the acquiring unit 1001 acquires the first information, the communication unit 1002 is further configured to send a second card-searching instruction to the NFC device, where the second card-searching instruction is configured to instruct the NFC device to wake up the first simulated card.

[0191] Optionally, the second card-searching instruction is used to instruct the NFC device to wake up the first simulated card. It can also be understood that the second card-searching instruction is used to instruct the NFC device to return relevant information of the first simulated card to complete the authentication of the NFC device.

[0192] Optionally, when multiple simulated cards are set in the NFC device, the second card search instruction is used to instruct the NFC device to wake up the first simulated card. It can also be understood that the second card search instruction is used to instruct the NFC device to switch cards, for example, instructing the NFC device to switch the first simulated card to an active state and the second simulated card to a sleep state.

[0193] In another possible implementation, the acquisition unit 1001 is specifically configured to acquire first information when the time length for the NFC device to respond to the second card search instruction is greater than a first threshold, where the first information is used to indicate that the NFC device authentication fails.

[0194] In another possible implementation, the communication unit 1002 is further configured to obtain a first message from the NFC device. The obtaining unit 1001 is specifically configured to obtain first information based on the first message, where the first information is used to indicate that the NFC device authentication fails.

[0195] In another possible implementation, the first simulated card is any one of a first access card, a first bus card, a first car key or a first bank card.

[0196] In another possible implementation, the NFC device includes an electronic device with an NFC function or an NFC physical card.

[0197] In another possible implementation, the first card searching instruction includes REQA, REQB, REQF or REQV.

[0198] The division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processor, or may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0199] It is understandable that the function of the communication unit in the above embodiment can be implemented by a transceiver, such as an NFC communication module, and the function of the acquisition unit can be implemented by a processor. The transceiver may include a transmitter and / or a receiver, etc., which are respectively used to implement the functions of the sending unit and / or the receiving unit. Fig.11 Let me explain this with an example.

[0200] Fig.11 is a schematic block diagram of a second near field communication device provided in an embodiment of the present application, Fig.11 The near field communication device 1100 shown may be Fig.10 A hardware circuit implementation of the device shown in FIG. 1100 is used to implement the above Figures 6 to 9 For ease of explanation, Fig.11 Only the main components of the near field communication device are shown.

[0201] Fig.11 The near field communication device 1100 shown includes at least one processor 1101. The near field communication device 1100 may also include at least one memory 1102 for storing program instructions and / or data. The memory 1102 is coupled to the processor 1101. The coupling in the embodiment of the present application is an indirect coupling or communication connection between devices, units or modules, which may be electrical, mechanical or other forms, and is used for information exchange between devices, units or modules. The processor 1101 can operate in conjunction with the memory 1102, and the processor 1101 can execute program instructions stored in the memory 1102, and at least one of the at least one memory 1102 may be included in the processor 1101.

[0202] The near field communication device 1100 may also include a communication interface 1103 for communicating with other devices through a transmission medium, so that the near field communication device 1100 can communicate with other devices. In the embodiment of the present application, the communication interface may be a transceiver, a circuit, a bus, a module, or other types of communication interfaces. In the embodiment of the present application, when the communication interface is a transceiver, the transceiver may include an independent receiver, an independent transmitter; or a transceiver with integrated transceiver functions, or an interface circuit.

[0203] It should be understood that the connection medium between the processor 1101, the memory 1102 and the communication interface 1103 is not limited in the embodiment of the present application. Fig.11 In the embodiment, the memory 1102, the processor 1101 and the communication interface 1103 are connected via a communication bus 1104. Fig.11 The connections between other components are shown in bold lines, which are only schematic and not limiting. The bus may include an address bus, a data bus, a control bus, etc. For ease of representation, Fig.11 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. For the operations performed by the processor 1101, please refer to Fig.10 The operations performed by the acquisition unit 1001 are not described here. Fig.10 The operations performed by the communication unit 1002 are not repeated here.

[0204] A chip includes: a processor, the processor is coupled to a memory, the memory is used to store a program or an instruction, when the program or the instruction is executed by the processor, the device executes the above Figures 6 to 9 The method of any of the processes shown in .

[0205] In the embodiments of the present application, the processor may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0206] In the embodiment of the present application, the memory may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or a volatile memory (volatile memory), such as a random access memory (RAM). The memory is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory in the embodiment of the present application may also be a circuit or any other device that can implement a storage function, for storing program instructions and / or data.

[0207] The present application also provides another near field communication device, which includes a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program, so that the device performs the above Figures 6 to 9 and a near field communication method obtained by combining the above.

[0208] The embodiment of the present application also provides a vehicle, which includes the above-mentioned near-field communication device. Exemplarily, the vehicle can be a means of transportation (such as a commercial vehicle, a passenger car, a motorcycle, a flying car, a tram, a train, etc.), an industrial vehicle (such as a forklift, a trailer, a tractor, etc.), an engineering vehicle (such as an excavator, a bulldozer, a crane, etc.) or agricultural equipment (such as a mower, a harvester, etc.). The vehicle can also refer to a robot (an intelligent handling robot (automated guided vehicle, AGV), a walkable conversational robot, a service robot, etc.), an industrial equipment (industrial robot, a robotic arm, etc.) or a leisure and entertainment equipment (virtual reality (VR) equipment, mixed reality (MR) equipment, or a 4D cinema cabin), etc.

[0209] An embodiment of the present application further provides a terminal device, which includes the above-mentioned near field communication device.

[0210] The embodiment of the present application further provides a data interaction system, comprising the above-mentioned near field communication device. Optionally, the data interaction system comprises a near field communication device and an NFC device.

[0211] The present application provides a computer program, which, when executed by a processor, is used to perform the above Figures 6 to 9 and a near field communication method obtained by combining the above.

[0212] The present application provides a computer program product, which includes: a computer program (also referred to as code or instruction); when the computer program is executed, the computer executes the above Figures 6 to 9 and a near field communication method obtained by combining the above.

[0213] The present application also provides a computer-readable storage medium in which instructions are stored. When the instructions are executed on at least one processor, the above-mentioned Figures 6 to 9 and a near field communication method obtained by combining the above.

[0214] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

Claims

1. A near field communication method, characterized in that: Applied to a near field communication NFC card reader, the near field communication method comprises: Acquire first information, where the first information is used to indicate that the NFC device returns an error response message, or the first information is used to indicate that the NFC device returns a response message timeout; the first information is also used to indicate that the NFC card reader sends a first card search instruction; Sending the first card-searching instruction at a first frequency within a first duration, wherein the first card-searching instruction is used to establish a communication connection between the NFC card reader and the NFC device, and the NFC device does not need to move; When the authentication of the NFC device is completed, the sending of the first card searching instruction is stopped.

2. The method according to claim 1, characterized in that The first time length T satisfies the following relationship: 1s≤ T ≤4s.

3. The method according to claim 1 or 2, characterized in that: The step of stopping sending the first card search instruction when the authentication of the NFC device is completed includes: When the authentication of the NFC device is completed and the NFC chip in the NFC card reader is in a state of waiting for a response, the sending of the first card searching instruction is stopped.

4. The method according to claim 1 or 2, characterized in that: Before acquiring the first information, the method further includes: sending a second card-searching instruction to the NFC device, where the second card-searching instruction is used to instruct the NFC device to wake up the first simulated card.

5. The method according to claim 4, characterized in that The obtaining of the first information includes: In a case where the time length for the NFC device to respond to the second card-searching instruction is greater than a first threshold, the first information is acquired, where the first information is used to indicate that the NFC device has timed out in returning a response message.

6. The method according to claim 1 or 2, characterized in that: The obtaining of the first information includes: A first message is received from the NFC device, and the first information is acquired based on the first message, where the first information is used to instruct the NFC device to return error response information.

7. The method according to claim 4, characterized in that The first simulated card is any one of a first access card, a first bus card, a first car key or a first bank card.

8. The method according to claim 1 or 2, characterized in that: The NFC device includes an electronic device with NFC function or an NFC physical card.

9. The method according to claim 1 or 2, characterized in that: The first card search instruction includes a type A request command, a type B request command, a type F request command or a type V request command.

10. A near field communication device, characterized in that: The near field communication device comprises an acquisition unit and a communication unit; The acquisition unit is used to acquire first information, where the first information is used to indicate that the NFC device returns an error response message, or the first information is used to indicate that the NFC device returns a response message timeout; the first information is also used to instruct the near field communication device to send a first card search instruction; The communication unit is used to send the first card-searching instruction at a first frequency within a first time period, and the first card-searching instruction is used to establish a communication connection between the near field communication device and the NFC device, and the NFC device does not need to move; The communication unit is used to stop sending the first card searching instruction when the authentication of the NFC device is completed.

11. The device according to claim 10, characterized in that The first time length T satisfies the following relationship: 1s≤ T≤4s.

12. The device according to claim 10 or 11, characterized in that When the authentication of the NFC device is completed and the NFC chip in the near field communication apparatus is in a state of waiting for a response, the communication unit is used to stop sending the first card searching instruction.

13. The device according to claim 10 or 11, characterized in that Before the acquiring unit acquires the first information, the communication unit is further used to send a second card-searching instruction to the NFC device, where the second card-searching instruction is used to instruct the NFC device to wake up the first simulated card.

14. The device according to claim 13, characterized in that The acquisition unit is specifically configured to acquire the first information when the time length for the NFC device to respond to the second card-searching instruction is greater than a first threshold, wherein the first information is used to indicate that the NFC device has timed out in returning a response message.

15. The device according to claim 10 or 11, characterized in that The communication unit is further used to receive a first message from the NFC device; the acquisition unit is specifically used to acquire the first information based on the first message, where the first information is used to instruct the NFC device to return error response information.

16. The device according to claim 13, characterized in that The first simulated card is any one of a first access card, a first bus card, a first car key or a first bank card.

17. The device according to claim 10 or 11, characterized in that The NFC device includes an electronic device with NFC function or an NFC physical card.

18. The device according to claim 10 or 11, characterized in that The first card search instruction includes a type A request command, a type B request command, a type F request command or a type V request command.

19. A near field communication device, characterized in that: include: processor; When the processor calls the computer program or instruction in the memory, the method according to any one of claims 1 to 9 is executed.

20. A vehicle, characterized in that: The vehicle comprises the near field communication device according to any one of claims 10-18.

21. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program. When the computer program is executed, the method according to any one of claims 1 to 9 is executed.

22. A computer program product, characterized in that The computer program product comprises instructions, which, when executed by a processor, enable the method according to any one of claims 1 to 9 to be implemented.

Citation Information

Patent Citations

  • Control method, system and equipment for preventing near-field transmission error identification, and medium

    CN111953388A

  • Communication method and equipment based on NFC

    CN112395894A

  • Low-power-consumption working method of non-contact card reader and card reader system

    CN117808021A