Near field communication method and apparatus

By sending a card search command when NFC device authentication fails, the problems of long NFC card swiping time and low success rate are solved, achieving a more efficient card swiping process.

WO2026040372A1PCT designated stage Publication Date: 2026-02-26HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/079437
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-19
Filing Date
2025-02-27
Publication Date
2026-02-26

AI Technical Summary

Technical Problem

The existing NFC card-swiping process is time-consuming and has a low success rate. In particular, when authentication fails, users need to repeat the process, which makes the operation cumbersome and time-consuming.

Method used

When NFC device authentication fails, the NFC reader sends a first card search command to establish a communication connection, reducing the need for re-swiping the card. This includes sending the card search command within a certain time period or frequency, and adjusting the transmission frequency according to the NFC chip status to optimize power consumption.

Benefits of technology

It effectively reduced card swiping time, increased the success rate of card swiping, and improved the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025079437_26022026_PF_FP_ABST
    Figure CN2025079437_26022026_PF_FP_ABST
Patent Text Reader

Abstract

A near field communication (NFC) method and apparatus, relating to the technical field of near field communications. The method comprises: acquiring first information used for indicating that authentication of an NFC device fails, and sending a first card polling instruction used for establishing a communication connection between an NFC reader and the NFC device. In the NFC method, when authentication of an NFC device fails, by sending a first card polling instruction to attempt to re-establish a communication connection between the NFC device and an NFC reader, the NFC device can establish a communication connection with the NFC reader as quickly as possible; moreover, from the perspective of users, the process is perceived as a single card-swiping process, thereby improving the success rate of card swiping and improving the card swiping experience of the users.
Need to check novelty before this filing date? Find Prior Art

Description

Near field communication method and device

[0001] The present application claims priority to the Chinese patent application No. 202411132611.1, filed on August 19, 2024, and entitled "Near field communication method and device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0002] The present application relates to the technical field of near field communication, and in particular to a near field communication method and device. BACKGROUND

[0003] Near field communication (NFC) is a short-range wireless communication technology with high security, low power consumption and low cost, and is widely used in access control, payment, public transportation and communication fields. For example, using the card emulation mode of NFC, a mobile phone or an electronic device supporting NFC is used as a debit card, a bus card or an access control card. For another example, using the reader / writer mode of NFC, a mobile phone or an electronic device supporting NFC realizes the function of a card reader.

[0004] However, the current NFC card swiping time is relatively long, and the success rate of card swiping is relatively low. SUMMARY

[0005] The present application provides a near field communication method and device, which relates to the technical field of near field communication. The near field communication method provided by the present application can send a first card searching instruction in the case of monitoring that the NFC device fails to authenticate, so that the NFC device can continue to complete the authentication operation based on the first card searching instruction without the user moving the NFC device to re-swipe the card, thereby reducing the time consumption of NFC card swiping and improving the success rate of card swiping.

[0006] 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 fails to authenticate, and sending a first card searching instruction for establishing a communication connection between the NFC card reader and the NFC device.

[0007] In the present application, the NFC device can be an NFC electronic device with an analog card, or an NFC physical card. The first information is used to indicate that the NFC device fails to authenticate, for example, the NFC reader receives the response information of the NFC device beyond a time limit, or the response information returned by the NFC device indicates that the NFC device fails to authenticate. It can be understood that the failure of the NFC device to authenticate can be understood as the failure of the NFC device to swipe the card, and the NFC device needs to re-enter the NFC radio frequency field of the NFC reader and authenticate again. This process is complicated and time-consuming. The near field communication method provided in the present application sends a first card search instruction when the first information indicating that the NFC device fails to authenticate is obtained, and the first card search instruction is used to establish a communication connection between the NFC reader and the NFC device, thereby completing the card swiping. Therefore, the near field communication method provided in the present application can greatly reduce the time consumption of card swiping on the one hand, and the NFC reader sends the first card search instruction to make the NFC device and the NFC reader try to establish a communication connection again. From the user's perspective, this is considered to be a card swiping process, thereby improving the success rate of card swiping and improving the user's card swiping experience. In summary, the near field communication method provided in the present application has the characteristics of short card swiping time and high card swiping success rate.

[0008] Optionally, the first information is also used to indicate that the NFC reader sends the first card search instruction.

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

[0010] In the above implementation, the starting time point of the first time period can be the time point at which the NFC reader obtains the first information, and the first time period is greater than 0s, for example, the first time period is 1s, 2s, 3s or 4s. The first card search instruction is sent within the first time period, which can be understood as being continuously sent within the time period represented by the first time period. By sending the first card search instruction within the first time period, on the one hand, the NFC device can receive the first card search instruction within the first time period and establish a communication connection between the NFC device and the NFC reader, and on the other hand, the NFC reader can stop sending the first card search instruction after sending the first card search instruction within the first time period, thereby avoiding high energy consumption of the NFC reader or the phenomenon that the NFC reader is damaged due to frequent sending of the first card search instruction.

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

[0012] In the above embodiment, the first time length T satisfies the following relationship: 1s≤T≤4s. On one hand, this is used to ensure that the card swiping can be completed within the first time length T. On the other hand, this is used to avoid that the time for the NFC card reader to send the first card searching instruction is too long, thereby causing resource waste.

[0013] In another possible implementation, the first card searching instruction is sent at a first frequency within the first time length.

[0014] In the above embodiment, 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 when the NFC card reader is manufactured, or can be adjusted by updating parameters during use of the NFC card reader. The present application does not limit this. By setting the frequency of sending the first card searching instruction, the relationship between the timeliness of the NFC device receiving the first card searching instruction and the power consumption of the NFC card reader can be balanced. For example, when the first frequency is too low, the time interval between two times of sending the first card searching instruction by the NFC card reader is too large, so that the NFC device cannot receive the first card searching instruction in time, which can easily cause the problem of too long card swiping time. When the first frequency is too high, the NFC card reader needs to frequently send the first card searching instruction, thereby causing the power consumption of the NFC card reader to be too high, and in a serious case, the service life of the NFC card reader can be reduced, or even the NFC card reader can be damaged.

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

[0016] In the above embodiment, the sending of the first card searching instruction is stopped when the NFC device is authenticated, which can help to reduce the power consumption of the NFC card reader, and avoid unexpected problems caused by the NFC card reader continuing to send the first card searching instruction, such as frequent locking and unlocking (hereinafter referred to as "ping-pong") of the NFC device.

[0017] In another possible implementation, the sending of the first card searching instruction is stopped when the NFC device is authenticated, and the NFC chip in the NFC card reader is in a polling state.

[0018] In the above embodiment, in the case that the NFC reader completes the authentication of the NFC device, the state of the NFC chip is further read to determine whether to stop sending the first card searching instruction. For example, in the case that the NFC chip in the NFC reader is in a polling state, it is determined to stop sending the first card searching instruction. In the polling state, the NFC chip indicates that the NFC device is in a connection state with the NFC reader, and the NFC device can communicate with the NFC reader and transmit data. In the above embodiment, the state of the NFC chip is read to more accurately determine whether to stop sending the first card searching instruction, thereby avoiding the failure to authenticate other NFC devices due to the stop of sending the first card searching instruction. In addition, in the case that the NFC device authentication is completed and the NFC chip in the NFC reader is in the polling state, the stop of sending the first card searching instruction can also avoid the "ping-pong" effect caused by frequent sending of the first card searching instruction.

[0019] Optionally, the NFC chip can also be in a listening state, which indicates that the NFC reader has not established a communication connection with any NFC device, and waits for other NFC devices to approach to read information therein.

[0020] In another possible embodiment, before obtaining the first information, the above near field communication method further includes: sending a second card searching instruction to the NFC device, the second card searching instruction being used to instruct the NFC device to wake up the first analog card.

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

[0022] Optionally, the second card searching instruction is used to instruct the NFC device to wake up the first analog card, which can also be understood as that the second card searching instruction is used to instruct the NFC device to return relevant information of the first analog card to establish a communication connection between the NFC device and the NFC reader, and then complete the authentication of the NFC device.

[0023] Optionally, in the case that multiple analog cards are set in the NFC device, the second card searching instruction is used to instruct the NFC device to wake up the first analog card, which can also be understood as that the second card searching instruction is used to instruct the NFC device to switch cards. For example, the first analog card and the second analog card are set in the NFC device, and the second card searching instruction is used to instruct the NFC device to switch the first analog card to an active state and switch the second analog card to a dormant state.

[0024] In another possible implementation, the first information is obtained in a case where a time length of the NFC device responding to the second card searching instruction is greater than a first threshold value, and the first information is used to indicate that the NFC device fails in the authentication.

[0025] In the above implementation, the first information is obtained in a case where a time length of the NFC device responding to the second card searching instruction is greater than a first threshold value, to indicate that the NFC device fails in the authentication, so that the NFC card reader can determine that the NFC device fails in the authentication in time, and perform subsequent related operations (for example, sending the first card searching instruction) in time, and then complete the authentication. The first threshold value is for example 100 ms or 200 ms, which is not limited in the present application.

[0026] In another possible implementation, the first information is obtained by receiving a first message from the NFC device, and the first information is used to indicate that the NFC device fails in the authentication.

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

[0028] In another possible implementation, the first simulated card is any one of a first access control card, a first public transportation card, a first vehicle key, or a first bank card.

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

[0030] In the above implementation, the electronic device with NFC function is for example a mobile phone, a smart watch, a smart bracelet, a tablet computer, or the like with NFC function. The NFC entity card is a card with an NFC chip built-in, for example, an access control card, a transportation card, a vehicle key, or a bank card, and the like.

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

[0032] It can be understood that the first card searching instruction is usually determined according to the function of the NFC reader. For example, if the NFC reader is used to read the information of the A-type card, the first card searching instruction is REQA. For another example, if the NFC reader is used to read the information of the B-type card, the first card searching instruction is REQB.

[0033] In a second aspect, the present application provides a near field communication device, comprising an obtaining unit and a communication unit. The obtaining unit is configured to obtain first information, the first information being used to indicate that the NFC device fails to be authenticated, and the first information being further used to indicate that the near field communication device sends a first card searching instruction.

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

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

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

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

[0038] 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.

[0039] In another possible implementation, when the authentication of the NFC device is completed and the NFC chip in the near field communication device is in a polling state, the communication unit is configured to stop sending the first card searching instruction.

[0040] Optionally, the NFC chip is further in a listening state, which indicates that the NFC reader does not establish a communication connection with any NFC device, and waits for other NFC devices to approach so as to read the information therein.

[0041] In another possible implementation, before the obtaining unit obtains the first information, the communication unit is further configured to send a second card searching instruction to the NFC device, the second card searching instruction being used to instruct the NFC device to wake up the first analog card.

[0042] Optionally, the second card searching instruction is used to instruct the NFC device to wake up the first analog card, and it can also be understood that the second card searching instruction is used to instruct the NFC device to return the related information of the first analog card, so as to complete the authentication of the NFC device.

[0043] Optionally, in the case that multiple analog cards are set in the NFC device, the second card searching instruction is used to instruct the NFC device to wake up the first analog card, and it can also be understood that the second card searching instruction is used to instruct the NFC device to switch cards, for example, instruct the NFC device to switch the first analog card to the active state and switch the second analog card to the dormant state.

[0044] In another possible implementation, the acquisition unit is specifically configured to acquire the first information in the case that the duration for the NFC device to respond to the second card searching instruction is greater than the first threshold, and the first information is used to indicate that the NFC device fails in the authentication.

[0045] In another possible implementation, the communication unit is further configured to acquire the first message from the NFC device. The acquisition unit is specifically configured to acquire the first information based on the first message, and the first information is used to indicate that the NFC device fails in the authentication.

[0046] In another possible implementation, the first analog card is any one of the first access control card, the first bus card, the first vehicle key or the first bank card.

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

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

[0049] In a third aspect, the present application provides a terminal including the near field communication device described in any one of the second aspect. Optionally, the terminal includes a smart phone, an access control card reader, a bus card reader, a non-contact payment terminal, a vehicle, a robot, a drone, or a ship, and the like.

[0050] In a fourth aspect, a terminal is provided, including a processor, a memory, an NFC module and a touch screen, the memory, the touch screen and the NFC module are coupled to the processor, the memory is configured to store computer program codes, the computer program codes include computer instructions, when the processor reads the computer instructions from the memory, the terminal implements the method in any one of the first aspect.

[0051] In a fifth aspect, a chip is provided, including a processor, when the processor executes instructions, the method in any one of the first aspect is implemented.

[0052] In a sixth aspect, the present application provides a computer readable storage medium, the storage medium stores computer programs or instructions, when the computer programs or instructions are executed by a computer, the method in any one of the first aspect is implemented.

[0053] In a seventh aspect, the present application provides a computer program product comprising instructions, the computer program product comprising computer program code which, when executed on a computer, implements the method of any one of the first aspect.

[0054] In an eighth aspect, the embodiments of the present application provide a data interaction system, which can comprise an NFC device and an NFC card reader, and the NFC device and the NFC card reader can be used to execute the method of any one of the first aspect.

[0055] The solutions provided by the second aspect to the eighth aspect are used to implement or assist in implementing the method provided in the first aspect, and thus can achieve the same or corresponding beneficial effects as the corresponding method in the first aspect, which will not be described here again. BRIEF DESCRIPTION OF DRAWINGS

[0056] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly introduced as follows. Obviously, the drawings described below are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0057] FIG. 1A is a schematic diagram of a communication system provided by the present application;

[0058] FIG. 1B is a working schematic diagram of the communication system shown in FIG. 1A;

[0059] FIG. 2 is a schematic diagram of an application scenario of an NFC card reader provided by the present application;

[0060] FIG. 3 is a schematic diagram of a user interface of a wallet application provided by the present application;

[0061] FIG. 4 is a schematic diagram of a card switching process provided by the present application;

[0062] FIG. 5 is a schematic diagram of another card switching process provided by the present application;

[0063] FIG. 6 is a flowchart of a first near field communication method provided by the present application;

[0064] FIG. 7 is a flowchart of a second near field communication method provided by the present application;

[0065] FIG. 8 is a flowchart of a third near field communication method provided by the present application;

[0066] FIG. 9 is a flowchart of a fourth near field communication method provided by the present application;

[0067] FIG. 10 is a schematic block diagram of a first near field communication device provided by the embodiments of the present application;

[0068] Fig. 11 is a schematic block diagram of a second near field communication device according to an embodiment of the present application. DETAILED DESCRIPTION

[0069] In order to make the objects, technical solutions and advantages of the present application clearer, the embodiments of the present application will be described below with reference to the drawings.

[0070] The terms "first" and "second" and the like in the specification of the present application, claims, and drawings are used to distinguish different objects, and are not intended to describe a particular order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device, etc. including a series of steps or units is not limited to the listed steps or units, but can optionally include other steps or units not listed, or can optionally include other steps or units inherent to the process, method, product, or device, etc.

[0071] "Embodiment" mentioned herein 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 at various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment to other embodiments. Those skilled in the art can explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0072] It should be understood that in the present application, "at least one" means one or more, "multiple" means two or more, "at least two" means two or three and more, and "and / or" is used to describe the association relationship of the associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that there are three cases of only A, only B, and A and B at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple 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, and c can be single or multiple.

[0073] The following will first explain some terms in the present application. It should be noted that these explanations are for the convenience of those skilled in the art to understand, and are not intended to limit the scope of protection required by the present application.

[0074] 1. NFC.

[0075] NFC is a short-range high frequency wireless communication technology, which allows non-contact point-to-point data transmission between NFC devices within a distance of 10 centimeters. The transmission speed of NFC technology includes 106 Kbit / s, 212 Kbit / s or 424 Kbit / s. Currently, NFC technology has become a relevant international standard and is widely used. For example, NFC complies with standards such as ISO 18092 (NFCIP-1) and ISO 21481 (NFCIP-2).

[0076] 2. NFC device.

[0077] In this application, the NFC device includes an electronic device with NFC function or an NFC physical card. The electronic device with NFC function refers to an electronic device with built-in NFC chip, which can perform NFC communication and realize the related functions of NFC, such as card emulation function, card reader function or point-to-point function, etc. The electronic device with NFC function includes smart phone, smart bracelet, smart watch, tablet computer or notebook computer, etc. The NFC physical card includes access control card, transportation card, bank card, car key or campus card, etc. In a possible implementation, the electronic device with NFC function can be provided with multiple simulation cards for simulating the information and functions of different NFC physical cards, which can improve the convenience of user travel.

[0078] 3. NFC card reader.

[0079] The NFC card reader is a device that can read and process the information stored in a near NFC device or tag. For example, the NFC card reader can read the text, website or contact information in the NFC device. For another example, the NFC card reader supports data writing operation and can write information into the NFC device or tag. The NFC card reader can be provided in an access control system (such as the door of a house, a company, a subway or various venues, etc.), a payment system (such as a checkout device in a store or an ATM in a bank, etc.) or a locking and unlocking system of a vehicle door, etc.

[0080] 4. NFC communication system.

[0081] Please refer to FIG. 1A, which is a communication system provided by the present application, and the communication system comprises an NFC device 101 and an NFC reader 102. The NFC device 101 can refer to the introduction of the NFC device mentioned above, and the NFC reader 102 can also refer to the introduction of the NFC reader mentioned above, which will not be repeated here. The NFC device 101 and the NFC reader 102 can communicate within any appropriate short distance, such as 2 cm, 3 cm or 4 cm, etc. For specific communication between the NFC device 101 and the NFC reader 102, please refer to FIG. 1B. As shown in FIG. 1B, the NFC reader 102 can generate an electromagnetic field of a specific frequency (also referred to as the NFC electromagnetic field of the NFC reader 102). If the NFC device 101 enters the effective range of the NFC electromagnetic field, the inductor coil in the NFC device 101 will receive the energy of the NFC electromagnetic field and convert it into electric energy to power the NFC chip of the NFC device 101, thereby realizing the communication between the NFC device 101 and the NFC reader 102.

[0082] The explanation of the above terms can be applied in the following.

[0083] In order to better understand the near field communication method provided by the present application, the following first introduces an application scenario of the NFC reader provided by the present application.

[0084] FIG. 2 exemplarily shows an application scenario of an NFC reader. In this example, the NFC reader 102 is installed on the rearview mirror of a vehicle, and is also referred to as a vehicle-mounted near field communication device. In addition, the NFC reader 102 also comprises a ship-mounted near field communication device installed on a ship, a machine-mounted near field communication device installed on a machine, etc. Of course, the NFC reader 102 can also be installed on an access control and a cash dispenser. In a possible example, as shown in FIG. 2, when a 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.

[0085] In a possible implementation, the NFC device 101 is an NFC physical card. It can be understood 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 reader 102. However, the NFC electromagnetic field is prone to instability, which makes the NFC device 101 prone to card swiping failure or a long card swiping time when swiping the card.

[0086] In another possible implementation, the NFC device 101 is an NFC-enabled electronic device, and the wallet application on the NFC device 101 is used to manage multiple simulated cards. Next, the NFC device 101 is taken as an example of an NFC electronic device, and a case where multiple simulated cards are set is described.

[0087] Referring to FIG. 3, which is a schematic diagram of a user interface of a wallet application provided by the present application, the user interface 300 includes a status bar 310, a card package, and a page switching bar 320.

[0088] The status bar 310 includes information such as the current time, network status, and power level. As shown in FIG. 3, 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 can include bank cards, public transportation cards, access control cards, electronic identity cards, or smart door lock cards, etc. In the embodiment of the present application, the bank cards, public transportation cards, access control cards, electronic identity cards, and smart door lock cards are all categories of simulated cards, for example, the bank cards include bank card A and bank card B. The user can view the added simulated cards in the card package page of the wallet application, as shown in FIG. 3, the card package includes "bank cards", "transportation cards", and "keys", among which, the "bank cards" include "bank card A" and "bank card B"; the "transportation cards" include "subway card C"; and the "keys" include "my home" and "my car". The page switching bar 320 includes multiple page switching buttons, which are used to switch multiple pages in the wallet application. For example, as shown in FIG. 3, the multiple page switching buttons include a "home" button, a "life" button, a "card package" button, and a "my" button, for example, when the user clicks the "card package" button, the NFC device 101 displays the card package 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 "subway card C" at the same time. The user can set a default card in the wallet application as a card that is activated in priority. As shown in FIG. 3, the user sets the access control card "my home" as the default card. However, when the NFC reader 102 is used to read a non-default card (for example, "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 switching the card by the NFC device 101, please refer to the description below.

[0089] Exemplarily, the card switching process of the NFC device 101 can be completed by the user by selecting a designated card (as shown in Fig. 4) or by the NFC device 101 by automatically selecting a card (as shown in Fig. 5).

[0090] Please refer to Figs. (a) to (d) in Fig. 4. Figs. (a) to (d) in Fig. 4 are, for example, the user interface of the NFC device 101 in Fig. 3. Exemplarily, when the user holds the NFC device 101 close to the vehicle rearview mirror (with the NFC 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 the default card "My Home" as shown in Fig. (a) in Fig. 4. In this case, the user needs to switch "My Home" to "My Car". For example, the user clicks "Car Key" on the NFC device 101 to complete the card switching as shown in Fig. (b) in Fig. 4. The user interface of the NFC device 101 after completing the card switching is shown in Fig. (c) in Fig. 4. It can be understood that after the NFC device 101 completes the card switching, the NFC device 101 is used as a vehicle key to complete the unlocking of the vehicle by the authentication of the NFC reader 102. Fig. (d) in Fig. 4 is the user interface of the NFC device 101 after completing the unlocking of the vehicle. It can be seen from the description of Fig. 4 that the card switching scheme shown in Fig. 4 needs the user's intervention to assist the NFC device 101 to complete the card switching operation, which is complicated and inefficient. Therefore, the present application also provides an automatic card switching scheme. Please refer to Fig. 5.

[0091] As shown in FIG. 5, the diagrams (a) to (c) shown in FIG. 5 are, for example, the user interface of the NFC device 101 in FIG. 3. For example, when the user holds the NFC device 101 close to the vehicle rearview mirror (with the NFC reader 102 built-in), the NFC device 101 displays the interface shown in diagram (a) of FIG. 5, for example, the user interface of the NFC device 101 displays the words "Running Smart Flash Card..." and the like. When the NFC device 101 is in the interface shown in diagram (a) of FIG. 5, the NFC device 101 automatically performs card switching according to the obtained unique identifier (UID). The user interface of the NFC device 101 after the card switching according to the UID is shown in diagram (b) of FIG. 5. Further, the NFC device 101 is used as a vehicle key to complete the unlocking of the vehicle through the authentication of the NFC reader 102. Diagram (c) of FIG. 5 is the user interface of the NFC device 101 after the unlocking of the vehicle is completed. It can be seen from the description of FIG. 5 that the card switching scheme shown in FIG. 5 does not require the intervention of the user, and can automatically complete a series of card swiping operations such as card switching and authentication according to the obtained UID, thereby improving the card swiping efficiency. However, the automatic card switching process of the NFC device 101 takes a long time, and is prone to freezing and incorrect switching, which also leads to low card swiping success rate and long card swiping time.

[0092] As can be known from the above description, when the NFC device 101 is an NFC physical card, the NFC electromagnetic field is prone to instability, which leads to the phenomenon of card swiping failure or long card swiping time when the NFC device 101 performs card swiping. When the NFC device 101 is an NFC electronic device, whether the NFC device 101 automatically completes card switching or manually completes card switching, there are problems such as card switching failure and slow card switching speed, thereby leading to low card swiping success rate and slow card swiping speed.

[0093] Therefore, the present application provides a near field communication method and device, which relates to the technical field of near field communication, and can send a first card searching instruction to complete card swiping when the NFC device authentication fails, thereby effectively improving the card swiping success rate and greatly reducing the card swiping time.

[0094] Please refer to FIG. 6, which is a flowchart of the first near field communication method provided by the present application. It should be understood that the near field communication method shown in FIG. 6 is described in the order of steps S601 to S602 for the convenience of description, and is not intended to limit the execution in the above order. The present application does not limit the execution order, execution time, execution times, etc. of one or more steps.

[0095] The steps S601 to S602 are as follows:

[0096] S601, the NFC reader acquires first information.

[0097] The NFC reader is, for example, the NFC reader 102 shown in FIG. 1A. The description of the NFC reader can refer to the foregoing description, 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 NFC device 101 shown in FIG. 1A. The description of the NFC device can also refer to the foregoing description, which will not be repeated here.

[0098] It should be noted that before the NFC reader acquires the first information, the NFC reader will send a second card search instruction to the NFC device. 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 operation. 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 an entity card, the first simulated card is the NFC device. When the NFC device is an electronic device with NFC function, the first simulated card can be any one of the simulated cards set in the NFC device. The above-mentioned "instructing the NFC device to wake up the first simulated card" can be understood as instructing the NFC device to send the relevant information of the first simulated card to the NFC reader when the NFC device is an NFC card. 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 active state, and the relevant information of the first simulated card is sent to the NFC reader. The role of the second card search instruction and the related operation that the NFC device can perform after receiving the second card search instruction will be described below with reference to the corresponding content in FIG. 7, which will not be described here.

[0099] Optionally, the second card search instruction is also called a "card selection instruction".

[0100] Optionally, the first simulated card is any one of the first access control card, the first bus card, the first vehicle key, or the first bank card.

[0101] In some scenarios, the NFC device will send a response message to the NFC reader after receiving the second card search instruction from the NFC reader. For example, the response message includes select acknowledge (SAK) information, answer to select (ATS) information, or error response information. The error response information is used to indicate that the NFC device cannot normally establish a communication connection with the NFC reader.

[0102] In other scenarios, the NFC device may not return a response message to the NFC reader after receiving the second card search instruction from the NFC reader, or the waiting time for the NFC device to return a response message to the NFC reader is timed out. For details of the above two scenarios, refer to the subsequent near field communication method shown in FIG. 8, which is not described here.

[0103] In combination with the above description, the NFC reader obtains the first information, including two possible cases, as follows:

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

[0105] In one possible implementation, the NFC reader receives the first message from the NFC device, and obtains the first information based on the first message. The first information is used to indicate that the NFC device authentication fails.

[0106] For example, when the NFC reader receives the response message from the NFC device about the second card search instruction, the response message includes error response information. The NFC reader obtains the first information according to the error response information. The first information is used to indicate that the NFC device authentication fails.

[0107] Case 2: The NFC device returns a response message that is timed out, for example, the NFC device returns a response message that exceeds a first threshold.

[0108] In one possible implementation, when the NFC device responds to the second card search instruction for a time greater than the first threshold, the NFC reader obtains the first information. The first information is used to indicate that the NFC device authentication fails.

[0109] Exemplarily, the NFC reader can establish a timestamp when sending the second card search instruction to the NFC device, to record the time of sending the second card search instruction. Further, the NFC reader can determine whether the waiting time of the NFC reader for receiving the second card search instruction response message from the NFC device exceeds a first threshold according to the timestamp, to determine whether the response message of the NFC device to the second card search instruction is timed out. For example, the first threshold is 100 ms or 200 ms, which is not limited in the present application. For example, the first threshold is 100 ms, and the NFC reader does not receive the response message of the second card search instruction within 100 ms after sending the second card search instruction to the NFC device, and it is considered that the time of the NFC device responding to the second card search instruction is greater than the first threshold.

[0110] It should be noted that the above-mentioned second card search instruction can be understood in combination with the "card selection instruction" shown in S704 of FIG. 7 below.

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

[0112] S602, the NFC reader sends the first card search instruction.

[0113] The first card search instruction is used to establish a communication connection between the NFC reader and the NFC device, and the first card search instruction can be a card search request instruction such as REQA / B / F / V. For specific description of the first card search instruction, please refer to the description of "requesting to obtain information" in S702 of FIG. 7 below. Exemplarily, the NFC reader can send the card search request instruction such as REQA / B / F / V through a radio frequency signal.

[0114] In a possible implementation, the NFC reader sends the first card search instruction within a first time length. The starting time point of the first time length can be the time point of the NFC reader obtaining the first information, and the first time length is greater than 0 s, for example, the first time length is 1 s, 2 s, 3 s or 4 s.

[0115] Exemplarily, the first time length is 3 s, and the time point of the NFC reader obtaining the first information can be any time point. For example, the time point of the NFC reader obtaining the first information is January 1, 2020, 0:00:00, and the NFC reader will continuously send the first card search instruction within the time period from January 1, 2020, 0:00:00 to January 1, 2020, 0:00:03.

[0116] The above embodiment sends the first card searching instruction in the first time length, on one hand, to ensure that the NFC device can receive the first card searching instruction in the first time length and establish the communication connection between the NFC device and the NFC card reader, and on the other hand, to enable the NFC card reader to stop sending the first card searching instruction after sending the first card searching instruction in the first time length, so as to avoid high energy consumption of the NFC card reader or the phenomenon that the NFC card reader is damaged due to frequent sending of the first card searching instruction.

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

[0118] In another possible embodiment, the NFC card reader sends the first card searching instruction at a first frequency in the first time length. The first time length is described above, 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 when it is shipped, and can also be adjusted by updating parameters during use, which is not limited in the present application.

[0119] For example, the first time length is 3s, the first frequency is 10 times / s, and the time point at which the NFC card reader obtains the first information is 2020-01-01 00:00:00, then the NFC card reader will send the first card searching instruction at a frequency of 10 times / s continuously in the time period from 2020-01-01 00:00:00 to 2020-01-01 00:00:03, or the NFC card reader will send the first card searching instruction every 100ms in the time period from 2020-01-01 00:00:00 to 2020-01-01 00:00:03.

[0120] The above embodiment sets the frequency of sending the first card searching instruction, which helps to balance the relationship between the timeliness of the NFC device receiving the first card searching instruction and the power consumption of the NFC card reader. For example, when the first frequency is too low, the time interval between two times of sending the first card searching instruction by the NFC card reader is too large, so that the NFC device cannot receive the first card searching instruction in time, which easily causes the problem of long card swiping time. When the first frequency is too high, the NFC card reader needs to send the first card searching instruction frequently, which leads to high power consumption of the NFC card reader, and in serious cases, the service life of the NFC card reader is reduced, and even the NFC card reader is damaged.

[0121] Further, the NFC device in the NFC radio frequency field of the NFC card reader returns a response message of the first card searching instruction when receiving the first card searching instruction, so as to establish the communication connection between the NFC card reader and the NFC device.

[0122] It should be noted that the NFC reader sends the first card searching instruction after obtaining the first information, regardless of whether the NFC device is still in the NFC radio frequency field of the NFC reader. Next, three specific scenarios are combined for further introduction.

[0123] Scenario one: the NFC device matches the NFC reader, and the NFC device is in the NFC radio frequency field of the NFC reader. However, the field strength provided by the NFC reader is unstable, the NFC device responds to the second card selecting instruction beyond the time limit, the communication process of the NFC reader sending the second card selecting instruction is wrong, and the like, resulting in that the card swiping operation cannot be completed in time.

[0124] The above-mentioned matching of the NFC device and the NFC reader means that the NFC device and the NFC reader can complete the card swiping operation under normal circumstances. For example, the NFC reader is an NFC reader provided in a bank teller machine, and the NFC device is a bank card.

[0125] Obviously, scenario one is the card swiping failure caused by some problems objectively existing in the NFC reader or the NFC device. Under normal circumstances, the user needs to operate the NFC device to re-enter the NFC radio frequency field of the NFC reader to complete the card swiping operation. The near field communication method shown in FIG. 6 sends the first card searching instruction to attempt to establish the communication connection between the NFC device and the NFC reader again to complete the card swiping operation when the NFC reader determines that the NFC device authentication fails. Moreover, the process is not perceived by the user, and the user considers it as a card swiping process, thereby improving the card swiping success rate and the user's card swiping experience. In addition, the near field communication method shown in FIG. 6 does not need to perform the operation of the NFC device re-entering the NFC radio frequency field, thereby greatly reducing the time consumption of the card swiping.

[0126] Scenario two: the NFC device matches the NFC reader. However, the NFC device quickly leaves the NFC radio frequency field of the NFC reader after entering the NFC radio frequency field of the NFC reader, and the field strength provided by the NFC reader is unstable, the NFC device responds to the second card selecting instruction beyond the time limit, the communication process of the NFC reader sending the second card selecting instruction is wrong, and the like, resulting in that the card swiping operation cannot be completed in time. In summary, scenario two can be understood as a mis-swiping card scenario, and the NFC device and the NFC reader do not successfully swipe the card in time due to objective reasons.

[0127] In scenario two, even if the NFC reader leaves the NFC radio frequency field provided by the NFC reader in time due to the mis-swiping card, the NFC reader still sends the first card searching instruction. In combination with the NFC reader sending the first card searching instruction within the first time, the resource waste in scenario two can be reduced.

[0128] Scenario three: the NFC device does not match the NFC reader.

[0129] According to the description of S601, before the NFC reader acquires the first information, the NFC reader sends a second card searching instruction to the NFC device, for example, a SELECT instruction. It can be understood that when the NFC device does not match the NFC reader, the NFC reader does not send the second card searching instruction to the NFC device. For detailed description of this part, please refer to the description of FIG. 7 below, which is not described here.

[0130] According to the description of the above "scenario three", when the NFC device does not match the NFC reader, the NFC reader does not send the first card searching instruction, and therefore, there is no resource waste.

[0131] It can be seen that after the NFC reader acquires the first information, the NFC reader sends the first card searching instruction regardless of whether the NFC device is in the NFC radio frequency field provided by the NFC reader.

[0132] In order to better understand how the NFC reader acquires the first information in S601 of FIG. 6, the interaction process between the NFC reader and the NFC device before the NFC reader acquires the first information will be described exemplarily.

[0133] Please refer to FIG. 7, which is a flowchart of a second near field communication method exemplarily provided by the present application. It can be understood that the steps in the embodiments of the present application can be regarded as a reasonable modification or supplement of the above-mentioned embodiments of FIG. 6; or it can be understood that the near field communication method in the embodiments of the present application can also be regarded as an independently executable embodiment, and the present application does not limit this. The near field communication method shown in FIG. 7 includes but is not limited to the following steps:

[0134] S701, the NFC reader detects that the NFC device is close. Exemplarily, the NFC reader can detect whether a card is close by continuously monitoring the change of the NFC electromagnetic field, or by sending a specific command. How the NFC reader detects that the NFC device is close is not limited by the present application.

[0135] S702, the NFC reader sends a request for acquiring information to the NFC device, and correspondingly, the NFC device receives the request for acquiring information from the NFC reader.

[0136] Exemplarily, the NFC reader sends a card search request instruction such as REQA / B / F / V to the NFC device, and the NFC device receives the card search request instruction sent by the NFC reader. For example, the NFC reader can send the 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 reader sending the card search request instruction such as REQA / B / F / V can be used to detect whether there is an NFC device close to the NFC reader, which is not limited in the present application.

[0137] Exemplarily, the above-mentioned request acquisition information is mainly used to acquire the response of the NFC device, and to lay the foundation for establishing the communication connection between the NFC device and the NFC reader. The above-mentioned request acquisition information can include the information of the basic parameters supported by the NFC reader, such as the communication protocol and the frequency.

[0138] S703, the NFC device sends a response message of the request acquisition information to the NFC reader, and the NFC reader receives the response message of the request acquisition information from the NFC device.

[0139] Exemplarily, the response message of the request acquisition information can include response instructions such as ATQA / B / F / V. For example, if the request acquisition information is REQA, the response message of the request acquisition information is ATQA. For another example, if the request acquisition information is REQB, the response message of the request acquisition information is ATQB. The response message of the request acquisition information can include the type of the NFC device, the supported communication protocol and other basic information, which is used to let the NFC reader preliminarily understand the characteristics of the NFC device, so as to determine the subsequent communication mode and instruction. In order to more clearly describe the response message of the request acquisition information, the response message of the request acquisition information can be displayed in the form of a table. For example, Table 1 is an exemplary response message of the request acquisition information.

[0140] Table 1 Response message of the request acquisition information

[0141] As shown in Table 1, the type of the NFC device in the response message requesting for information can include "electronic device with NFC function" or "NFC entity card", and the communication protocol supported by the NFC device in the response message requesting for information can include one or more of "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, other information can also be included in the response message requesting for information, which is not limited in the present application, for example, the communication frequency or the encoding mode and the like can also be included in the response message requesting for information.

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

[0143] Exemplarily, the card selection instruction can 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 can include the UID and the like of the NFC card, and through the identifier, the NFC reader can ensure communication with the specified NFC card. Of course, the card selection instruction also has the function of preventing collision, which is not limited in the present application.

[0144] S705 (case one), the NFC device sends a response message of the card selection instruction to the NFC reader, and correspondingly, the NFC reader receives the card selection instruction response message from the NFC device.

[0145] The response message of the card selection instruction can include select acknowledge (SAK) information, answer to select (ATS) information or error response information and the like.

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

[0147] 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 effectively communicate with the NFC device in subsequent communication.

[0148] The "error response information" is used to indicate that the NFC card cannot establish a communication connection with the NFC reader, which can include the following reasons: 1) the NFC card does not support the operation or function requested by the NFC reader; 2) the NFC card is in a locked or protected state, which prohibits the current card selection operation; 3) the card selection parameters provided by the NFC reader are incorrect or incomplete, causing the NFC card to be unable to identify and respond; 4) the storage area of the NFC device is damaged or fails, and the card selection operation cannot be completed and cannot respond normally; 5) during the communication between the NFC device and the NFC reader, signal interference, transmission failure, etc. occur, causing the transmitted information to be incorrect. It can be understood that if the NFC device is an electronic device with NFC function, the above NFC card can refer to the NFC simulation card in the NFC device. If the NFC device is an NFC entity card, the above NFC card can refer to the NFC device.

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

[0150] S706 (case two), the NFC reader detects that the response of the card selection instruction sent by the NFC device is timed out.

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

[0152] Exemplarily, the NFC reader establishes a timestamp when sending the card selection instruction to the NFC device, which is used to record the time of sending the card selection instruction. Further, the NFC reader can determine whether the waiting time of the NFC reader receiving the card selection instruction response message from the NFC device exceeds the first threshold value according to the timestamp, to determine whether the response message of the card selection instruction sent by the NFC device is timed out. The first threshold value is, for example, 100ms or 200ms, which is not limited in the present application.

[0153] It can be known from the above description that the near field communication method provided by the present application can greatly reduce the time consumption of card swiping on one hand, and the NFC reader sends the first card searching instruction to make the NFC device and the NFC reader try to establish a communication connection again, which can effectively improve the card swiping success rate. 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.

[0154] It can be understood that, in the case that the NFC device and the NFC reader establish communication and complete authentication based on the first card search instruction, the NFC reader can still continue to send the first card search instruction, causing the NFC reader to continuously identify that the NFC device completes, thereby presenting the phenomenon that the NFC reader presents "unlock", "lock", "unlock", "lock" (i.e., "ping-pong" effect) continuously. In view of this phenomenon, the present application provides a near field communication method.

[0155] Please refer to FIG. 8, which is a flowchart of a third near field communication method provided by the present application. It can be understood that the steps in the embodiments of the present application can be regarded as reasonable variations or supplements of the embodiments of the above-mentioned FIG. 6; or it can be understood that the near field communication method in the embodiments of the present application can also be regarded as an independently executable embodiment, and the present application does not limit this. The near field communication method shown in FIG. 8 includes but is not limited to the following steps:

[0156] S801, the NFC reader acquires first information. For specific introduction, please refer to the description of the foregoing S601, which will not be repeated here.

[0157] S802, the NFC reader sends a first card search instruction. For specific introduction, please refer to the description of the foregoing S602, which will not be repeated here.

[0158] S803, the NFC reader stops sending the first card search instruction in the case that the authentication of the NFC device is completed.

[0159] As described in the foregoing S705, it can be known that the response message of the card selection instruction sent by the NFC device to the NFC reader can include SAK information, ATS information or "error response information", etc. And, in the case that the NFC device sends the response message of the card selection instruction to the NFC reader within a preset waiting time, and the response message of the card selection instruction includes SAK information and / or ATS information, the NFC reader and the NFC device can establish subsequent communication and complete related operations. Therefore, in the present application, the completion of the authentication of the NFC device by the NFC reader can mean that "the NFC device sends the response message of the card selection instruction (the first card search instruction) to the NFC reader within a preset waiting time, and the response message of the card selection instruction (the first card search instruction) includes SAK information and / or ATS information". In some implementations, the completion of the authentication of the NFC device by the NFC reader needs to meet one or more of the following: completion of identity verification of the NFC device, completion of data integrity verification, or completion of permission verification, etc.

[0160] It can be understood that the NFC reader stops sending the first card searching instruction in the case that the NFC device is authenticated, which helps to reduce the energy consumption of the NFC reader and avoid unexpected problems caused by the NFC reader continuing to send the first card searching instruction, such as "ping-pong" effect.

[0161] In a possible implementation, the NFC reader stops sending the first card searching instruction in the case that the NFC device is authenticated and the NFC chip in the NFC reader is in the polling state.

[0162] Exemplarily, the state information of the NFC chip can be acquired in the following ways. The state information of the NFC chip includes the polling state or the listening state. The polling state indicates that the NFC device is in the connection state with the NFC reader, and the NFC device can communicate with the NFC reader and transmit data. The listening state indicates that the NFC reader does not establish a communication connection with any NFC device and waits for other NFC devices to approach to read information therein.

[0163] Firstly, the state information of the NFC chip can be acquired by reading an application programming interface (API) of the NFC.

[0164] Secondly, the state information of the NFC chip can be acquired by reading a register or a related hardware identifier of the NFC chip.

[0165] Exemplarily, the state information of the NFC chip is continuously acquired in the case that the NFC device is authenticated, and the first card searching instruction is stopped in the case that the NFC chip is in the polling state. Of course, if the NFC chip is detected to be in the listening state, the NFC reader can normally perform the near field communication method shown in FIG. 6 or FIG. 7.

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

[0167] In summary, the near field communication method shown in Fig. 8 can determine the timing of stopping the NFC reader from sending the first card searching instruction and allowing the NFC reader to send the first card searching instruction more accurately by reading the state information of the NFC chip, thereby avoiding the situation that the NFC reader cannot establish a communication connection with other NFC devices in time due to the long time of stopping the NFC reader from sending the first card searching instruction. In addition, in the case that the NFC reader completes the authentication of the NFC device and the NFC chip in the NFC reader is in the polling state of waiting for response, stopping the NFC reader from sending the first card searching instruction can also avoid the "ping-pong" effect caused by the frequent sending of the first card searching instruction by the NFC reader.

[0168] For a clearer introduction, the present application provides a fourth near field communication method. Please refer to Fig. 9. It can be understood that the steps in the embodiments of the present application can be regarded as reasonable variations or supplements of the above-mentioned embodiments of Fig. 6, Fig. 7 or Fig. 8; or it can be understood that the near field communication method in the embodiments of the present application can also be regarded as an independently executable embodiment, and the present application does not limit this. The near field communication method shown in Fig. 9 includes but is not limited to the following steps:

[0169] S901, the NFC reader detects that the NFC device is close. For a specific introduction, please refer to the introduction of the foregoing S701, which will not be repeated here.

[0170] S902, the NFC reader sends REQA / B / F / V to the NFC device, and correspondingly, the NFC device receives REQA / B / F / V from the NFC reader. For a specific introduction, please refer to the introduction of the foregoing S702, which will not be repeated here.

[0171] S903, the NFC device sends ATQA / B / F / V to the NFC reader, and correspondingly, the NFC reader receives REQA / B / F / V from the NFC device. For a specific introduction, please refer to the introduction of the foregoing S703, which will not be repeated here.

[0172] S904, the NFC reader sends the SELECT instruction to the NFC device, and correspondingly, the NFC device receives the SELECT instruction from the NFC reader. For a specific introduction, please refer to the introduction of the foregoing S704, which will not be repeated here.

[0173] S905 (case one), the NFC device sends a response message (including error response information) of SELECT to the NFC reader, and correspondingly, the NFC reader receives the response message (including error response information) of SELECT from the NFC device. For a specific introduction, please refer to the introduction of the foregoing S705, which will not be repeated here.

[0174] S906 (case two), the NFC reader detects that the NFC device sends a response to the card selection instruction timeout. Details can be referred to the foregoing description of S705, and thus will not be repeated here.

[0175] S907, the NFC reader sends REQA / B / F / V. It can be understood that the NFC device can be in the NFC radio frequency field of the NFC reader or not in the NFC radio frequency field of the NFC reader when the NFC reader sends REQA / B / F / V. Details can be referred to the foregoing description of S803, and thus will not be repeated here.

[0176] S908, the NFC device sends ATQA / B / F / V to the NFC reader, and correspondingly, the NFC reader receives REQA / B / F / V from the NFC device. Details can be referred to the foregoing description of S703, and thus will not be repeated here.

[0177] In a possible case, the NFC device shown in S901 to S906 leaves the NFC radio frequency field of the NFC device when the NFC reader sends REQA / B / F / V again. Another NFC device (referred to as a 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 device shown in S901 to S906 is the same NFC device, and the NFC device shown in S908 to S910 is another NFC device (target NFC device).

[0178] S909, the NFC reader sends SELECT to the NFC device, and correspondingly, the NFC device receives SELECT from the NFC reader. Details can be referred to the foregoing description of S704, and thus will not be repeated here.

[0179] S910, the NFC device sends a response message (including SAK information, and / or ATS information) of SELECT to the NFC reader, and correspondingly, the NFC reader receives the response message (including SAK information, and / or ATS information) of SELECT from the NFC device. Details can be referred to the foregoing description of S705, and thus will not be repeated here.

[0180] S911, the NFC reader detects that the NFC chip is in a polling state, and stops sending ATQA / B / F / V. Details can be referred to the foregoing description of the corresponding content in S803.

[0181] In summary, the near field communication method provided in the application can, in the case of NFC device authentication failure, try to establish the communication connection between the NFC device and the NFC card reader again by sending the first card searching instruction, so that the NFC device can establish the communication connection with the NFC card reader as soon as possible, and the user will consider it as 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 in the application can also determine the timing of stopping the NFC card reader from sending the first card searching instruction and allowing the NFC card reader to send the first card searching instruction by reading the state information of the NFC chip, thereby avoiding the situation that the NFC device cannot establish a communication connection with other NFC devices in time due to the long time of stopping the NFC card reader from sending the first card searching instruction. Further, in the case that the NFC card reader completes the authentication of the NFC device and the NFC chip in the NFC card reader is in the polling state, stopping the NFC card reader from sending the first card searching instruction can also avoid the "ping-pong" effect caused by the frequent sending of the first card searching instruction by the NFC card reader.

[0182] The near field communication method provided in the above embodiments of the application is described 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 embodiments of the application, the NFC card reader can include a hardware structure and / or a software unit, and the above functions can be realized in the form of hardware structure, software unit, or hardware structure plus software unit. Whether a certain function in the above functions is executed in the form of hardware structure, software unit, or hardware structure plus software unit depends on the specific application and design constraints of the technical solution.

[0183] The method provided in the embodiments of the application is described in detail above in combination with FIGS. 6 to 9. The near field communication device provided in the embodiments of the application is described in detail below in combination with FIG. 10. It should be understood that the description of the device embodiments corresponds to the description of the method embodiments. Therefore, the content not described in detail can be referred to the description in the method embodiments above.

[0184] FIG. 10 is a schematic block diagram of a first near field communication device according to an embodiment of the present application, which is configured to implement the near field communication method shown in FIGS. 6-9. 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 include a chip and other discrete devices. The near field communication device 1000 includes an obtaining unit 1001 configured to obtain data. For example, the obtaining unit 1001 is configured to obtain first information, which is used to indicate that the NFC device fails to authenticate and is also used to indicate that the near field communication device sends a first card searching instruction. The near field communication device 1000 can further include a communication unit 1002, which is configured to communicate with another part. For example, the first card searching instruction can be sent through the communication unit 1002, and the first card searching 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 referred to as a communication interface, a transceiver unit, an input / output interface, etc.

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

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

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

[0188] 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.

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

[0190] Optionally, the NFC chip can also be in a listening state, which indicates that the NFC card reader does not establish a communication connection with any NFC device and waits for other NFC devices to approach to read information therein.

[0191] In another possible implementation, before the obtaining unit 1001 obtains the first information, the communication unit 1002 is further configured to send a second card searching instruction to the NFC device, and the second card searching instruction is used to instruct the NFC device to wake up the first analog card.

[0192] Optionally, the second card search instruction is used to instruct the NFC device to wake up the first analog card, and it can also be understood that the second card search instruction is used to instruct the NFC device to return the relevant information of the first analog card to complete the authentication of the NFC device.

[0193] Optionally, in the case that multiple analog cards are set in the NFC device, the second card search instruction is used to instruct the NFC device to wake up the first analog card, and it can also be understood that the second card search instruction is used to instruct the NFC device to switch the cards, for example, instruct the NFC device to switch the first analog card to the active state and switch the second analog card to the dormant state.

[0194] In another possible implementation, the acquisition unit 1001 is specifically configured to acquire the first information in the case that the time length of the response of the NFC device to the second card search instruction is greater than the first threshold, and the first information is used to indicate that the NFC device fails in the authentication.

[0195] In another possible implementation, the communication unit 1002 is further configured to acquire the first message from the NFC device. The acquisition unit 1001 is specifically configured to acquire the first information based on the first message, and the first information is used to indicate that the NFC device fails in the authentication.

[0196] In another possible implementation, the first analog card is any one of the first access control card, the first bus card, the first vehicle key, or the first bank card.

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

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

[0199] The division of the units in the embodiments of the present application is illustrative, and is merely a logical function division. In actual implementation, another division manner can be used, and each functional unit in each embodiment of the present application can be integrated in one processor, or can be physically separated, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0200] It can be understood that the functions of the communication unit in the above embodiments can be realized by a transceiver, for example, an NFC communication module, and the functions of the acquisition unit can be realized by a processor. The transceiver can include a transmitter and / or a receiver, etc., and is used to realize the functions of the sending unit and / or the receiving unit. The following is illustrated by taking FIG. 11 as an example.

[0201] Fig. 11 is a schematic block diagram of a second near field communication device according to an embodiment of the present application. The near field communication device 1100 shown in Fig. 11 can be a hardware circuit implementation of the device shown in Fig. 10. The near field communication device 1100 is configured to implement the near field communication method shown in Figs. 6-9. For ease of illustration, Fig. 11 only shows the main components of the near field communication device.

[0202] The near field communication device 1100 shown in Fig. 11 includes at least one processor 1101. The near field communication device 1100 can also include at least one memory 1102 configured to store program instructions and / or data. The memory 1102 and the processor 1101 are coupled. The coupling between the devices, units or modules in the embodiments of the present application is indirect coupling or communication connection between devices, units or modules, which can be electrical, mechanical or other form, for information interaction between devices, units or modules. The processor 1101 can operate in cooperation with the memory 1102. The processor 1101 can execute program instructions stored in the memory 1102. At least one of the at least one memory 1102 can be included in the processor 1101.

[0203] The near field communication device 1100 can also include a communication interface 1103 configured to communicate with other devices through a transmission medium, so that the near field communication device 1100 can communicate with other devices. In the embodiments of the present application, the communication interface can be a transceiver, a circuit, a bus, a module or other types of communication interfaces. In the embodiments of the present application, when the communication interface is a transceiver, the transceiver can include a separate receiver, a separate transmitter, a transceiver integrated with transceiving functions, or an interface circuit.

[0204] 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 embodiments of the present application. In Fig. 11, the memory 1102, the processor 1101 and the communication interface 1103 are connected through a communication bus 1104. The bus is represented by a thick line in Fig. 11. The connection mode between other components is only illustrative and is not limited. The bus can include an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in Fig. 11, but it does not mean that there is only one bus or only one type of bus. The operations performed by the processor 1101 can refer to the operations performed by the obtaining unit 1001 in Fig. 10, which will not be described here. The operations performed by the communication interface 1103 can refer to the operations performed by the communication unit 1002 in Fig. 10, which will not be described here.

[0205] A chip comprising: a processor coupled with a memory, the memory to store a program or instructions that, when executed by the processor, cause the apparatus to perform the method of any of the flowcharts of FIGS. 6-9 above.

[0206] In the embodiments of the present application, the processor can be a general 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, a discrete hardware component, and can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application. The general processor can be a microprocessor or any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as hardware processor execution or executed by a combination of hardware and software modules in the processor.

[0207] In the embodiments of the present application, the memory can be a non-volatile memory such as a hard disk drive (HDD) or a solid-state drive (SSD), and can also be a volatile memory such as a random-access memory (RAM). The memory can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by a computer, but is not limited to this. The memory in the embodiments of the present application can also be a circuit or any other device capable of realizing a storage function, for storing program instructions and / or data.

[0208] The present application also provides another near field communication device, which comprises a processor and a memory, wherein the memory is configured to store a computer program, and the processor is configured to execute the computer program, so that the device executes the near field communication method obtained by the combination of the above-mentioned FIGS. 6-9.

[0209] The present application also provides a vehicle comprising the above-mentioned near field communication device. Exemplarily, the vehicle can be a transportation tool (such as a commercial vehicle, a passenger vehicle, a motorcycle, a flying vehicle, 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 an agricultural equipment (such as a mower, a harvester, etc.), etc. The vehicle can also refer to a robot (an automated guided vehicle (AGV), a walkable conversational robot, a service robot, etc.), an industrial equipment (an industrial robot, a mechanical arm, etc.), or a leisure and entertainment equipment (a virtual reality (VR) equipment, a mixed reality (MR) equipment, or a 4D cinema cabin), etc.

[0210] The embodiment of the present application further provides a terminal device, which comprises the near field communication device.

[0211] The embodiment of the present application further provides a data interaction system, which comprises the near field communication device. Optionally, the data interaction system comprises the near field communication device and the NFC device.

[0212] The embodiment of the present application provides a computer program, which is used for executing the near field communication method obtained by the combination of the above-mentioned figures 6 to 9 when executed by a processor.

[0213] The embodiment of the present application provides a computer program product, which comprises a computer program (also referred to as code or instruction); and when the computer program is executed, the computer program enables a computer to execute the near field communication method obtained by the combination of the above-mentioned figures 6 to 9.

[0214] The embodiment of the present application further provides a computer readable storage medium, which stores instructions, and when the instructions are executed on at least one processor, the near field communication method obtained by the combination of the above-mentioned figures 6 to 9 is implemented.

[0215] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by program instructing relevant hardware, and the program can be stored in a computer readable storage medium, and the storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk.

Claims

A near field communication method, characterized by, The application is applied to a near field communication (NFC) card reader, and the NFC method comprises the following steps: obtaining first information, wherein the first information is used to indicate that NFC device authentication fails, and the first information is also used to indicate that the NFC card reader sends a first card searching instruction; sending the first card searching instruction, wherein the first card searching instruction is used to establish a communication connection between the NFC card reader and the NFC device. The method of claim 1, wherein The sending of the first card searching instruction comprises the following steps: sending the first card searching instruction within a first time length. The method according to claim 2, characterized in that The sending of the first card searching instruction within the first time length comprises the following steps: sending the first card searching instruction at a first frequency within the first time length. The method according to claim 2 or 3, characterized in that The first time length T satisfies the following relationship: 1s≤T≤4s. The method according to any one of claims 1 to 3, characterized in that The method further comprises the following steps: stopping the sending of the first card searching instruction in the case of completing the authentication of the NFC device. The method according to claim 5, characterized in that The stopping of the sending of the first card searching instruction in the case of completing the authentication of the NFC device comprises the following steps: stopping the sending of the first card searching instruction in the case of completing the authentication of the NFC device and the NFC chip in the NFC card reader being in a waiting response state. According to the method in any one of claims 1-3, wherein before the obtaining of the first information, the method further comprises the following step: sending a second card searching instruction to the NFC device, wherein the second card searching instruction is used to instruct the NFC device to wake up a first analog card. The method of claim 7, wherein The obtaining of the first information comprises the following steps: obtaining the first information in the case that the time length of the response of the NFC device to the second card searching instruction is greater than a first threshold value, wherein the first information is used to indicate that the NFC device authentication fails. The method according to any one of claims 1 to 3, characterized in that The obtaining of the first information comprises the following steps: receiving a first message from the NFC device, and obtaining the first information based on the first message, wherein the first information is used to indicate that the NFC device authentication fails. The method of claim 7, wherein The first analog card is any one of a first access control card, a first bus card, a first vehicle key or a first bank card. The method according to any one of claims 1 to 3, characterized in that The NFC device comprises an electronic device with NFC function or an NFC entity card. The method according to any one of claims 1 to 3, characterized in that The first card searching instruction comprises an A-type request command, a B-type request command, an F-type request command or a V-type request command. A near field communication device, characterized in that The NFC device comprises an obtaining unit and a communication unit. The obtaining unit is used to obtain first information, wherein the first information is used to indicate that NFC device authentication fails, and the first information is also used to indicate that the NFC device sends a first card searching instruction. The communication unit is used to send the first card searching instruction, wherein the first card searching instruction is used to establish a communication connection between the NFC device and the NFC device. The apparatus of claim 13, wherein The communication unit is specifically used to send the first card searching instruction within a first time length. The apparatus of claim 14, wherein The communication unit is specifically used to send the first card searching instruction at a first frequency within the first time length. The apparatus of claim 14 or 15, wherein The first time length T satisfies the following relationship: 1s≤T≤4s. The apparatus according to any one of claims 13-15, characterized in that In the case of completing the authentication of the NFC device, the communication unit is further used to stop the sending of the first card searching instruction. The apparatus of claim 17, wherein The communication unit is configured to stop sending the first card searching instruction when the NFC device is authenticated and the NFC chip in the near field communication device is in a waiting response state. The apparatus according to any one of claims 13-15, characterized in that Before the acquisition unit acquires the first information, the communication unit is further configured to send a second card searching instruction to the NFC device, the second card searching instruction being configured to instruct the NFC device to wake up the first analog card. The apparatus of claim 19, wherein The acquisition unit is specifically configured to acquire the first information when a time length for the NFC device to respond to the second card searching instruction is greater than a first threshold value, the first information being configured to indicate that the NFC device fails to be authenticated. The apparatus according to any one of claims 13-15, characterized in that The communication unit is further configured to receive a first message from the NFC device, and the acquisition unit is specifically configured to acquire the first information based on the first message, the first information being configured to indicate that the NFC device fails to be authenticated. The apparatus of claim 19, wherein The first analog card is any one of a first access control card, a first bus card, a first vehicle key, or a first bank card. The apparatus according to any one of claims 13-15, characterized in that The NFC device includes an electronic device with NFC function or an NFC entity card. The apparatus according to any one of claims 13-15, characterized in that The first card searching instruction includes an A-type request command, a B-type request command, an F-type request command, or a V-type request command. A near field communication device, characterized in that Comprise: a processor; when the processor invokes a computer program or instructions in the memory, the method as claimed in any one of claims 1-12 is executed. A vehicle characterized by comprising: The vehicle comprises the near field communication device as claimed in any one of claims 13-25. A computer-readable storage medium, characterized by The computer readable storage medium is configured to store a computer program, and the computer program is executed to execute the method as claimed in any one of claims 1-12. A computer program product, characterized in that The computer program product comprises instructions, and when the instructions are executed by the processor, the method as claimed in any one of claims 1-12 is implemented.

Citation Information

Patent Citations

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

    CN111953388A

  • Card searching method, NFC chip and electronic equipment

    CN114896997A

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

    CN117808021A

  • Near field communication method and device

    CN118659803A

  • Card emulation method, and NFC chip and electronic device

    WO2023221429A1