WO2014117701A1 - 近场通信方法和近场通信设备 - Google Patents

近场通信方法和近场通信设备 Download PDF

Info

Publication number
WO2014117701A1
WO2014117701A1 PCT/CN2014/071510 CN2014071510W WO2014117701A1 WO 2014117701 A1 WO2014117701 A1 WO 2014117701A1 CN 2014071510 W CN2014071510 W CN 2014071510W WO 2014117701 A1 WO2014117701 A1 WO 2014117701A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
nfcid
nfc
bits
valid
Prior art date
Application number
PCT/CN2014/071510
Other languages
English (en)
French (fr)
Inventor
王淼
常新苗
金志皓
Original Assignee
华为终端有限公司
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 华为终端有限公司 filed Critical 华为终端有限公司
Priority to EP14746479.6A priority Critical patent/EP2858261B1/en
Publication of WO2014117701A1 publication Critical patent/WO2014117701A1/zh
Priority to US14/574,981 priority patent/US20150147966A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B5/00Near-field transmission systems, e.g. inductive or capacitive transmission systems
    • H04B5/70Near-field transmission systems, e.g. inductive or capacitive transmission systems specially adapted for specific purposes
    • H04B5/72Near-field transmission systems, e.g. inductive or capacitive transmission systems specially adapted for specific purposes for local intradevice communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B5/00Near-field transmission systems, e.g. inductive or capacitive transmission systems
    • H04B5/70Near-field transmission systems, e.g. inductive or capacitive transmission systems specially adapted for specific purposes
    • H04B5/77Near-field transmission systems, e.g. inductive or capacitive transmission systems specially adapted for specific purposes for interrogation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication

Definitions

  • Embodiments of the present invention relate to the field of wireless communications, and more particularly, to a near field communication method and a near field communication device. Background technique
  • NFC Near Field Communication
  • RFID Radio Frequency Identification
  • NFC operates at 13.56MHz and supports four speeds of 106kbit/s, 212kbit/s, 424kbit/s and 848kbit/s. The effective range of communication is 0-20cm.
  • NFC adds point-to-point communication capabilities to RFID technology. Both devices of peer-to-peer communication are peer-to-peer, and the two devices of RFID communication are master-slave relationships.
  • NFC devices are divided into two roles: master device and target device.
  • the master device is the initiator of the communication.
  • the target device responds to the message sent by the master device, and the response message can be sent through load modulation or the target device itself generates a radio frequency field.
  • NFC has three modes of operation: card emulation, card reader mode, and peer-to-peer communication.
  • Card emulation mode Simulate NFC-enabled devices into a contactless card, such as access cards, bank cards, and subway tickets. In this way, even if the mobile device is not powered or powered off, it does not affect it as a card to use.
  • the card reader reads data from the NFC tag of the phone and completes the collection of information.
  • An NFC-enabled phone acts as a card reader, reading data from an NFC tag from an NFC-labeled poster, card, or device.
  • Peer-to-peer communication Two NFC-enabled devices can establish communication links between the two parties and then exchange data. Typical applications in this mode are the fast establishment of Bluetooth links, data transfer between devices, and business card exchange.
  • NFC communication has two modes: Active Communication Mode and Passive Communication Mode.
  • the NFC master In the passive communication mode, the NFC master provides an RF field (RF-field) throughout the communication process. It can select one of the transmission speeds of 106 kbps, 212 kbps or 424 kbps, and 848 kbps. Send to another device.
  • RF-field RF-field
  • each device In active communication mode, each device must generate its own RF field when it wants to send data to another device.
  • NFC communication is divided into four phases: initialization, device activation, data communication, and device release.
  • the NFC device is in the listening state, performing collision detection, technical detection and other initialization processes; device activation: completing the selection of the target device, and negotiating the parameters of the communication, such as the communication mode, the transmission rate, etc.;
  • Data communication After the device is activated, data can be exchanged between the master device and the target device.
  • Device release After the data exchange is completed, the current connection is released.
  • NFC's relevant specifications are mainly developed by the NFC Forum (NFC Forum) to ensure interoperability between NFC devices.
  • NFC Forum NFC Forum
  • NFC Forum also introduced the N-MARK flag to identify whether a device supports NFC.
  • the NFC communication protocol specifies several types, such as NFC-A, NFC-B or NFC-F.
  • the master device sends a probe request message to discover the surrounding target devices.
  • the master device receives the probe response of multiple target devices, it starts the SDD (Single Device Detection) process.
  • the identifier of the NFC device is expressed as "NFCID ⁇ .
  • the master device obtains NFCID 1 of all target devices, it can communicate by selecting one of the target devices and use NFCID 1 to identify the corresponding target device.
  • the master device negotiates the communication parameters with the target device by sending an activation request message, and activates the target device. After the target device is successfully activated, the master device can exchange data with the target device. After the data exchange is completed, the master device transmits the data.
  • the request message is released to release the connection.
  • the master device sends a single device detection request message, and receives a response message from the target device, and obtains the NFCID1 of the complete target device through continuous bit collision.
  • the master sends a probe request message to discover surrounding target devices.
  • the target device selects a time slot to respond according to the information about the time slot included in the message.
  • the master device obtains the identity of the target device by receiving the response of the target device on different time slots.
  • the identity of the NFC device is denoted as "NFCID2”. If two or more target devices select the same time slot to respond, the master device can detect that a collision occurs in the time slot, so the master device will resend the probe request message, and the target device will reselect the time slot to avoid A conflict has occurred.
  • the master device sends an attribute request message to the target device. Since the target device generates its own radio frequency field in the active communication mode, the target device passes the competition window to the main device. The device responds with a response message. After the target device successfully responds to the response message, it will no longer respond to the next received attribute request message, thereby ensuring that the master device can discover all the target devices.
  • the identifier of the NFC device is a random number generated by the NFC device, and is used to uniquely identify the NFC device during device discovery.
  • NFC-A uses NFCID1 of 4 bytes, 7 bytes and 10 bytes in length
  • NFC-F uses NFCID2 of 8 bytes in length.
  • the device identification exchanged by the existing NFC communication process is a random number, which causes limitations of NFC communication applications. Summary of the invention
  • Embodiments of the present invention provide a near field communication method and a near field communication device, which can implement device type exchange or search by device identification.
  • the first aspect provides a near field communication method, including: acquiring, by a second device, a near field communication identifier NFCID of the first device, where the NFCID of the first device carries the first device type/device capability DT information, where A DT information is used to indicate a device type/device capability supported by the first device; and a second device extracts the first DT information from an NFCID of the first device.
  • the extracting, by the second device, the first DT information from the NFCID of the first device includes: the second device detecting an NFCID of the first device The second device extracts a corresponding byte or bit in the NFCID of the first device as the first DT information according to the length of the NFCID of the first device.
  • the extracting, by the second device, the first DT information from the NFCID of the first device, A predetermined byte or bit in the NFCID of the first device is used as the first DT information.
  • the acquiring, by the second device, the near field communication identifier NFCID of the first device includes: sending, by the second device, a first request message, where A request message carries second DT information, the second DT information is used to indicate a device type/device capability to be searched by the second device; and the second device matches the second DT information from determining the first DT information.
  • the first device receives the NFCID of the first device.
  • the second device is Determining, by the first device that the first DT information matches the second DT information, the NFCID of the first device, if the second device detects a conflict when receiving the NFCID of the first device, determining that the device is valid
  • the second device sends the second request message, where the second request message carries the valid conflict bit, wherein if the number n of the valid conflict bits is smaller than the second DT information
  • the number of bits m, the second request message further carries the last mn bits of the second DT information, where m and n are positive integers.
  • the first request message is a single device detection request SDD_REQ message, or a probe request message ATR_REQ.
  • the second aspect provides a near field communication method, including: the first device generates an NFCID of the first device, where the NFCID of the first device carries the first device type/device capability DT information, where the first The DT information is used to indicate the device type/device capability supported by the first device; the first device sends the NFCID of the first device to the second device.
  • the generating, by the first device, the NFCID of the first device includes: the first device filling a predetermined byte or bit in an NFCID of the first device The first DT information; or the first device fills the first DT information on a corresponding byte or bit in the NFCID of the first device according to the length of the NFCID of the first device.
  • the method before the first device sends the NFCID of the first device to the second device, the method further includes: receiving, by the first device a first request message sent by the second device, where the first request message carries a second DT information, where the second DT information is used to indicate a device type/device capability to be searched by the second device; Determining, by the device, whether the NFCID matches the second DT information, where the sending, by the first device, the NFCID of the first device to the second device includes: when determining that the NFCID matches the second DT information, The first device sends an NFCID of the first device to the second device.
  • the method further includes: the first device receiving a second request message sent by the second device, where the second request message carries a valid collision bit determined when the second device detects a collision when receiving the NFCID of the first device; the first device according to the matching result of the valid conflict bit and the NFCID of the first device Determining whether to send the NFCID of the first device to the second device again.
  • the number of the valid conflicting bits is n, and n is a positive integer
  • the first device is configured according to the valid conflicting bit and the first Determining, by the matching result of the NFCID of the device, whether to send the first device to the second device again
  • the NFCID comprising: determining that the NFCID of the first device is no longer sent if the valid collision bit is different from the first n bits of the NFCID; if the valid collision bit is the first n bits of the NFCID And if n ⁇ m, determining to resend the NFCID of the first device, where m is the number of bits of the second DT information, m is a positive integer; if the valid collision bit and the first n bits of the NFCID The same and n ⁇ m, if the mn bits after the valid collision bit are the same as the corresponding bits of the NFCID, determining to resend the NFCID
  • the first request message is a single device detection request SDD_REQ message or a probe request message ATR_REQ.
  • the third aspect provides a near field communication device, including: an acquiring unit, configured to acquire a near field communication identifier NFCID of the first device, where the NFCID of the first device carries the first device type/device capability DT information, where The first DT information is used to indicate the device type/device capability supported by the first device; and the extracting unit is configured to extract the first DT information from the NFCID of the first device.
  • the extracting unit is specifically configured to detect a length of an NFCID of the first device, and extract an NFCID of the first device according to a length of the NFCID of the first device.
  • the corresponding byte or bit is used as the first DT information.
  • the extracting unit is configured to extract a predetermined byte or bit in an NFCID of the first device as the first DT information.
  • the acquiring unit is specifically configured to send a first request message, where the first request message carries second DT information, and the second DT information is used by And indicating a device type/device capability to be searched by the near field communication device; receiving an NFCID of the first device from a first device that determines that the first DT information matches the second DT information.
  • the acquiring unit is specifically configured to: if a conflict is detected when receiving the NFCID of the first device, determine a valid conflict bit; send the second a request message, where the second request message carries the valid conflicting bit, wherein if the number n of the valid conflicting bits is smaller than the number of bits m of the second DT information, the second request message is further Carrying the last mn bits of the second DT information, where m and n are positive integers.
  • a near field communication device including: a generating unit, configured to generate the near field An NFCID of the field communication device, wherein the NFCID of the near field communication device carries first device type/device capability DT information, the first DT information is used to indicate a device type/device capability supported by the near field communication device; And a unit, configured to send, to the second device, an NFCID of the near field communication device.
  • the generating unit is specifically configured to fill the first DT information on a predetermined byte or bit in an NFCID of the near field communication device; or, according to the near The length of the NFCID of the field communication device is filled with the first DT information on a corresponding byte or bit in the NFCID of the near field communication device.
  • the near field communication device further includes: a receiving unit, configured to receive a first request message sent by the second device, the first request The message carries the second DT information, the second DT information is used to indicate the device type/device capability to be searched by the second device, and the determining unit is configured to determine whether the NFCID matches the second DT information;
  • the sending unit is specifically configured to: when the determining unit determines that the NFCID matches the second DT information, send the NFCID of the near field communication device to the second device.
  • the receiving unit is further configured to receive a second request message sent by the second device, where the second request message carries the second device Determining a valid collision bit when the collision is detected when the NFCID of the first device is received; the determining unit is further configured to determine, according to the matching result of the valid conflict bit and the NFCID of the first device, Whether to send the NFCID of the first device to the second device again.
  • the number of the valid conflicting bits is n, and n is a positive integer
  • the determining unit is specifically configured to: if the valid conflicting bit is If the first n bits of the NFCID are different, determining that the NFCID of the first device is no longer sent; if the valid collision bit is the same as the first n bits of the NFCID and n ⁇ m, determining to send the first NFCID of a device, m is the number of bits of the second DT information; if the valid collision bit is the same as the first n bits of the NFCID and n ⁇ m, then mn after the valid collision bit If the bit is the same as the corresponding bit of the NFCID, determining to resend the NFCID of the first device; if the valid collision bit is the same as the first n bits of the NFCID and n ⁇ m, then the valid In the case where the mn bits following the collision bit are
  • the NFCID of the NFC device carries information about the device type/device capability supported by the NFC device, so that the device type/device capability can be exchanged or searched through the NFCID.
  • FIG. 1 is a flow chart of a near field communication method in accordance with an embodiment of the present invention.
  • FIG. 2 is a flow chart of a near field communication method according to another embodiment of the present invention.
  • FIG. 3 is a schematic flow chart of a near field communication process in accordance with an embodiment of the present invention.
  • FIG. 4 is a schematic flow chart of a near field communication process in accordance with an embodiment of the present invention.
  • FIG. 5 is a flow chart showing an example of a master device acquiring DT information of a target device according to an embodiment of the present invention.
  • 6 is a schematic diagram of message interaction between a master device and a target device in the embodiment of FIG. 5.
  • FIG. 7A and 7B are schematic flow charts of a process of searching for a target device supporting a specific device type according to an embodiment of the present invention.
  • Figure 8 is a schematic flow diagram of a process for searching for a target device of a particular device type in accordance with one embodiment of the present invention.
  • FIG. 10 is a schematic flow chart of a process of acquiring a device type according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of message interaction between a master device and a target device in the embodiment of FIG.
  • FIGS. 12A and 12B are schematic flow charts of a process of acquiring a device type according to another embodiment of the present invention.
  • Figure 13 is a schematic illustration of message interaction between a master device and a target device in the embodiment of Figure 12.
  • Figure 14 is a schematic flow chart showing a process of searching for a target device of a specific device type according to another embodiment of the present invention.
  • Figure 15 is a schematic flow chart showing a process of searching for a target device of a specific device type according to another embodiment of the present invention.
  • FIG 16 is a block diagram of an NFC device in accordance with one embodiment of the present invention.
  • FIG. 17 is a block diagram of an NFC device in accordance with another embodiment of the present invention.
  • FIG. 18 is a block diagram of an NFC device in accordance with another embodiment of the present invention.
  • FIG. 19 is a block diagram of an NFC device in accordance with another embodiment of the present invention. detailed description
  • an NFC device can be divided into two functional entities, DH (Device Host) and NFCC (NFC controller).
  • DH is responsible for managing the operating environment of NFC devices and peripherals (including NFCC), such as initialization, configuration, power management, and more.
  • the NFCC is responsible for transmitting data on the NFC radio interface.
  • the NFCC can be implemented by a separate chip, and the DH can be implemented by a processor that executes the corresponding instructions.
  • the logical interface between DH and NFCC is called NCI (NFC Controller Interface).
  • FIG. 1 is a flow chart of a near field communication method in accordance with an embodiment of the present invention.
  • the method of Figure 1 is performed by an NFC device, and in particular, by an NFC device that receives an NFCID.
  • the second device acquires an NFCID of the first device.
  • the NFCID of the first device carries the first DT (Device Type, Device Type) information.
  • the first DT information is used to indicate the device type/device capability supported by the first device.
  • the first device and the second device are both NFC devices and may be master devices or target devices in the near field communication process.
  • the first device and the second device can operate in an active or passive mode.
  • the first device is an NFC device that generates and sends an NFCID
  • the second device is an NFC device that receives an NFCID.
  • the second device extracts the first DT information from the NFCID of the first device.
  • the NFCID of the NFC device carries information about the device type/device capability supported by the NFC device, so that the device type/device capability can be exchanged or searched through the NFCID.
  • the method of Figure 1 can be performed during the device identification exchange of the device discovery process or during the device search process. Specific examples of performing the method of Fig. 1 in different flows will be described below in conjunction with specific embodiments.
  • the second device may send a first request message, where the first request message carries the second DT information, and the second The DT information is used to indicate the device type/device capability that the second device is to search for.
  • the second device receives the NFCID of the first device from the first device that determines that the first DT information matches the second DT information.
  • a conflict may occur in the process of receiving the NFCID of the first device, for example, multiple devices simultaneously feed back the NFCID to the second device.
  • the second device detects a conflict when receiving the NFCID of the first device, determining a valid collision bit; then the second device sends a second request message, where the second request message carries a valid Conflict bit. If the number n of valid collision bits is smaller than the number m of bits of the second DT information, the second request message also carries the second DT information Mn bits, where m and n are positive integers.
  • the foregoing first request message may be a single device detection request SDD REQ message or a probe request message ATR_REQ.
  • SEL_PAR 20h in the SDD_REQ message and the total length of the SDD REQ message is greater than 2 bytes
  • the SDD_REQ message may be implicitly represented to carry the second DT information.
  • different types of first request messages can be explicitly represented by different command field values by setting a command field in the first request message. For example, when CMD1 of A
  • the embodiment of the present invention can solve the conflict problem in the device search process and can be compatible with the existing conflict resolution mechanism.
  • the embodiment of the present invention does not limit the specific manner in which the NFCID carries the DT information.
  • the NFCID can carry DT information on a predetermined byte or bit in the NFCID.
  • the second device extracts a predetermined byte or bit in the NFCID of the first device as the first DT information.
  • the location of the byte or bit of the NFCID carrying the DT information may vary depending on the length of the NFCID.
  • the second device may detect the length of the NFCID of the first device, and then the second device extracts the corresponding byte or bit in the NFCID of the first device as the first according to the length of the NFCID of the first device. DT information.
  • FIG. 2 is a flow chart of a near field communication method according to another embodiment of the present invention.
  • the method of Figure 2 is performed by an NFC device, and in particular, by an NFC device that generates and transmits an NFCID.
  • the method of Fig. 2 corresponds to Fig. 1, and in order to avoid repetition, the repeated description is omitted as appropriate.
  • the first device generates an NFCID of the first device, where the NFCID of the first device carries the first DT information, where the first DT information is used to indicate the device type/device capability supported by the first device.
  • the first device and the second device are both NFC devices and may be master devices or target devices in the near field communication process.
  • the first device and the second device can operate in an active or passive mode.
  • the first device is an NFC device that generates and sends an NFCID
  • the second device is an NFC device that receives an NFCID.
  • the first device sends the NFCID of the first device to the second device.
  • the NFCID of the NFC device carries information about the device type/device capability supported by the NFC device, so that the device type/device capability can be exchanged or searched through the NFCID.
  • the method of Figure 2 can be performed during the device identification exchange of the device discovery process or during the device search process.
  • the method of Figure 2 will be described in different flows in conjunction with specific embodiments. Specific examples of the law.
  • the embodiment of the present invention does not limit the specific manner in which the NFCID carries the DT information.
  • the NFCID may carry DT information on predetermined bytes or bits in the NFCID.
  • the first device may fill the first DT information on a predetermined byte or bit in the NFCID of the first device.
  • the location of the byte or bit of the NFCID carrying the DT information may vary depending on the length of the NFCID.
  • the first device may fill the first DT information on the corresponding byte or bit in the NFCID of the first device according to the length of the NFCID of the first device.
  • the first device may receive a first request message sent by the second device, where the first request message carries the second DT information, where The second DT information is used to indicate the device type/device capability that the second device is to search for.
  • the first device determines whether the NFCID matches the second DT information.
  • the first device sends the NFCID of the first device to the second device.
  • the NFCID matches the second DT information, which means that the device type supported by the first device covers the device type/device capability that the second device wants to search.
  • the second DT information is a subset of the first DT information or the same as the first DT information.
  • the DT information is represented by the bitmap of Table 4 below, the corresponding bit of the first DT information is also set to " ⁇ " when the second DT information is set to " ⁇ "; The second DT information is set to a bit of "0", and the corresponding bit of the first DT information can be set to " ⁇ or set to "0".
  • the first device may further receive a second request message that is sent by the second device, where the second request message is configured to be determined when the second device detects a conflict when receiving the NFCID of the first device.
  • Valid conflict bits The first device determines, according to the matching result of the valid conflict bit and the NFCID of the first device, whether to send the NFCID of the first device to the second device again.
  • the number of valid collision bits is n
  • the number of bits of the second DT information is m.
  • m and n are positive integers.
  • the first device determines, according to the matching result of the valid conflict bit and the NFCID of the first device, whether to send the NFCID of the first device to the second device again, if the valid conflict bit is different from the first n bits of the NFCID, determining not Then send the NFCID of the first device.
  • the valid collision bit is the same as the first n bits of the NFCID and n>m, it is determined to resend the NFCID of the first device.
  • the valid collision bit is the same as the first n bits of the NFCID and n ⁇ m, then in the case where the mn bits following the valid collision bit are the same as the corresponding bits of the NFCID, it is determined that the NFCID of the first device is transmitted again. Or, if the valid collision bit is the same as the first n bits of the NFCID And n ⁇ m , then the NFCID of the first device is no longer transmitted when the mn bits following the valid collision bit are different from the '1' of the NFCID.
  • the foregoing first request message may be a single device detection request SDD REQ message or a probe request message ATR_REQ.
  • SEL_PAR 20h in the SDD_REQ message and the total length of the SDD REQ message is greater than 2 bytes
  • the SDD_REQ message may be implicitly represented to carry the second DT information.
  • different types of first request messages can be explicitly represented by different command field values by setting a command field in the first request message. For example, when CMD1 of A
  • the embodiment of the present invention can solve the conflict problem in the device search process and can be compatible with the existing conflict resolution mechanism.
  • the DT information can be configured by sending a configuration command from the DH of the NFC device (master device or target device) to the NFCC of the NFC device.
  • This configuration command can carry information about the device types supported by the NFC device.
  • the above configuration commands can be implemented by extending the existing CORE-SET-CONFIG-CMD. You can also add a dedicated configuration command. The embodiment of the invention does not limit this.
  • the NFCC of the NFC device stores DT information.
  • the configuration of the DT information in the NFC device can be realized.
  • the method of configuring DT information can be performed during the initial setup process or if the device type/device capability is changed.
  • the DH of the master device can perform corresponding function processing according to the device type/device capability of the target device, thereby enhancing the application experience of the user.
  • DH can launch an application that matches the device type, such as when the target device (such as a mobile phone) is close to the printer, the file transfer service of the mobile phone is immediately activated; or, when the main device (such as a mobile phone) is close to the NFC module of the car cab ( Target device), immediately initiate pairing of Bluetooth headsets, or immediately launch an application that collects car parameters.
  • the embodiment of the present invention does not limit the specific form of the storage, operation, and may be long-term static storage, or short-term storage, such as caching.
  • the main device such as a mobile phone
  • the target device with the speaker function will respond to the device.
  • the main device such as a mobile phone
  • the printing application turned on
  • the DT information can indicate the device type.
  • Table 1 is an example of a description of the device type.
  • An NFC device can belong to multiple categories, which means that multiple device types can be supported simultaneously.
  • the DT information may also represent device capabilities.
  • Table 2 shows an example of device capability description.
  • An NFC device can belong to multiple categories, that is, it can support multiple device capabilities at the same time.
  • the DT information of Table 1 will be described as an example, but the embodiment of the present invention can be similarly applied to the DT information of Table 2, and such an application also falls within the scope of the embodiment of the present invention.
  • Table 3 is an example of a device type data format of an embodiment of the present invention.
  • the device type parameter "DEVICE_TYPE" is added, and the specific definition is as shown in Table 3, and the length is 2 bytes (byte).
  • the embodiment of the present invention does not limit the specific length of the device type parameter.
  • Table 4 is an example of the format of the device type parameter "DEVICE_TYPE" of one embodiment of the present invention, where h represents hexadecimal.
  • the device type parameter "DEVICE_TYPE” the encoding format of the bitmap is used, but the format of the device type parameter is not limited in the embodiment of the present invention.
  • the individual bits of each byte are arranged in reverse order.
  • an NFC device can support multiple device types (or device capabilities). If the device has video, display capabilities, then b2 and b3 in the first byte are set to 1. The "X" in Table 3 indicates reserved bits.
  • Table 5 is an example of NFCID carrying DT information according to an embodiment of the present invention.
  • NFCID length DT information bytes 4 bytes NFCID11, NFCID12
  • NFCID1 7 bytes or 10 bytes NFCID10, NFCID11 (NFC-A) or
  • NFCID11 NFCID12
  • NFCID2 (NFC-F) 8 bytes any two consecutive
  • the NFCID can carry DT information on a predetermined byte or bit in the NFCID.
  • the device identifier under the NFC-F type is represented as NFCID2 and the length is 8 bytes, and the DT information can be carried by any predetermined two consecutive bytes NFCID2x in the 8-byte NFCID2.
  • "X" represents the corresponding sequence number of the byte in NFCID2, and the value ranges from any predetermined two consecutive integers in 0-7.
  • the NFC device can extract the predetermined two bytes from the received NFCID as DT information, or fill the DT information in the predetermined two bytes when generating the NFCID.
  • the position of the byte or bit of the NFCID carrying the DT information may vary depending on the length of the NFCID.
  • a device ID under the NFC-A type is represented as NFCID 1 and may be 4 bytes, 7 bytes, or 10 bytes in length.
  • the Byte information can be carried by two bytes of NFCID11 and NFCID12 in NFCID1.
  • the length of NFCID1 is 7 bytes or 10 bytes, you can use the NFCID10 and NFCID11 two bytes in NFCID1 to carry DT information, or use NFCID11 and NFCID12 in NFCID1 to carry DT information.
  • NFCID10 represents the first byte of NFCID1
  • NFCID11 represents the second byte of NFCID1
  • NFCID12 represents the third byte of NFCID1.
  • the byte described in the table 5 is only an example of the NFCID carrying the DT information.
  • the embodiment of the present invention does not limit the specific location of the DT information in the NFCID. For example, it may be two bytes that are not consecutive, or may be other words. Section.
  • FIG. 3 is a schematic flow chart of a near field communication process in accordance with an embodiment of the present invention.
  • the same steps use the same reference numerals.
  • the embodiment of Figure 3 is a method for configuring a device type and reporting a device type in a process for exchanging device types.
  • DH sends a configuration command CORE_SET_CONFIG-CMD to the NFCC. This command is used to configure the relevant parameters of the NFCC.
  • the configuration command CORE_SET_CONFIG_CMD of the embodiment of the present invention contains the device type to be configured.
  • step 301 can be performed during the initial setup process, or if the device type is changed. Execution.
  • the NFCC After receiving the configuration command, the NFCC feeds back the response message to the DH CORE_SET_CONFIG- RSP, which is used to indicate whether the configuration is successful.
  • Steps 301 and 302 are procedures for configuring the device type. This process does not have to be executed each time before the discovery process is initiated, but only at the initial setup, or when the configuration of the device type changes. Therefore, steps 301 and 302 are optional procedures.
  • the DH sends an RF-DISCOVER-CMD command to the NFCC to trigger the discovery process of the NFCC boot device.
  • the NFCC sends a response message to the DH, indicating that the device discovery process is in progress; 305: performing a discovery process for exchanging the device type between the primary device and the target device.
  • the NFCC of the master device After the NFCC of the master device discovers the surrounding target device, it sends a radio frequency discovery notification message RF_DISCOVER-NTF to the DH to announce the discovery result.
  • the radio frequency discovery notification message RF_DISCOVER_NTF of the embodiment of the present invention includes the device type of the target device.
  • the NFCC of the target device when it discovers the surrounding master device, it sends a radio frequency discovery notification message RF_DISCOVER-NTF to the DH to announce the discovery result.
  • the radio frequency discovery notification message RF_DISCOVER_NTF of the embodiment of the present invention includes the device type of the master device.
  • FIG. 4 is a schematic flow chart of a near field communication process in accordance with an embodiment of the present invention.
  • the same steps use the same reference numerals.
  • the embodiment of Figure 4 is a method of configuring a device type and reporting a device type in a process for searching for a device type.
  • the device type exchange is also performed while searching for the device type, but the embodiment of the present invention is not limited thereto.
  • the step 406 of the target device may be omitted without performing an exchange of device types.
  • Steps 401-402 are the same as steps 301-302 of Fig. 3, and thus the repeated description is omitted.
  • the DH sends an RF-DISCOVER-CMD command to the NFCC, which includes the type of device to be searched, triggering the discovery process of the NFCC boot device.
  • the NFCC feeds back a response message to the DH, indicating that the device discovery process is in progress.
  • Step 406 is the same as step 306 of FIG. 3, and thus the repeated description is omitted.
  • the following describes the master device through identity switching or an example in the NFC-A passive communication process in conjunction with FIG. 5-9.
  • FIG. 5 is a flow chart showing an example of a master device acquiring DT information of a target device according to an embodiment of the present invention. The method of Figure 5 is performed by the master device.
  • the master sends a SENS_REQ (Probe Request) message to the target device to detect surrounding target devices.
  • SENS_REQ Probe Request
  • the target device After receiving the SENS_REQ, the target device will feed back the SENS_RES (probe response) message to the master device.
  • SENS_RES probe response
  • the master initiates a single device detection (SDD) process.
  • SDD single device detection
  • the master acquires NFCID1 of all target devices.
  • the master device detects whether the length of the target device NFCID 1 is 4 bytes.
  • NFCID1 l and NFCID12 are stored as device types.
  • the NFCID1 and the NFCID12 are extracted as the DT information, but the embodiment of the present invention does not limit this.
  • the corresponding byte or bit can also be extracted as DT information according to other configurations.
  • NFCIDIO and NFCID1 are stored as device types.
  • the NFCIDIO and the NFCID1 are extracted as DT information, but the embodiment of the present invention does not limit this.
  • NFCID1 and NFCID12 may be extracted as DT information, or according to other configurations, corresponding bytes or bits may be extracted as DT information.
  • the primary device verifies that the device type is valid. If the device type is valid, go to step 509. If the device type is invalid, go to step 510.
  • the NFCC of the master device notifies the DH of the master device to discover the target device, and carries the device type of the target device.
  • the master device determines whether to continue the detection. If it continues, step 503 is performed, otherwise it ends. In this way, the exchange of device types can be realized by NFCID.
  • 6 is a schematic diagram of message interaction between a master device and a target device in the embodiment of FIG. 5. The definition of each message in FIG. 6 can be referred to the embodiment of FIG. 3 to FIG. 5, and thus the description will not be repeated.
  • FIGS. 7A and 7B are schematic flow charts of a process of searching for a target device supporting a specific device type according to an embodiment of the present invention. The method of Figures 7A-7B is performed by the master device.
  • the master device selects the cascading level 1 after transmitting the SENS_REQ and receiving the SENS_RES message fed back from the target device.
  • step 702 The master device determines whether it is necessary to search for a target device of a specific device type. If the determination is yes, step 703 is performed; if the determination is no, step 704 is performed.
  • the second DT information of the three bytes is only an example, and the length of the second DT information in the embodiment of the present invention is not limited to three bytes.
  • the SDD-REQ message frame contains at least one byte of SEL_CMD field and one byte of SEL_PAR field.
  • SEL_PAR hexadecimal value of SEL_PAR
  • ij hexadecimal value of SEL_PAR
  • i, j positive integers
  • SEL_PAR in the SDD_REQ message is followed by (i-2)x8+j valid. Conflicting bits.
  • the target device discovers that the actual length of the SDD-REQ message frame is greater than the length indicated by SEL_PAR, which can be understood as the SDD-REQ message carrying the second DT information for searching for a particular device type.
  • the SDD REQ message frame is 5 bytes, but the value of SEL_PAR is 20h (indicating that SDD-REQ is 2 bytes long and does not carry valid collision bits), the target device can be understood as SEL-PAR
  • the 3 bytes after the field are the second DT information, not the valid collision bits.
  • step 705 The master detects any conflicts. If there is a conflict, step 706 is performed, otherwise step 713 is performed.
  • the master device determines a valid collision bit.
  • the master device determines whether it is necessary to search for a target device of a specific device type. If yes, go to step 708, otherwise go to step 710.
  • step 708 The master checks if the cascading level is 1. If yes, go to step 709, otherwise end. 709: The master device determines whether the number of valid collision bits (assumed to be n) is greater than or equal to the second DT The length of the message (3 bytes). If yes, go to step 710, otherwise go to step 711.
  • the valid collision bit is included in the 3 bytes after the SEL PAR field. Specifically, among the 3 bytes following the SEL_PAR field, n valid collision bits are first filled, and the remaining bits still use the corresponding bits of the second DT information in step 703. In other words, the first n bits in the second DT information are overwritten with valid collision bits.
  • step 712 The master detects a conflict with the received SDD-RES (single device detection response) message. If so, step 706 is performed; otherwise, step 713 is performed.
  • SDD-RES single device detection response
  • step 713 The NFCID1 judged by the master device is complete. If yes, go to step 715. Otherwise, step 714 is performed.
  • step 714 increase the cascading level, and then perform step 704.
  • 715-720 is the same as 505-510 of FIG. 5, and therefore will not be described again.
  • the master device determines whether to continue the detection. If it continues, step 701 is performed, otherwise it ends. In this way, the master device can search for a target device supporting a specific device type, and can solve the feedback conflict problem of multiple target devices while being compatible with the existing conflict resolution mechanism.
  • Figure 8 is a schematic flow diagram of a process for searching for a target device of a particular device type in accordance with one embodiment of the present invention. The method of Figure 8 is performed by the target device.
  • the target device receives the SDD-REQ message.
  • the target device finds that the actual length of the SDD-REQ message frame is greater than the length indicated by SEL_PAR, it can be understood that the SDD-REQ message carries the second DT information for searching for a particular device type.
  • the SDD_REQ message frame sent in step 703 is 5 bytes, but the value of SEL_PAR is 20h (indicating that the SDD_REQ length is 2 bytes and does not carry valid collision bits)
  • the target device can be understood as the third DT information after the SEL_PAR field is the second DT information, instead of the valid collision bit.
  • the target device detects whether its own NFCID matches the second DT information, and if it matches, sends an SDD_RES message to the master device, and the SDD_RES message carries the NFCID1 of the target device.
  • the target device detects whether the first n bits after the SEL_PAR field in the SDD_REQ message is Matches the first n bits of its own NFCID 1. If yes, go to step 803; otherwise, end.
  • Target device detects whether the SEL_PAR of the SDD-REQ message is less than 50h. If yes, go to step 804; otherwise, go to step 805.
  • SEL PAR is greater than or equal to 50h, indicating that the SEL_PAR field carries only valid collision bits afterwards, and does not carry any bits of the second DT information.
  • the SEL PAR is less than 50h, indicating that the SEL_PAR field carries an effective collision bit of n bits, and the valid collision bit carries a non-valid collision bit.
  • the non-valid collision bit is the next 24-n bits of the second DT information, where 24 is the number of bits of the second DT information (equal to 3 bytes).
  • step 805 The target device determines whether its device type matches the non-valid collision bit after the SEL_PAR field in the SDD-REQ message. If it matches, step 805 is performed; otherwise it ends.
  • the target device returns an SDD_RES message for responding to SDD-REQ.
  • the SDD-RES message carries the NFCID 1 of the target device.
  • the master device can search for a target device supporting a specific device type, and can solve the feedback conflict problem of multiple target devices.
  • Figure 9 is a schematic illustration of message interaction between a master device and a target device in the embodiment of Figures 7 and 8.
  • the definition of each message in Fig. 9 can be referred to the embodiment of Figs. 3-4 and Figs. 7-8, and therefore the description will not be repeated.
  • FIG. 10 is a schematic flow chart of a process of acquiring a device type according to an embodiment of the present invention.
  • the method of Figure 10 is performed by the master device.
  • the DT information is carried by using two bytes of NFCID20 and NFCID21 (ie, the first byte and the second byte of NFCID2), but the embodiment of the present invention carries DT information to NFCID2.
  • Bytes or bits are not limited.
  • the master sends a SENSF-REQ (Probe Request) message to the target device to detect the surrounding target device.
  • SENSF-REQ Probe Request
  • the master receives the SENSF_RES (Probe Response) message that is fed back from the target device.
  • the master device performs single device detection.
  • the master device obtains the NFCID2 of the target device and uses NFCID20 and NFCID21 as the device type.
  • step 1005 The master device detects whether the device type is valid. If step 1006 is valid, the device type is set to "unknown", and then step 1006 is performed.
  • the NFCC of the master device notifies the DH of the device type of the target device.
  • step 1007 The master device determines whether to continue the resolution of the target device, and if yes, step 1003 is performed. Otherwise it ends.
  • FIG. 11 is a schematic diagram of message interaction between a master device and a target device in the embodiment of FIG.
  • the definition of each message in Fig. 11 can be referred to the embodiment of Figs. 3-4 and Fig. 10, and thus the description will not be repeated.
  • FIGS. 12A and 12B are schematic flow charts of a process of acquiring a device type according to another embodiment of the present invention.
  • the method of Figures 12A-B is performed by the master device, and the operation of the target device corresponds to the master device.
  • the master device detects its own configuration information and determines whether it supports NFC-A technology. If the NFC-A technology is supported, step 1202 is performed, otherwise step 1205 is performed.
  • step 1202 The master judges whether the length of the NFCID (in this case, NFCID1) is 4 bytes. If the NFCID1 is 4 bytes in length, step 1203 is performed; otherwise, step 1204 is performed.
  • NFCID1 is 4 bytes long, and NFCID11 and NFCID12 are set to the device type.
  • NFCID1 is 7 bytes or 10 bytes long, and NFCID10 and NFCID11 are set to the device type.
  • step 1205 The master device determines whether it supports NFC-F technology. If the NFC-F technology is supported, then step 1206 is performed, otherwise it ends.
  • the master device sets NFCID20 and NFCID21 of the NFCID (in this case, NFCID2) as the device type.
  • the master sends an ATR-REQ (Probe Request) message to the target device to detect the surrounding target device and request acquisition of the target device parameter.
  • ATR-REQ Probe Request
  • the target device After receiving the ATR_REQ message, the target device responds to the ATR_RES (probe response) message to the master device.
  • ATR_RES probe response
  • the master repeats steps 1201-1208 until it receives a response from all target devices.
  • step 1209 The master detects the NFCID value in the ATR-RES to determine if the NFC-A technology is supported. If the NFC-A technology is supported, step 1210 is performed, otherwise step 1213 is performed.
  • NFCID1 The master judges whether the length of the NFCID (in this case, NFCID1) is 4 bytes. If yes, go to step 1211, otherwise go to step 1212.
  • NFCID1 is 4 bytes in length, and NFCIDl 1 and NFCID12 are obtained as device types.
  • step 1213 Determine whether NFC-F technology is supported. If the NFC-F technology is supported, step 1214 is performed. Otherwise, go to step 1207.
  • the master device stores the acquired device type.
  • step 1216 The master device detects whether the device type is valid. If step 1217 is performed effectively, step 1218 is performed.
  • the NFCC of the master device notifies the DH of the device type of the target device.
  • step 1218 Set the device type to "Unknown” and proceed to step 1217.
  • the master device determines whether to continue the resolution of the target device. If yes, go to step 1207, otherwise end.
  • Figure 13 is a schematic illustration of message interaction between a master device and a target device in the embodiment of Figure 12.
  • the definition of each message in Fig. 13 can be referred to the embodiment of Figs. 3-4 and Fig. 12, and thus the description will not be repeated.
  • Figure 14 is a schematic flow chart showing a process of searching for a target device of a specific device type according to another embodiment of the present invention. The method of Figure 14 is performed by the master device.
  • the ATR REQ message is used to search for a target device of a specific device type.
  • the primary device sets the first two bytes in the NFCID field of the ATR-REQ message to the type of device to be searched.
  • the master sends an ATR_REQ to the target device to detect the surrounding target device and request the target device parameter.
  • the master device receives an ATR_RES message fed back from the target device;
  • step 1405 The master device detects the NFCID in the received ATR_RES message to determine whether the NFC-A technology is supported. If the NFC-A technology is supported, step 1406 is performed, otherwise step 1409 is performed.
  • the master device determines whether the length of the NFCID (in this case, NFCID1) is 4 bytes. If yes, go to step 1407, otherwise go to step 1408.
  • NFCID1 is 4 bytes in length, and NFCID 11 and NFCID 12 are obtained as device types.
  • 1408 NFCID1 is 7 bytes or 10 bytes long, and NFCID10 and NFCID11 are obtained as device types.
  • step 1409 Determine whether NFC-F technology is supported. If the NFC-F technology is supported, step 1410 is performed, otherwise step 1403 is performed.
  • step 1412 The master device detects whether the device type is valid. If step 1413 is performed effectively, step 1414 is performed.
  • the NFCC of the master device notifies the DH of the device type of the target device.
  • step 1414 Set the device type to "Unknown” and proceed to step 1413.
  • the master device determines whether to continue the resolution of the target device. If yes, go to step 1403, otherwise end.
  • Figure 15 is a schematic flow chart showing a process of searching for a target device of a specific device type according to another embodiment of the present invention.
  • the method of Fig. 15 is performed by the target device and corresponds to the method of Fig. 14.
  • the target device received an ATR_REQ message.
  • the target device obtains the first two bytes from the NFCID field in the ATR REQ message.
  • the target device determines if the two bytes match their own device type. If it matches, go to step 1505; otherwise, it ends.
  • the target device sends an ATR_RES message to the master device.
  • the current frame format and communication architecture can be reused to the greatest extent, and device type acquisition and search can be realized in NFC-A, NFC-F passive communication mode, and active communication mode.
  • Target device for a specific device type.
  • FIG. 16 is a block diagram of an NFC device in accordance with one embodiment of the present invention.
  • the NFC device of Fig. 16 includes an acquisition unit 161 and an extraction unit 162.
  • the obtaining unit 161 obtains the NFCID of the first device, and the NFCID of the first device carries the first DT information, where the first DT information is used to indicate the device type/device capability supported by the first device. And an extracting unit, configured to extract the first DT information from the NFCID of the first device.
  • the NFCID of the NFC device carries information about the device type/device capability supported by the NFC device, so that the device type can be exchanged or searched through the NFCID.
  • the NFC device 160 can perform various processes related to the device receiving the NFCID in the above method embodiments, and implement exchange or search of device type/device capabilities. To avoid repetition, it will not be described in detail.
  • the extracting unit 162 may detect a length of the NFCID of the first device. According to the length of the NFCID of the first device, extract a corresponding byte or bit in the NFCID of the first device as the first DT information.
  • the corresponding byte NFCID 11 and NFCID 12 can be extracted as the first DT information; or, when the length of the NFCID1 is When it is 7 or 10 bytes, the corresponding bytes NFCID10 and NFCID11, or the corresponding bytes NFCID11 and NFCID12, can be extracted as the first DT information.
  • the extracting unit 162 may extract a predetermined byte or bit in the NFCID of the first device as the first DT information.
  • the first DT information such as NFCID20 and NFCID21 in the embodiment of FIG.
  • the obtaining unit 161 may send a first request message, where the first request message carries the second DT information, where the second DT information is used to indicate the device type/device capability that the NFC device 160 is to search for.
  • the NFCID of the first device is received from the first device that determines that the first DT information matches the second DT information.
  • the obtaining unit 161 may determine a valid collision bit.
  • the obtaining unit 161 can send a second request message, wherein the second request message carries a valid conflicting bit. If the number n of valid collision bits is smaller than the number m of bits of the second DT information, the second request message also carries the following m-n bits of the second DT information, where m and n are positive integers.
  • the first request message is a single device detection request SDD_REQ message or a probe request message ATR_REQ.
  • FIG. 17 is a block diagram of an NFC device in accordance with another embodiment of the present invention.
  • the NFC device 170 of Fig. 17 includes a generating unit 171 and a transmitting unit 172.
  • the generating unit 171 generates an NFCID of the NFC device 170, wherein the NFCID of the NFC device 170 carries the first DT information, and the first DT information is used to indicate the device type/device capability supported by the NFC device 170.
  • the sending unit sends the NFCID of the NFC device 170 to the second device.
  • the NFCID of the NFC device carries information about the device type/device capability supported by the NFC device, so that the device type can be exchanged or searched through the NFCID.
  • the NFC device 170 can perform various processes for generating and transmitting NFCID devices in the above-described method embodiments, and implement device type/device capability exchange or search. To avoid repetition, it will not be described in detail.
  • the generating unit 171 may be at the NFCID of the NFC device 170.
  • the first DT information is padded on a predetermined byte or bit; or the first DT information is padded on a corresponding byte or bit in the NFCID of the NFC device 170 according to the length of the NFCID of the NFC device 170.
  • the NFC device 170 further includes a receiving unit 173 and a determining unit.
  • the receiving unit 173 receives the first request message sent by the second device, where the first request message carries the second DT information, where the second DT information is used to indicate the device type/device capability to be searched by the second device.
  • the determining unit 174 determines if the NFCID matches the second DT information.
  • the transmitting unit 172 transmits the NFCID of the NFC device 170 to the second device when the determining unit 174 determines that the NFCID matches the second DT information.
  • the receiving unit 173 may further receive a second request message that is sent by the second device, where the second request message is determined by the second device that detects a conflict when receiving the NFCID of the first device.
  • Valid conflict bits The determining unit 174 can also determine whether to send the NFCID of the first device to the second device again according to the matching result of the valid conflict bit and the NFCID of the first device.
  • the number of valid collision bits is n, and n is a positive integer. If the valid collision bit is different from the first n bits of the NFCID, the determining unit 174 may determine that the NFCID of the first device is no longer transmitted; if the valid collision bit is the same as the first n bits of the NFCID and n ⁇ m, the determining unit 174 may determine to resend the NFCID of the first device, where m is the number of bits of the second DT information; if the valid collision bit is the same as the first n bits of the NFCID and n ⁇ m, then mn bits after the valid collision bit are In the case where the corresponding bits of the NFCID are the same, the determining unit 174 may determine to resend the NFCID of the first device; if the valid collision bit is the same as the first n bits of the NFCID and n ⁇ m, then mn after the valid collision bit When the bit is different from the '1
  • the first request message is a single device detection request SDD_REQ message or a probe request message ATR_REQ.
  • FIG. 18 is a block diagram of an NFC device in accordance with another embodiment of the present invention.
  • the NFC device 180 of Figure 18 includes
  • the NFCC 183 includes a transmitting circuit 1831, a receiving circuit 1832, an antenna 1833, a processor 1834, and a memory 1835.
  • the memory 1835 stores instructions for causing the processor 1834 to: obtain an NFCID of the first device, the NFCID of the first device carries the first DT information, the first DT information is used to indicate the device type/device capability supported by the first device, and The first DT information is extracted from the NFCID of the first device.
  • the embodiment of the present invention carries the device type supported by the NFC device in the NFCID of the NFC device/ Information about device capabilities, so that device type/device capabilities can be exchanged or searched through NFCID.
  • the NFC device 180 can perform various processes related to the NFCID-receiving device in the above method embodiments, and implement device type/device capability exchange or search. To avoid repetition, it will not be described in detail.
  • the NFC device 180 further includes a processor 181 and a memory 182.
  • the memory 182 stores instructions that cause the processor 181 to implement control of the NFCC 183.
  • the NFCC 183 implements the above functions under the control of the processor 181.
  • the processor 181 implements the function of the host (DH) in the NFC device 180.
  • bus system 189 The processor 181, the memory 182 and the NFCC 183 of the NFC device 180 are coupled together by a bus system 189, wherein the bus system 189 may include a power bus, a control bus, a status signal bus, and the like in addition to the data bus. However, for clarity of description, various buses are labeled as bus system 189 in the figure. The logical interface between DH and NFCC is implemented by bus system 189.
  • the processor 181 generally controls the operation of the NFC device 180, and the processor 181 may be a CPU (Central Processing Unit).
  • the processor 181 can also be other general purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware. Components, etc.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • Memory 182 can include read only memory and random access memory and provides instructions and data to processor 181. A portion of memory 182 may also include non-volatile random access memory. For example, the memory 182 can also store information of the device type.
  • the NFCC 183 can be implemented as a separate chip, and the transmitting circuit 1831, the receiving circuit 1832, and the antenna 1833 implement the RF interface of the NFCC 183.
  • Transmitting circuit 1831 and receiving circuit 1832 are coupled to antenna 1833 via internal connection 1839.
  • the embodiment of the present invention does not limit the form of the internal connection 1839, and may be an internal bus or an internal circuit or the like.
  • the transmitting circuit 1831 and the receiving circuit 1832 may be implemented by a set of circuits that implement transmit and receive functions in a duplex mode.
  • processor 1834 and memory 1835 of NFCC 183 may also be the responsibility of processor 181 and memory 182, respectively.
  • processor 1834 and memory 1835 can be removed from NFCC 183.
  • the memory 182 may store instructions that cause the processor 181 to: obtain an NFCID of the first device, the NFCID of the first device carries the first DT information, and the first DT information is used to indicate the device type/device supported by the first device Capability, and extracting the first DT information from the NFCID of the first device.
  • each step of the above method may be through hardware in the processor 181 or 1834.
  • the instruction in the form of an integrated logic circuit or software is completed.
  • the steps of the method disclosed in the embodiments of the present invention may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor.
  • the software modules can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in memory 182 or 1835, and processor 181 or 1834 reads the information in memory 182 or 1835, in conjunction with its hardware, to perform the steps of the above method. To avoid repetition, it will not be described in detail here.
  • the processor 181 or 1834 may detect the length of the NFCID of the first device. According to the length of the NFCID of the first device, extract the corresponding byte or bit in the NFCID of the first device as the first DT. information. For example, according to the example of NFCID 1 in the NFC-A mode in Table 5, when the length of the NFCID 1 is 4 bytes, the corresponding bytes NFCID 11 and NFCID 12 can be extracted as the first DT information; or, when NFCID1 When the length is 7 or 10 bytes, the corresponding bytes NFCID10 and NFCID11, or the corresponding bytes NFCID11 and NFCID12, may be extracted as the first DT information.
  • the processor 181 or 1834 may extract a predetermined byte or bit in the NFCID of the first device as the first DT information.
  • a predetermined byte or bit in the NFCID of the first device For example, according to the example of NFCID2 in the NFC-F mode in Table 5, any two consecutive NFCID2x predetermined in NFCID2 can be extracted as the first DT information, such as NFCID20 and NFCID21 in the embodiment of FIG.
  • the transmitting circuit 1831 may send the first request message by using the antenna 1833, where the first request message carries the second DT information, where the second DT information is used to indicate the device type/device to be searched by the NFC device 180. ability.
  • the receiving circuit 1832 can receive the NFCID of the first device from the first device that determines that the first DT information matches the second DT information through the antenna 1833.
  • the processor 181 or 1834 may determine a valid collision bit.
  • Transmitting circuit 1831 can transmit a second request message via antenna 1833, wherein the second request message carries a valid collision bit. If the number n of valid collision bits is smaller than the number m of bits of the second DT information, the second request message also carries the following m-n bits of the second DT information, where m and n are positive integers.
  • the first request message is a single device detection request SDD_REQ message or a probe request message ATR_REQ.
  • FIG. 19 is a block diagram of an NFC device in accordance with another embodiment of the present invention.
  • the NFC device 190 of FIG. 19 includes an NFCC 193.
  • the NFCC 193 includes a transmitting circuit 1931, a receiving circuit 1932, an antenna 1933, a processor 1934, and a memory 1935.
  • the memory 1935 stores instructions that cause the processor 1934 to: generate an NFCID of the NFC device 190, wherein the NFCID of the NFC device 190 carries the first DT information, the first DT information being used to indicate the device type/device capability supported by the NFC device 190.
  • the transmitting circuit 1931 transmits the NFCID of the NFC device 190 to the second device through the antenna 1933.
  • the NFCID of the NFC device carries information about the device type/device capability supported by the NFC device, so that the device type/device capability can be exchanged or searched through the NFCID.
  • the NFC device 190 can perform various processes for generating and transmitting NFCID devices in the above method embodiments, and implement device type/device capability exchange or search. To avoid repetition, it will not be described in detail.
  • the NFC device 190 also includes a processor 191 and a memory 192.
  • the memory 192 stores instructions that cause the processor 191 to implement control of the NFCC 193.
  • the NFCC 193 implements the above functions under the control of the processor 191.
  • the processor 191 implements the functions of the host (DH) in the NFC device 190.
  • the processor 191, the memory 192 and the NFCC 193 of the NFC device 190 are coupled together by a bus system 199, wherein the bus system 199 may include a power bus, a control bus, a status signal bus, and the like in addition to the data bus.
  • bus system 199 may include a power bus, a control bus, a status signal bus, and the like in addition to the data bus.
  • various buses are labeled as bus system 199 in the figure.
  • the logical interface between DH and NFCC can be implemented by bus system 199.
  • the processor 191 generally controls the operation of the NFC device 190, which may be a CPU (Central Processing Unit).
  • the processor 191 can also be other general purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware. Components, etc.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • Memory 192 can include read only memory and random access memory and provides instructions and data to processor 191. A portion of memory 192 may also include non-volatile random access memory. For example, the memory 192 can also store information of the device type.
  • the NFCC 193 can be implemented as a separate chip, and the transmitting circuit 1931, the receiving circuit 1932, and the antenna 1933 implement the RF interface of the NFCC 193.
  • Transmitting circuit 1931 and receiving circuit 1932 are coupled to antenna 1933 via internal connection 1939.
  • the embodiment of the present invention does not limit the form of the internal connection 1939, and may be an internal bus or an internal circuit or the like.
  • the transmitting circuit 1931 and the receiving circuit 1932 may be implemented by a set of circuits that implement transmit and receive functions in a duplex mode.
  • the functions of the processor 1934 and the memory 1935 of the NFCC 193 may also be respectively performed by the processor 191 and The memory 192 is responsible. Thus processor 1934 and memory 1935 can be removed from NFCC 193.
  • the memory 192 can store instructions that cause the processor 191 to: generate an NFCID of the NFC device 190, wherein the NFCID of the NFC device 190 carries the first DT information, the first DT information being used to indicate the type of device supported by the NFC device 190 / Equipment capacity.
  • each step of the above method may be completed by an integrated logic circuit of hardware in the processor 191 or 1934 or an instruction in the form of software.
  • the steps of the method disclosed in the embodiments of the present invention may be directly implemented as hardware processor execution, or performed by a combination of hardware and software modules in the processor.
  • the software modules can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in memory 192 or 1935, and processor 191 or 1934 reads the information in memory 192 or 1935 and, in conjunction with its hardware, performs the steps of the above method. To avoid repetition, it will not be described in detail here.
  • the generating unit 191 may fill the first DT information on a predetermined byte or bit in the NFCID of the NFC device 190; or, according to the length of the NFCID of the NFC device 190, the NFCID in the NFC device 190 The corresponding DT information is filled in the corresponding byte or bit.
  • the receiving circuit 1932 can receive the first request message sent by the second device by using the antenna 1933, where the first request message carries the second DT information, where the second DT information is used to indicate that the second device is to search. Type of device.
  • Processor 191 or 1934 determines if the NFCID matches the second DT information.
  • the transmitting circuit 1931 transmits the NFCID of the NFC device 190 to the second device through the antenna 1933 when the processor 191 or 1934 determines that the NFCID matches the second DT information.
  • the receiving circuit 1932 may further receive, by using the antenna 1933, a second request message sent by the second device, where the second request message carries a situation that the second device detects a conflict when receiving the NFCID of the first device.
  • the valid conflict bits are determined below.
  • the processor 191 or 1934 may also determine whether to send the NFCID of the first device to the second device again according to the matching result of the valid conflict bit and the NFCID of the first device.
  • the number of valid collision bits is n, and n is a positive integer. If the valid collision bit is different from the first n bits of the NFCID, the processor 191 or 1934 may determine that the NFCID of the first device is no longer transmitted; if the valid collision bit is the same as the first n bits of the NFCID and n>m, then The processor 191 or 1934 may determine to resend the NFCID of the first device, m being the number of bits of the second DT information; if the valid collision bit is the same as the first n bits of the NFCID and n ⁇ m, then after the valid collision bit In the case where the mn bits are the same as the corresponding bits of the NFCID, the processor 191 or 1934 may determine to resend the NFCID of the first device; if the valid conflict bit and the NFCID The first n bits are the same and n ⁇ m, then if the mn bits after the valid collision bit are different from the corresponding
  • the first request message is a single device detection request SDD_REQ message or a probe request message ATR_REQ.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
  • the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
  • the components displayed by the unit may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product.
  • the technical solution of the present invention which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including Several instructions to make a computer device (can be a personal computer, server, or network device) Etc.) Perform all or part of the steps of the method of the various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明提供一种近场通信方法和近场通信设备。该近场通信方法包括:第二设备获取第一设备的近场通信标识NFC ID,第一设备的NFC ID携带第一设备类型/设备能力DT信息,第一DT信息用于指示第一设备支持的设备类型/设备能力;第二设备从第一设备的NFC ID中提取第一DT信息。本发明在NFC设备的NFC ID中携带该NFC设备支持的设备类型/设备能力的信息,从而可以通过NFC ID实现设备类型/设备能力的交换或搜索。

Description

近场通信方法和近场通信设备 技术领域
本发明实施例涉及无线通信领域, 并且更具体地, 涉及近场通信方法和近 场通信设备。 背景技术
NFC ( Near Field Communication, 近场通信 )是一种短距离无线连接技术, 基于 RFID ( Radio Frequency Identification, 射频标识)技术, 利用磁场感应实 现电子设备在近距离间的通信。 用户只需要通过触摸或者设备靠近, 就可以实 现直观、 安全和非接触式的信息交换、 内容交换和交易等操作。 NFC 工作在 13.56MHz的频率上, 支持 106kbit/秒、 212kbit/秒、 424kbit/秒以及 848kbit/秒四 种速度。 通信的有效范围为 0-20cm。 NFC在 RFID技术的基础上增加了点对点 通信功能。 点对点通信的双方设备是对等的, 而 RFID通信的双方设备是主从关 系。
在 NFC通信中, NFC的设备分为两种角色: 主设备和目标设备。 主设备是 通信的发起方。 目标设备响应主设备发来的消息, 响应消息可以通过负载调制 或目标设备本身产生射频场进行发送。
NFC有三种工作方式: 卡模拟方式、 读卡器方式及点对点通信方式。
卡模拟方式: 将具有 NFC功能的设备模拟成一张非接触卡,如门禁卡、银行 卡、 地铁票等。 在这种方式下, 即使移动设备没有电或关机, 也不影响它当做 一张卡来使用。 读卡器从手机的 NFC标签上来读取数据, 完成信息的采集。
读卡器方式: 具有 NFC功能的手机充当的是读卡器的角色, 从一个有 NFC 标签的海报、 卡片或设备上读取 NFC标签中的数据。
点对点通信方式: 两个具有 NFC功能设备可以建立双方的通信链接, 然后 进行数据的交换。 这个模式下的典型应用有快速建立蓝牙链接、 设备间数据传 输和名片交换等。
NFC通信有两种模式: 主动通信模式 ( Active Communication Mode )和被 动通信模式 ( Passive Communication Mode )。
在被动通信模式下,由 NFC主设备在整个通信过程中提供射频场 (RF-field), 它可以选择 106kbps、 212kbps或 424kbps、 848kbps其中一种传输速度, 将数据 发送到另一台设备。
在主动通信模式下, 每台设备要向另一台设备发送数据时, 都必须产生自 己的射频场。
NFC通信分为四个阶段: 初始化、 设备激活、 数据通信和设备释放。
初始化: NFC设备处于监听状态, 进行冲突检测, 技术检测等初始化过程; 设备激活: 完成目标设备的选择, 并协商信参数, 如通信模式、 传输速率 等;
数据通信: 设备激活后, 就可以在主设备和目标设备间进行数据的交换; 设备释放: 数据交换完毕后, 释放当前的连接。
NFC的相关规范主要由 NFC Forum ( NFC论坛 ) 来制定, 保证了 NFC设 备之间的互操作性。 随着 NFC技术的逐渐普及, 很多电子产品已经集成了 NFC 功能, 如打印机、 电视、 音箱、手机、 照相机等。 NFC Forum也推出了 N-MARK 标志用于标识一个设备是否支持 NFC功能。
NFC通信协议规定了多种类型, 如 NFC-A、 NFC-B或 NFC-F。
NFC-A被动通信模式下,主设备发送探测请求消息来发现周围的目标设备, 当主设备收到多个目标设备的探测响应后, 就会启动 SDD ( Single Device Detection, 单设备检测)过程来得到所有目标设备的标识。 在 NFC-A中, NFC 设备的标识被表示为 "NFCID Γ。 当主设备获取到所有目标设备的 NFCID 1后, 就可以通过选择其中一个目标设备进行通信, 使用 NFCID 1 来标识对应的目标 设备。 主设备通过发送激活请求消息, 与目标设备进行通信参数的协商, 并激 活目标设备。 目标设备被成功激活后, 主设备就可以和目标设备进行数据交换。 当数据交换完毕后, 主设备通过发送释放请求消息, 来进行连接的释放。 在单 设备检测过程中, 主设备发送单设备检测请求消息, 并从目标设备处接收响应 消息, 通过不断的比特冲突来获取完整的目标设备的 NFCID1。
NFC-F被动模式下, 主设备发送探测请求消息来发现周围的目标设备。 目 标设备收到该探测请求消息后, 根据消息中包含的关于时隙的信息, 选择一个 时隙进行回应。 主设备通过在不同时隙上接收目标设备的响应, 从而获得目标 设备的标识。 在 NFC-F中, NFC设备的标识被表示为 "NFCID2"。 如果两个或 多个目标设备选择相同的时隙进行回应, 主设备可以检测出该时隙中产生了冲 突, 因此主设备将会重新发送探测请求消息, 目标设备将会重新选择时隙, 避 免冲突发生。 在 NFC-A、 NFC-F的主动通信模式下, 主设备向目标设备发送属性请求消 息, 由于工作在主动通信模式下, 目标设备产生自己的射频场, 因此目标设备 通过竟争窗口来向主设备回复响应消息。 当目标设备成功回应响应消息后, 将 不再响应接下来的收到的属性请求消息, 从而保证主设备能够发现所有的目标 设备。
NFC设备的标识是由 NFC设备产生的随机数, 在设备发现过程中, 用于唯 一的标识该 NFC设备。 NFC-A使用 4字节、 7字节及 10字节长度的 NFCID1 , NFC-F采用 8字节长度的 NFCID2。
现有的 NFC通信过程交换的设备标识是一个随机数,造成 NFC通信应用的 局限性。 发明内容
本发明实施例提供一种近场通信方法和近场通信设备, 能够通过设备标识 实现设备类型的交换或搜索。
第一方面, 提供了一种近场通信方法, 包括: 第二设备获取第一设备的近 场通信标识 NFCID, 所述第一设备的 NFCID携带第一设备类型 /设备能力 DT 信息, 所述第一 DT信息用于指示所述第一设备支持的设备类型 /设备能力; 第 二设备从所述第一设备的 NFCID中提取所述第一 DT信息。
结合第一方面,在一种实现方式中,所述第二设备从所述第一设备的 NFCID 中提取所述第一 DT信息, 包括: 所述第二设备检测所述第一设备的 NFCID的 长度; 所述第二设备根据所述第一设备的 NFCID的长度, 提取所述第一设备的 NFCID中的对应字节或比特作为所述第一 DT信息。
结合第一方面及其上述实现方式, 在另一种实现方式中, 所述第二设备从 所述第一设备的 NFCID中提取所述第一 DT信息, 包括: 所述第二设备提取所 述第一设备的 NFCID中的预定字节或比特作为所述第一 DT信息。
结合第一方面及其上述实现方式, 在另一种实现方式中, 所述第二设备获 取第一设备的近场通信标识 NFCID , 包括: 所述第二设备发送第一请求消息, 所述第一请求消息携带第二 DT信息,所述第二 DT信息用于指示所述第二设备 要搜索的设备类型 /设备能力; 所述第二设备从确定第一 DT信息匹配所述第二 DT信息的第一设备接收所述第一设备的 NFCID。
结合第一方面及其上述实现方式, 在另一种实现方式中, 所述第二设备从 确定第一 DT 信息匹配所述第二 DT 信息的第一设备接收所述第一设备的 NFCID, 包括:如果所述第二设备在接收所述第一设备的 NFCID时检测到冲突, 则确定有效的冲突比特; 所述第二设备发送第二请求消息, 其中所述第二请求 消息携带所述有效的冲突比特, 其中, 如果所述有效的冲突比特的数目 n小于 所述第二 DT信息的比特数 m,则所述第二请求消息还携带所述第二 DT信息的 后面 m-n个比特, 其中 m和 n为正整数。
结合第一方面及其上述实现方式, 在另一种实现方式中, 所述第一请求消 息为单设备检测请求 SDD— REQ消息, 或者为探测请求消息 ATR— REQ。
第二方面, 提供了一种近场通信方法, 包括: 第一设备生成所述第一设备 的 NFCID, 其中所述第一设备的 NFCID携带第一设备类型 /设备能力 DT信息, 所述第一 DT信息用于指示所述第一设备支持的设备类型 /设备能力; 第一设备 向第二设备发送所述第一设备的 NFCID。
结合第二方面, 在一种实现方式中, 所述第一设备生成所述第一设备的 NFCID, 包括: 所述第一设备在所述第一设备的 NFCID中的预定字节或比特上 填充所述第一 DT信息; 或者, 所述第一设备根据所述第一设备的 NFCID的长 度, 在所述第一设备的 NFCID中的对应字节或比特上填充所述第一 DT信息。
结合第二方面及其上述实现方式, 在另一种实现方式中, 在所述第一设备 向第二设备发送所述第一设备的 NFCID之前, 所述方法还包括: 所述第一设备 接收所述第二设备发送的第一请求消息, 所述第一请求消息携带第二 DT信息, 所述第二 DT信息用于指示所述第二设备要搜索的设备类型 /设备能力; 所述第 一设备确定所述 NFCID是否匹配所述第二 DT信息; 其中所述第一设备向第二 设备发送所述第一设备的 NFCID , 包括: 在确定所述 NFCID匹配所述第二 DT 信息时, 所述第一设备向所述第二设备发送所述第一设备的 NFCID。
结合第二方面及其上述实现方式, 在另一种实现方式中, 所述方法还包括: 所述第一设备接收所述第二设备发送的第二请求消息, 所述第二请求消息携带 所述第二设备在接收所述第一设备的 NFCID时检测到冲突的情况下确定的有效 的冲突比特; 所述第一设备根据所述有效的冲突比特和所述第一设备的 NFCID 的匹配结果, 确定是否再次向所述第二设备发送所述第一设备的 NFCID。
结合第二方面及其上述实现方式, 在另一种实现方式中, 所述有效的冲突 比特的数目为 n, n为正整数, 所述第一设备根据所述有效的冲突比特和所述第 一设备的 NFCID的匹配结果, 确定是否再次向所述第二设备发送所述第一设备 的 NFCID, 包括: 如果所述有效的冲突比特与所述 NFCID的前 n比特不同, 则 确定不再发送所述第一设备的 NFCID; 如果所述有效的冲突比特与所述 NFCID 的前 n比特相同且 n≥m, 则确定再次发送所述第一设备的 NFCID , m为所述第 二 DT信息的比特数, m为正整数; 如果所述有效的冲突比特与所述 NFCID的 前 n比特相同且 n<m,则在所述有效的冲突比特之后的 m-n个比特与所述 NFCID 的相应比特相同的情况下, 确定再次发送所述第一设备的 NFCID; 如果所述有 效的冲突比特与所述 NFCID的前 n比特相同且 n<m, 则在所述有效的冲突比特 之后的 m-n个比特与所述 NFCID的相应比特不同的情况下,确定不再发送所述 第一设备的 NFCID。
结合第二方面及其上述实现方式, 在另一种实现方式中, 所述第一请求消 息为单设备检测请求 SDD— REQ消息或者探测请求消息 ATR— REQ。
第三方面, 提供了一种近场通信设备, 包括: 获取单元, 用于获取第一设 备的近场通信标识 NFCID, 所述第一设备的 NFCID携带第一设备类型 /设备能 力 DT信息, 所述第一 DT信息用于指示所述第一设备支持的设备类型 /设备能 力; 提取单元, 用于从所述第一设备的 NFCID中提取所述第一 DT信息。
结合第三方面, 在一种实现方式中, 所述提取单元具体用于检测所述第一 设备的 NFCID的长度; 根据所述第一设备的 NFCID的长度, 提取所述第一设 备的 NFCID中的对应字节或比特作为所述第一 DT信息。
结合第三方面及其上述实现方式, 在另一种实现方式中, 所述提取单元具 体用于提取所述第一设备的 NFCID中的预定字节或比特作为所述第一 DT信息。
结合第三方面及其上述实现方式, 在另一种实现方式中, 所述获取单元具 体用于发送第一请求消息, 所述第一请求消息携带第二 DT信息, 所述第二 DT 信息用于指示所述近场通信设备要搜索的设备类型 /设备能力; 从确定第一 DT 信息匹配所述第二 DT信息的第一设备接收所述第一设备的 NFCID。
结合第三方面及其上述实现方式, 在另一种实现方式中, 所述获取单元具 体用于如果在接收所述第一设备的 NFCID时检测到冲突, 则确定有效的冲突比 特; 发送第二请求消息, 其中所述第二请求消息携带所述有效的冲突比特, 其 中,如果所述有效的冲突比特的数目 n小于所述第二 DT信息的比特数 m,则所 述第二请求消息还携带所述第二 DT信息的后面 m-n个比特, 其中 m和 n为正 整数。
第四方面, 提供了一种近场通信设备, 包括: 生成单元, 用于生成所述近 场通信设备的 NFCID, 其中所述近场通信设备的 NFCID携带第一设备类型 /设 备能力 DT信息,所述第一 DT信息用于指示所述近场通信设备支持的设备类型 /设备能力; 发送单元, 用于向第二设备发送所述近场通信设备的 NFCID。
结合第四方面, 在一种实现方式中, 所述生成单元具体用于在所述近场通 信设备的 NFCID中的预定字节或比特上填充所述第一 DT信息; 或者, 根据所 述近场通信设备的 NFCID的长度, 在所述近场通信设备的 NFCID中的对应字 节或比特上填充所述第一 DT信息。
结合第四方面及其上述实现方式, 在另一种实现方式中, 所述近场通信设 备还包括: 接收单元, 用于接收所述第二设备发送的第一请求消息, 所述第一 请求消息携带第二 DT信息,所述第二 DT信息用于指示所述第二设备要搜索的 设备类型 /设备能力; 确定单元, 用于确定所述 NFCID是否匹配所述第二 DT信 息; 所述发送单元具体用于在所述确定单元确定到所述 NFCID 匹配所述第二 DT信息时, 向所述第二设备发送所述近场通信设备的 NFCID。
结合第四方面及其上述实现方式, 在另一种实现方式中, 所述接收单元还 用于接收所述第二设备发送的第二请求消息, 所述第二请求消息携带所述第二 设备在接收所述第一设备的 NFCID时检测到冲突的情况下确定的有效的冲突比 特; 所述确定单元还用于根据所述有效的冲突比特和所述第一设备的 NFCID的 匹配结果, 确定是否再次向所述第二设备发送所述第一设备的 NFCID。
结合第四方面及其上述实现方式, 在另一种实现方式中, 所述有效的冲突 比特的数目为 n, n为正整数, 所述确定单元具体用于: 如果所述有效的冲突比 特与所述 NFCID的前 n比特不同, 则确定不再发送所述第一设备的 NFCID; 如 果所述有效的冲突比特与所述 NFCID的前 n比特相同且 n≥m, 则确定再次发送 所述第一设备的 NFCID , m为所述第二 DT信息的比特数; 如果所述有效的冲 突比特与所述 NFCID的前 n比特相同且 n<m, 则在所述有效的冲突比特之后的 m-n个比特与所述 NFCID的相应比特相同的情况下, 确定再次发送所述第一设 备的 NFCID; 如果所述有效的冲突比特与所述 NFCID的前 n比特相同且 n<m, 则在所述有效的冲突比特之后的 m-n个比特与所述 NFCID的相应比特不同的情 况下, 确定不再发送所述第一设备的 NFCID。
本发明实施例在 NFC设备的 NFCID 中携带该 NFC设备支持的设备类型 / 设备能力的信息, 从而可以通过 NFCID实现设备类型 /设备能力的交换或搜索。 附图说明
为了更清楚地说明本发明实施例的技术方案, 下面将对实施例或现有技术 描述中所需要使用的附图作筒单地介绍, 显而易见地, 下面描述中的附图仅仅 是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动 的前提下, 还可以根据这些附图获得其他的附图。
图 1是本发明一个实施例的近场通信方法的流程图。
图 2是本发明另一实施例的近场通信方法的流程图。
图 3是本发明一个实施例的近场通信过程的示意流程图。
图 4是本发明一个实施例的近场通信过程的示意流程图。
图 5是本发明一个实施例的主设备获取目标设备的 DT信息的示例流程图。 图 6是图 5的实施例中主设备和目标设备的消息交互的示意图。
图 7A和图 7B是本发明一个实施例的搜索支持特定设备类型的目标设备的 过程的示意流程图。
图 8是本发明一个实施例的搜索支持特定设备类型的目标设备的过程的示 意流程图。
图 9是图 7和图 8的实施例中主设备和目标设备的消息交互的示意图。 图 10是本发明一个实施例的获取设备类型的过程的示意流程图。
图 11是图 10的实施例中主设备和目标设备的消息交互的示意图。
图 12A和图 12B是本发明另一实施例的获取设备类型的过程的示意流程图。 图 13是图 12的实施例中主设备和目标设备的消息交互的示意图。
图 14是本发明另一实施例的搜索特定设备类型的目标设备的过程的示意流 程图。
图 15是本发明另一实施例的搜索特定设备类型的目标设备的过程的示意流 程图。
图 16是本发明一个实施例的 NFC设备的框图。
图 17是本发明另一实施例的 NFC设备的框图。
图 18是本发明另一实施例的 NFC设备的框图。
图 19是本发明另一实施例的 NFC设备的框图。 具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部 的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作出创造性劳 动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
一般而言,可以将 NFC设备划分为两个功能实体, DH ( Device Host,主机) 和 NFCC ( NFC controller )。 DH负责管理 NFC设备和外设 (包括 NFCC ) 的运 行环境, 如初始化、 配置、 电源管理等。 NFCC负责在 NFC射频接口上传送数 据。 NFCC可以通过单独的芯片实现, DH可以通过执行相应指令的处理器实现。 DH和 NFCC之间的逻辑接口称为 NCI ( NFC Controller Interface )。
图 1是本发明一个实施例的近场通信方法的流程图。 图 1的方法由 NFC设 备执行, 具体地, 由接收 NFCID的 NFC设备执行。
101 , 第二设备获取第一设备的 NFCID。 第一设备的 NFCID携带第一 DT ( Device Type, 设备类型 /设备能力)信息。 第一 DT信息用于指示第一设备支 持的设备类型 /设备能力。
第一设备和第二设备均为 NFC设备, 可以是近场通信过程中的主设备或目 标设备。 第一设备和第二设备可以按照主动或被动的模式工作。 第一设备是生 成和发送 NFCID的 NFC设备, 第二设备是接收 NFCID的 NFC设备。
102 , 第二设备从第一设备的 NFCID中提取第一 DT信息。
本发明实施例在 NFC设备的 NFCID 中携带该 NFC设备支持的设备类型 / 设备能力的信息, 从而可以通过 NFCID实现设备类型 /设备能力的交换或搜索。
图 1 的方法可以在设备发现流程的设备标识交换过程中执行, 或者在设备 搜索过程中执行。 下面还将结合具体实施例描述在不同的流程中执行图 1 的方 法的具体例子。
可选地, 作为一个实施例, 当在设备搜索过程中执行图 1 的方法时, 在步 骤 101中, 第二设备可发送第一请求消息, 该第一请求消息携带第二 DT信息, 第二 DT信息用于指示第二设备要搜索的设备类型 /设备能力。 第二设备从确定 第一 DT信息匹配第二 DT信息的第一设备接收第一设备的 NFCID。
在接收第一设备的 NFCID的过程中可能会产生冲突, 例如有多个设备同时 向第二设备反馈 NFCID。 可选地, 作为另一实施例, 如果第二设备在接收第一 设备的 NFCID时检测到冲突, 则确定有效的冲突比特; 然后第二设备发送第二 请求消息, 其中第二请求消息携带有效的冲突比特。 如果有效的冲突比特的数 目 n小于第二 DT信息的比特数 m,则第二请求消息还携带第二 DT信息的后面 m-n个比特, 其中 m和 n为正整数。
可选地, 作为另一实施例, 上述第一请求消息可以是单设备检测请求 SDD REQ消息或者探测请求消息 ATR— REQ.
第一请求消息可以隐式地或显式地指示该第一请求消息是否用于搜索特定 设备类型 /设备能力。 例如, 例如, 当 SDD— REQ 消息中的 SEL— PAR=20h且 SDD REQ消息的总长度大于 2字节时,可隐式地表示 SDD— REQ消息携带第二 DT信息。 或者例如, 可通过设置第一请求消息中的命令字段, 通过不同的命令 字段值来显式地表示不同类型的第一请求消息。如, ATR— REQ的 CMD1取特定 值(如 OCh ) 时表示 ATR— REQ携带第二 DT信息。
这样, 本发明实施例能够解决设备搜索过程中的冲突问题, 并且能够兼容 现有的冲突解决机制。
本发明实施例对 NFCID携带 DT信息的具体方式不作限制。 例如, NFCID 可以在 NFCID中的预定字节或比特上携带 DT信息。 此时, 在步骤 102中, 第 二设备提取第一设备的 NFCID中的预定字节或比特作为第一 DT信息。
再例如, NFCID携带 DT信息的字节或比特的位置可以根据 NFCID的长度 而变化。 此时, 在步骤 102中, 第二设备可检测第一设备的 NFCID的长度, 然 后第二设备根据第一设备的 NFCID的长度, 提取第一设备的 NFCID中的对应 字节或比特作为第一 DT信息。
图 2是本发明另一实施例的近场通信方法的流程图。 图 2的方法由 NFC设 备执行, 具体地, 由生成和发送 NFCID的 NFC设备执行。 图 2的方法与图 1 相对应, 为避免重复, 适当省略重复的描述。
201 , 第一设备生成第一设备的 NFCID , 其中第一设备的 NFCID携带第一 DT信息, 第一 DT信息用于指示第一设备支持的设备类型 /设备能力。
第一设备和第二设备均为 NFC设备, 可以是近场通信过程中的主设备或目 标设备。 第一设备和第二设备可以按照主动或被动的模式工作。 第一设备是生 成和发送 NFCID的 NFC设备, 第二设备是接收 NFCID的 NFC设备。
202 , 第一设备向第二设备发送第一设备的 NFCID。
本发明实施例在 NFC设备的 NFCID 中携带该 NFC设备支持的设备类型 / 设备能力的信息, 从而可以通过 NFCID实现设备类型 /设备能力的交换或搜索。
图 2 的方法可以在设备发现流程的设备标识交换过程中执行, 或者在设备 搜索过程中执行。 下面还将结合具体实施例描述在不同的流程中执行图 2 的方 法的具体例子。
本发明实施例对 NFCID携带 DT信息的具体方式不作限制。 可选地, 作为 一个实施例, NFCID可以在 NFCID中的预定字节或比特上携带 DT信息。此时, 在步骤 201中, 第一设备可在第一设备的 NFCID中的预定字节或比特上填充第 一 DT信息。 或者, NFCID携带 DT信息的字节或比特的位置可以根据 NFCID 的长度而变化。 此时, 在步骤 201中, 第一设备可根据第一设备的 NFCID的长 度, 在第一设备的 NFCID中的对应字节或比特上填充第一 DT信息。
可选地, 作为另一实施例, 当在设备搜索过程中执行图 2 的方法时, 第一 设备可接收第二设备发送的第一请求消息, 第一请求消息携带第二 DT信息,所 述第二 DT信息用于指示第二设备要搜索的设备类型 /设备能力。 第一设备确定 NFCID是否匹配第二 DT信息。 此时, 在步骤 202中, 在确定 NFCID匹配第二 DT信息时, 第一设备向第二设备发送第一设备的 NFCID。
需要说明的是, NFCID 匹配第二 DT信息, 是指第一设备支持的设备类型 涵盖了第二设备想要搜索的设备类型 /设备能力。 例如, 如果 DT信息使用集合 的方式来表示,则第二 DT信息是第一 DT信息的子集或者与第一 DT信息相同。 再例如, 如果 DT信息使用下面表 4的位图 (bitmap )的方式来表示, 则在第二 DT信息置为 "Γ 的比特上, 第一 DT信息的相应比特也置为 " Γ ; 但是在第二 DT信息置为 "0" 的比特上, 第一 DT信息的相应比特可以置为 " Γ 也可以置 为 "0"。
可选地, 作为另一实施例, 第一设备还可以接收第二设备发送的第二请求 消息, 第二请求消息携带第二设备在接收第一设备的 NFCID时检测到冲突的情 况下确定的有效的冲突比特。 第一设备根据有效的冲突比特和第一设备的 NFCID的匹配结果, 确定是否再次向第二设备发送第一设备的 NFCID。
具体地,假设有效的冲突比特的数目为 n, 第二 DT信息的比特数为 m。 m、 n为正整数。第一设备在根据有效的冲突比特和第一设备的 NFCID的匹配结果, 确定是否再次向第二设备发送第一设备的 NFCID 时, 如果有效的冲突比特与 NFCID的前 n比特不同, 则确定不再发送第一设备的 NFCID。 或者, 如果有效 的冲突比特与 NFCID 的前 n 比特相同且 n>m, 则确定再次发送第一设备的 NFCID。 或者, 如果有效的冲突比特与 NFCID的前 n比特相同且 n<m , 则在有 效的冲突比特之后的 m-n个比特与 NFCID的相应比特相同的情况下,确定再次 发送第一设备的 NFCID。 或者, 如果有效的冲突比特与 NFCID的前 n比特相同 且 n<m ,则在有效的冲突比特之后的 m-n个比特与 NFCID的 ^目应比特不同的'1"青 况下, 确定不再发送第一设备的 NFCID。
可选地, 作为另一实施例, 上述第一请求消息可以是单设备检测请求 SDD REQ消息或者探测请求消息 ATR— REQ。
第一请求消息可以隐式地或显式地指示该第一请求消息是否用于搜索特定 设备类型 /设备能力。 例如, 例如, 当 SDD— REQ 消息中的 SEL— PAR=20h且 SDD REQ消息的总长度大于 2字节时,可隐式地表示 SDD— REQ消息携带第二 DT信息。 或者例如, 可通过设置第一请求消息中的命令字段, 通过不同的命令 字段值来显式地表示不同类型的第一请求消息。如, ATR— REQ的 CMD1取特定 值(如 OCh ) 时表示 ATR— REQ携带第二 DT信息。
这样, 本发明实施例能够解决设备搜索过程中的冲突问题, 并且能够兼容 现有的冲突解决机制。
DT信息可以通过由 NFC设备 (主设备或目标设备 ) 的 DH向 NFC设备的 NFCC发送配置命令来配置。 该配置命令可携带 NFC设备支持的设备类型的信 息。例如,可以通过扩展现有的 CORE— SET— CONFIG— CMD实现上述配置命令。 也可以新增一个专用的配置命令。 本发明实施例对此不作限制。
NFC设备的 NFCC存储 DT信息。 这样, 能够实现 NFC设备中 DT信息的 配置。 例如, 配置 DT信息的方法可以在初始设置过程中执行, 或者在改变了设 备类型 /设备能力的情况下执行。
这样, 主设备的 DH能够根据目标设备的设备类型 /设备能力, 进行相应的 功能处理, 增强用户的应用体验。 例如, DH可启动与该设备类型匹配的应用程 序, 如当目标设备(如手机) 靠近打印机时, 手机的文件传输服务立刻启动; 或者, 当主设备(如手机) 靠近汽车驾驶室的 NFC模块(目标设备), 立刻启 动蓝牙耳机的配对, 或者立刻启动收集汽车参数的应用程序。
应注意, 本发明实施例对 "存储,, 操作的具体形式不作限制, 可以是长期 的静态存储, 也可以是短期存储, 如緩存等。
另外, 通过已启动的应用程序来搜索匹配的设备, 可以过滤掉无关设备。 例如, 如果主设备(如手机)开启了音乐播放器, 则只有具有扬声器功能的目 标设备才会对设备进行响应。 或者, 如果主设备(如手机)开启了打印应用程 序, 只有具有打印功能的目标设备才能响应。
上面的例子仅仅是为了帮助本领域技术人员理解本发明实施例的可能的应 用场景, 而本发明实施例对设备类型的具体应用方式不作限制。
下面结合具体例子, 更加详细地描述本发明实施例的 DT信息。 应注意, 以 的范围。
DT信息可以表示设备类型。 表 1为设备类型的描述的一个例子。 一个 NFC 设备可以属于多个分类, 即可以同时支持多种设备类型。
表 1 设备类型的例子
Figure imgf000014_0001
本发明实施例中, DT信息还可以表示设备能力。 表 2为设备能力描述的- 个例子。 一个 NFC设备可以属于多个分类, 即可以同时支持多种设备能力。
Figure imgf000014_0002
在下文中, 以表 1的 DT信息为例进行描述,但本发明实施例可以类似地应 用于表 2的 DT信息, 这样的应用也落入本发明实施例的范围内。
表 3 是本发明实施例的设备类型数据格式的例子。 本发明实施例增加了设 备类型参数" DEVICE_TYPE", 具体定义如表 3所示, 长度为 2字节(byte )。 但 是本发明实施例对设备类型参数的具体长度不作限制。
表 3设备类型参数" DEVICE TYPE"的例子 类型 02h
长度 02h
格式 见表 4
表 4是本发明一个实施例的设备类型参数" DEVICE— TYPE"的格式的一个例 子, 其中 h表示十六进制。 在表 34例子中, 设备类型参数 "DEVICE_TYPE,,使 用位图( bitmap )的编码格式,但本发明实施例对设备类型参数的格式不作限制。 应注意, 在本发明实施例的各个表中, 按照倒序的方式排列各个字节的各个比 特。
表 4设备类型参数的编码格式的例子
Figure imgf000015_0001
如表 4所示, 一个 NFC设备可以支持多个设备类型 (或者说设备能力)。 如设备具有视频、 显示的能力, 那么在第一个字节的 b2和 b3设置为 1。 表 3中 "X"表示预留比特。
表 5是本发明一个实施例的 NFCID携带 DT信息的例子。
表 5 NFCID的例子
NFCID 长度 DT信息的字节 4字节 NFCID11, NFCID12
NFCID1 7字节或 10字节 NFCID10, NFCID11 (NFC-A) 或
NFCID11, NFCID12
NFCID2 (NFC-F) 8字节 任意 两个连续 的
NFCID2x
NFCID可以在 NFCID中的预定字节或比特上携带 DT信息。 例如, 如表 5 所示, NFC-F类型下的设备标识被表示为 NFCID2 , 长度为 8字节, 则可以使用 该 8字节 NFCID2中的预定的任意两个连续的字节 NFCID2x携带 DT信息, 其 中 "X" 表示 NFCID2中的字节的相应序号, 取值范围为 0-7中的预定的任意两 个连续的整数。 此时, NFC设备可以从接收到的 NFCID中提取预定的两个字节 作为 DT信息, 或者在生成 NFCID时在预定的两个字节中填充 DT信息。
NFCID携带 DT信息的字节或比特的位置可以根据 NFCID的长度而变化。 例如, NFC-A类型下的设备标识被表示为 NFCID 1 , 长度可能为 4字节、 7字节 或 10字节。 在表 5的例子中, 如果 NFCID1的长度为 4字节, 可使用 NFCID1 中的 NFCID11和 NFCID12两个字节携带 DT信息。 如果 NFCID1的长度为 7 字节或 10字节, 可使用 NFCID1 中的 NFCID10和 NFCID11两个字节携带 DT 信息,或者使用 NFCID1中的 NFCID11和 NFCID12两个字节携带 DT信息。其 中, NFCID10表示 NFCID1的第一个字节, NFCID11表示 NFCID1的第二个字 节, NFCID12表示 NFCID1的第三个字节。
表 5中所描述的字节仅仅是 NFCID携带 DT信息的一个例子, 本发明实施 例对 NFCID中 DT信息的具体位置不作限制,例如也可以是不连续的两个字节, 或者可以是其他字节。
图 3是本发明一个实施例的近场通信过程的示意流程图。 图 3的实施例中, 相同的步骤使用相同的附图标记。 图 3 的实施例是用于交换设备类型的过程中 配置设备类型和上报设备类型的方法。
301 : DH向 NFCC发送配置命令 CORE— SET— CONFIG— CMD , 该命令用于 配置 NFCC的相关参数。
与现有 的配置命令不 同 的是, 本发明 实施例 的 配置命令 CORE— SET— CONFIG— CMD包含了要配置的设备类型。
例如, 步骤 301 可以在初始设置过程中执行, 或者在改变了设备类型的情 况下执行。
302 : NFCC 收 到 配 置 命令后 , 向 DH 反馈 响 应 消 息 CORE— SET— CONFIG— RSP, 用于指示配置是否成功。
步骤 301和 302是配置设备类型的过程。 该过程不必再每次启动发现过程 之前均需执行, 而只需在初始设置时执行即可, 或者在设备类型的配置发生变 化时执行。 因此, 步骤 301和 302是可选的过程。
303: DH向 NFCC发送 RF— DISCOVER— CMD命令, 触发 NFCC启动设备 的发现过程。
304: NFCC向 DH反馈响应消息, 用于指示设备发现过程正在进行; 305: 主设备和目标设备之间执行用于交换设备类型的发现过程。
306: 当主设备的 NFCC发现周围的目标设备后, 会向 DH发送射频发现通 知消息 RF— DISCOVER— NTF, 用于通告发现结果。 与现有的射频发现通知消息 不同, 本发明实施例的射频发现通知消息 RF— DISCOVER— NTF包括该目标设备 的设备类型。
同样的, 当目标设备的 NFCC发现周围的主设备后, 会向 DH发送射频发 现通知消息 RF— DISCOVER— NTF, 用于通告发现结果。 与现有的射频发现通知 消息不同, 本发明实施例的射频发现通知消息 RF— DISCOVER— NTF包括主设备 的设备类型。
例如, 可以在 RF— DISCOVER— NTF消息中增加 "Device Type" (设备类型) 字段, 携带表 3所示的设备类型参数。
图 4是本发明一个实施例的近场通信过程的示意流程图。 图 4的实施例中, 相同的步骤使用相同的附图标记。 图 4 的实施例是用于搜索设备类型的过程中 配置设备类型和上报设备类型的方法。
应注意, 在图 4 的实施例中, 在搜索设备类型的同时, 也执行设备类型的 交换, 但本发明实施例不限于此。 例如, 在不执行设备类型的交换的情况下, 目标设备的步骤 406可以省略。
步骤 401-402和图 3的步骤 301-302相同, 因此省略重复的描述。
403: DH向 NFCC发送 RF— DISCOVER— CMD命令, 其中包括要搜索的设 备类型, 触发 NFCC启动设备的发现过程。
404: NFCC向 DH反馈响应消息, 用于指示设备发现过程正在进行。
405: 主设备和目标设备之间执行用于搜索设备类型的发现过程。 步骤 406和图 3的步骤 306相同, 因此省略重复的描述。
下面结合图 5-图 9描述在 NFC-A被动通信过程中, 主设备通过标识交换或 例。
图 5是本发明一个实施例的主设备获取目标设备的 DT信息的示例流程图。 图 5的方法由主设备执行。
501 : 主设备向目标设备发送 SENS— REQ (探测请求 )消息, 用于探测周围 目标设备。
502: 目标设备收到 SENS— REQ后, 将会向主设备反馈 SENS— RES (探测 响应 ) 消息。
503: 主设备启动单设备检测 (SDD )过程。
504: 主设备获取所有目标设备的 NFCID1。
505: 主设备检测目标设备 NFCID 1的长度是否为 4字节。
506: 如果在步骤 505中确定 NFCID1 的长度为 4字节, 则存储 NFCIDl l 和 NFCID12作为设备类型。
在图 5以及后面的实施例中,当 NFCID1的长度为 4字节时,提取 NFCIDl l 和 NFCID12作为 DT信息, 但本发明实施例对此不作限制。 例如, 也可以按照 其他配置, 提取对应的字节或比特作为 DT信息。
507: 如果在步骤 505中确定 NFCID1的长度不是 4字节, 即 NFCID1的长 度是 7字节或 10字节, 则存储 NFCIDIO和 NFCIDl l作为设备类型。
在图 5以及后面的实施例中, 当 NFCID1 的长度为 7或 10字节时, 提取 NFCIDIO和 NFCIDl l作为 DT信息, 但本发明实施例对此不作限制。 例如, 也 可以如表 5所示,提取 NFCIDl l和 NFCID12作为 DT信息,或者按照其他配置, 提取对应的字节或比特作为 DT信息。
508: 主设备验证设备类型是否有效。 如果设备类型有效, 执行步骤 509, 如果设备类型无效, 则执行步骤 510。
509: 主设备的 NFCC向主设备的 DH通告发现目标设备, 并携带该目标设 备的设备类型。
510: 将该设备类型设置为 "未知", 然后执行步骤 509。
511 : 主设备判断是否继续检测, 如果继续, 则执行步骤 503 , 否则结束。 这样, 能够通过 NFCID实现设备类型的交换。 图 6是图 5的实施例中主设备和目标设备的消息交互的示意图。 图 6中各 个消息的定义可参照图 3-图 5的实施例, 因此不再重复描述。
图 7A和图 7B是本发明一个实施例的搜索支持特定设备类型的目标设备的 过程的示意流程图。 图 7A-7B的方法由主设备执行。
701 :主设备在发送 SENS— REQ并接收到从目标设备反馈回来的 SENS— RES 消息之后, 选择级联等级 1。
702: 主设备判断是否需要搜索特定设备类型的目标设备。 如果判断为是, 则执行步骤 703; 如果判断为否, 则执行步骤 704。
703: 主设备发送 SDD REQ 消息, 其中 SEL— PAR=20h, 并且 SDD— REQ 消息中的 SEL— PAR字段后还包括 3个字节, 这 3个字节携带第二 DT信息, 即 表示主设备要搜索的设备类型。
3个字节的第二 DT信息只是一个例子, 本发明实施例的第二 DT信息的长 度不限于 3个字节。
需要说明的是, SDD— REQ消息帧至少包含一个字节的 SEL— CMD字段和一 个字节的 SEL— PAR字段。 按照现有协议, 如果将 SEL— PAR的十六进制值表示 为 ij , i、 j为正整数, 则表示 SDD— REQ消息中 SEL— PAR之后跟随了(i-2)x8+j 个有效冲突比特。
目标设备发现 SDD— REQ消息帧的实际长度大于 SEL— PAR指示的长度,可 理解为 SDD— REQ消息携带了第二 DT信息,用于搜索特定设备类型。在本例中, SDD REQ消息帧为 5个字节, 但 SEL— PAR的值为 20h (指示 SDD— REQ长度 为 2个字节且不携带有效冲突比特),目标设备可以理解为 SEL— PAR字段后的 3 个字节是第二 DT信息, 而不是有效的冲突比特。
704: 主设备发送 SDD REQ消息, 其中 SEL— PAR=20h, 并且 SEL— PAR后 不携带任何比特。 这是符合现有协议的 SDD— REQ消息。
705: 主设备检测是否有任何冲突。 如有冲突, 则执行步骤 706, 否则执行 步骤 713。
706: 主设备确定有效的冲突比特。
707: 主设备判断是否需要搜索特定设备类型的目标设备。 如果是, 则执行 步骤 708, 否则执行步骤 710。
708: 主设备检查级联等级是否为 1。 如果是, 则执行步骤 709 , 否则结束。 709: 主设备判断有效的冲突比特数(假设为 n )是否大于或等于第二 DT 信息的长度(3字节)。 如果是, 则执行步骤 710, 否则执行步骤 711。
710:发送 SDD— REQ消息, SDD— REQ消息的 SEL— PAR字段之后包含有效 冲突比特。 这是符合现有协议的用于冲突解决的 SDD— REQ消息。
711 : 发送 SDD— REQ消息, 有效冲突比特被包含在 SEL PAR字段后的 3 字节中。 具体地, SEL— PAR字段后的 3字节中, 首先填充 n个有效冲突比特, 后面的剩余比特仍然使用步骤 703中第二 DT信息的相应比特。换句话说,使用 有效冲突比特覆盖第二 DT信息中的前面 n个比特。
712: 主设备检测接收到的 SDD— RES (单设备检测响应) 消息是否发生冲 突。 如果发生, 则执行步骤 706; 否则执行步骤 713。
713: 主设备判断得到的 NFCID1是否已经完整。 如果是, 则执行步骤 715。 否则, 执行步骤 714。
714, 增加级联等级, 然后执行步骤 704。
715-720与图 5的 505-510相同, 因此不再赘述。
721 : 主设备判断是否继续检测, 如果继续, 则执行步骤 701 , 否则结束。 这样, 主设备能够搜索支持特定设备类型的目标设备, 并且能够解决多个 目标设备的反馈冲突问题, 同时能够兼容现有的冲突解决机制。
图 8是本发明一个实施例的搜索支持特定设备类型的目标设备的过程的示 意流程图。 图 8的方法由目标设备执行。
801 : 目标设备收到 SDD— REQ消息。
如果目标设备发现 SDD— REQ 消息帧的实际长度大于 SEL— PAR指示的长 度, 则可理解为 SDD— REQ消息携带了第二 DT信息, 用于搜索特定设备类型。
例如, 参照图 7的例子, 步骤 703中发送的 SDD— REQ消息帧为 5个字节, 但 SEL— PAR的值为 20h (指示 SDD— REQ长度为 2个字节且不携带有效冲突比 特), 目标设备可以理解为 SEL— PAR字段后的 3个字节是第二 DT信息, 而不 是有效的冲突比特。 在此情况下, 目标设备检测自己的 NFCID 是否匹配第二 DT信息, 并在匹配的情况下向主设备发送 SDD— RES消息, 该 SDD— RES消息 携带目标设备的 NFCID1。
如果 SEL— PAR的值不为 20h, 且 SDD— REQ消息中 SEL— PAR的值所表示 的比特数比 20h表示的比特数(即 2字节 =16比特)大 n个比特,则表示 SEL— PAR 字段之后的 n个比特为有效的冲突比特, 此时执行步骤 802。
802: 目标设备检测 SDD— REQ消息中 SEL— PAR字段后的前 n个比特是否 与自己的 NFCID 1的前 n个比特相匹配。 如果是, 则执行步骤 803; 否则结束。
803: 目标设备检测 SDD— REQ消息的 SEL— PAR是否小于 50h。 如果是, 则 执行步骤 804; 否则执行步骤 805。
SEL PAR大于或等于 50h,表示 SEL— PAR字段之后仅携带有效的冲突比特, 而不携带第二 DT信息的任何比特。
SEL PAR小于 50h, 表示 SEL— PAR字段之后携带 n比特的有效冲突比特, 而有效冲突比特之后还携带非有效冲突比特。 具体地, 该非有效冲突比特为第 二 DT信息的后面 24-n个比特,这里 24是第二 DT信息的比特数(等于 3字节)。
804: 目标设备判断自己的设备类型是否与 SDD— REQ 消息中的 SEL— PAR 字段后的非有效冲突比特匹配。 如果匹配, 则执行步骤 805; 否则结束。
805: 目标设备返回 SDD— RES消息, 用于响应 SDD— REQ。
SDD— RES消息中携带目标设备的 NFCID 1。
这样, 主设备能够搜索支持特定设备类型的目标设备, 并且能够解决多个 目标设备的反馈冲突问题。
图 9是图 7和图 8的实施例中主设备和目标设备的消息交互的示意图。图 9 中各个消息的定义可参照图 3-4以及图 7-8的实施例, 因此不再重复描述。
下面结合图 10-11描述 NFC-F被动通信模式下获取设备类型的实施例。 图 10是本发明一个实施例的获取设备类型的过程的示意流程图。 图 10的 方法由主设备执行。 在图 10 的实施例中, 4叚设使用两个字节 NFCID20 和 NFCID21 (即 NFCID2的第一个字节和第二个字节 )携带 DT信息, 但是本发明 实施例对 NFCID2携带 DT信息的字节或比特不作限制。
1001 : 主设备向目标设备发送 SENSF— REQ (探测请求 )消息, 用于探测周 围目标设备。
1002: 主设备接收从目标设备反馈回来的 SENSF— RES (探测响应) 消息。 1003: 主设备执行单设备检测。
1004: 主设备获取目标设备的 NFCID2 , 并将 NFCID20和 NFCID21作为设 备类型。
1005: 主设备检测设备类型是否有效, 如果有效执行步骤 1006, 无效则设 置该设备类型为 "未知", 然后执行步骤 1006。
1006: 主设备的 NFCC向 DH通告目标设备的设备类型。
1007: 主设备判断是否继续进行目标设备的解析, 如果是, 执行步骤 1003 , 否则结束。
这样, 能够通过 NFCID实现设备类型的交换。
图 11是图 10的实施例中主设备和目标设备的消息交互的示意图。 图 11中 各个消息的定义可参照图 3-4以及图 10的实施例, 因此不再重复描述。
下面结合图 12-15描述主动通信模式下获取设备类型的实施例。
图 12A和图 12B是本发明另一实施例的获取设备类型的过程的示意流程图。 图 12A-B的方法由主设备执行, 目标设备的操作与主设备相对应。
1201 : 主设备检测自己的配置信息, 确定是否支持 NFC-A技术。 如果支持 NFC-A技术, 则执行步骤 1202 , 否则执行步骤 1205。
1202: 主设备判断 NFCID (此时表示为 NFCIDl ) 的长度是否为 4字节。 如果 NFCIDl长度为 4字节, 则执行步骤 1203; 否则执行步骤 1204。
1203: NFCIDl长度为 4字节, 设置 NFCID11和 NFCID12为设备类型。
1204: NFCIDl长度为 7字节或 10字节, 设置 NFCID10和 NFCID11为设 备类型。
1205: 主设备判断是否支持 NFC-F技术。 如果支持 NFC-F技术, 则执行步 骤 1206, 否则结束。
1206: 主设备设置 NFCID (此时表示为 NFCID2 )的 NFCID20和 NFCID21 作为设备类型。
1207: 主设备向目标设备发送 ATR— REQ (探测请求) 消息, 用于探测周 围目标设备并请求获取目标设备参数。
1208: 目标设备收到 ATR— REQ消息后, 向主设备响应 ATR— RES (探测响 应) 消息。
主设备重复步骤 1201-1208, 直到收到所有的目标设备的响应。
1209: 主设备检测 ATR— RES中的 NFCID值, 确定是否支持 NFC-A技术。 如果支持 NFC-A技术, 则执行步骤 1210, 否则执行步骤 1213。
1210: 主设备判断 NFCID (此时表示为 NFCIDl ) 的长度是否为 4字节。 如果是, 则执行步骤 1211 , 否则执行步骤 1212。
1211 : NFCIDl长度为 4字节, 获取 NFCIDl 1和 NFCID12为设备类型。 1212: NFCIDl长度为 7字节或 10字节, 获取 NFCID10和 NFCID11为设 备类型。
1213:判断是否支持 NFC-F技术。如果支持 NFC-F技术,则执行步骤 1214, 否则执行步骤 1207。
1214: 获取 NFCID20和 NFCID21作为设备类型。
1215: 主设备存储所获取的设备类型。
1216: 主设备检测设备类型是否有效, 如果有效执行步骤 1217, 无效则执 行步骤 1218。
1217: 主设备的 NFCC向 DH通告目标设备的设备类型。
1218: 设置该设备类型为 "未知", 然后执行步骤 1217。
1219: 主设备判断是否继续进行目标设备的解析, 如果是, 执行步骤 1207, 否则结束。
这样, 能够通过 NFCID实现设备类型的交换。
图 13是图 12的实施例中主设备和目标设备的消息交互的示意图。 图 13中 各个消息的定义可参照图 3-4以及图 12的实施例, 因此不再重复描述。
图 14是本发明另一实施例的搜索特定设备类型的目标设备的过程的示意流 程图。 图 14的方法由主设备执行。
1401 : 主设备设置 ATR— REQ消息中的 CMD1 (命令)字段为 OCh, 表示该
ATR REQ消息用于搜索特定设备类型的目标设备。
1402: 主设备在 ATR— REQ消息中的 NFCID字段设置前两个字节为要搜索 的设备类型。
1403: 主设备向目标设备发送 ATR— REQ , 用于探测周围目标设备并请求 获取目标设备参数。
1404: 主设备接收从目标设备反馈回来的 ATR— RES消息;
1405 : 主设备检测接收到的 ATR— RES 消息中的 NFCID , 确定是否支持 NFC-A技术。 如果支持 NFC-A技术, 则执行步骤 1406, 否则执行步骤 1409。
1406: 主设备判断 NFCID (此时表示为 NFCIDl ) 的长度是否为 4字节。 如果是, 则执行步骤 1407, 否则执行步骤 1408。
1407: NFCIDl长度为 4字节, 获取 NFCID 11和 NFCID 12为设备类型。 1408: NFCIDl长度为 7字节或 10字节, 获取 NFCID10和 NFCID11为设 备类型。
1409:判断是否支持 NFC-F技术。如果支持 NFC-F技术,则执行步骤 1410, 否则执行步骤 1403。
1410: 获取 NFCID20和 NFCID21作为设备类型。 1411 : 主设备存储所获取的设备类型。
1412: 主设备检测设备类型是否有效, 如果有效执行步骤 1413 , 无效则执 行步骤 1414。
1413: 主设备的 NFCC向 DH通告目标设备的设备类型。
1414: 设置该设备类型为 "未知", 然后执行步骤 1413。
1415: 主设备判断是否继续进行目标设备的解析, 如果是, 执行步骤 1403 , 否则结束。
这样, 能够实现特定设备类型的搜索。
图 15是本发明另一实施例的搜索特定设备类型的目标设备的过程的示意流 程图。 图 15的方法由目标设备执行, 并且与图 14的方法相对应。
1501 : 目标设备收到 ATR— REQ消息。
1502: 目标设备检测 ATR— REQ消息中的 CMD1的值。 如果 CMDl=00h, 执行步骤 1505; 如果 CMDl=0Ch, 执行步骤 1503。
1503: 目标设备从 ATR REQ消息中的 NFCID字段获取前两个字节。
1504: 目标设备判断这两个字节与自己的设备类型是否匹配。 如果匹配, 执行步骤 1505; 否则结束。
1505: 目标设备向主设备发送 ATR— RES消息。
这样, 能够实现特定设备类型的搜索。
利用 NFCID中的两个字节表示设备类型, 能够在最大程度上重用目前的帧 格式及通信架构, 在 NFC-A, NFC-F被动通信模式, 及主动通信模式下实现设 备类型的获取及搜索特定设备类型目标设备。
下面, 描述本发明实施例的 NFC设备的实施例。
图 16是本发明一个实施例的 NFC设备的框图。图 16的 NFC设备包括获取 单元 161和提取单元 162。
获取单元 161获取第一设备的 NFCID , 第一设备的 NFCID携带第一 DT信 息, 第一 DT信息用于指示第一设备支持的设备类型 /设备能力。 提取单元, 用 于从第一设备的 NFCID中提取第一 DT信息。
本发明实施例在 NFC设备的 NFCID 中携带该 NFC设备支持的设备类型 / 设备能力的信息, 从而可以通过 NFCID实现设备类型的交换或搜索。
NFC设备 160可执行上述方法实施例中有关接收 NFCID的设备的各个过 程, 实现设备类型 /设备能力的交换或搜索。 为避免重复, 不再详细描述。 可选地,作为一个实施例,提取单元 162可检测第一设备的 NFCID的长度; 根据第一设备的 NFCID的长度, 提取第一设备的 NFCID中的对应字节或比特 作为第一 DT信息。 例如, 按照表 5 中 NFC-A模式下的 NFCID1 的例子, 当 NFCID 1的长度为 4字节时,可提取对应的字节 NFCID 11和 NFCID 12作为第一 DT信息;或者,当 NFCID1的长度为 7或 10字节时,可提取对应的字节 NFCID10 和 NFCID11 , 或者对应的字节 NFCID11和 NFCID12 , 作为第一 DT信息。
可选地, 作为另一实施例, 提取单元 162可提取第一设备的 NFCID中的预 定字节或比特作为第一 DT信息。 例如, 按照表 5中 NFC-F模式下的 NFCID2 的例子, 可以提取 NFCID2中预定的任意两个连续的 NFCID2x作为第一 DT信 息, 如图 10的实施例中的 NFCID20和 NFCID21。
可选地, 作为另一实施例, 获取单元 161 可发送第一请求消息, 第一请求 消息携带第二 DT信息, 第二 DT信息用于指示 NFC设备 160要搜索的设备类 型 /设备能力。 从确定第一 DT信息匹配第二 DT信息的第一设备接收第一设备 的 NFCID。
可选地, 作为另一实施例, 如果在接收所述第一设备的 NFCID时检测到冲 突, 则获取单元 161可确定有效的冲突比特。 获取单元 161可发送第二请求消 息, 其中第二请求消息携带有效的冲突比特。 如果有效的冲突比特的数目 n小 于第二 DT信息的比特数 m, 则第二请求消息还携带第二 DT信息的后面 m-n 个比特, 其中 m和 n为正整数。
可选地, 作为另一实施例, 第一请求消息为单设备检测请求 SDD— REQ 消 息或者探测请求消息 ATR— REQ。
图 17是本发明另一实施例的 NFC设备的框图。图 17的 NFC设备 170包括 生成单元 171和发送单元 172。
生成单元 171生成 NFC设备 170的 NFCID , 其中 NFC设备 170的 NFCID 携带第一 DT信息, 第一 DT信息用于指示 NFC设备 170支持的设备类型 /设备 能力。 发送单元, 向第二设备发送 NFC设备 170的 NFCID。
本发明实施例在 NFC设备的 NFCID 中携带该 NFC设备支持的设备类型 / 设备能力的信息, 从而可以通过 NFCID实现设备类型的交换或搜索。
NFC设备 170可执行上述方法实施例中有关生成和发送 NFCID的设备的各 个过程, 实现设备类型 /设备能力的交换或搜索。 为避免重复, 不再详细描述。
可选地, 作为一个实施例, 生成单元 171可以在 NFC设备 170的 NFCID 中的预定字节或比特上填充第一 DT信息; 或者, 根据 NFC设备 170的 NFCID 的长度, 在 NFC设备 170的 NFCID中的对应字节或比特上填充第一 DT信息。
可选地, 作为另一实施例, NFC设备 170还包括接收单元 173和确定单元
174。
接收单元 173接收第二设备发送的第一请求消息, 第一请求消息携带第二 DT信息, 第二 DT信息用于指示第二设备要搜索的设备类型 /设备能力。 确定单 元 174确定 NFCID是否匹配第二 DT信息。 发送单元 172在确定单元 174确定 NFCID匹配第二 DT信息时, 向第二设备发送 NFC设备 170的 NFCID。
可选地, 作为另一实施例, 接收单元 173还可以接收第二设备发送的第二 请求消息, 第二请求消息携带第二设备在接收第一设备的 NFCID时检测到冲突 的情况下确定的有效的冲突比特。 确定单元 174还可以根据有效的冲突比特和 第一设备的 NFCID 的匹配结果, 确定是否再次向第二设备发送第一设备的 NFCID。
可选地, 作为另一实施例, 有效的冲突比特的数目为 n, n为正整数。 如果 所述有效的冲突比特与 NFCID的前 n比特不同, 则确定单元 174可确定不再发 送第一设备的 NFCID; 如果有效的冲突比特与 NFCID的前 n比特相同且 n≥m , 则确定单元 174可确定再次发送第一设备的 NFCID , m为第二 DT信息的比特 数; 如果有效的冲突比特与 NFCID的前 n比特相同且 n<m, 则在有效的冲突比 特之后的 m-n个比特与 NFCID的相应比特相同的情况下, 则确定单元 174可确 定再次发送第一设备的 NFCID;如果有效的冲突比特与 NFCID的前 n比特相同 且 n<m ,则在有效的冲突比特之后的 m-n个比特与 NFCID的 ^目应比特不同的'1"青 况下, 则确定单元 174可确定不再发送第一设备的 NFCID。
可选地, 作为另一实施例, 第一请求消息为单设备检测请求 SDD— REQ 消 息或者探测请求消息 ATR— REQ。
图 18是本发明另一实施例的 NFC设备的框图。图 18的 NFC设备 180包括
NFCC 183。 NFCC 183包括发射电路 1831、 接收电路 1832、 天线 1833、 处理器 1834和存储器 1835。
存储器 1835存储使得处理器 1834执行以下操作的指令: 获取第一设备的 NFCID, 第一设备的 NFCID携带第一 DT信息, 第一 DT信息用于指示第一设 备支持的设备类型 /设备能力, 并从第一设备的 NFCID中提取第一 DT信息。
本发明实施例在 NFC设备的 NFCID 中携带该 NFC设备支持的设备类型 / 设备能力的信息, 从而可以通过 NFCID实现设备类型 /设备能力的交换或搜索。 NFC设备 180可执行上述方法实施例中有关接收 NFCID的设备的各个过 程, 实现设备类型 /设备能力的交换或搜索。 为避免重复, 不再详细描述。
如图 18所示, NFC设备 180还包括处理器 181和存储器 182。 存储器 182 存储使得处理器 181实现对 NFCC 183的控制的指令。 这样, NFCC 183在处理 器 181的控制之下实现上述功能。 换句话说, 处理器 181实现 NFC设备 180中 的主机(DH ) 的功能。
NFC设备 180的处理器 181、 存储器 182和 NFCC 183通过总线系统 189 耦合在一起, 其中总线系统 189 除包括数据总线之外, 还可以包括电源总线、 控制总线和状态信号总线等。 但是为了清楚说明起见, 在图中将各种总线都标 为总线系统 189。 DH和 NFCC之间的逻辑接口 NCI可通过总线系统 189实现。
处理器 181从总体上控制 NFC设备 180的操作, 处理器 181可以是 CPU ( Central Processing Unit, 中央处理单元)。 处理器 181还可以是其他通用处理 器、数字信号处理器( DSP )、专用集成电路( ASIC )、现成可编程门阵列( FPGA ) 或者其他可编程逻辑器件、 分立门或者晶体管逻辑器件、 分立硬件组件等。 通 用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器 182可以包括只读存储器和随机存取存储器, 并向处理器 181提供 指令和数据。 存储器 182的一部分还可以包括非易失性随机存取存储器。 例如, 存储器 182还可以存储设备类型的信息。
NFCC 183可以实现为单独的芯片, 发射电路 1831、 接收电路 1832和天线 1833实现 NFCC 183的射频接口。 发射电路 1831和接收电路 1832通过内部连 接 1839耦合到天线 1833。 本发明实施例对内部连接 1839的形式不作限制, 可 以是内部总线或内部电路等。
可选地, 在一个实施例中, 发射电路 1831和接收电路 1832可以由一套电 路实现, 通过双工模式实现发射和接收功能。
NFCC 183的处理器 1834和存储器 1835的功能也可以分别由处理器 181和 存储器 182负责。这样 NFCC 183中可以去除处理器 1834和存储器 1835。例如, 存储器 182 可存储使得处理器 181 执行以下操作的指令: 获取第一设备的 NFCID, 第一设备的 NFCID携带第一 DT信息, 第一 DT信息用于指示第一设 备支持的设备类型 /设备能力, 并从第一设备的 NFCID中提取第一 DT信息。
在实现过程中, 上述方法的各步骤可以通过处理器 181或 1834中的硬件的 集成逻辑电路或者软件形式的指令完成。 结合本发明实施例所公开的方法的步 骤可以直接体现为硬件处理器执行完成, 或者用处理器中的硬件及软件模块组 合执行完成。 软件模块可以位于随机存储器, 闪存、 只读存储器, 可编程只读 存储器或者电可擦写可编程存储器、 寄存器等本领域成熟的存储介质中。 该存 储介质位于存储器 182或 1835 , 处理器 181或 1834读取存储器 182或 1835中 的信息, 结合其硬件完成上述方法的步骤。 为避免重复, 这里不再详细描述。
可选地, 作为一个实施例, 处理器 181或 1834可检测第一设备的 NFCID 的长度; 根据第一设备的 NFCID的长度, 提取第一设备的 NFCID中的对应字 节或比特作为第一 DT信息。 例如, 按照表 5中 NFC-A模式下的 NFCID 1的例 子, 当 NFCID 1的长度为 4字节时, 可提取对应的字节 NFCID 11和 NFCID 12 作为第一 DT信息; 或者, 当 NFCID1的长度为 7或 10字节时, 可提取对应的 字节 NFCID10和 NFCID11 , 或者对应的字节 NFCID11和 NFCID12 , 作为第一 DT信息。
可选地, 作为另一实施例, 处理器 181或 1834可提取第一设备的 NFCID 中的预定字节或比特作为第一 DT信息。 例如, 按照表 5 中 NFC-F模式下的 NFCID2的例子, 可以提取 NFCID2中预定的任意两个连续的 NFCID2x作为第 一 DT信息, 如图 10的实施例中的 NFCID20和 NFCID21。
可选地, 作为另一实施例, 发射电路 1831可通过天线 1833发送第一请求 消息, 第一请求消息携带第二 DT信息, 第二 DT信息用于指示 NFC设备 180 要搜索的设备类型 /设备能力。 接收电路 1832可通过天线 1833从确定第一 DT 信息匹配第二 DT信息的第一设备接收第一设备的 NFCID。
可选地, 作为另一实施例, 如果在接收第一设备的 NFCID时检测到冲突, 则处理器 181或 1834可确定有效的冲突比特。 发射电路 1831可通过天线 1833 发送第二请求消息, 其中第二请求消息携带有效的冲突比特。 如果有效的冲突 比特的数目 n小于第二 DT信息的比特数 m,则第二请求消息还携带第二 DT信 息的后面 m-n个比特, 其中 m和 n为正整数。
可选地, 作为另一实施例, 第一请求消息为单设备检测请求 SDD— REQ 消 息或者探测请求消息 ATR— REQ。
图 19是本发明另一实施例的 NFC设备的框图。图 19的 NFC设备 190包括 NFCC 193。 NFCC 193包括发射电路 1931、 接收电路 1932、 天线 1933、 处理器 1934和存储器 1935。 存储器 1935存储使得处理器 1934执行以下操作的指令:生成 NFC设备 190 的 NFCID,其中 NFC设备 190的 NFCID携带第一 DT信息,第一 DT信息用于 指示 NFC设备 190支持的设备类型 /设备能力。发射电路 1931通过天线 1933向 第二设备发送 NFC设备 190的 NFCID。
本发明实施例在 NFC设备的 NFCID 中携带该 NFC设备支持的设备类型 / 设备能力的信息, 从而可以通过 NFCID实现设备类型 /设备能力的交换或搜索。
NFC设备 190可执行上述方法实施例中有关生成和发送 NFCID的设备的各 个过程, 实现设备类型 /设备能力的交换或搜索。 为避免重复, 不再详细描述。
如图 19所示, NFC设备 190还包括处理器 191和存储器 192。 存储器 192 存储使得处理器 191实现对 NFCC 193的控制的指令。 这样, NFCC 193在处理 器 191的控制之下实现上述功能。 换句话说, 处理器 191实现 NFC设备 190中 的主机(DH ) 的功能。
NFC设备 190的处理器 191、 存储器 192和 NFCC 193通过总线系统 199 耦合在一起, 其中总线系统 199 除包括数据总线之外, 还可以包括电源总线、 控制总线和状态信号总线等。 但是为了清楚说明起见, 在图中将各种总线都标 为总线系统 199。 DH和 NFCC之间的逻辑接口 NCI可通过总线系统 199实现。
处理器 191从总体上控制 NFC设备 190的操作, 处理器 191可以是 CPU ( Central Processing Unit, 中央处理单元)。 处理器 191还可以是其他通用处理 器、数字信号处理器( DSP )、专用集成电路( ASIC )、现成可编程门阵列( FPGA ) 或者其他可编程逻辑器件、 分立门或者晶体管逻辑器件、 分立硬件组件等。 通 用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器 192可以包括只读存储器和随机存取存储器, 并向处理器 191提供 指令和数据。 存储器 192的一部分还可以包括非易失性随机存取存储器。 例如, 存储器 192还可以存储设备类型的信息。
NFCC 193可以实现为单独的芯片, 发射电路 1931、 接收电路 1932和天线 1933实现 NFCC 193的射频接口。 发射电路 1931和接收电路 1932通过内部连 接 1939耦合到天线 1933。 本发明实施例对内部连接 1939的形式不作限制, 可 以是内部总线或内部电路等。
可选地, 在一个实施例中, 发射电路 1931和接收电路 1932可以由一套电 路实现, 通过双工模式实现发射和接收功能。
NFCC 193的处理器 1934和存储器 1935的功能也可以分别由处理器 191和 存储器 192负责。这样 NFCC 193中可以去除处理器 1934和存储器 1935。例如, 存储器 192可存储使得处理器 191执行以下操作的指令: 生成 NFC设备 190的 NFCID , 其中 NFC设备 190的 NFCID携带第一 DT信息, 第一 DT信息用于指 示 NFC设备 190支持的设备类型 /设备能力。
在实现过程中, 上述方法的各步骤可以通过处理器 191或 1934中的硬件的 集成逻辑电路或者软件形式的指令完成。 结合本发明实施例所公开的方法的步 骤可以直接体现为硬件处理器执行完成, 或者用处理器中的硬件及软件模块组 合执行完成。 软件模块可以位于随机存储器, 闪存、 只读存储器, 可编程只读 存储器或者电可擦写可编程存储器、 寄存器等本领域成熟的存储介质中。 该存 储介质位于存储器 192或 1935 , 处理器 191或 1934读取存储器 192或 1935中 的信息, 结合其硬件完成上述方法的步骤。 为避免重复, 这里不再详细描述。
可选地, 作为一个实施例, 生成单元 191可以在 NFC设备 190的 NFCID 中的预定字节或比特上填充第一 DT信息; 或者, 根据 NFC设备 190的 NFCID 的长度, 在 NFC设备 190的 NFCID中的对应字节或比特上填充第一 DT信息。
可选地, 作为另一实施例, 接收电路 1932可通过天线 1933接收第二设备 发送的第一请求消息, 第一请求消息携带第二 DT信息, 第二 DT信息用于指示 第二设备要搜索的设备类型。 处理器 191或 1934确定 NFCID是否匹配第二 DT 信息。 发射电路 1931在处理器 191或 1934确定 NFCID匹配第二 DT信息时, 通过天线 1933向第二设备发送 NFC设备 190的 NFCID。
可选地, 作为另一实施例, 接收电路 1932还可以通过天线 1933接收第二 设备发送的第二请求消息, 第二请求消息携带第二设备在接收第一设备的 NFCID时检测到冲突的情况下确定的有效的冲突比特。处理器 191或 1934还可 以根据有效的冲突比特和第一设备的 NFCID的匹配结果, 确定是否再次向第二 设备发送第一设备的 NFCID。
可选地, 作为另一实施例, 有效的冲突比特的数目为 n, n为正整数。 如果 所述有效的冲突比特与 NFCID的前 n比特不同, 则处理器 191或 1934可确定 不再发送第一设备的 NFCID;如果有效的冲突比特与 NFCID的前 n比特相同且 n>m, 则处理器 191或 1934可确定再次发送第一设备的 NFCID, m为第二 DT 信息的比特数; 如果有效的冲突比特与 NFCID的前 n比特相同且 n<m, 则在有 效的冲突比特之后的 m-n个比特与 NFCID的相应比特相同的情况下, 则处理器 191或 1934可确定再次发送第一设备的 NFCID;如果有效的冲突比特与 NFCID 的前 n比特相同且 n<m,则在有效的冲突比特之后的 m-n个比特与 NFCID的相 应比特不同的情况下,则处理器 191或 1934可确定不再发送第一设备的 NFCID。
可选地, 作为另一实施例, 第一请求消息为单设备检测请求 SDD— REQ 消 息或者探测请求消息 ATR— REQ。
本领域普通技术人员可以意识到, 结合本文中所公开的实施例描述的各示 例的单元及算法步骤, 能够以电子硬件、 或者计算机软件和电子硬件的结合来 实现。 这些功能究竟以硬件还是软件方式来执行, 取决于技术方案的特定应用 和设计约束条件。 专业技术人员可以对每个特定的应用来使用不同方法来实现 所描述的功能, 但是这种实现不应认为超出本发明的范围。
所属领域的技术人员可以清楚地了解到, 为描述的方便和筒洁, 上述描述 的系统、 装置和单元的具体工作过程, 可以参考前述方法实施例中的对应过程, 在此不再赘述。
在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统、 装置和方 法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是示意性 的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实现时可以有另 外的划分方式, 例如多个单元或组件可以结合或者可以集成到另一个系统, 或 一些特征可以忽略, 或不执行。 另一点, 所显示或讨论的相互之间的耦合或直 接耦合或通信连接可以是通过一些接口, 装置或单元的间接耦合或通信连接, 可以是电性, 机械或其它的形式。 单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者 也可以分布到多个网络单元上。 可以根据实际的需要选择其中的部分或者全部 单元来实现本实施例方案的目的。
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集成在一个单元 中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用 时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发明的技 术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以 软件产品的形式体现出来, 该计算机软件产品存储在一个存储介质中, 包括若 干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备 等)执行本发明各个实施例所述方法的全部或部分步骤。 而前述的存储介质包 括: U盘、 移动硬盘、 只读存储器(ROM, Read-Only Memory ), 随机存取存储 器(RAM, Random Access Memory ),磁碟或者光盘等各种可以存储程序代码的 介质。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限于 此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易想到 变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护范围应 所述以权利要求的保护范围为准。

Claims

权 利 要 求
1、 一种近场通信方法, 其特征在于, 包括:
第二设备获取第一设备的近场通信标识 NFC I D , 所述第一设备的 NFC I D携带 第一设备类型 /设备能力 DT信息, 所述第一 DT信息用于指示所述第一设备支持的 设备类型 /设备能力;
第二设备从所述第一设备的 NFC I D中提取所述第一 DT信息。
2、 如权利要求 1所述的方法, 其特征在于, 所述第二设备从所述第一设备 的 NFC I D中提取所述第一 DT信息, 包括:
所述第二设备检测所述第一设备的 NFC I D的长度;
所述第二设备根据所述第一设备的 NFC I D的长度, 提取所述第一设备的 NFC I D中的对应字节或比特作为所述第一 DT信息。
3、 如权利要求 1所述的方法, 其特征在于, 所述第二设备从所述第一设备 的 NFC I D中提取所述第一 DT信息, 包括:
所述第二设备提取所述第一设备的 N F C I D中的预定字节或比特作为所述第 一 DT信息。
4、 如权利要求 1 -3任一项所述的方法, 其特征在于, 所述第二设备获取第 一设备的近场通信标识 NFC I D , 包括:
所述第二设备发送第一请求消息, 所述第一请求消息携带第二 DT信息, 所 述第二 DT信息用于指示所述第二设备要搜索的设备类型 /设备能力;
所述第二设备从确定第一 DT信息匹配所述第二 DT信息的第一设备接收所述 第一设备的 NFC I D。
5、 如权利要求 4所述的方法, 其特征在于, 所述第二设备从确定第一 DT信 息匹配所述第二 DT信息的第一设备接收所述第一设备的 NFC I D, 包括:
如果所述第二设备在接收所述第一设备的 NFC I D时检測到冲突, 则确定有效 的冲突比特;
所述第二设备发送第二请求消息, 其中所述第二请求消息携带所述有效的 冲突比特,
其中, 如果所述有效的冲突比特的数目 n小于所述第二 DT信息的比特数 m, 则所述第二请求消息还携带所述第二 DT信息的后面 m-n个比特, 其中 m和 n为正整 数。
6、 如权利要求 4所述的方法, 其特征在于, 所述第一请求消息为单设备检 測请求 SDD_REQ消息, 或者为探測请求消息 ATR_REQ。
7、 一种近场通信方法, 其特征在于, 包括:
第一设备生成所述第一设备的 NFCID, 其中所述第一设备的 NFCID携带第一 设备类型 /设备能力 DT信息, 所述第一 DT信息用于指示所述第一设备支持的设备 类型 /设备能力;
第一设备向第二设备发送所述第一设备的 NFC I D。
8、 如权利要求 7所述的方法, 其特征在于, 所述第一设备生成所述第一设 备的 NFCID, 包括:
所述第一设备在所述第一设备的 NFCID中的预定字节或比特上填充所述第 一 DT信息; 或者,
所述第一设备根据所述第一设备的 NFCID的长度, 在所述第一设备的 NFCID 中的对应字节或比特上填充所述第一 DT信息。
9、 如权利要求 7或 8所述的方法, 其特征在于, 在所述第一设备向第二设备 发送所述第一设备的 NFCID之前, 所述方法还包括:
所述第一设备接收所述第二设备发送的第一请求消息, 所述第一请求消息 携带第二 DT信息, 所述第二 DT信息用于指示所述第二设备要搜索的设备类型 /设 备能力;
所述第一设备确定所述 NFCID是否匹配所述第二 DT信息;
其中所述第一设备向第二设备发送所述第一设备的 NFCID, 包括: 在确定所 述 NFCID匹配所述第二 DT信息时, 所述第一设备向所述第二设备发送所述第一设 备的 NFCID。
10、 如权利要求 9所述的方法, 其特征在于, 所述方法还包括:
所述第一设备接收所述第二设备发送的第二请求消息, 所述第二请求消息 携带所述第二设备在接收所述第一设备的 NFCID时检測到冲突的情况下确定的 有效的冲突比特;
所述第一设备根据所述有效的冲突比特和所述第一设备的 NFCID的匹配结 果, 确定是否再次向所述第二设备发送所述第一设备的 NFCID。
11、 如权利要求 10所述的方法, 其特征在于, 所述有效的冲突比特的数目 为 n, n为正整数,
所述第一设备根据所述有效的冲突比特和所述第一设备的 NFCID的匹配结 果, 确定是否再次向所述第二设备发送所述第一设备的 NFCID, 包括: 如果所述有效的冲突比特与所述 NFC ID的前 n比特不同, 则确定不再发送所 述第一设备的 NFCID;
如果所述有效的冲突比特与所述 NFC I D的前 n比特相同且 n m, 则确定再次 发送所述第一设备的 NFCID, m为所述第二 DT信息的比特数, m为正整数;
如果所述有效的冲突比特与所述 NFCID的前 n比特相同且 n<m, 则在所述有效 的冲突比特之后的 m-n个比特与所述 NFC I D的相应比特相同的情况下, 确定再次 发送所述第一设备的 NFC I D;
如果所述有效的冲突比特与所述 NFC I D的前 n比特相同且 n<m, 则在所述有效 的冲突比特之后的 m-n个比特与所述 NFC I D的相应比特不同的情况下, 确定不再 发送所述第一设备的 NFCID。
12、 如权利要求 9所述的方法, 其特征在于, 所述第一请求消息为单设备检 測请求 SDD_REQ消息或者探測请求消息 ATR_REQ。
13、 一种近场通信设备, 其特征在于, 包括:
获取单元, 用于获取第一设备的近场通信标识 NFCID,所述第一设备的 NFC ID 携带第一设备类型 /设备能力 DT信息, 所述第一 DT信息用于指示所述第一设备支 持的设备类型 /设备能力;
提取单元, 用于从所述第一设备的 NFC I D中提取所述第一 DT信息。
14、 如权利要求 13所述的近场通信设备, 其特征在于, 所述提取单元具体 用于检測所述第一设备的 NFCID的长度; 根据所述第一设备的 NFCID的长度, 提 取所述第一设备的 NFCID中的对应字节或比特作为所述第一 DT信息。
15、 如权利要求 13所述的近场通信设备, 其特征在于, 所述提取单元具体 用于提取所述第一设备的 NFC I D中的预定字节或比特作为所述第一 DT信息。
16、 如权利要求 13-15任一项所述的近场通信设备, 其特征在于, 所述获取 单元具体用于发送第一请求消息, 所述第一请求消息携带第二 DT信息, 所述第 二 DT信息用于指示所述近场通信设备要搜索的设备类型 /设备能力; 从确定第一 DT信息匹配所述第二 DT信息的第一设备接收所述第一设备的 NFC I D。
17、 如权利要求 16所述的近场通信设备, 其特征在于, 所述获取单元具体 用于如果在接收所述第一设备的 NFC I D时检測到冲突, 则确定有效的冲突比特; 发送第二请求消息, 其中所述第二请求消息携带所述有效的冲突比特,
其中, 如果所述有效的冲突比特的数目 n小于所述第二 DT信息的比特数 m, 则所述第二请求消息还携带所述第二 DT信息的后面 m-n个比特, 其中 m和 n为正整 数。
18、 一种近场通信设备, 其特征在于, 包括:
生成单元, 用于生成所述近场通信设备的 NFCID, 其中所述近场通信设备的 NFCID携带第一设备类型 /设备能力 DT信息, 所述第一 DT信息用于指示所述近场 通信设备支持的设备类型 /设备能力;
发送单元, 用于向第二设备发送所述近场通信设备的 NFC I D。
19、 如权利要求 18所述的近场通信设备, 其特征在于, 所述生成单元具体 用于在所述近场通信设备的 NFCID中的预定字节或比特上填充所述第一 DT信息; 或者, 根据所述近场通信设备的 NFCID的长度, 在所述近场通信设备的 NFCID中 的对应字节或比特上填充所述第一 DT信息。
20、 如权利要求 18或 19所述的近场通信设备, 其特征在于, 所述近场通信 设备还包括:
接收单元, 用于接收所述第二设备发送的第一请求消息, 所述第一请求消 息携带第二 DT信息, 所述第二 DT信息用于指示所述第二设备要搜索的设备类型 / 设备能力;
确定单元, 用于确定所述 NFC I D是否匹配所述第二 DT信息; 息时, 向所述第二设备发送所述近场通信设备的 NFCID。
21、 如权利要求 20所述的近场通信设备, 其特征在于,
所述接收单元还用于接收所述第二设备发送的第二请求消息, 所述第二请 求消息携带所述第二设备在接收所述第一设备的 NFCID时检測到冲突的情况下 确定的有效的冲突比特;
所述确定单元还用于根据所述有效的冲突比特和所述第一设备的 NFCID的 匹配结果, 确定是否再次向所述第二设备发送所述第一设备的 NFCID。
22、 如权利要求 21所述的近场通信设备, 其特征在于, 所述有效的冲突比 特的数目为 n, n为正整数,
所述确定单元具体用于:
如果所述有效的冲突比特与所述 NFCID的前 n比特不同, 则确定不再发送所 述第一设备的 NFCID;
如果所述有效的冲突比特与所述 NFCID的前 n比特相同且 n m, 则确定再次 发送所述第一设备的 NFC ID, m为所述第二 DT信息的比特数; 如果所述有效的冲突比特与所述 NFC I D的前 n比特相同且 n<m, 则在所述有效 的冲突比特之后的 m-n个比特与所述 NFC I D的相应比特相同的情况下, 确定再次 发送所述第一设备的 NFC I D;
如果所述有效的冲突比特与所述 NFC I D的前 n比特相同且 n<m, 则在所述有效 的冲突比特之后的 m-n个比特与所述 NFC I D的相应比特不同的情况下, 确定不再 发送所述第一设备的 NFC I D。
PCT/CN2014/071510 2013-01-29 2014-01-26 近场通信方法和近场通信设备 WO2014117701A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP14746479.6A EP2858261B1 (en) 2013-01-29 2014-01-26 Near field communication method and device
US14/574,981 US20150147966A1 (en) 2013-01-29 2014-12-18 Near Field Communication Method and Near Field Communication Device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310034238.1 2013-01-29
CN201310034238.1A CN103973340B (zh) 2013-01-29 2013-01-29 近场通信方法和近场通信设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/574,981 Continuation US20150147966A1 (en) 2013-01-29 2014-12-18 Near Field Communication Method and Near Field Communication Device

Publications (1)

Publication Number Publication Date
WO2014117701A1 true WO2014117701A1 (zh) 2014-08-07

Family

ID=51242432

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/071510 WO2014117701A1 (zh) 2013-01-29 2014-01-26 近场通信方法和近场通信设备

Country Status (4)

Country Link
US (1) US20150147966A1 (zh)
EP (1) EP2858261B1 (zh)
CN (1) CN103973340B (zh)
WO (1) WO2014117701A1 (zh)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130201007A1 (en) * 2012-02-02 2013-08-08 Qualcomm Incorporated Methods and apparatus for improving resolution among devices with different size nfc identifiers
CN105578497B (zh) * 2015-04-28 2019-06-11 宇龙计算机通信科技(深圳)有限公司 一种nfc侦听设备的检测方法及相关设备
EP3301821B1 (en) * 2016-09-29 2019-08-21 Continental Automotive GmbH Antenna for an nfc device and nfc device
CN108605215B (zh) * 2017-01-24 2020-06-16 华为技术有限公司 一种交易处理方法及终端
WO2018216459A1 (ja) * 2017-05-22 2018-11-29 フェリカネットワークス株式会社 通信装置、通信方法、およびプログラム
CN107360633B (zh) * 2017-06-05 2020-11-03 北京小鸟看看科技有限公司 虚拟现实系统的配对连接方法、设备及虚拟现实系统
WO2020257983A1 (zh) * 2019-06-24 2020-12-30 西门子股份公司 主从模块配对处理系统、装置和方法

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101754493A (zh) * 2008-11-28 2010-06-23 华为技术有限公司 识别微基站的方法、终端
CN101753200A (zh) * 2008-11-27 2010-06-23 索尼株式会社 通信设备、通信方法、程序和通信系统

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7532122B2 (en) * 2006-09-13 2009-05-12 Northrop Grumman Corporation Systems and methods for verifying the identities of RFID tags
US8400913B2 (en) * 2007-05-23 2013-03-19 Microsoft Corporation Method for optimizing near field links
AU2009243169B2 (en) * 2008-04-29 2014-06-05 Visa U. S. A. Inc. Authorization system with split messaging
JP4720899B2 (ja) * 2008-11-27 2011-07-13 ソニー株式会社 通信装置、通信方法、プログラム、および通信システム
EP2680657B1 (en) * 2012-06-28 2017-08-02 OCT Circuit Technologies International Limited Emulation of multiple nfc devices inside a communication device
EP2801930B1 (en) * 2013-05-09 2016-07-27 ST-Ericsson SA A near field communication reader adapted for NFC A anti collision and a method of NFC A anti collision

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101753200A (zh) * 2008-11-27 2010-06-23 索尼株式会社 通信设备、通信方法、程序和通信系统
CN101754493A (zh) * 2008-11-28 2010-06-23 华为技术有限公司 识别微基站的方法、终端

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Information technology-Telecornmunications and information exchange between systems-Near Field Communication-Interface and Protocol (NFCIP-I)", INTERNATIONAL STANDARD ISO/IEC 18092, vol. 1ST ED., 1 April 2004 (2004-04-01), XP007905654 *
See also references of EP2858261A4 *

Also Published As

Publication number Publication date
EP2858261A4 (en) 2015-06-24
CN103973340B (zh) 2016-05-25
US20150147966A1 (en) 2015-05-28
EP2858261B1 (en) 2017-07-26
CN103973340A (zh) 2014-08-06
EP2858261A1 (en) 2015-04-08

Similar Documents

Publication Publication Date Title
WO2014117701A1 (zh) 近场通信方法和近场通信设备
EP2790373B1 (en) Apparatuses for transmitting data via a second interface based on network identification information transmitted via a first interface
US9262711B2 (en) NFC tag, communication method and system
US20100211685A1 (en) Pairing exchange
ES2961700T3 (es) Procedimiento para transacciones UWB y dispositivo electrónico para las mismas
JP6100926B2 (ja) タグ識別方法及び装置
EP2861037A1 (en) Radio frequency communication method, device and terminal device for near field communication
KR20150105976A (ko) 근접장 통신에서 보안 요소의 선택을 구현하기 위한 방법, 모바일 단말기, 및 pos 머신
JP2011103047A (ja) 電子機器及びアクセス制御方法
JP6858200B2 (ja) データフレームをルーティングするための方法、近距離無線通信コントローラ、および端末
WO2014146229A1 (zh) Nfc设备通信方法、装置和nfc设备
US11398849B2 (en) Continuous communication method and apparatus of contactless communication device
CN104081679B (zh) 近场通信方法和近场通信设备
CN107426668B (zh) 通信装置
JP6447625B2 (ja) 通信回路、通信装置、通信方法及びコンピュータプログラム
WO2017177362A1 (zh) 一种无线可配置闪存
JP6306866B2 (ja) 通信装置及びその制御方法、並びにプログラム
US10481838B2 (en) Communication device, and non-transitory computer-readable recording medium storing computer-readable instructions for communication device
JP2018050132A (ja) 通信装置、その制御方法及びプログラム
JP2016178686A (ja) 通信機器
US10051155B2 (en) Communication device capable of executing authentication of target device
KR20210039109A (ko) 데이터를 송/수신하는 전자 장치 및 그 방법
JP7278087B2 (ja) 通信装置およびその制御方法、プログラム
JP2018107831A (ja) 通信機器
JP6613083B2 (ja) 電子機器および制御方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14746479

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2014746479

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE