CN117674910A - Data receiving method for NFC equipment and NFC equipment - Google Patents

Data receiving method for NFC equipment and NFC equipment Download PDF

Info

Publication number
CN117674910A
CN117674910A CN202311660378.XA CN202311660378A CN117674910A CN 117674910 A CN117674910 A CN 117674910A CN 202311660378 A CN202311660378 A CN 202311660378A CN 117674910 A CN117674910 A CN 117674910A
Authority
CN
China
Prior art keywords
data
target interface
state
nfc chip
received
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311660378.XA
Other languages
Chinese (zh)
Inventor
林敏�
董宇
黄金煌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Unigroup Tsingteng Microsystems Co Ltd
Original Assignee
Beijing Unigroup Tsingteng Microsystems Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Unigroup Tsingteng Microsystems Co Ltd filed Critical Beijing Unigroup Tsingteng Microsystems Co Ltd
Priority to CN202311660378.XA priority Critical patent/CN117674910A/en
Publication of CN117674910A publication Critical patent/CN117674910A/en
Pending legal-status Critical Current

Links

Landscapes

  • Communication Control (AREA)

Abstract

The utility model relates to a near field communication technical field discloses a data receiving method for NFC equipment, NFC equipment includes equipment host computer and NFC chip, and equipment host computer passes through target interface connection with NFC chip for NFC equipment's data receiving method includes: when the equipment host sends data to the NFC chip through the target interface, determining whether the data sent by the equipment host is allowed to be received through the target interface at present; receiving data sent by the device host through the target interface under the condition that the data is allowed to be received through the target interface is determined; in the event that it is determined that data reception via the target interface is not permitted, the data reception is refused and data reception failure information is returned to the device host. The method can reduce the loss risk of the data sent by the equipment host by refusing to receive the data sent by the equipment host and returning the data receiving failure information to the equipment host.

Description

Data receiving method for NFC equipment and NFC equipment
Technical Field
The disclosure relates to the field of near field communication technology, for example, to a data receiving method for an NFC device and the NFC device.
Background
Near field communication (Near Field Communication, NFC) is a short-range wireless communication technology, and NFC devices with NFC functionality are widely used in various application scenarios. NFC devices typically include a Device Host (DH) and an NFC chip, where the Device Host is connected to the NFC chip through a corresponding communication protocol interface, and the Device Host may send data to the NFC chip through the communication protocol interface.
In the related art, under some communication protocols, when a part of data sent by a device host is received and the received data is not processed, new data sent by the device host is continuously received, but since the data received before the NFC chip is not processed, the received data of the NFC chip is easily updated continuously, which causes data loss. As can be seen, the related art has a problem that there is a high risk of losing data transmitted by the device host.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The following presents a simplified summary in order to provide a basic understanding of some aspects of the disclosed embodiments. This summary is not an extensive overview, and is intended to neither identify key/critical elements nor delineate the scope of such embodiments, but is intended as a prelude to the more detailed description that follows.
The embodiment of the disclosure provides a data receiving method for NFC equipment and the NFC equipment, which can reduce the loss risk of data sent by an equipment host.
According to a first aspect of the present disclosure, there is provided a data receiving method for an NFC device, the NFC device including a device host and an NFC chip, the device host and the NFC chip being connected by a target interface, the data receiving method for the NFC device including:
when the equipment host sends data to the NFC chip through the target interface, determining whether the data sent by the equipment host is allowed to be received through the target interface at present;
receiving data sent by the device host through the target interface under the condition that the data is allowed to be received through the target interface is determined;
in the event that it is determined that data reception via the target interface is not permitted, the data reception is refused and data reception failure information is returned to the device host.
In some embodiments, determining whether to allow reception of data sent by the device host over the target interface comprises: and determining whether to allow the data sent by the host of the equipment to be received through the target interface currently according to the data receiving and sending condition and the processing condition of the received data.
In some embodiments, determining whether to allow reception of data sent by the device host over the target interface comprises: detecting the state of a state machine of a target interface, wherein the state of the state machine is set according to the data receiving and transmitting condition of the target interface and the processing condition of received data; based on the state of the state machine, it is determined whether the data sent by the device host is currently allowed to be received via the target interface.
In some embodiments, the states of the state machine include a first state and a second state; the first state is used for indicating that the NFC chip is allowed to receive data sent by the device host through the target interface; the second state is used to indicate that the NFC chip is currently not allowed to receive data sent by the device host through the target interface.
In some embodiments, the NFC device includes a data mover, the NFC chip being connected to the data mover through a target interface; the NFC chip sets the state of the state machine according to the data receiving and transmitting condition of the target interface and the processing condition of the received data by the following modes: when the state machine is in the first state, the state machine is switched to the second state when the target interface is determined to be unable to send data to the data handler.
In some embodiments, after switching the state machine to the second state, comprising: and switching the state machine to the first state when the target interface is determined to be capable of normally sending data to the data carrier.
In some embodiments, the NFC chip determines whether the target interface can send data to the data mover by: determining that the target interface cannot transmit data to the data carrier when a receiving channel of the data carrier corresponding to the target interface is enabled to be in a closed state; when a receiving channel of the data carrier corresponding to the target interface is enabled to be in an open state, determining that the target interface is capable of transmitting data to the data carrier.
In some embodiments, the NFC chip sets the state of the state machine according to the data transceiving condition of the target interface and the processing condition of the received data by: and when the state machine is in the first state and a stop bit in one frame of data sent by the device host is received through the target interface, switching the state machine into the second state.
In some embodiments, after switching the state machine to the second state, comprising: and switching the state machine to the first state when the received data sent by the device host is determined to be processed.
In some embodiments, the NFC chip sets the state of the state machine according to the data transceiving condition of the target interface and the processing condition of the received data by: under the condition that the state machine is in a first state, when the number of data which is received by the NFC chip through the target interface and is sent by the equipment host at a time exceeds a preset number threshold value, the state machine is switched to a second state.
In some embodiments, after switching the state machine to the second state, comprising: and switching the state machine to the first state when the received data sent by the device host is determined to be processed.
In some embodiments, the data reception failure information is used to instruct the device host to send the data refused to be received to the NFC chip through the target interface.
According to a second aspect of the present disclosure, there is provided an NFC device, the NFC device including a device host and an NFC chip, the device host and the NFC chip being connected by a target interface;
the device host is configured to: transmitting data to the NFC chip through the target interface;
the NFC chip is configured to perform the data receiving method for an NFC device provided in the first aspect of the present disclosure.
According to a third aspect of the present disclosure, there is provided a computer-readable storage medium storing program instructions that, when executed, cause a computer to perform the data receiving method for an NFC device provided in the first aspect of the present disclosure.
The data receiving method for the NFC device and the NFC device provided by the embodiment of the disclosure can realize the following technical effects:
the embodiment of the disclosure can select to receive or reject the data sent by the host device according to whether the data sent by the host device is allowed to be received through the target interface. The NFC chip is allowed to actively reject the data sent by the host of the receiving device, so that the situation that the received data is updated due to the fact that the NFC chip receives too much new data can be avoided to a large extent. In addition, when the data sent by the equipment host is refused to be received, the data receiving failure information is returned to the equipment host, and the equipment host is informed of unsuccessful receiving of the data sent by the equipment host through the data receiving failure information, so that the situation that the equipment host subsequently leaks the data refused to be received can be avoided, and further, the situation that the data is lost due to the data leakage is avoided. It can be seen that the risk of loss of data sent by the device host can be reduced by rejecting the data sent by the device host and returning data reception failure information to the device host.
The foregoing general description and the following description are exemplary and explanatory only and are not intended to limit the present disclosure.
Drawings
One or more embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings, in which like references indicate similar elements, and in which like reference numerals refer to similar elements, and in which:
fig. 1 is a schematic diagram of an NFC device provided in an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a data receiving method for an NFC device according to an embodiment of the disclosure;
fig. 3 is a schematic diagram of a data receiving method for an NFC device according to an embodiment of the disclosure;
fig. 4 is a schematic diagram of a data receiving method for an NFC device according to an embodiment of the disclosure;
fig. 5 is a schematic diagram of a data receiving method for an NFC device according to an embodiment of the disclosure;
fig. 6 is a signal timing diagram of an NFC device provided by an embodiment of the present disclosure;
fig. 7 is a signal timing diagram of another NFC device provided by an embodiment of the present disclosure;
fig. 8 is a signal timing diagram of another NFC device provided by an embodiment of the present disclosure;
FIG. 9 is a schematic diagram of a device host provided by an embodiment of the present disclosure;
fig. 10 is a schematic diagram of an NFC chip provided in an embodiment of the disclosure.
Detailed Description
So that the manner in which the features and techniques of the disclosed embodiments can be understood in more detail, a more particular description of the embodiments of the disclosure, briefly summarized below, may be had by reference to the appended drawings, which are not intended to be limiting of the embodiments of the disclosure. In the following description of the technology, for purposes of explanation, numerous details are set forth in order to provide a thorough understanding of the disclosed embodiments. However, one or more embodiments may still be practiced without these details. In other instances, well-known structures and devices may be shown simplified in order to simplify the drawing.
The terms first, second and the like in the description and in the claims of the embodiments of the disclosure and in the above-described figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe embodiments of the present disclosure. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion.
The term "plurality" means two or more, unless otherwise indicated.
In the embodiment of the present disclosure, the character "/" indicates that the front and rear objects are an or relationship. For example, A/B represents: a or B.
The term "and/or" is an associative relationship that describes an object, meaning that there may be three relationships. For example, a and/or B, represent: a or B, or, A and B.
The term "corresponding" may refer to an association or binding relationship, and the correspondence between a and B refers to an association or binding relationship between a and B.
Near field communication (Near Field Communication, NFC) is a short-range wireless communication technology, and NFC devices with NFC functionality are widely used in various application scenarios. NFC devices typically include a Device Host (DH) and an NFC chip, where the Device Host is connected to the NFC chip through a corresponding communication protocol interface, and the Device Host may send data to the NFC chip through the communication protocol interface.
In the related art, under some communication protocols, when a part of data sent by a device host is received and the received data is not processed, new data sent by the device host is continuously received, but since the data received before the NFC chip is not processed, the received data of the NFC chip is easily updated continuously, which causes data loss.
Taking an I2C (Inter-Integrated Circuit, integrated circuit bus) communication protocol as an example, when the I2C selects Zhong Yanzhan mode when not in use due to the logic characteristics of the I2C itself, in the scene of communication in the slave mode, if the addresses match and the situation is the situation of data writing, if the data stored in the data register of the NFC chip is not processed yet, the master device will still issue a write instruction to the NFC chip through the I2C interface, and the NFC chip will continue to receive data through the I2C interface. And the NFC chip feeds back a 1bit low level to the device host by occupying an SDA bus (Serial Data Line) every time the NFC chip receives Data of one byte, so that response is successful. When the master detects a successful response bit sent by the NFC chip through the I2C interface, the master also continues to send data. However, since the data stored in the data register of the NFC chip is not processed yet, the data in the data register is easily updated continuously, and thus the data is lost. As can be seen, the related art has a problem that there is a high risk of losing data transmitted by the device host.
As shown in connection with fig. 1, embodiments of the present disclosure provide an NFC device 100, where the NFC device 100 may reduce the risk of losing data sent by a device host 101. The NFC device 100 includes a device host 101 and an NFC chip 102, and the device host 101 and the NFC chip 102 are connected through a target interface. NFC device 100 may be a mobile terminal, a computer, etc., and the mobile device may include, for example, a mobile phone, a PAD, a wearable device, a virtual reality device, an internet of things device, a payment device, an access control device, etc., or any combination thereof, where the wearable device includes, for example: smart watches, smart bracelets, pedometers, etc. The NFC device 100 may be applied in the fields of mobile payment, identity authentication, intelligent access control, public transportation ticketing, and the like.
In the disclosed embodiment, the device host 101 is configured to transmit data to the NFC chip 102 through the target interface. The NFC chip 102 determines whether to allow the device host 101 to receive data transmitted by the device host 101 through the target interface at present when the device host 101 transmits data to the NFC chip 102 through the target interface; in the case where it is determined that the reception of data through the target interface is permitted, the reception device host 101 receives the data transmitted through the target interface; in the case where it is determined that the reception of data through the target interface is not permitted, the reception of data is refused and the data reception failure information is returned to the device host 101.
In some embodiments, the device host 101, upon receiving the data reception failure information, transmits the data refused to be received to the NFC chip 102 through the target interface.
In some embodiments, the target interface is an I2C communication protocol interface. Of course, the target interface may be other types of communication protocol interfaces.
In some embodiments, NFC device 100 further includes a data handler 103, and data handler 103 may be a memory direct access (Direct Memory Access, DMA) device. The NFC chip 102 is connected to the data transfer through the target interface, and the data handler 103 can handle the data sent by the device host 101 received by the NFC chip 102. Specifically, data sent by the device host 101, which is received by the NFC chip 102 through the target interface, may be stored in a data register of the target interface, and the data handler 103 may handle the data in the data register.
In some embodiments, the data handler 103 is configured with a receive channel enable, such as an I2C receive channel enable, corresponding to the target interface. When the reception channel corresponding to the target interface is enabled to be in an on state, it may be determined that the target interface is capable of transmitting data to the data carrier 103 at this time, that is, the data carrier 103 may carry the data transmitted by the device host 101 received by the NFC chip 102; when the reception channel enable corresponding to the target interface is in the off state, it may be determined that the target interface cannot transmit data to the data carrier 103, that is, the data carrier 103 cannot carry the data transmitted by the device host 101 received by the NFC chip 102.
In some embodiments, NFC device 100 further comprises a data memory 104, which data memory 104 may be a random access memory (Random Access Memory, RAM), which data memory 104 is communicatively connected to data carrier 103. The data carrier 103 may carry the data sent by the device host 101 and received by the NFC chip 102 to the data memory 104; the data carrier 103 may also carry the data in the data memory 104 to the NFC chip 102 for transmission.
The data receiving method for the NFC device provided by the embodiment of the disclosure can be applied to a communication scene that the NFC device uses a non-clock extension mode under the I2C communication protocol, and can also be applied to a communication scene that the NFC device uses other types of communication protocols.
In connection with the NFC device shown in fig. 1, an embodiment of the present disclosure provides a data receiving method for an NFC device, as shown in fig. 2, including:
s201, when the device host transmits data to the NFC chip through the target interface, the NFC chip determines whether to allow the device host to receive the data transmitted through the target interface.
S202, the NFC chip receives data sent by the host of the equipment through the target interface under the condition that the NFC chip determines that the data is allowed to be received through the target interface.
S203, the NFC chip refuses to receive the data and returns the data reception failure information to the device host if it is determined that the data reception through the target interface is not allowed.
In the embodiment of the disclosure, the data reception failure information is used to indicate that the NFC chip does not successfully receive data, that is, the device host may be informed that the data sent by the device host is not successfully received through the data reception failure information. Alternatively, the data reception failure information may be a response failure bit.
It should be noted that, the data for which the data receiving method for NFC devices provided in the embodiments of the present disclosure is directed is data sent by the device host in a non-addressing phase. That is, the device host according to the embodiments of the present disclosure sends data to the NFC chip through the target interface, specifically, the data sent by the device host in the non-addressing phase. For address data sent by the device host in the addressing phase, the NFC chip does not actively reject the reception.
According to the data receiving method for the NFC device, the NFC chip can select to receive or reject the data sent by the device host according to whether the data sent by the device host is allowed to be received through the target interface currently. The NFC chip is allowed to actively reject the data sent by the host of the receiving device, so that the situation that the received data is updated due to the fact that the NFC chip receives too much new data can be avoided to a large extent. In addition, when the data sent by the equipment host is refused to be received, the data receiving failure information is returned to the equipment host, and the equipment host is informed of unsuccessful receiving of the data sent by the equipment host through the data receiving failure information, so that the situation that the equipment host subsequently leaks the data refused to be received can be avoided, and further, the situation that the data is lost due to the data leakage is avoided. It can be seen that the risk of loss of data sent by the device host can be reduced by rejecting the data sent by the device host and returning data reception failure information to the device host.
The data receiving method for the NFC device provided by the embodiment of the disclosure may be applied in a communication scenario where the NFC device uses a non-clock extension mode under an I2C communication protocol, and in the communication scenario, the NFC chip may select to receive or reject to receive data sent by the device host according to whether to allow the device host to receive data sent by the device host through the I2C communication protocol interface currently. The data receiving logic can avoid the situation that the NFC chip is forced to receive data issued by the equipment host through the I2C interface under the communication scene that the NFC equipment uses a non-clock extension mode under the I2C communication protocol, and the NFC chip is allowed to actively reject the data issued by the equipment host, so that the received data (namely, the data in the data register of the I2C) is updated due to the fact that the NFC chip receives too much new data to a large extent, and the data loss is avoided. In addition, when the data sent by the equipment host is refused to be received, the data receiving failure information is returned to the equipment host through the I2C interface, and the equipment host is informed that the data sent by the equipment host is not successfully received through the data receiving failure information, so that the situation that the equipment host subsequently leaks the data refused to be received can be avoided, and the situation that the data is lost due to the data leakage is further avoided. It can be seen that by rejecting the data sent by the device host and returning the data reception failure information to the device host, the risk of losing the data sent by the device host in a communication scenario in which the NFC device uses the non-clock extension mode in the I2C communication protocol can be reduced.
In some embodiments, the data reception failure information is used to instruct the device host to send the data refused to be received to the NFC chip through the target interface. That is, when receiving the data reception failure information, the device host transmits the data that is refused to be received to the NFC chip through the target interface.
The embodiment of the disclosure provides another data receiving method for an NFC device, as shown in fig. 3, where the data receiving method for the NFC device includes:
s301, when the equipment host sends data to the NFC chip through the target interface, the NFC chip determines whether the data sent by the equipment host is allowed to be received through the target interface currently;
s302, the NFC chip receives data sent by the host of the equipment through the target interface under the condition that the data is allowed to be received through the target interface.
S303, the NFC chip refuses to receive the data and returns data receiving failure information to the device host under the condition that the NFC chip determines that the data is not allowed to be received through the target interface.
And S304, when receiving the data receiving failure information, the equipment host sends the data refused to be received to the NFC chip through the target interface.
In some embodiments, determining whether to allow reception of data sent by the device host over the target interface comprises: and determining whether to allow the data sent by the host of the equipment to be received through the target interface currently according to the data receiving and sending condition and the processing condition of the received data.
The embodiment of the disclosure provides another data receiving method for an NFC device, as shown in fig. 3, where the data receiving method for the NFC device includes:
s401, when the device host sends data to the NFC chip through the target interface, the NFC chip determines whether to allow the device host to receive the data sent by the target interface currently according to the data receiving and sending condition and the processing condition of the received data.
S402, in the case where the NFC chip determines that the data is allowed to be received through the target interface, the NFC chip receives data sent by the host device through the target interface.
S403, the NFC chip refuses to receive the data and returns data receiving failure information to the device host under the condition that the NFC chip determines that the data is not allowed to be received through the target interface.
In some embodiments, determining whether to allow reception of data sent by the device host over the target interface comprises: detecting the state of a state machine of a target interface; based on the state of the state machine, it is determined whether the data sent by the device host is currently allowed to be received via the target interface. Here, the state of the state machine is set according to the data transmission/reception condition of the target interface and the processing condition of the received data.
The embodiment of the disclosure provides another data receiving method for an NFC device, as shown in fig. 3, where the data receiving method for the NFC device includes:
S501, when the device host sends data to the NFC chip through the target interface, the NFC chip detects the state of the state machine of the target interface.
S502, the NFC chip determines whether to allow the data sent by the device host to be received through the target interface according to the state of the state machine.
In some embodiments, the states of the state machine include a first state and a second state. The state machine may switch between a first state and a second state. Optionally, the first state is a default state.
The first state may be referred to as a data reception state, and is used to indicate that the NFC chip is currently allowed to receive data transmitted by the device host through the target interface. That is, when the NFC chip is in the first state at the time of detecting the state machine of the target interface, it may be determined that the data transmitted by the device host is currently allowed to be received through the target interface.
The second state may be referred to as a space (IDLE) state, and is used to indicate that the NFC chip is currently not allowed to receive data sent by the device host through the target interface. That is, when the NFC chip is in the second state at the time of detecting the state machine of the target interface, it may be determined that the data transmitted by the device host is not currently allowed to be received through the target interface.
S503, where the NFC chip determines that the data is allowed to be received through the target interface, the NFC chip receives the data sent by the host device through the target interface.
In the embodiment of the disclosure, when the NFC chip determines that the state machine is in the first state, the NFC chip receives data sent by the device host through the target interface.
S504, the NFC chip refuses to receive data and returns data reception failure information to the device host if it is determined that data reception through the target interface is not allowed.
In the embodiment of the disclosure, when the NFC chip determines that the state machine is in the second state, the NFC chip refuses to receive the data and returns data receiving failure information to the device host.
In some embodiments, after the NFC chip detects the state of the state machine of the target interface, the NFC chip receives data sent by the device host through the target interface when determining that the state machine is in the first state; and when the NFC chip determines that the state machine is in the second state, refusing to receive the data and returning data receiving failure information to the equipment host.
In the embodiment of the disclosure, the state of the state machine may be set according to the data transceiving condition of the target interface and the processing condition of the received data, for example, the state machine is set to the first state or the second state. Wherein the first state may be a default state in which the state machine is normally in the first state.
In some embodiments, the NFC device includes a data mover, and the NFC chip is connected to the data mover through a target interface. The data receiving and transmitting condition of the target interface includes whether the target interface can send data to the data carrier, and can also be understood as whether the data carrier can carry the data sent by the device host received by the NFC chip.
Optionally, the NFC chip sets the state of the state machine according to the data receiving and sending condition of the target interface and the processing condition of the received data by: when the state machine is in the first state, the state machine is switched to the second state when the target interface is determined to be unable to send data to the data handler. It will be appreciated that after switching the state machine to the second state, the NFC chip determines that data is not allowed to be received through the target interface, in which case, when the device host sends data to the NFC chip through the target interface, the NFC chip refuses to receive the data sent by the device host through the target interface and returns data reception failure information to the device host.
In some embodiments, upon determining that the target interface is unable to send data to the data handler, after switching the state machine to the second state, further comprising: and switching the state machine to the first state when the target interface is determined to be capable of normally sending data to the data carrier. It will be appreciated that after switching the state machine to the first state, the NFC chip determines that data is allowed to be received through the target interface, in which case, when the device host sends data to the NFC chip through the target interface, the NFC chip may receive data sent by the device host through the target interface.
The NFC chip determines whether the target interface can send data to the data mover by: determining that the target interface cannot transmit data to the data carrier when a receiving channel of the data carrier corresponding to the target interface is enabled to be in a closed state; when a receiving channel of the data carrier corresponding to the target interface is enabled to be in an open state, determining that the target interface is capable of transmitting data to the data carrier.
In some embodiments, the state machine is switched to the second state while the receive channel of the data mover corresponding to the target interface is enabled to be in the off state with the state machine in the first state.
In some embodiments, after switching the state machine to the second state while the receive channel of the data mover corresponding to the target interface is enabled in the off state, further comprising: the state machine is switched to a first state when a receive channel of the data handler corresponding to the target interface is enabled in an open state.
Fig. 6 is a signal timing diagram of an NFC device provided by an embodiment of the present disclosure, specifically, fig. 6 shows a signal timing diagram of an I2C system clock, an I2C receive channel enable in a DMA (data handler), an address match flag, a read/write flag, an I2C state machine, an SCL (Serial Clock Line ), and an SDA. As shown in connection with fig. 6, when the receiving channel enable of the DMA is in the off state, the I2C address matches and when the read-write status bit is judged to be in the write state, the state opportunity is switched back from the data receiving state to the IDLE state (second state) and a response failure bit is issued.
In some embodiments, the data transceiving condition of the target interface includes whether the target interface receives a stop bit in a frame of data sent by the device host, and the processing condition of the received data includes whether the data sent by the NFC received device host is processed. The NFC chip sets the state of the state machine according to the data receiving and transmitting condition of the target interface and the processing condition of the received data by the following modes: and when the state machine is in the first state and a stop bit in one frame of data sent by the device host is received through the target interface, switching the state machine into the second state. The above steps may be performed during the process of receiving data sent by the device host through the target interface by NFC. It will be appreciated that after switching the state machine to the second state, the NFC chip determines that data is not allowed to be received through the target interface, in which case, when the device host sends data to the NFC chip through the target interface, the NFC chip refuses to receive the data sent by the device host through the target interface and returns data reception failure information to the device host.
In an embodiment of the present disclosure, when a stop bit in a frame of data sent by a device host is received through a target interface, after switching a state machine to a second state, the method includes: and switching the state machine to the first state when the received data sent by the device host is determined to be processed. It will be appreciated that after switching the state machine to the first state, the NFC chip determines that data is allowed to be received through the target interface, in which case, when the device host sends data to the NFC chip through the target interface, the NFC chip may receive data sent by the device host through the target interface.
Here, the device host transmits data in units of frames. A frame of data includes a start bit, a data bit, a stop bit, and the like. When the NFC chip receives a stop bit in a frame of data sent by the device host through the target interface, it indicates that the device host has completely sent the frame of data, and in this case, the NFC chip switches the state machine to the second state to reject the next frame of data that is continuously sent by the device host. The NFC chip then waits for the received data sent by the device host to be processed (i.e., the data stored in the data register) to be completed, and switches the state machine to the first state when it is determined that the received data sent by the device host is processed, so as to allow the NFC chip to receive the next frame of data that the device host continues to send through the target interface.
Fig. 7 is a signal timing diagram of another NFC device provided by an embodiment of the present disclosure, and in particular, fig. 7 shows a signal timing diagram of an I2C system clock, an I2C receive channel enable in a DMA (data handler), an address match flag bit, a read/write flag, a STOP signal (i.e., a STOP bit in one frame of data) given by a host, an I2C state machine, a STOP pf interrupt flag, and a block receive signal. Referring to fig. 7, the NFC chip receives a frame of normal data through the I2C interface, the device host issues a stop flag bit, and then generates a stop interrupt state, and the NFC chip generates a blocking receiving signal according to the stop flag bit, where the blocking signal switches the state machine to the IDLE state (the second state), so that data reception in a subsequent period is blocked, that is, the NFC chip refuses to receive the next frame of data that the device host continues to send. The blocking signal is pulled low waiting for the stop pf interrupt flag to clear and does not block the addressing phase.
In some embodiments, the data transceiving condition of the target interface includes a single-time data transmitting condition of the device host received through the target interface, and the processing condition of the received data includes whether the data transmitted by the NFC received device host is processed.
Embodiments of the present disclosure may preset a number threshold that is the maximum amount of data that a device host is allowed to issue at a single time. When the quantity threshold is set, the quantity threshold can be determined according to the quantity of data which can be stored in a data register in the NFC chip, and the quantity threshold does not exceed the maximum quantity of data which can be stored in the data register. The ability of the device host to actually issue a single volume of data may also be considered when setting the quantity threshold.
In the embodiment of the present disclosure, the NFC chip sets the state of the state machine according to the data receiving and sending condition of the target interface and the processing condition of the received data by: under the condition that the state machine is in a first state, when the number of data which is received by the NFC chip through the target interface and is sent by the equipment host at a time exceeds a preset number threshold value, the state machine is switched to a second state. The above steps may be performed during the process of receiving data sent by the device host through the target interface by NFC. It will be appreciated that after switching the state machine to the second state, the NFC chip determines that data is not allowed to be received through the target interface, in which case, when the device host sends data to the NFC chip through the target interface, the NFC chip refuses to receive the data sent by the device host through the target interface and returns data reception failure information to the device host.
In some embodiments, after the state machine is switched to the second state when the number of data that is received by the NFC chip through the target interface and sent by the device host at a time exceeds a preset number threshold, the method includes: and switching the state machine to the first state when the received data sent by the device host is determined to be processed. It will be appreciated that after switching the state machine to the first state, the NFC chip determines that data is allowed to be received through the target interface, in which case, when the device host sends data to the NFC chip through the target interface, the NFC chip may receive data sent by the device host through the target interface.
Fig. 8 is a signal timing diagram of another NFC device provided by an embodiment of the present disclosure, and in particular, fig. 8 shows a signal timing diagram of an I2C system clock, a number threshold, an I2C state machine, a block receive signal, a stop f interrupt, and a data receive byte (bit) technique, where the number of number threshold settings may be N. Referring to fig. 8, in the process of receiving data, the I2C interface counts received data bytes (i.e. calculates the number of received data), when the number of data sent by the host computer at a time exceeds a preset number threshold, a stop interrupt state is generated, the NFC chip generates a blocking reception signal, the blocking signal switches the state machine to an IDLE state (a second state), the blocking signal is pulled down only when waiting for clearing the stop interrupt flag bit, and the blocking signal does not block the addressed data sent in the addressing stage.
And generating a signal for blocking the reception, switching the state machine to an initial IDLE state, not receiving data, sending out response failure bits by overflowed 1byte data, generating a reception completion interrupt, waiting for software to process normally received data, and clearing the STOPF interrupt, so that data communication can be normally performed.
As shown in connection with fig. 9, the device host 101 provided by the embodiment of the present disclosure includes a processor (processor) 1011 and a memory (memory) 1012. Optionally, the device host 101 may also include a communication interface (Communication Interface) 1013 and a bus 1014. The processor 1011, the communication interface 1013, and the memory 1012 may communicate with each other through the bus 1014. The communication interface 1013 may be used for information transmission. The processor 1011 may invoke logic instructions in the memory 1012 to implement the steps performed by the device host 101 in the corresponding embodiments described above.
Further, the logic instructions in memory 1012 described above may be implemented in the form of software functional units and stored in a computer readable storage medium when sold or used as a stand alone product.
The memory 1012, as a computer-readable storage medium, may be used to store a software program, a computer-executable program, such as program instructions/modules corresponding to the methods in the embodiments of the present disclosure. The processor 1011 performs functional applications as well as data processing by executing program instructions/modules stored in the memory 1012, i.e., implements the steps performed by the device host 101 in the respective embodiments described above.
Memory 1012 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created according to the use of the terminal device, etc. Further, memory 1012 may include high-speed random access memory, and may also include non-volatile memory.
As shown in connection with fig. 9, the NFC chip 102 provided by the embodiment of the present disclosure includes a processor (processor) 1021 and a memory (memory) 1022. Optionally, the NFC chip 102 may further include a communication interface (Communication Interface) 1023 and a bus 1024. Processor 1021, communication interface 1023, and memory 1022 may communicate with each other via bus 1024. The communication interface 1023 may be used for information transfer. The processor 1021 may invoke logic instructions in the memory 1022 to implement the steps performed by the NFC chip 102 in the respective embodiments described above.
Further, the logic instructions in the memory 1022 described above may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product.
The memory 1022 is a computer-readable storage medium that may be used to store a software program, a computer-executable program, such as program instructions/modules corresponding to the methods in the embodiments of the present disclosure. The processor 1021 performs functional applications and data processing by executing program instructions/modules stored in the memory 1022, i.e., implements the steps performed by the NFC chip 102 in the respective embodiments described above.
Memory 1022 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created according to the use of the terminal device, etc. Further, the memory 1022 may include high-speed random access memory, and may also include nonvolatile memory.
The disclosed embodiments provide a computer-readable storage medium storing computer-executable instructions configured to perform a data reception method for an NFC device.
Embodiments of the present disclosure may be embodied in a software product stored on a storage medium, including one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of a method according to embodiments of the present disclosure. While the aforementioned storage medium may be a non-transitory storage medium, such as: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk or an optical disk, or the like, which can store program codes.
The above description and the drawings illustrate embodiments of the disclosure sufficiently to enable those skilled in the art to practice them. Other embodiments may involve structural, logical, electrical, process, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the sequence of operations may vary. Portions and features of some embodiments may be included in, or substituted for, those of others. Moreover, the terminology used in the present application is for the purpose of describing embodiments only and is not intended to limit the claims. As used in the description of the embodiments and the claims, the singular forms "a," "an," and "the" (the) are intended to include the plural forms as well, unless the context clearly indicates otherwise. Similarly, the term "and/or" as used in this application is meant to encompass any and all possible combinations of one or more of the associated listed. Furthermore, when used in this application, the terms "comprises," "comprising," and/or "includes," and variations thereof, mean that the stated features, integers, steps, operations, elements, and/or components are present, but that the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof is not precluded. Without further limitation, an element defined by the phrase "comprising one …" does not exclude the presence of other like elements in a process, method or apparatus comprising such elements. In this context, each embodiment may be described with emphasis on the differences from the other embodiments, and the same similar parts between the various embodiments may be referred to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method sections disclosed in the embodiments, the description of the method sections may be referred to for relevance.
Those of skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. The skilled artisan may use different methods for each particular application to achieve the described functionality, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the embodiments disclosed herein, the disclosed methods, articles of manufacture (including but not limited to devices, apparatuses, etc.) may be practiced in other ways. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the units may be merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form. The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to implement the present embodiment. In addition, each functional unit in the embodiments of the present disclosure may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. In the description corresponding to the flowcharts and block diagrams in the figures, operations or steps corresponding to different blocks may also occur in different orders than that disclosed in the description, and sometimes no specific order exists between different operations or steps. For example, two consecutive operations or steps may actually be performed substantially in parallel, they may sometimes be performed in reverse order, which may be dependent on the functions involved. Each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

Claims (15)

1. A data receiving method for an NFC device, where the NFC device includes a device host and an NFC chip, and the device host is connected with the NFC chip through a target interface, and the method is characterized by comprising:
when the equipment host sends data to the NFC chip through the target interface, determining whether the data sent by the equipment host is allowed to be received through the target interface currently;
receiving data sent by the equipment host through the target interface under the condition that the permission of receiving the data through the target interface is determined;
and refusing to receive the data and returning data receiving failure information to the equipment host under the condition that the data is not allowed to be received through the target interface.
2. The data receiving method according to claim 1, wherein the determining whether the data transmitted by the device host is currently allowed to be received through the target interface includes:
and determining whether the data sent by the equipment host is allowed to be received through the target interface currently according to the data receiving and sending condition and the processing condition of the received data.
3. The data receiving method according to claim 1, wherein the determining whether the data transmitted by the device host is currently allowed to be received through the target interface includes:
Detecting the state of a state machine of the target interface, wherein the state of the state machine is set according to the data receiving and transmitting condition of the target interface and the processing condition of received data;
and determining whether the data sent by the equipment host is allowed to be received through the target interface currently according to the state of the state machine.
4. A data receiving method according to claim 3, wherein the states of the state machine comprise a first state and a second state;
the first state is used for indicating that the NFC chip is currently allowed to receive data sent by the equipment host through the target interface;
the second state is used for indicating that the NFC chip is not allowed to receive data sent by the device host through the target interface.
5. The data receiving method according to claim 4, wherein the NFC device includes a data handler, and the NFC chip is connected to the data transfer through the target interface;
the NFC chip sets the state of the state machine according to the data receiving and transmitting condition of the target interface and the processing condition of the received data by the following modes:
when the state machine is in the first state, the state machine is switched to the second state upon determining that the target interface is unable to send data to the data mover.
6. The data receiving method according to claim 5, characterized by comprising, after said switching said state machine to said second state:
and switching the state machine to the first state when the target interface is determined to be capable of normally sending data to the data carrier.
7. The data receiving method of claim 5, wherein the NFC chip determines whether the target interface can send data to the data handler by:
determining that the target interface cannot transmit data to the data carrier when a receiving channel of the data carrier corresponding to the target interface is enabled to be in a closed state;
when a receiving channel of the data carrier corresponding to the target interface is enabled to be in an open state, determining that the target interface can send data to the data carrier.
8. The data receiving method according to claim 4, wherein the NFC chip sets the state of the state machine according to the data receiving and transmitting condition of the target interface and the processing condition of the received data by:
and when the state machine is in the first state and a stop bit in a frame of data sent by the equipment host is received through the target interface, switching the state machine into the second state.
9. The data receiving method according to claim 8, characterized by comprising, after said switching said state machine to said second state:
and switching the state machine to the first state when the received data sent by the device host is determined to be processed.
10. The data receiving method according to claim 4, wherein the NFC chip sets the state of the state machine according to the data receiving and transmitting condition of the target interface and the processing condition of the received data by:
and when the quantity of data which is received by the NFC chip through the target interface and is issued by the equipment host once exceeds a preset quantity threshold value under the condition that the state machine is in the first state, switching the state machine into the second state.
11. The data receiving method according to claim 10, characterized by comprising, after said switching said state machine to said second state:
and switching the state machine to the first state when the received data sent by the device host is determined to be processed.
12. The data receiving method according to any one of claims 1 to 11, wherein the data reception failure information is used to instruct a device host to transmit data refused to be received to the NFC chip through the target interface.
13. The NFC device is characterized by comprising a device host and an NFC chip, wherein the device host is connected with the NFC chip through a target interface;
the device host is configured to: transmitting data to the NFC chip through the target interface;
the NFC chip is configured to perform the data reception method for an NFC device according to any of claims 1 to 12.
14. The NFC device of claim 13, further comprising a data mover, wherein the NFC chip is coupled with the data mover through the target interface.
15. The NFC device according to claim 13 or 14 wherein the device host is further configured to: and when receiving the data receiving failure information, sending the data which is refused to be received to the NFC chip through the target interface.
CN202311660378.XA 2023-12-05 2023-12-05 Data receiving method for NFC equipment and NFC equipment Pending CN117674910A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311660378.XA CN117674910A (en) 2023-12-05 2023-12-05 Data receiving method for NFC equipment and NFC equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311660378.XA CN117674910A (en) 2023-12-05 2023-12-05 Data receiving method for NFC equipment and NFC equipment

Publications (1)

Publication Number Publication Date
CN117674910A true CN117674910A (en) 2024-03-08

Family

ID=90082118

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311660378.XA Pending CN117674910A (en) 2023-12-05 2023-12-05 Data receiving method for NFC equipment and NFC equipment

Country Status (1)

Country Link
CN (1) CN117674910A (en)

Similar Documents

Publication Publication Date Title
CN106557446B (en) Bus system
CN107078761B (en) Mobile equipment with short-distance wireless communication function
CN112579509A (en) Single-wire communication method, device, electronic equipment and readable storage medium
CN105468548B (en) Communication of serial peripheral interface
EP3377965B1 (en) Data processing method, device, and system
KR100919159B1 (en) Multimedia card interface method, computer program product and apparatus
CN110312266B (en) Method and device for realizing WIFI communication by multiple systems of terminal
US8423680B2 (en) System, method, and computer program product for inserting a gap in information sent from a drive to a host device
CN113726498A (en) SPI-based dual-full-duplex communication method, host, slave and storage medium
US10423373B2 (en) Regeneration chip and contact control method therefor
CN112000019B (en) Method, device and equipment for sharing equipment instruction control
CN117674910A (en) Data receiving method for NFC equipment and NFC equipment
CN106708761A (en) Service message processing method and device
CN109800202B (en) PCIE (peripheral component interface express) -based data transmission system, method and device
CN111427806A (en) Method for sharing serial port by dual-core AMP system, storage medium and intelligent terminal
CN113836058B (en) Method, device, equipment and storage medium for exchanging data between boards
CN105183373A (en) Data processing method and network device
CN100517377C (en) Multifunctional IC card and control method thereof
CN115604366B (en) Method and device for data transmission, near field communication chip and storage medium
CN117176205B (en) Control method for NFC device, NFC device and storage medium
CN116501507B (en) Method for interrupt processing, interrupt control module, processor, and storage medium
CN116980362B (en) Multitasking method and device for SPI architecture
CN116226021B (en) Data receiving and transmitting method and device and graphics processor
CN110703991B (en) Data storage system and switching control method, device, equipment and medium thereof
CN117155426A (en) Data transmission method for NFC device, NFC device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination