Near field communication method and device, NFC chip and NFC device

By restarting the abnormal hardware module in the stand-alone state of the NFC chip and restoring communication according to the previous configuration parameters, the communication abnormality problem caused by non-hardware damage of the NFC chip is solved, and rapid recovery and improved user experience are achieved.

CN115884144BActive Publication Date: 2025-03-25SHENZHEN GOODIX TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211458777.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-18
Publication Date
2025-03-25
Estimated Expiration
2042-11-18

AI Technical Summary

Technical Problem

Communication abnormalities caused by non-hardware damage in NFC chips cause the NFC system to fail to respond correctly to the instructions of the master control device and require a cold reset, resulting in a long system recovery time and affecting the user experience.

Method used

By determining that after an abnormality occurs in the NFC chip, it is controlled to enter a stand-alone state, and in this state the hardware module that has an abnormality is restarted, the wake-up source is set so that it wakes up after a predetermined time period, and the near-field communication is continued according to the previously saved configuration parameters.

Benefits of technology

Without cold start of the entire NFC chip, it can restore the NFC chip to its previous state without the user's perception, greatly improving the user experience and reducing the system recovery time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115884144B_ABST
    Figure CN115884144B_ABST
Patent Text Reader

Abstract

The present application provides a method and apparatus for near field communication, an NFC chip and an NFC device, which can solve the communication anomaly caused by non-hardware damage in the NFC chip without affecting the user experience. The method is applied to an NFC chip, and includes: determining that the NFC chip is abnormal; controlling the NFC chip to enter a static standby state, and restarting the hardware module in the NFC chip where the anomaly occurs in the static standby state; setting a wake-up source so that the NFC chip wakes up from the static standby state after a predetermined period of time; setting configuration parameters so that the NFC chip performs the near field communication according to the configuration parameters after waking up, wherein the configuration parameters are the configuration parameters for near field communication saved by the NFC chip before entering the static standby state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of near field communication, and more specifically, to a near field communication method and apparatus, an NFC chip, and an NFC device. Background Art

[0002] Near field communication (NFC) technology has good security and convenience, and has been widely used in access control, transportation, electronic payment and other fields. When the NFC chip has communication anomalies due to reasons other than hardware damage, the NFC system has fallen into an unexpected operating state and can no longer correctly respond to NFC controller interface (NCI) instructions issued by the main control device such as the device host (DH). The NFC chip needs to be cold reset, so it takes a long time for the NFC system to recover to a usable state. Users will feel obvious lag when using applications, affecting the user experience. Therefore, how to effectively solve the communication anomalies caused by reasons other than hardware damage in the NFC chip without affecting the user experience has become a problem that needs to be solved. Summary of the invention

[0003] The embodiments of the present application provide a near field communication method and apparatus, an NFC chip, and an NFC device, which can effectively solve communication anomalies caused by non-hardware damage in the NFC chip without affecting the user experience.

[0004] In a first aspect, a method for near field communication is provided, the method being applied to an NFC chip, the method comprising: determining that an abnormality occurs in the NFC chip; controlling the NFC chip to enter a static standby state, and restarting a hardware module in the NFC chip where the abnormality occurs in the static standby state; setting a wake-up source so that the NFC chip wakes up from the static standby state after a predetermined period of time; setting configuration parameters so that the NFC chip performs the near field communication according to the configuration parameters after waking up, wherein the configuration parameters are configuration parameters for near field communication saved by the NFC chip before entering the static standby state.

[0005] In one implementation, determining that an abnormality occurs in the NFC chip includes: detecting a state machine of a hardware module of the NFC chip; and determining that an abnormality occurs in the NFC chip if a state of the state machine is different from an expected state.

[0006] In one implementation, determining that an abnormality occurs in the NFC chip includes: detecting a status register of the NFC chip; and determining that an abnormality occurs in the NFC chip if a value of the status register is different from an expected value.

[0007] In one implementation, the method further includes: when it is determined that an abnormality occurs in the NFC chip, turning off the clock and functions that have been turned on in the NFC chip so that the NFC chip enters a low power consumption mode, and controlling the hardware modules in the NFC chip that have not experienced an abnormality to enter an initial state.

[0008] In one implementation, before controlling the NFC chip to enter a static standby state, the method further includes: completing a currently executed operation.

[0009] In one implementation, the NFC chip uses a real-time operating system RTOS, and the processing of the currently executing operation includes: processing of the currently executing message or event.

[0010] In one implementation, restarting the abnormal hardware module in the NFC chip in the static standby state includes: resetting the power supply of the abnormal hardware module in the NFC chip to make the abnormal hardware module enter an initial state.

[0011] In an implementation manner, the wake-up source includes a timer, and the wake-up source is used to wake up the NFC chip from the static standby state after the timing duration of the timer expires.

[0012] In one implementation, the wake-up source is used to wake up the NFC chip from the static standby state when the field strength of the radio frequency signal during the near field communication meets a predetermined condition.

[0013] In an implementation manner, the wake-up source is used to trigger the NFC chip to wake up from the static standby state according to a change in a power level of the NFC chip.

[0014] In one implementation, the wake-up source includes a wake-up message sent by the master device, and the wake-up message is used to trigger the NFC chip to wake up from the static standby state. For example, the wake-up message includes at least one of the following messages: a message of an I2C communication interface, a message of an SPI communication interface, a message of an SWP communication interface, and a message of a GPIO communication interface.

[0015] In an implementation manner, the configuration parameter includes at least one of the following parameters: an NFC identifier, a parameter indicating the NFC technology, a parameter indicating a transmission rate or a frame length, and an RF characteristic parameter of an antenna.

[0016] In one implementation, the NFC chip is applied to an NFC device in CE mode, RW mode or P2P mode.

[0017] In a second aspect, a near field communication device is provided, which is applied to an NFC chip, and the device includes: an abnormality detection unit, used to determine that an abnormality occurs in the NFC chip; a processing unit, used to control the NFC chip to enter a static standby state, and restart the hardware module in the NFC chip where the abnormality occurs in the static standby state; the processing unit is also used to set a wake-up source so that the NFC chip wakes up from the static standby state after a predetermined period of time; the processing unit is also used to set configuration parameters so that the NFC chip performs the near field communication according to the configuration parameters after waking up, wherein the configuration parameters are configuration parameters for near field communication saved by the NFC chip before entering the static standby state.

[0018] In one implementation, the abnormality detection unit is specifically used to: detect a state machine of a hardware module of the NFC chip; if a state of the state machine is different from an expected state, determine that an abnormality occurs in the NFC chip.

[0019] In one implementation, the abnormality detection unit is specifically used to: detect a status register of the NFC chip; if a value of the status register is different from an expected value, determine that an abnormality occurs in the NFC chip.

[0020] In one implementation, the processing unit is further used to: when it is determined that an abnormality occurs in the NFC chip, turn off the clock and functions that have been turned on in the NFC chip to make the NFC chip enter a low power consumption mode, and control the hardware modules in the NFC chip that have not experienced an abnormality to enter an initial state.

[0021] In one implementation, the processing unit is further configured to: complete the currently executed operation before controlling the NFC chip to enter the static standby state.

[0022] In one implementation, the NFC chip uses RTOS, and the processing unit is specifically used to: process the message or event that is currently being executed.

[0023] In one implementation, the processing unit is specifically configured to: reset the power supply of the hardware module in the NFC chip where the abnormality occurs, so that the hardware module in the NFC chip where the abnormality occurs enters an initial state.

[0024] In an implementation manner, the wake-up source includes a timer, and the wake-up source is used to wake up the NFC chip from the static standby state after the timing duration of the timer expires.

[0025] In one implementation, the wake-up source is used to wake up the NFC chip from the static standby state when the field strength of the radio frequency signal during the near field communication meets a predetermined condition.

[0026] In an implementation manner, the wake-up source is used to trigger the NFC chip to wake up from the static standby state according to a change in a power level of the NFC chip.

[0027] In one implementation, the wake-up source includes a wake-up message sent by the master device, and the wake-up message is used to trigger the NFC chip to wake up from the static standby state. For example, the wake-up message includes at least one of the following messages: a message of an I2C communication interface, a message of an SPI communication interface, a message of an SWP communication interface, and a message of a GPIO communication interface.

[0028] In an implementation manner, the configuration parameter includes at least one of the following parameters: an NFC identifier, a parameter indicating the NFC technology, a parameter indicating a transmission rate or a frame length, and an RF characteristic parameter of an antenna.

[0029] In one implementation, the NFC chip is applied to an NFC device in CE mode, RW mode or P2P mode.

[0030] According to a third aspect, an NFC chip is provided, wherein the NFC chip includes the near field communication device according to the second aspect or any possible implementation manner of the second aspect.

[0031] In a fourth aspect, an NFC device is provided, comprising the NFC chip described in the third aspect or any implementation manner of the third aspect.

[0032] In an implementation manner, the NFC device is an NFC device in CE mode, RW mode or P2P mode.

[0033] Based on the above technical solution, when it is determined that an abnormality occurs in the NFC chip, the NFC chip is controlled to enter a static standby state, so as to restart the hardware module in the NFC chip where the abnormality occurs in the static standby state, and by setting a wake-up source, the NFC chip is awakened from the static standby state after a predetermined time, so that after awakening, the NFC chip continues to perform near field communication according to the configuration parameters for near field communication saved before entering the static standby state. In this way, by restarting the hardware module where the abnormality occurs in the static standby state of the NFC chip, there is no need to cold-start the entire NFC chip, and the NFC chip can be restored to the state before the abnormality without the user's perception, which greatly improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a schematic flow chart of the near field communication method of an embodiment of the present application.

[0035] Figure 2 yes Figure 1A flow chart of a possible specific implementation of the method shown.

[0036] Figure 3 It is a schematic block diagram of a near field communication device according to an embodiment of the present application. DETAILED DESCRIPTION

[0037] The technical solution in this application will be described below in conjunction with the accompanying drawings.

[0038] NFC technology has been widely used in people's lives. Generally, there are three working modes of NFC devices. The first is active mode, also known as reader / writer (RW) mode. NFC devices working in RW mode are used as card readers, actively sending out radio frequency signals to identify and read and write other NFC devices, such as POS machines, access control, etc. The second is passive mode, also known as card emulation (CE) mode. NFC devices working in CE mode can be read and written as cards, and passively respond in the radio frequency field emitted by other NFC devices, such as mobile payments. The third is peer to peer (P2P) mode. In the following, for the sake of simplicity, NFC devices working in RW mode are referred to as RW devices, NFC devices working in CE mode are referred to as CE devices, and NFC devices working in P2P mode are referred to as PSP devices.

[0039] When using the three modes of NFC, communication anomalies may occur due to reasons other than hardware damage, which may lead to communication failure or even NFC chip freezing. These reasons include but are not limited to the following:

[0040] 1) The hardware module of the NFC chip makes errors in sampling or decoding electromagnetic waves in the normal frequency range, such as 13.56Mhz;

[0041] 2) The hardware clock of the NFC chip is inaccurate, causing the NFC chip to run abnormally;

[0042] 3) There are signal sources of other frequencies or foreign interference sources outside the NFC chip, causing the hardware module of the NFC chip to fall into an abnormal working state;

[0043] 4) The configuration of the register parameters or hardware characteristic values ​​of the NFC chip does not meet the expected values ​​of the current scenario, but the NFC chip will still operate in this scenario.

[0044] For communication anomalies caused by reasons other than hardware damage, the hardware module of the NFC chip cannot work normally. The software module in the NFC chip falls into an unexpected operating state due to the abnormal response of the hardware module. It can no longer respond normally to commands issued by the device host (DH), security chip (SE), universal integrated circuit card (UICC), subscriber identity module (SIM), other readers, access control and other main control devices. The NFC chip needs to be cold reset again. Therefore, it takes a long time for the NFC system to recover to a usable state. Users will feel obvious lag when using the application, affecting the user experience.

[0045] To this end, the present application provides a near-field communication solution, which aims to solve the problem of communication anomalies caused by non-hardware damage in the NFC chip. By restarting the abnormal hardware module in the static standby state of the NFC chip, there is no need to cold-start the entire NFC chip. The NFC chip can be restored to the state before the abnormality without the user's perception, greatly improving the user experience.

[0046] Figure 1 The schematic flowchart of the method 100 for near field communication of the embodiment of the present application is shown in FIG. The method 100 is applied to the NFC chip 200, and the NFC chip 200 can be applied to the NFC device in CE mode, the NFC device in RW mode, or the NFC device in P2P mode. In addition, the method 100 can also be applied to the card swiping scenario when the CE device is turned off, and the scenario without DH participation such as the SE-based RW device, CE device or P2P device. Therefore, the method 100 can also be called the self-recovery method of the NFC chip.

[0047] The method 100 can be performed by a near field communication device 210. It should be understood that the NFC device 210 described in the embodiment of the present application refers to the software module 210 of the NFC chip 200, or the software part. For example, the device 210 can be the firmware 210 of the NFC chip 200. The NFC device 210 can interact with the hardware module 220 of the NFC chip 200, so as to control the hardware module 220 to implement the corresponding function. Hereinafter, the device 210 is also referred to as the software module 210. The hardware module 220 can include, for example, a field detection module, a sampling module, a coding module, an analog-to-digital conversion module and other hardware modules of the NFC chip 200.

[0048] like Figure 1 As shown, method 100 may include some or all of the following steps.

[0049] In step 110 , it is determined that an abnormality occurs in the NFC chip 200 .

[0050] In step 120 , the NFC chip 200 is controlled to enter a standby state (Stdby), and the hardware module in which an abnormality occurs in the NFC chip 200 is restarted in the standby state.

[0051] In step 130 , a wake-up source is set so that the NFC chip 200 wakes up from the static standby state after a predetermined time period.

[0052] In step 140, configuration parameters are set so that the NFC chip 200 performs near field communication according to the configuration parameters after being awakened, wherein the configuration parameters are configuration parameters for near field communication saved by the NFC chip 200 before entering the static standby state.

[0053] The configuration parameters may include, for example, at least one of the following parameters: an NFC identifier (NFC identify, NFCID), a parameter for indicating NFC technology, a parameter for indicating a transmission rate or a frame length, and a radio frequency (RF) characteristic parameter of an antenna. NFC technology includes, for example, NFC technology A, technology B, NFC technology F, etc., also referred to as mode or protocol information. These configuration parameters are used by the hardware module to implement the corresponding functions, thereby completing the near field communication of the NFC chip 200. In the actual protocol, these configuration parameters are carried by signaling such as selecting information of type A as a response (select knowledge of type A, SKA), a reply to a Select command (answer to select, ATS), etc.

[0054] In this way, by restarting the abnormal hardware module in the static standby state of the NFC chip 200, there is no need to cold start the entire NFC chip 200. The NFC chip 200 can be automatically restored to the state before the abnormality without the user's perception, which greatly improves the user experience.

[0055] Generally, the state machine includes several state registers and related combinational logic circuits. In the embodiment of the present application, it is possible to determine whether an abnormality occurs in the NFC chip 200 by detecting the state register or the state machine of the NFC chip 200.

[0056] For example, in step 110, the status register of the NFC chip 200 may be detected, and when the value of the status register is different from the expected value, it is determined that an abnormality has occurred in the NFC chip 200. For example, the NFC chip 200 includes 8 registers. Before sending or receiving a command, the NFC device 210 queries the values ​​of these status registers. Assuming that the current expected values ​​of these status registers are 11000000, if it is found after the query that the values ​​of these status registers are not 11000000, it is considered that an abnormality has occurred in the NFC chip 200.

[0057] For another example, in step 110, the state machine of the hardware module of the NFC chip 200 may be detected, and when the state of the state machine is different from the expected state, it is determined that an abnormality has occurred in the NFC chip 200. For example, the NFC chip 200 has three possible states, namely, state S0, state S1, and state S2. Before sending or receiving a command, the NFC device 210 queries the state of the state machine. Assuming that the current expected state of the state should be S0, if it is found after the query that the current state of the state machine is not S0, it is considered that an abnormality has occurred in the NFC chip 200.

[0058] Once it is determined that an abnormality occurs in the NFC chip 200 , the self-recovery process of the NFC chip 200 is entered, and steps 120 to 140 are executed, for example.

[0059] The NFC chip 200 supports a low power mode (LPM), and the NFC chip 200 can be in a static standby state in the low power mode. Therefore, in one implementation, the method 100 further includes: when it is determined that an abnormality occurs in the NFC chip 200, turning off the clock and function that have been turned on in the NFC chip 200, so that the NFC chip 200 enters the low power mode, and controlling the hardware modules in the NFC chip that have not experienced an abnormality to enter an initial state (IDLE state).

[0060] In one implementation, in step 120, restarting the abnormal hardware module in the NFC chip 200 in the static standby state includes: resetting the power supply of the abnormal hardware module in the NFC chip 200 to make the abnormal hardware module enter the initial state.

[0061] Specifically, before the NFC chip 200 enters the static standby state, it is necessary to actively turn off all turned-on clocks (timers) in the NFC chip 200, and turn off various functions of the NFC chip 200, in preparation for entering the low power consumption mode, and then entering the static standby state; at the same time, it is necessary to set the NFC chip 200 to the initial state, for example, clear all status bits and data in the current NFC chip 200. However, the abnormal hardware module cannot be controlled by the software module 210 to enter the initial state, so it is necessary to perform a power reset operation in the static standby state to reset the power of the abnormal hardware module, so that the abnormal hardware module is restored to the initial state. For example, in the static standby state, the power domain associated with the abnormal hardware module is restarted, that is, power off and then power on.

[0062] In one implementation, before controlling the NFC chip 200 to enter the static standby state, the method 100 further includes: processing the currently executed operation, that is, the software module 210 completes processing the currently executed statement. For example, for a real-time operating system (RTOS), the software module 210 completes processing the currently executed message or event in the original order, thereby avoiding memory leaks.

[0063] After the NFC chip 200 enters the static standby state and completes the power reset of the abnormal hardware module in the static standby state, it needs to be awakened from the static standby state by using a wakeup source and exit the low power consumption mode.

[0064] Usually, the wake-up source can be realized by setting a timer, detecting the field strength, receiving a wake-up message sent by the master device through the communication interface, detecting the level change of the chip power supply, etc.

[0065] The timer is a software timer in the NFC chip 200, which is configured with a timing duration, for example, 100 us. The timer starts timing and triggers the NFC chip 200 to wake up from the static standby state after the timing duration is reached.

[0066] The wake-up method of detecting field strength refers to triggering the NFC chip 200 to wake up from the static standby state according to the change of the field strength of the RF signal. For example, when it is detected that the field strength meets a predetermined condition, such as being greater than a preset value, the NFC chip 200 is triggered to wake up from the static standby state.

[0067] The wake-up method of detecting the level change of the chip power supply refers to triggering the NFC chip 200 to wake up from the static standby state according to the change of the power level of the NFC chip 200. For example, raising the power supply level of the NFC chip 200, such as raising the voltage of the corresponding pin from 1.3-1.8V to 2.7-3.3V, will trigger the NFC chip 200 to wake up from the static standby state.

[0068] The NFC chip 200 can be connected to the main control device 300 through a corresponding communication interface, for example, the NFC chip 200 is connected to the DH through an inter integrated circuit (I2C) communication interface, or is connected to the SE through a serial peripheral interface (SPI) communication interface, or is connected to the UICC or SIM card through a single wire protocol (SWP) communication interface. Optionally, after determining that the NFC chip 200 is abnormal, the software module 210 can send a wake-up notification to the main control device 300, for example, sending the wake-up notification to the main control device 300 when it is about to enter the static standby state; after receiving the wake-up notification, the main control device 300 sends a wake-up message to the NFC chip 200 after a predetermined period of time according to the wake-up notification to wake it up from the static standby state. For different master control devices, the wake-up message can be transmitted by different communication interfaces. For example, the wake-up message can be a message of the I2C communication interface sent by DH, a message of the SPI communication interface sent by SE, a message of the SWP communication interface sent by UICC or SIM card, or a message of the GPIO communication interface sent by other readers and access control.

[0069] Different devices are usually configured with multiple wake-up sources. For electronic devices such as mobile phones, two wake-up sources are usually configured, such as a wake-up source based on field strength detection and a wake-up source based on I2C interface messages; for security devices, three wake-up sources are usually configured, such as a wake-up source based on field strength detection, a wake-up source based on SPI interface messages, and a wake-up source based on SWP interface messages. These wake-up sources can also be used in the recovery process of the NFC chip 200.

[0070] In order to avoid the situation where a single wake-up source is abnormal and cannot be awakened, multiple wake-up sources can be configured for the recovery process of the NFC chip 200. At this time, the wake-up sources can be executed in descending order of priority; if the wake-up sources have the same priority, the wake-up sources are executed in a predetermined triggering order.

[0071] The method 100 of the embodiment of the present application can be applied in a scenario where no master device is involved. In this case, the wake-up message sent by the master device cannot be used as the wake-up source. For example, when applied in a scenario where no DH is involved, the I2C interface message cannot be configured as the wake-up source. Therefore, in order to expand the application scenarios of the NFC chip 200, preferably, a software timer can be configured as the wake-up source for the self-recovery process of the NFC chip 200 to wake up the NFC chip 200 from the static standby state after the timing duration of the timer ends. The timer has the advantages of wide application scenarios, simple operation and easy implementation.

[0072] Since the NFC chip 200 has saved the obtained configuration parameters for its near field communication before entering the static standby state, after the NFC chip 200 is awakened from the static standby state under the triggering of the wake-up source, it can immediately continue the near field communication according to the saved configuration parameters. For example, for a CE device, its NFC chip 200 can enter a discovery process according to these configuration parameters after being awakened successfully, so that the CE device resumes the interaction process between it and the RW device.

[0073] When an abnormality occurs in the NFC chip 200, if the NFC chip 200 is cold reset, that is, the entire NFC chip 200 is powered off and restarted to restore its hardware state, the user will have an obvious sense of interruption in use, and the application being used must be restarted. However, by adopting the near-field communication method 100 of the present application, the NFC chip 200 can achieve self-recovery, which only controls the abnormal hardware module to power off and restart in the static standby state, and because the relevant configuration parameters for near-field communication are pre-saved, there is no need for the main control device to re-send the configuration parameters, so the self-recovery process is imperceptible to the main control device, and the main control device will not think that the NFC chip 200 has an abnormality, and will not cold reset the NFC chip, nor terminate the current near-field communication process. The user will only feel the hysteresis in the operation for a very short period of time, which greatly improves the user experience.

[0074] The following, combined Figure 2 A possible process interaction diagram is shown in FIG. 2 , taking the NFC chip 200 applied to a CE device as an example, a self-recovery process of the NFC chip 200 is described in detail. The process is executed by the NFC chip 200 applied to the CE device and the NFC chip 300 applied to the RW device, wherein the NFC chip 200 includes a software module 210 and a hardware module 220. Figure 2 As shown, the process may include some or all of the following steps.

[0075] In step 401 , communication is established between the NFC chip 200 and the NFC chip 300 .

[0076] Here, assuming that the NFC chip 200 and the NFC chip 300 communicate based on NFC technology A (type A), then in step 401, a communication based on protocol layer 3 of technology A (Tech A layer-3 communication) is established between the NFC chip 200 and the NFC chip 300.

[0077] In step 402 , the hardware module 220 sends a single device detection (SDD) completion instruction (SDD done) to the software module 210 .

[0078] In step 403 , the NFC chip 300 sends a request (Request ATS, RATS) message for requesting ATS to the hardware module 220 .

[0079] Among them, the ATS message can carry configuration parameters such as transmission rate and data length.

[0080] In step 404 , the hardware module 220 sends a RATS message to the software module 210 .

[0081] In step 405 , in response to the RATS message, the software module 210 sends an ATS message to the hardware module 220 .

[0082] In step 406 , the hardware module 220 sends an ATS message to the NFC chip 300 .

[0083] In step 407 , the NFC chip 300 sends other commands to the hardware module 220 .

[0084] In step 408 , the hardware module 220 sends other commands to the software module 210 .

[0085] In step 409 , the software module 210 sends a response message (response) to other commands to the hardware module 220 .

[0086] In step 410 , the hardware module 220 sends a response message for other commands to the NFC chip 300 .

[0087] If the NFC chip 200 is abnormal due to interference or other reasons during the execution of step 409, that is, abnormal position 1, the subsequent steps 409 and 410 cannot be executed normally. At this time, after detecting the abnormality, the software module 210 of the NFC chip 200 will directly control the NFC chip 200 to execute steps 413 to 418.

[0088] Of course, the anomaly may also occur in other locations, such as during the field detection process shown in step 411 or step 412, that is, abnormal position 2. At this time, an abnormality occurs in the field detection module. Among them, in step 411, the NFC chip 300 of the RW device may close the field due to reasons such as the end of the transaction, that is, leave the field (field off). In step 412, after the hardware module 220 detects that the RW device has left the field, it sends a message indicating the departure to the software module 210. At this time, after detecting the abnormality, the software module 210 of the NFC chip 200 will also directly control the NFC chip 200 to execute steps 413 to 418.

[0089] In step 413 , the software module 210 sends an instruction to terminate the NFC operation (terminateNFC operation) to the hardware module 220 .

[0090] For example, the software module 21 finishes executing the currently executed statement, and turns off the clock and various functions that have been turned on, and prepares to enter the low power consumption mode.

[0091] In step 414 , the hardware module 220 sends the configuration parameters for near field communication to the software module 210 to save the configuration parameters.

[0092] The configuration parameters include, for example, RF feature parameters and NFC parameters, and the NFC parameters include, for example, NFCID, SAK, ATS, and the like.

[0093] In step 415 , the software module 21 controls the hardware module 220 to enter a quiescent state and sets a wakeup source (enterStdby and enable timer source).

[0094] The software module 210 can control the hardware modules 220 in the NFC chip 200 that have not experienced any abnormality to be set to the initial state, while the abnormal hardware modules 220 are not subject to this control. Therefore, the power domain associated with the abnormal hardware module 220 can only be restarted in the static standby state, that is, powered off and then powered on, so that the abnormal hardware module 220 enters the initial state.

[0095] In step 416 , the NFC chip 200 wakes up from the static standby state based on the wakeup source (wake up from timer source).

[0096] In step 417 , the software module 210 sets configuration parameters for the hardware module 220 .

[0097] The configuration parameters are the configuration parameters saved before the NFC chip 200 enters the static standby state, that is, the configuration parameters saved in step 414 .

[0098] In step 418, the NFC chip 200 re-executes the discovery process based on the configuration parameters, that is, starts the card emulation working mode and detects the field (start CE and detect field).

[0099] At this time, the aforementioned related steps, such as step 401 to step 406, may be re-executed to restore the near field communication between the CE device and the RW device.

[0100] It can be seen that when an abnormality is detected in the NFC chip 200, the NFC chip 200 is controlled to enter a static standby state, so as to restart the hardware module in the NFC chip 200 where the abnormality occurs in the static standby state, and by setting a wake-up source, the NFC chip 200 is awakened from the static standby state after a predetermined period of time, so that after awakening, the NFC chip 200 continues to perform near field communication according to the configuration parameters for near field communication saved before entering the static standby state. In this way, by restarting the hardware module where the abnormality occurs in the static standby state of the NFC chip 200, there is no need to cold-start the entire NFC chip, and the NFC chip 200 can be restored to the state before the abnormality without the user's perception, which greatly improves the user experience.

[0101] Figure 2 For example only, the near field communication method 100 of the embodiment of the present application can also be applied to the NFC chip 300 of the RW device to achieve self-recovery of the NFC chip 300, and can be applied to the self-recovery of near field communication of various NFC technologies including technology A, technology B, and technology F.

[0102] The present application also provides a near field communication device, the device 210 is applied to an NFC chip 200, and the NFC chip 200 can be applied to an NFC device in CE mode, RW mode or P2P mode. Figure 3 As shown, the device 210 includes an abnormality detection unit 2101 and a processing unit 2101.

[0103] The abnormality detection unit 2101 is used to determine whether an abnormality occurs in the NFC chip 200;

[0104] The processing unit 2102 is used for:

[0105] Control the NFC chip 200 to enter a static standby state, and restart the hardware module in the NFC chip 200 where an abnormality occurs in the static standby state;

[0106] Setting a wake-up source so that the NFC chip 200 wakes up from a static standby state after a predetermined period of time;

[0107] The processing unit 2102 is further used to set configuration parameters so that the NFC chip 200 performs near field communication according to the configuration parameters after being awakened, wherein the configuration parameters are configuration parameters for near field communication saved by the NFC chip before entering the static standby state.

[0108] In one implementation, the abnormality detection unit 2101 is specifically used to: detect a state machine of a hardware module of the NFC chip 200; if the state of the state machine is different from an expected state, determine that an abnormality occurs in the NFC chip 200.

[0109] In one implementation, the abnormality detection unit 2101 is specifically used to: detect a status register of the NFC chip 200; if the value of the status register is different from an expected value, determine that an abnormality occurs in the NFC chip 200.

[0110] In one implementation, the processing unit 2102 is further used to: when it is determined that an abnormality occurs in the NFC chip 200, turn off the clock and functions that have been turned on in the NFC chip 200 to make the NFC chip 200 enter a low power consumption mode, and control the hardware modules in the NFC chip 200 that have not experienced an abnormality to enter an initial state.

[0111] In one implementation, the processing unit 2102 is further configured to complete the currently executed operation before controlling the NFC chip 200 to enter the static standby state.

[0112] In one implementation, the NFC chip 200 uses RTOS, and the processing unit 2102 is specifically used to: process the message or event that is currently being executed.

[0113] In one implementation, the processing unit 2102 is specifically configured to reset the power supply of the hardware module in the NFC chip 200 where the abnormality occurs, so that the hardware module in which the abnormality occurs enters an initial state.

[0114] In one implementation, the wake-up source includes a timer, and the wake-up source is used to wake up the NFC chip 200 from the static standby state after the timing duration of the timer expires.

[0115] In one implementation, the wake-up source is used to wake up the NFC chip 200 from the static standby state when the field strength of the radio frequency signal during near field communication meets a predetermined condition.

[0116] In one implementation, the wake-up source includes a wake-up message sent by the master device 300 , and the wake-up message is used to trigger the NFC chip 200 to wake up from the static standby state.

[0117] In one implementation, the wake-up message includes at least one of the following messages: a message of an I2C communication interface, a message of an SPI communication interface, a message of an SWP communication interface, and a message of a GPIO communication interface.

[0118] In one implementation, the wake-up source is used to trigger the NFC chip 200 to wake up from the static standby state according to a change in the power level of the NFC chip 200 .

[0119] In an implementation manner, the configuration parameter includes at least one of the following parameters: an NFC identifier, a parameter indicating the NFC technology, a parameter indicating a transmission rate or a frame length, and an RF characteristic parameter of an antenna.

[0120] The present application also provides an NFC chip 200 , which includes the near field communication device 210 described in any of the above embodiments. Optionally, the NFC chip 200 also includes a hardware module 220 connected to the device 210 .

[0121] The present application also provides an NFC device, the NFC device comprising the NFC chip 200 described in any of the above embodiments, wherein the NFC chip 200 comprises the near field communication device 210 described in any of the above embodiments. Optionally, the NFC chip 200 further comprises a hardware module 220 connected to the device 210. The NFC device may be, for example, an NFC device in CE mode, RW mode or P2P mode.

[0122] It should be noted that, under the premise of no conflict, the various embodiments described in this application and / or the technical features in each embodiment can be arbitrarily combined with each other, and the technical solution obtained after the combination should also fall within the protection scope of this application.

[0123] The systems, devices and methods disclosed in the embodiments of the present application may be implemented in other ways. For example, some features of the method embodiments described above may be ignored or not performed. The device embodiments described above are merely schematic, and the division of units is merely a logical function division. There may be other division methods in actual implementation, and multiple units or components may be combined or integrated into another system. In addition, the coupling between the units or the coupling between the components may be direct coupling or indirect coupling, and the coupling may include electrical, mechanical or other forms of connection.

[0124] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described devices and equipment and the technical effects produced can refer to the corresponding processes and technical effects in the aforementioned method embodiments, and will not be repeated here.

[0125] It should be understood that the specific examples in the embodiments of the present application are only to help those skilled in the art to better understand the embodiments of the present application, rather than to limit the scope of the embodiments of the present application. Those skilled in the art can make various improvements and modifications based on the above embodiments, and these improvements or modifications all fall within the scope of protection of the present application.

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

Claims

1. A near field communication (NFC) method, characterized in that: The method is applied to an NFC chip, and the method comprises: Determining that an abnormality occurs in the NFC chip; Turning off the enabled clock and functions in the NFC chip so that the NFC chip enters a low power consumption mode; Controlling the NFC chip to enter a static standby state, and restarting the hardware module in which an abnormality occurs in the NFC chip in the static standby state; Controlling the hardware modules in the NFC chip that have no abnormality to enter an initial state; Setting a wake-up source so that the NFC chip wakes up from the static standby state after a predetermined period of time; Configuration parameters are set so that the NFC chip performs the near field communication according to the configuration parameters after being awakened, wherein the configuration parameters are configuration parameters for near field communication saved by the NFC chip before entering the static standby state.

2. The method according to claim 1, characterized in that The determining that an abnormality occurs in the NFC chip includes: Detecting a state machine of a hardware module of the NFC chip; If the state of the state machine is different from the expected state, it is determined that an abnormality occurs in the NFC chip.

3. The method according to claim 1, characterized in that The determining that an abnormality occurs in the NFC chip includes: Detecting a status register of the NFC chip; If the value of the status register is different from the expected value, it is determined that an abnormality occurs in the NFC chip.

4. The method according to any one of claims 1 to 3, characterized in that Before controlling the NFC chip to enter a static standby state, the method further includes: Completes the currently executing operation.

5. The method according to claim 4, characterized in that The NFC chip uses a real-time operating system RTOS, and the processing completes the currently executed operation, including: Finish processing the currently executing message or event.

6. The method according to any one of claims 1 to 3, characterized in that The step of restarting the abnormal hardware module in the NFC chip in the static standby state includes: The power supply of the hardware module in which the abnormality occurs in the NFC chip is reset so that the hardware module in which the abnormality occurs enters an initial state.

7. The method according to any one of claims 1 to 3, characterized in that The wake-up source includes a timer, and the wake-up source is used to wake up the NFC chip from the static standby state after the timing duration of the timer ends.

8. The method according to any one of claims 1 to 3, characterized in that The wake-up source includes a wake-up message sent by a master control device, and the wake-up message is used to trigger the NFC chip to wake up from the static standby state.

9. The method according to claim 8, characterized in that The wake-up message includes at least one of the following messages: Messages of the internal integrated circuit I2C communication interface, messages of the serial peripheral interface SPI communication interface, messages of the single-wire protocol SWP communication interface, and messages of the general input and output GPIO communication interface.

10. The method according to any one of claims 1 to 3, characterized in that The wake-up source is used to trigger the NFC chip to wake up from the static standby state according to a change in a power level of the NFC chip.

11. The method according to any one of claims 1 to 3, characterized in that The wake-up source is used to wake up the NFC chip from the static standby state when the field strength of the radio frequency signal during the near field communication meets a predetermined condition.

12. The method according to any one of claims 1 to 3, characterized in that The configuration parameters include at least one of the following parameters: The NFC identifier, parameters used to indicate the NFC technology, parameters used to indicate the transmission rate or frame length, and the RF characteristic parameters of the antenna.

13. The method according to any one of claims 1 to 3, characterized in that The NFC chip is applied to NFC devices in card emulation CE mode, card reader RW mode or point-to-point P2P mode.

14. A near field communication (NFC) device, characterized in that: The device is applied to an NFC chip, and the device comprises: An abnormality detection unit, used to determine if an abnormality occurs in the NFC chip; A processing unit, configured to shut down a clock and a function that have been turned on in the NFC chip, so that the NFC chip enters a low power consumption mode; The processing unit is further used to control the NFC chip to enter a static standby state, and restart an abnormal hardware module in the NFC chip in the static standby state; The processing unit is further used to control the hardware modules in the NFC chip that have no abnormality to enter an initial state; The processing unit is further used to set a wake-up source so that the NFC chip wakes up from the static standby state after a predetermined time period; The processing unit is further used to set configuration parameters so that the NFC chip performs the near field communication according to the configuration parameters after being awakened, wherein the configuration parameters are configuration parameters for near field communication saved by the NFC chip before entering the static standby state.

15. The device according to claim 14, characterized in that The processing unit is specifically used for: The power supply of the hardware module in which the abnormality occurs in the NFC chip is reset so that the hardware module in which the abnormality occurs enters an initial state.

16. The device according to claim 14, characterized in that The configuration parameters include at least one of the following parameters: The NFC identifier, parameters used to indicate the NFC technology, parameters used to indicate the transmission rate or frame length, and the RF characteristic parameters of the antenna.

17. A near field communication (NFC) chip, characterized in that: The NFC chip comprises: a near field communication device according to any one of claims 14 to 16.

18. A near field communication (NFC) device, characterized in that: The NFC device comprises the NFC chip according to claim 17.

19. The NFC device according to claim 18, characterized in that: The NFC device is an NFC device in card emulation CE mode, card reader RW mode or point-to-point P2P mode.

Citation Information

Patent Citations

  • Radio frequency subscriber identity module (SIM) card with regular awakening function and implementation method of card

    CN102957811A

  • Fault repairing method, device and equipment for chip

    CN108226752A

  • Device and method for malfunction monitoring and control

    US20070028148A1