WO2016187821A1 - Method, device, and system for adjusting packet length in near field communication (nfc) - Google Patents

Method, device, and system for adjusting packet length in near field communication (nfc) Download PDF

Info

Publication number
WO2016187821A1
WO2016187821A1 PCT/CN2015/079847 CN2015079847W WO2016187821A1 WO 2016187821 A1 WO2016187821 A1 WO 2016187821A1 CN 2015079847 W CN2015079847 W CN 2015079847W WO 2016187821 A1 WO2016187821 A1 WO 2016187821A1
Authority
WO
WIPO (PCT)
Prior art keywords
length value
nfcc
nfc device
data packet
nfc
Prior art date
Application number
PCT/CN2015/079847
Other languages
French (fr)
Chinese (zh)
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 KR1020207005978A priority Critical patent/KR102256450B1/en
Priority to JP2017561382A priority patent/JP6564070B2/en
Priority to PCT/CN2015/079847 priority patent/WO2016187821A1/en
Priority to KR1020177036894A priority patent/KR102085175B1/en
Priority to EP15892902.6A priority patent/EP3297176B1/en
Priority to CN201580045514.1A priority patent/CN106605371B/en
Priority to US15/576,649 priority patent/US10470019B2/en
Publication of WO2016187821A1 publication Critical patent/WO2016187821A1/en
Priority to US16/597,511 priority patent/US11166137B2/en

Links

Images

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
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B5/00Near-field transmission systems, e.g. inductive or capacitive transmission systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/36Flow control; Congestion control by determining packet size, e.g. maximum transfer unit [MTU]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/36Flow control; Congestion control by determining packet size, e.g. maximum transfer unit [MTU]
    • H04L47/365Dynamic adaptation of the packet size
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2212/00Encapsulation of packets

Definitions

  • the present invention relates to the field of near field communication (NFC) technology, and in particular, to a method, device and system for adjusting the length of a data packet in a near field communication NFC.
  • NFC near field communication
  • NFC technology is a short-range wireless connection technology that can realize close-range communication between NFC-enabled electronic devices (also known as "NFC devices") by magnetic field induction
  • the NFC device mainly includes three functional entities: a host (DH) , Device Host), NFC Controller (NFCC, NFC Controller) and NFC Execution Environment (NFCEE, NFC Execution Environment).
  • DH host
  • NFCC NFC Controller
  • NFCEE NFC Execution Environment
  • NFC Controller Interface (NCI) interface mainly defines a logical interface for implementing communication between DH and NFCC in an NFC device, and two are implemented in a Peer-to-Peer (P2P) mode.
  • P2P Peer-to-Peer
  • the NFC device for communication is subject to the NFC-Data Exchange Protocol (NFC-DEP).
  • NFC-DEP NFC-Data Exchange Protocol
  • the Digital Specification developed by the NFC Forum stipulates that two NFC devices that perform point-to-point communication can pass the attribute request (ATR_REQ, Attribute Request) before communicating through the NFC-DEP protocol.
  • the attribute response (ATR_RES, Attribute Response) negotiates the maximum length values LR I and LR T of the data packets transmitted during the subsequent communication, wherein the LR I is set by the NFC device as an initiator and is used as a target
  • the length of the data packet transmitted by the (target) NFC device, the LR T is set by the NFC device as the target and is used to limit the length of the data packet transmitted by the NFC device as the initiator.
  • the NFC device as the initiator can also adjust the maximum length value LR of the data packet transmitted in the subsequent communication process with the NFC device as the target through the parameter selection request (PSL_REQ, Parameter Selection Request), where LR is less than or equal to LR.
  • PSL_REQ Parameter Selection Request
  • I and LR T , LR are methods for negotiating the length of a communication packet between two NFC chips.
  • the NCI protocol is used to specify how parameters, commands, etc. are used when the NFC chip communicates with the NFC chip on the opposite end.
  • the NCI protocol does not give a guide to how the NFC chip uses the PSL_REQ defined by the Digital protocol to adjust the maximum length value LR of packets transmitted during subsequent communication.
  • the embodiment of the invention discloses a method, device and system for adjusting the length of a data packet in a near field communication NFC, which can realize the adjustment of the first NFC device as the initiator through the NCI specification and the second NFC device as the target by the NCI specification.
  • a first aspect of the embodiments of the present invention discloses a method for adjusting a data packet length in a near field communication NFC, where the method includes:
  • the NFCC of the first NFC device determines whether the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication;
  • the NFCC If the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication, the NFCC sends a first request including the first length value to the second NFC device, the first request is used to indicate that The maximum length value of the data packet transmitted by the first NFC device and the second NFC device in the subsequent communication is adjusted to the first length value, and the first request further includes a first device identifier DID, where The first length value is a value determined by the NFCC;
  • the NFCC receives a first response returned by the second NFC device for the first request, and the first response includes a second DID;
  • the NFCC uses the first length value as the maximum length value of the data packet transmitted in the subsequent communication.
  • the determining, by the NFCC is determining, by the NFCC, a maximum length value of the data packet transmitted in the subsequent communication, including:
  • the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that a maximum length value of the data packet transmitted in the subsequent communication is determined by the NFCC, wherein the value of the first parameter Is the default value of the NFCC, or the value assigned to the NFCC by the DH of the first device.
  • the method further includes:
  • the NFCC sends the data packet to the second NFC device.
  • the method further includes:
  • the NFCC sends a first notification including the first length value to the DH, where the first notification is used to notify the DH that the first radio frequency RF interface has been activated;
  • the NFCC sends the data packet to the second NFC device.
  • the method further includes:
  • the NFCC If the NFCC is not responsible for determining the maximum length value of the data packet transmitted in the subsequent communication, the NFCC does not send the first request including the first length value to the second NFC device.
  • the first request is Digital
  • the parameter selection request defined in the specification is PSL_REQ;
  • the first response is a parameter selection response PSL_RES defined in the Digital specification
  • the first RF interface is a near field communication data exchange protocol NFC-DEP radio frequency interface defined in an NFC controller interface NCI specification;
  • the first notification is a radio frequency interface activation notification RF_INTF_ACTIVATED_NTF defined in the NCI specification.
  • a second aspect of the embodiments of the present invention discloses a method for adjusting a data packet length in a near field communication NFC, where the method includes:
  • the NFCC of the first NFC device receives an adjustment command including a first length value sent by the DH of the first NFC device, where the adjustment command is used to instruct the NFCC to adjust a maximum length value of a data packet transmitted during a subsequent communication process.
  • a first request including the first length value to a second NFC device, where the first request is used to indicate that the first NFC device is transmitted during subsequent communication with the second NFC device
  • the maximum length value of the data packet is adjusted to the first length value, the first request further includes a first DID, and the first length value is a value determined by the NFCC;
  • the NFCC receives a first response returned by the second NFC device for the first request, and the first response includes a second DID;
  • the NFCC uses the first length value as the maximum length value of the data packet transmitted in the subsequent communication.
  • the method further includes:
  • the NFCC sends an adjustment response including a status indication and/or the first length value to the DH, the status indication indicating that the NFCC has adjusted the maximum length value to the first length value.
  • the receiving the DH of the first NFC device includes Before a length value adjustment command, the method further includes:
  • the NFCC activates a first RF interface and sends a first notification to the DH, the first notification being used to inform the DH that the first RF interface has been activated.
  • the sending, by the second NFC device, the first length value Before the first request the method further includes:
  • the method further includes:
  • the NFCC receives the first data message sent by the DH by using the first RF interface, and encapsulates the load in the first data message into the first data by using the first length value as the maximum length value. package;
  • the NFCC sends the first data packet to the second NFC device.
  • the method further includes:
  • the NFCC sends a second notification to the DH, the second notification being used to notify the DH of the second
  • the RF interface has been activated, and receives the second data message sent by the DH through the second RF interface, and encapsulates the load in the second data message with the first length value as the maximum length value Into a second data packet;
  • the NFCC sends the second data packet to the second NFC device.
  • the first request is a PSL_REQ defined in the Digital specification
  • the first response is a PSL_RES defined in the Digital specification
  • the first RF interface is an NFC-DEP radio frequency interface defined in an NCI specification
  • the first notification is RF_INTF_ACTIVATED_NTF defined in the NCI specification.
  • the third aspect of the embodiment of the present invention discloses an NFCC, where the NFCC is an NFCC in a first NFC device, where the NFCC includes a determining module, a communication module, and a determining module, where:
  • the determining module is configured to determine whether the NFCC is responsible for determining a maximum length value of the data packet transmitted in the subsequent communication;
  • the communication module is configured to: when the determination result of the determining module is yes, send a first request including a first length value to the second NFC device, and receive the second NFC device to return for the first request a first response, the first request is used to indicate that a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication is adjusted to the first length value, and
  • the first request further includes a first DID
  • the first response includes a second DID
  • the first length value is a value determined by the NFCC
  • the determining module is configured to use the first length value as a maximum length value of a data packet transmitted in a subsequent communication when the first DID is the same as the second DID.
  • the determining module determines whether the NFCC is responsible for determining a maximum length value of a data packet transmitted in a subsequent communication:
  • the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that a maximum length value of the data packet transmitted in the subsequent communication is determined by the NFCC, wherein the value of the first parameter Is the default value of the NFCC, or is the value assigned to the NFCC by the DH of the first NFC device.
  • the communication module is further configured to send, to the DH of the first NFC device, a first notification that includes the first length value, where the first notification is used to notify the DH of the first radio frequency RF interface. Has been activated, and receives the data message sent by the DH through the first RF interface;
  • the NFCC also includes a package module, wherein:
  • the encapsulating module is configured to encapsulate the load in the data message into a data packet by using the first length value as the maximum length value;
  • the communication module is further configured to send the data packet to the second NFC device.
  • the communications module is further configured to send the inclusion to the DH. a first notification of a first length value, the first notification being used to notify the DH that the first radio frequency RF interface has been activated;
  • the communication module is further configured to receive, by using the first RF interface, a data message sent by the DH;
  • the NFCC also includes a package module, wherein:
  • the encapsulating module is configured to encapsulate the load in the data message into a data packet by using the first length value as the maximum length value;
  • the communication module is further configured to send the data packet to the second NFC device.
  • the first request is Digital PSL_REQ as defined in the specification
  • the first response is a PSL_RES defined in the Digital specification
  • the first RF interface is an NFC-DEP radio frequency interface defined in an NCI specification
  • the first notification is RF_INTF_ACTIVATED_NTF defined in the NCI specification.
  • a fourth aspect of the embodiments of the present invention discloses an NFCC, where the NFCC is an NFCC in a first NFC device, where the NFCC includes a communication module and a determining module, where:
  • the communication module is configured to receive an adjustment command including a first length value sent by the DH of the first NFC device, where the adjustment command is used to instruct the NFCC to adjust a maximum length of a data packet transmitted during a subsequent communication process. value;
  • the communication module is further configured to send a first request that includes the first length value to a second NFC device, and receive a first response that is returned by the second NFC device for the first request, the first please And determining to adjust a maximum length value of the data packet transmitted during the subsequent communication between the first NFC device and the second NFC device to the first length value, where the first request further includes the first DID, the first response includes a second DID;
  • the determining module is configured to use the first length value as a maximum length value of a data packet transmitted in a subsequent communication when the first DID is the same as the second DID.
  • the communications module is further configured to send, to the DH, an adjustment response that includes a status indication and/or the first length value, where the status The indication is to indicate that the NFCC has adjusted the maximum length value to the first length value.
  • the NFCC further includes an activation module, where:
  • the activation module is configured to activate the first RF interface before the communication module receives the adjustment command including the first length value sent by the DH of the first NFC device;
  • the communication module is further configured to send a first notification to the DH, where the first notification is used to notify the DH that the first RF interface has been activated.
  • the determining module is further configured to: Before the second NFC device sends the first request including the first length value, determining that the first length value is less than or equal to the second length value and less than or equal to the third length value.
  • the communications module is further configured to pass the first RF interface. Receiving a first data message sent by the DH;
  • the NFCC also includes a first encapsulation module, wherein:
  • the first encapsulating module is configured to encapsulate the load in the first data message into a first data packet by using the first length value as the maximum length value;
  • the communication module is further configured to send the first data packet to the second NFC device.
  • the communications module is further configured to send a second to the DH. Notifying that the second notification is that the DH second RF interface has been activated, and receives the second data message sent by the DH by using the second RF interface;
  • the NFCC further includes a second encapsulation module, wherein:
  • the second encapsulating module is configured to encapsulate the load in the second data message into a second data packet by using the first length value as the maximum length value;
  • the communication module is further configured to send the second data packet to the second NFC device.
  • the first request is a PSL_REQ defined in the Digital specification
  • the first response is a PSL_RES defined in the Digital specification
  • the first RF interface is an NFC-DEP radio frequency interface defined in an NCI specification
  • the first notification is RF_INTF_ACTIVATED_NTF defined in the NCI specification.
  • the fifth aspect of the embodiment of the present invention discloses an NFCC, including a processor and a communication device, where the processor is configured to determine whether the NFCC is responsible for determining a maximum length value of a data packet transmitted in a subsequent communication;
  • the communication device is configured to: when the determination result of the processor is yes, send a first request including a first length value to the second NFC device, and receive the second NFC device to return for the first request a first response, the first request is used to indicate that a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication is adjusted to the first length value, where a length value is a value determined by the NFCC, the first request further includes a first DID, and the first response includes a second DID;
  • the processor is further configured to use, when the first DID is the same as the second DID, the first length value as a maximum length value of a data packet transmitted in a subsequent communication.
  • the determining, by the NFCC is determining, by the NFCC, a maximum length value of the data packet transmitted in the subsequent communication, including:
  • the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that a maximum length value of the data packet transmitted in the subsequent communication is determined by the N FCC, wherein the first parameter is determined by The value is the default value of the NFCC or the value assigned to the NFCC by the first NFC device DH.
  • the communications apparatus is further configured to send, by the DH of the first NFC device, the first length value. a first notification, the first notification being used to notify that the DH first RF interface has been activated;
  • the communication device is further configured to receive, by using the first RF interface, a data message sent by the DH;
  • the processor is further configured to encapsulate the load in the data message into a data packet by using the first length value as the maximum length value;
  • the communication device is further configured to send the data packet to the second NFC device.
  • the communications apparatus is further configured to send the inclusion to the DH. Determining a first notification of a first length value, the first notification being used to notify the DH that the first RF interface has been activated;
  • the communication device is further configured to receive, by using the first RF interface, a data message sent by the DH;
  • the processor is further configured to encapsulate the load in the data message into a data packet by using the first length value as the maximum length value;
  • the communication device is further configured to send the data packet to the second NFC device.
  • the first request is Digital PSL_REQ as defined in the specification
  • the first response is a PSL_RES defined in the Digital specification
  • the first RF interface is an NFC-DEP radio frequency interface defined in an NCI specification
  • the first notification is RF_INTF_ACTIVATED_NTF defined in the NCI specification.
  • a sixth aspect of the embodiments of the present invention discloses an NFCC, including a processor and a communication device, configured to receive an adjustment command including a first length value sent by a DH of the first NFC device, where the adjustment command is And configured to instruct the NFCC to adjust a maximum length value of a data packet transmitted during a subsequent communication process;
  • the communication device is further configured to send a first request that includes the first length value to a second NFC device, and receive a first response that is returned by the second NFC device for the first request, the first The request is used to indicate that a maximum length value of a data packet transmitted during a subsequent communication between the first NFC device and the second NFC device is adjusted to the first length value, and the first request further includes a first DID
  • the first response includes a second DID
  • the processor is configured to use the first length value as a maximum length value of a data packet transmitted in a subsequent communication when the first DID is the same as the second DID.
  • the communication device is further And an adjustment response for transmitting, to the DH, a status indication and/or the first length value, the status indication is used to indicate that the NFCC has adjusted the maximum length value to the first length value.
  • the processor is further configured to receive, at the communication device, Activating the first RF interface before the adjustment command including the first length value sent by the DH of the first NFC device;
  • the communication device is further configured to send a first notification to the DH, where the first notification is used to notify the DH that the first RF interface has been activated.
  • the processor is further used in the communication device Before the second NFC device sends the first request including the first length value, determining that the first length value is less than or equal to the second length value and less than or equal to the third length value.
  • the communications device is further configured to pass the first RF interface. Receiving a first data message sent by the DH;
  • the processor is further configured to encapsulate the load in the first data message into a first data packet by using the first length value as the maximum length value;
  • the communication device is further configured to send the first data packet to the second NFC device.
  • the communications device is further configured to send the second Notifying that the second notification is that the DH second RF interface has been activated, and receives the second data message sent by the DH by using the second RF interface;
  • the processor is further configured to encapsulate the load in the second data message into a second data packet by using the first length value as the maximum length value;
  • the communication device is further configured to send the second data packet to the second NFC device.
  • the first request is a PSL_REQ defined in the Digital specification
  • the first response is a PSL_RES defined in the Digital specification
  • the first RF interface is an NFC-DEP radio frequency interface defined in an NCI specification
  • the first notification is RF_INTF_ACTIVATED_NTF defined in the NCI specification.
  • the NFCC of the first NFC device as the initiator determines whether the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication, and if yes, transmitting the first length to the second NFC device.
  • the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party.
  • FIG. 1 is a schematic flowchart of a method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention
  • FIG. 2 is a schematic flow chart of another method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention
  • FIG. 3 is a schematic flow chart of another method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention
  • FIG. 4 is a schematic flow chart of another method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention
  • FIG. 5 is a schematic flowchart of still another method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present disclosure
  • FIG. 6 is a schematic structural diagram of an NFCC according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of another NFCC according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of still another NFCC according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of still another NFCC according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of still another NFCC according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of still another NFCC according to an embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of still another NFCC according to an embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram of a system for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention.
  • the embodiment of the invention discloses a method, device and system for adjusting the length of a data packet in a near field communication NFC, which can realize the adjustment of the first NFC device as the initiator through the NCI specification and the second NFC device as the target by the NCI specification.
  • the function of the maximum length value of the communication packet during subsequent communication The details are described below separately.
  • DH is responsible for the management of the entire NFC device, including the management of the NFC controller, such as initialization, configuration or power management, in the smart phone, it can correspond to the CPU of the mobile phone; DH can correspond to the European Telecommunications Standards Institute (ETSI) , the Terminal Host (HCI) in the Host Controller Interface (HCI) specification developed by the European Telecommunication Standards Institute; in addition, the management entity in the specifications developed by the Global Platform International Standards Organization (GP, Global Platform) ( ME, Managing Entity) If implemented on a Terminal Host, DH can also be referred to as a Management Host (MH).
  • ETSI European Telecommunications Standards Institute
  • HHI Terminal Host
  • HCI Host Controller Interface
  • GP Global Platform International Standards Organization
  • ME Management Entity
  • the NFCC is the entity responsible for data transmission of the NFC chip, and is usually used directly to refer to the NFC chip; the NFCC can correspond to the non-contact front end (CLF, Contactless) in the HCI specification developed by the European Telecommunication Standards Institute (ETSI). Front-end) At this time, the host controller in the HCI is implemented on the NFCC.
  • CLF non-contact front end
  • ETSI European Telecommunication Standards Institute
  • FIG. 1 is a diagram of adjusting the length of a data packet in a near field communication NFC according to an embodiment of the present invention. Schematic diagram of the method of degree. Among them, the method shown in FIG. 1 is applied to the NFCC of the first NFC device as the initiator. As shown in FIG. 1, the method for adjusting the packet length in the near field communication NFC may include the following steps:
  • the NFCC of the first NFC device may perform step S102, that is, the NFCC of the first NFC device sends the first length value to the second NFC device as the target party.
  • the first request when the determination result of the step S101 is NO, the NFCC of the first NFC device may end the current process, that is, the NFCC of the first NFC device does not send the first request including the first length value to the second NFC device.
  • the first NFC device and the second NFC device before the NFCC of the first NFC device performs step S101, the first NFC device and the second NFC device have activated the MAC layer, that is, the first NFC device and the second NFC device have negotiated with the ATR_RES through ATR_REQ.
  • the maximum length value of the data packet transmitted in the subsequent communication process that is, the second length value and the third length value, wherein the second length value is set by the first NFC device and is used to limit the second NFC device in the subsequent communication process.
  • the length of the data packet sent (ie, the length of the data packet transmitted from the second NFC device to the direction of the first NFC device), the third length value being set by the second NFC device and used to limit the first NFC device in subsequent
  • the length of the data packet sent during the communication (ie the length of the data packet transmitted from the first NFC device to the second NFC device), that is, the length of the data packet sent by the second NFC device in subsequent communication
  • the second length value cannot be exceeded, and the length of the data packet sent by the first NFC device cannot exceed the third length value.
  • the determination result of step S101 is that the NFCC of the first NFC device can adjust the maximum length of the data packet transmitted by the first NFC device and the second NFC device in the subsequent communication process after the MAC layer is activated. A value that limits the length of the data packets transmitted from the first NFC device to the second NFC device and from the second NFC device to the first NFC device, respectively.
  • the first request is used to indicate that a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication process is adjusted to a first length value included in the first request.
  • the first length value is a length value determined by the NFCC of the first NFC device, the first length value is less than or equal to the second length value and less than or equal to the third length value, and the first length value is A request further includes a first device identification DID (Device Identification Number).
  • the first request may be a parameter selection request PSL_REQ defined in the Digital specification defined by the NFC Forum, wherein the fifth byte (Byte 5) represents an FSL parameter, and the value of the byte defines the command and response.
  • the maximum length value further, the values corresponding to the first and second bits in the byte (ie, b1 and b2 defined in the Digital specification) represent the maximum length value, for example, when the values of the two bits are here When it is 00b, the maximum length value is 64 bytes; when the value of the two bits is 01b, the maximum length value is 128 bytes; when the value of the two bits is 10b, the maximum length value is It is 192 bytes; when the value of two bits here is 11b, the maximum length value is 254 bytes.
  • adjusting the maximum length value by PSL_REQ and PSL_RES can be understood as switching from one length value to another length value, and can also be understood as renegotiation or modification of the maximum length value, etc., which is not correct in the embodiment of the present invention. Limit the meaning of the word "adjustment”.
  • the command and response may be commands and responses used when communicating through the NFC-DEP protocol, such as a data exchange protocol request (DEP_REQ, Data Exchange Protocol Request) and a data exchange protocol response (DEP_RES, Data Exchange Protocol Response).
  • the above command and response can be encapsulated in a data packet as a payload (the upper-layer application-related business data), and then NFC-A technology (ie, type A radio frequency technology defined in the NFC forum, corresponding to the NFC device) ISO/IEC 14443, abbreviated type A) NFC-A Technology standard frame or NFC-F technology (ie type F radio technology defined in the NFC Forum, corresponding to the 212 kbps and 424 kbps communication mechanisms of ISO/IEC 18092) Abbreviation)
  • the frame format (NFC-F Technology frame) is sent out. Therefore, the above maximum length value can be understood as the maximum value of the packet length, and can also be understood as the maximum value of the number of payloads of the above command and response
  • the NFCC of the first NFC device sends a first request including the first length value to the second NFC device, so that the second NFC device does not accept the maximum length of the data packet transmitted during the subsequent communication.
  • the value is adjusted to the first length value, no response is returned, or the second NFC device returns a response indicating that the maximum length value of the data packet transmitted during the subsequent communication is not accepted to be adjusted to the first length value.
  • the DID included in the response is not equal to the DID included in the first request, to indicate that the second NFC device does not accept the first length value, or that the second NFC device returns to indicate that the acceptance will be followed.
  • the maximum length value of the data packet transmitted during the communication is adjusted to the response of the first length value, for example, the device identifier DID included in the response is equal to the DID included in the first request, to indicate the second NFC device. Accept the above first length value.
  • the NFCC of the first NFC device sends the first request including the first length value to the second NFC device, that is, the NFCC of the first NFC device sends the first length value to the NFCC of the second NFC device.
  • a request the NFCC of the first NFC device sends the first request including the first length value to the second NFC device, that is, the NFCC of the first NFC device sends the first length value to the NFCC of the second NFC device.
  • the first response may include a second DID.
  • the first length value is used as a maximum length value of the data packet transmitted in the subsequent communication.
  • the first response is used to indicate that the second NFC device has adjusted the maximum length value of the data packet transmitted in the subsequent communication process to the first a length value
  • the first DID and the second DID are both device identifiers of the second NFC device
  • the second DID is the first NFC device acting as the initiator in passing the ATR_REQ
  • An identifier assigned to the second NFC device as the target when the MAC layer is activated to identify the second NFC device and by way of example, for the ISO-DEP protocol, the second DID is used as a reader (Reader)
  • the first NFC device of /Writer is an identifier assigned to the second NFC device to identify the second NFC device when the second NFC device that is the NFC tag or the card emulation is activated by the RATS Command or the ATTRIB Command.
  • whether the NFCC of the first NFC device determines whether it is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication may include:
  • the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that the maximum length value of the data packet transmitted in the subsequent communication is determined by the NFCC in the first NFC device, and the first parameter
  • the value of the NFCC in the first NFC device may be the default value of the NFCC in the first NFC device (ie, the default value set in the NFCC when the NFC chip is shipped from the factory), or may be the value of the NFCC configured by the DH of the first NFC device to the first NFC device.
  • the embodiments of the present invention are not limited.
  • the NFCC of the first NFC device may further perform the following operations:
  • the first RF interface Receiving, by the first RF interface, a data message sent by the DH of the first NFC device, and encapsulating the load in the data message into a data packet by using the first length value as the maximum length value, that is, the data packet
  • the length value is less than or equal to the first length value
  • the data packet is sent to the second NFC device.
  • the NFCC of the first NFC device sends the foregoing first notification that includes the first length value to the DH of the first NFC device, and the first notification is to report the first NFC device to the DH of the first NFC device.
  • the maximum length of the data packet transmitted in the subsequent communication of the second NFC device is the first length value, so that the DH of the first NFC device can obtain the first length value and can be used in the upper layer service, for example, , estimating the time required to complete the transmission of the upper layer service related data in the communication, and the like, and notifying the first NFC device that the first RF interface of the first NFC device has been activated, that is, the NFCC of the first NFC device has been Ready to receive the data message sent by the DH of the first NFC device.
  • the data message may be a Data Message(s) defined in the NCI specification, where the Data Message(s) is transmitted between the DH and the NFCC by transmitting the Data Packet(s), and the load in the data message is (payload) can carry data related to upper layer services.
  • the foregoing data packet may be understood as a frame that carries the DEP_REQ in the corresponding technical frame format, as defined in the Digital specification, as described above; for the sake of simplicity of description, the foregoing data packet may also be understood as a Digital specification.
  • the packet in the data message is encapsulated into a data packet by using the first length value as the maximum length value, that is, the load in the data message is encapsulated in at least one DEP_REQ, and the length of the DEP_REQ is guaranteed.
  • the first length value is not exceeded to ensure that the NFCC of the first NFC device can send the DEP_REQs through corresponding frame formats (for example, NFC-A technical standard frame format, NFC-F technical frame format, etc.) (ie, these DEP_REQs)
  • corresponding frame formats for example, NFC-A technical standard frame format, NFC-F technical frame format, etc.
  • the encapsulation is sent out in the frame of the corresponding format). Therefore, the foregoing specific operation of sending the data packet to the second NFC device and subsequent steps thereof may be:
  • the DEP_RES (specifically, the service-related data in the DEP_RES) is acquired and forwarded to the DH of the first NFC device.
  • the first request may be the PSL_REQ defined in the Digital specification
  • the first RF interface may be an NFC-DEP radio interface defined in the NCI specification
  • the first notification may be a radio interface activation notification RF_INTF_ACTIVATED_NTF defined in the NCI specification, and the present invention is applicable to the PSL_RES defined in the Digital specification.
  • the embodiment is not limited.
  • the foregoing first request may also be a RATS Command or an ATTRIB Command applicable to the ISO-DEP protocol defined in the Digital specification, and the FSDI (Frame Size for proximity Couple Device Integer) parameter is included in the calculation work in the round.
  • RATS Command or an ATTRIB Command applicable to the ISO-DEP protocol defined in the Digital specification
  • FSDI Frae Size for proximity Couple Device Integer
  • the maximum length value FSD of a data packet (for example, an information block I-block or a load payload of the I-block) that can be accepted by an NFC device (for example, a reader/writer) in a poll mode; correspondingly, the first The response may also be a RATS Response or an ATTRIB Response defined in the Digital specification, which may include a FSCI (Frame Size for proximity Card Integer) parameter for calculating that an NFC device (eg, an NFC tag or card emulation) operating in poll mode can accept
  • the maximum length value FSC of the data packet (for example, the information block I-block or the load payload of the I-block);
  • the first RF interface may be an ISO-DEP radio interface or an NDEF radio interface defined in the NCI specification, the first The notification can be RF_INTF_ACTIVATED_NTF as defined in the NCI regulations.
  • the “adjustment” used in the solution of the present invention can be understood as a negotiation, a
  • the NFCC of the first NFC device determines whether the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication, and if yes, transmitting the first length value including the first length value to the second NFC device.
  • the NFCC of the first NFC device sets the first length value included in the first request Determining a maximum length value of a data packet transmitted by the first NFC device and the second NFC device during subsequent communication. It can be seen that the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the data packet in the subsequent communication process through the NFCC and the second NFC device as the target.
  • FIG. 2 is a schematic flowchart diagram of another method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention.
  • the method shown in FIG. 2 is applied to the NFCC of the first NFC device as the initiator.
  • the method for adjusting the packet length in the near field communication NFC may include the following steps:
  • the adjustment command is used to indicate that the NFCC of the first NFC device adjusts the maximum length value of the data packet transmitted in the subsequent communication process.
  • the first NFC device and the second NFC device before the NFCC of the first NFC device performs the step S201, the first NFC device and the second NFC device have activated the MAC layer, that is, the first NFC device and the second NFC device have passed the ATR_REQ and the ATR_RES.
  • the NFCC of the first NFC device receiving the foregoing adjustment command means that the NFCC of the first NFC device can adjust the data transmitted by the first NFC device and the second NFC device in the subsequent communication process after the MAC layer is activated.
  • the maximum length value of the packet which limits the length of the data packets respectively transmitted from the first NFC device to the second NFC device and from the second NFC device to the first NFC device.
  • the first request is used to indicate that a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication process is adjusted to a first length value included in the first request.
  • the first length value is less than or equal to the second length value and less than or equal to the third length value, and the first request further includes the first DID.
  • the NFCC of the first NFC device sends a first request including the first length value to the second NFC device, so that the second NFC device does not accept the maximum length of the data packet transmitted during the subsequent communication. Does not return any response when the value is adjusted to the first length value above, or to make the second NFC
  • the device returns a response indicating that the maximum length value of the data packet transmitted during the subsequent communication is not accepted to be adjusted to the first length value, for example, the DID included in the response is not equal to the DID included in the first request.
  • the DID included in the response is equal to the DID included in the first request to indicate that the second NFC device accepts the first length value.
  • the NFCC of the first NFC device sends the first request including the first length value to the second NFC device, that is, the NFCC of the first NFC device sends the NFCC of the second NFC device to include the first length value.
  • First request the NFCC of the first NFC device sends the first request including the first length value to the second NFC device, that is, the NFCC of the first NFC device sends the NFCC of the second NFC device to include the first length value.
  • the first response includes a second DID.
  • the first length value is used as a maximum length value of the data packet transmitted in the subsequent communication.
  • the first response when the second DID included in the first response is the same as the first DID included in the first request, the first response is used to indicate that the second NFC device has transmitted the subsequent communication process.
  • the maximum length value of the data packet is adjusted to the first length value, wherein the first DID and the second DID are both device identifiers of the second NFC device, and for example, for the NFC-DEP protocol, the second DID is The first NFC device as the initiator, which is assigned to the second NFC device as the target when the MAC layer is activated by the ATR_REQ, is used to identify one identifier of the second NFC device; and for example, for the ISO-DEP protocol, The second DID is allocated to the second NFC device as a first NFC device as a reader/writer (Reader/Writer) when the second NFC device is activated as an NFC tag or a card emulation by the RATS Command or the ATTRIB Command. An identifier identifying the second NFC device.
  • the NFCC of the first NFC device may further perform the following operations:
  • the NFCC of the first NFC device You can also do the following:
  • the first RF interface is activated and a first notification is sent to the DH of the first NFC device, wherein the first notification is used to inform the DH of the first NFC device that the first RF interface has been activated.
  • the first NFC device and the second NFC device activate the MAC layer between the first NFC device and the second NFC device by using ATR_REQ and ATR_RES, that is, the first NFC device and the second NFC device have negotiated The maximum length value of the data packets respectively transmitted in the two directions in the subsequent communication, that is, the second length value and the third length value in the above embodiment.
  • the parameter value in the ATR_RES may be carried, including the third length value.
  • the NFCC of the first NFC device may further perform the following operations:
  • the sending, by the DH of the first NFC device, the foregoing adjustment command to the NFCC of the first NFC device may occur before the first NFC device directly activates the MAC layer by using the NFCC and the second NFC device, or After that, because the DH of the first NFC device does not know the second length value and the third length value that the NFCC of the first NFC device and the second NFC device are about to negotiate or have negotiated, the DH of the first NFC device is The first length value of the sent adjustment command may be greater than, equal to, or less than the second length value or the third length value, then the NFCC of the first NFC device prevents the first length value from exceeding the second length value or For a three-length value, the NFCC of the first NFC device needs to perform the above operations to ensure that the first length value is less than or equal to the second length value and the third length value.
  • the NFCC of the first NFC device may also perform the following operations:
  • the first RF interface Receiving, by the first RF interface, the first data message sent by the DH of the first NFC device, and encapsulating the load in the first data message into the first data packet by using the first length value as the maximum length value, that is, the first data packet
  • the length value of a data packet is less than or equal to the first length value
  • the first data packet is sent to the second NFC device.
  • the determination is performed after step S201 and before step S202
  • the adjustment of the status indication and/or the first length value is sent to the DH of the first NFC device.
  • the NFCC of the first NFC device can also perform the following operations:
  • the second RF interface Receiving, by the second RF interface, the second data message sent by the DH of the first NFC device, and packaging the load in the second data message into the second data packet by using the first length value as the maximum length value, that is, the second data packet
  • the length value of the data packet is less than or equal to the first length value
  • the second data packet is sent to the second NFC device.
  • the first length value may be included in the second notification, and may not be included.
  • the first request may be a PSL_REQ defined in the Digital specification
  • the first response may be a PSL_RES defined in the Digital specification
  • the first RF interface and the second RF interface may be an NFC defined in the NCI specification.
  • the DEP radio interface, and the foregoing first notification and the second notification may be the radio interface activation notification RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
  • the foregoing first request may also be a RATS Command or an ATTRIB Command applicable to the ISO-DEP protocol defined in the Digital specification, and the FSDI (Frame Size for proximity Couple Device Integer) parameter is included in the calculation work in the round.
  • RATS Command or an ATTRIB Command applicable to the ISO-DEP protocol defined in the Digital specification
  • FSDI Frae Size for proximity Couple Device Integer
  • the maximum length value FSD of a data packet (for example, an information block I-block or a load payload of the I-block) that can be accepted by an NFC device (for example, a reader/writer) in a poll mode; correspondingly, the first The response may also be a RATS Response or an ATTRIB Response defined in the Digital specification, which may include a FSCI (Frame Size for proximity Card Integer) parameter for calculating that an NFC device (eg, an NFC tag or card emulation) operating in poll mode can accept
  • the maximum length value FSC of the data packet (for example, the information block I-block or the load payload of the I-block); the first RF interface and the second RF interface may be an ISO-DEP radio interface or NDEF defined in the NCI specification.
  • the radio frequency interface, the first notification and the second notification may be RF_INTF_ACTIVATED_NTF defined in the NCI specification.
  • the “adjustment” used in the solution of the present invention can be understood as a negotiation, a limitation, and the like in addition to the meaning of the present invention, and the present invention does not limit this.
  • the NFCC of the first NFC device determines whether it receives the adjustment command including the first length value sent by the DH of the first NFC device, where the adjustment command is used to indicate the first NFC.
  • the NFCC of the device adjusts the maximum length value of the data packet transmitted during the subsequent communication, and when the determination result is yes, sends a first request including the first length value to the second NFC device, where the first request is used for Adjusting a maximum length value of the data packet transmitted during the subsequent communication between the first NFC device and the second NFC device to a first length value, when receiving the first response returned by the second NFC device for the first request, and the first
  • the NFCC of the first NFC device determines the first length value included in the first request as the first NFC device and the second NFC device.
  • the maximum length of the data packet transmitted during subsequent communications can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party.
  • FIG. 3 is a schematic flowchart diagram of another method for adjusting the length of a data packet in a near field communication NFC according to an embodiment of the present invention.
  • the method shown in FIG. 3 is applied to the NFCC of the second NFC device as the target party that performs point-to-point communication with the first NFC device as the initiator in the above embodiment.
  • the method for adjusting the packet length in the near field communication NFC may include the following steps:
  • S301 Receive a first request that includes a first length value sent by an NFCC of the first NFC device.
  • the NFCC of the second NFC device performs the step S301, that is, the first NFC device and the second NFC device have activated the MAC layer, that is, the first NFC device and the second NFC device have negotiated with the ATR_RES through the ATR_REQ.
  • the maximum length value of the data packet transmitted in the subsequent communication process that is, the second length value and the third length value, wherein the second length value is set by the first NFC device and is used to limit the second NFC device in the subsequent communication process.
  • the length of the data packet sent (ie, the length of the data packet transmitted from the second NFC device to the direction of the first NFC device), the third length value being set by the second NFC device and used to limit the first NFC device in subsequent
  • the length of the data packet sent during the communication (ie the length of the data packet transmitted from the first NFC device to the second NFC device), that is, the length of the data packet sent by the second NFC device in subsequent communication
  • the second length value cannot be exceeded, and the length of the data packet sent by the first NFC device cannot exceed the third length value.
  • the first request that the NFCC of the second NFC device receives the first length value is determined by the NFCC of the first NFC device to determine that the NFCC is responsible for determining the maximum number of data packets transmitted in the subsequent communication.
  • the length value or the inclusion of the DH transmission received by the NFCC at the first NFC device A first length value and a request issued after the adjustment command to instruct the NFCC of the first NFC device to adjust the maximum length value of the data packet transmitted during the subsequent communication.
  • the first request is used to indicate that the maximum length value of the data packet transmitted by the first NFC device and the second NFC device in the subsequent communication process is adjusted to a first length value included in the first request, where the first The length value is less than or equal to the second length value and less than or equal to the third length value, and the first request may further include the first DID.
  • the NFCC of the second NFC device when the determination result of step S302 is YES, the NFCC of the second NFC device may perform step S303; when the determination result of step S302 is negative, the NFCC of the second NFC device may perform step S304, optionally
  • the NFCC of the second NFC device may also not return any response to the first NFC device, or return an error to the first NFC device, for example, the NFCC of the second NFC device sets the DID therein to be not equal to the first The DID in the request indicates that there is an error.
  • the NFCC of the second NFC device determines whether it is responsible for responding to the first request that the NFCC of the second NFC device determines whether the NFCC of the second NFC device is responsible for confirming the first content included in the first request. Length value.
  • determining, by the NFCC of the second NFC device, whether the NFCC of the second NFC device is responsible for responding to the foregoing first request may include:
  • first parameter in the embodiment of the present invention may not be the same parameter as the first parameter in the previous embodiment.
  • the first response may include a second DID.
  • the sending, by the NFCC of the second NFC device, the first response to the first request to the NFCC of the first NFC device may include:
  • sending to the NFCC of the first NFC device is used to indicate the second NFC device.
  • Receiving a first response that adjusts a maximum length value of the data packet transmitted during the subsequent communication to the first length value wherein the second DID included in the first response and the first DID included in the first request The same, and the second DID included in the first response and the first DID included in the first request are both device identifiers of the second NFC device;
  • the determination result is no, sending, to the NFCC of the first NFC device, a first response for indicating that the second NFC device does not accept the maximum length value of the data packet transmitted in the subsequent communication process to be adjusted to the first length value, For example, the DID included in the first response is not equal to the DID included in the first request, to indicate that the second NFC device does not accept the first length value.
  • the NFCC of the second NFC device may also perform the following operations:
  • the first length value is sent to the DH of the second NFC device by the first notification.
  • the NFCC of the second NFC device sends a second notification including the foregoing first length value to the DH of the second NFC device to notify the first RF interface on the DN second NFC device of the second NFC device.
  • the second response is used to indicate whether the DH of the second NFC device accepts to adjust the maximum length value of the data packet transmitted in the subsequent communication process to the first length value
  • the second response is The DH of the second NFC device determines whether the first length value is less than or equal to the second length value and is less than or equal to the third length value, and then returns a second response returned by the data message, that is, when the first When the length value is less than or equal to the second length value and less than or equal to the third length value, the second response is used to indicate that the DH accepting of the second NFC adjusts the maximum length value of the data packet transmitted in the subsequent communication process to the foregoing a first length value; when the first length value is greater than the second length value or the first length value is greater than the third length value, the second response is used to indicate that the DH of the second NFC device does not accept the subsequent communication process Maximum length adjustment of the packets transmitted in Is the first length value described above.
  • the first request may be a PSL_REQ defined in the Digital specification
  • the first response and the second response may be PSL_RES defined in the Digital specification
  • the first RF interface may be an NFC defined in the NCI specification.
  • the DEP radio interface, and the foregoing first notification and the second notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
  • the NFCC of the second NFC device may not follow the manner of the foregoing step S304, that is, the first RF interface is not activated, but the data packet defined by the NCI specification (Data Message/Packet) The first length value is reported to DH.
  • the NFCC of the second NFC device may send the second notification to the DH to notify the DH of the second NFC device that the first RF interface is activated.
  • step S302 is optional, that is, the NFCC has the ability or authority to process and respond to the first request by default.
  • the NFCC of the second NFC device may further perform the following operations:
  • the data packet can be understood as the above DEP_REQ
  • the data packet is decapsulated to obtain data related to the upper layer service, and the data related to the upper layer service is sent to the DH of the second NFC device by using the first RF interface.
  • the NFCC of the second NFC device as the target party receives the first request for adjusting the maximum length value of the data packet transmitted in the subsequent communication process, which is sent by the NFCC of the first NFC device as the initiator, And determining whether the NFCC of the second NFC device is responsible for responding to the first request, and when the determination result is yes, returning a response to the first request to the NFCC of the first NFC device, and when the determination result is no, activating the second NFC An RF interface on the device and transmitting a notification including a first length value to the DH of the second NFC device, receiving a response returned by the DH of the second NFC device, and transmitting the response to the NFCC of the first NFC device, wherein the response When the first DID included in the first DID is the same as the DID included in the first request, the response is used to indicate that the second NFC device has transmitted the subsequent communication process.
  • the maximum length value of the packet is adjusted to the first length value. It can be seen that the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party.
  • FIG. 4 is a schematic flowchart of another method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention.
  • the method shown in FIG. 4 is applied to the first NFC device as the initiator and the second NFC device as the target, wherein the first NFC device and the second NFC device are each composed of at least NFCC and DH, and the first The MAC layer is activated by both the NFC device and the second NFC device, that is, the first NFC device and the second NFC device have negotiated the maximum length value of the data packet transmitted in the subsequent communication process, that is, the second length, through the ATR_REQ and the ATR_RES.
  • the second length value is set by the first NFC device and is used to limit the length of the data packet sent by the second NFC device during the subsequent communication (ie, from the second NFC device to the first NFC device a length of the data packet transmitted in the direction), the third length value being set by the second NFC device and used to limit the length of the data packet sent by the first NFC device during the subsequent communication (ie, from the first NFC device to the second
  • the length of the data packet transmitted in the direction of the NFC device that is, in the subsequent communication, the length of the data packet sent by the second NFC device cannot exceed the second length value, and the length of the data packet sent by the first NFC device cannot be Exceeded the third length value.
  • the method for adjusting the packet length in the near field communication NFC may include the following steps:
  • the NFCC of the first NFC device determines whether it is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication.
  • step S401 when the determination result in step S401 is YES, the NFCC of the first NFC device performs step S402; when the determination result in step S401 is negative, the NFCC of the first NFC device may end the current process.
  • the NFCC of the first NFC device sends a first request including a first length value to the NFCC of the second NFC device.
  • the first request is used to indicate that a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication process is adjusted to a first length value included in the first request.
  • the first length value is a length value determined by the NFCC of the first NFC device, the first length value is less than or equal to the second length value and less than or equal to the third length value, and the first request is It can also contain the first DID.
  • the NFCC of the second NFC device receives the first request, and determines whether the NFCC of the second NFC device is responsible for responding to the first request.
  • step S403 when the determination result of step S403 is YES, the NFCC of the second NFC device may perform step S404; when the determination result of step S403 is negative, the NFCC of the second NFC device may perform step S405.
  • the NFCC of the second NFC device sends a first response to the first request to the NFCC of the first NFC device.
  • the sending, by the NFCC of the second NFC device, the first response to the first request to the NFCC of the first NFC device may include:
  • the first response to the NFCC of the first NFC device is sent to instruct the second NFC device not to accept the maximum length value of the data packet transmitted in the subsequent communication process to be adjusted to the first length value.
  • the NFCC of the second NFC device may not return any response to the NFCC of the first NFC device.
  • the response error message may also be returned to the NFCC of the first NFC device, which is not limited in the embodiment of the present invention.
  • the NFCC of the second NFC device activates the first RF interface on the second NFC device.
  • the NFCC of the second NFC device sends a first notification including the foregoing first length value to the DH of the second NFC device.
  • the NFCC of the second NFC device sends a first notification including the foregoing first length value to the DH of the second NFC device to notify the first RF interface of the DN second NFC device of the second NFC device.
  • the DH of the second NFC device receives the first notification, and determines whether the first length value is less than or equal to the second length value and is less than or equal to the third length value.
  • step S407 when the determination result of step S407 is YES, the DH of the second NFC device may perform step S408; when the determination result of step S407 is negative, the DH of the second NFC device may be to the second NFC device.
  • the NFCC returns a response error message.
  • the DH of the second NFC device sends a second response to the NFCC of the second NFC device by using a data packet.
  • the second response is used to indicate whether the DH of the second NFC device accepts to adjust the maximum length value of the data packet transmitted in the subsequent communication process to the first length value.
  • the NFCC of the second NFC device sends the foregoing second response to the NFCC of the first NFC device.
  • the NFCC of the first NFC device receives a response sent by the NFCC of the second NFC device.
  • the response received by the NFCC of the first NFC device is the first response or the second response.
  • the NFCC of the first NFC device may further perform step S412, step S413, and step S414, where:
  • the NFCC of the first NFC device sends a second notification including the foregoing first length value to the DH of the first NFC device.
  • the second notification is used to notify the DH of the first NFC device that the second RF interface in the first NFC device has been activated.
  • the NFCC of the first NFC device sends the foregoing second notification that includes the first length value to the DH of the first NFC device, and the purpose is to report the first NFC device and the second NFC to the DH of the first NFC device.
  • the maximum length of the data packet transmitted in the subsequent communication after the device is adjusted is the first length value, so that the DH of the first NFC device can obtain the first length value and can be used in the upper layer service, for example, estimating. What is the time required to complete the transmission of the upper layer service related data in this communication, and the DH of the first NFC device is notified that the second RF interface has been activated, that is, the NFCC of the first NFC device is ready.
  • the data message may be a Data Message(s) defined in the NCI specification, where the Data Message(s) is transmitted between the DH and the NFCC by transmitting the Data Packet(s), and the load in the data message is (payload) can carry data related to upper layer services.
  • the data packet and the data packet are the data packet described in the foregoing embodiment, that is, the data packet can be understood as DEP_REQ, and the length value thereof is less than or equal to the first length value;
  • whether the NFCC of the first NFC device determines whether it is responsible for determining a maximum length value of the data packet transmitted in the subsequent communication may include:
  • the value of the first parameter in the NFCC of the first NFC device is a first specific value, wherein the first specific value is used to indicate that the maximum length value of the data packet transmitted in the subsequent communication is from the NFCC in the first NFC device responsible for determining, and the value of the first parameter may be the default value of the NFCC in the first NFC device (ie, may be understood as a default value set in the NFCC when the NFC chip is shipped), or may be the DH of the first NFC device.
  • the value of the NFCC configured for the first NFC device is not limited in the embodiment of the present invention.
  • the first parameter is PN_NFC_DEP_LENGTH, which is 1 byte (ie, octet octet), and the first specific value is 0x00 (of course, other values may be used, here is only an example)
  • PN_NFC_DEP_LENGTH is 0x00
  • the NFCC can determine to adjust the maximum length value according to conditions such as its own capability.
  • the value of the first parameter PN_NFC_DEP_LENGTH may be set to a default value when the NFC chip is shipped from the factory. If the default value is the first specific value, the NFCC of the first NFC device is responsible for determining the transmission in the subsequent communication. The maximum length value of the data packet. Otherwise, the NFCC of the first NFC device cannot determine the maximum length value.
  • the DH can configure (ie, modify) the first NFCC through a parameter configuration command (eg, CORE_SET_CONFIG_CMD) defined in the NCI specification. The value of the parameter.
  • determining, by the NFCC of the second NFC device, whether the NFCC of the second NFC device is responsible for responding to the foregoing first request may include:
  • a value of the second parameter in the NFCC of the second NFC device is a second specific value, where The second specific value is used to indicate that the NFCC of the second NFC device is responsible for responding to the first request, and the second specific value may be a default value of the NFCC of the second NFC device, or may be a DH of the second NFC device.
  • the value of the NFCC configured for the second NFC device is not limited in the embodiment of the present invention.
  • the second parameter is LN_NFC_DEP_LENGTH, which is 1 byte (ie, octet octet), and the second specific value is 0x00 (of course, it can be other values, here is only an example)
  • LN_NFC_DEP_LENGTH is 0x00
  • the NFCC can process and respond to the first request according to conditions such as its own capability.
  • the value of the second parameter LN_NFC_DEP_LENGTH may be set to a default value when the NFC chip is shipped from the factory. If the default value is the second specific value, the NFCC of the second NFC device is responsible for confirming the transmission in the subsequent communication. The maximum length value of the data packet. Otherwise, the NFCC of the second NFC device cannot determine the maximum length value.
  • the DH can configure (ie, modify) the second NFCC through a parameter configuration command (eg, CORE_SET_CONFIG_CMD) defined in the NCI specification. The value of the parameter.
  • the NFCC of the second NFC device performs step S404 and when the first response is used to indicate that the second NFC device accepts to adjust the maximum length value of the data packet transmitted during the subsequent communication to the first length.
  • the value of the NFCC of the second NFC device can also perform the following operations:
  • the first length value is sent to the DH of the second NFC device by the third notification.
  • the first request may be a PSL_REQ defined in the Digital specification
  • the first response and the second response may be PSL_RES defined in the Digital specification
  • the first RF interface and the second RF interface may be NCI.
  • the NFC-DEP radio interface is defined in the specification
  • the first notification, the second notification, and the third notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
  • the foregoing first request may be a RATS Command or an ATTRIB Command defined in the Digital specification
  • the foregoing first response and the second response may be a RATS Response or an ATTRIB Response defined in the Digital specification
  • the foregoing first RF interface and The foregoing second RF interface may be an ISO-DEP radio interface or an NDEF radio interface defined in the NCI specification
  • the first notification, the second notification, and the third notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, and the implementation of the present invention The example is not limited.
  • the implementation of the embodiments of the present invention can implement the NFCC and the target party through the NCI specification.
  • the NFC device adjusts the maximum length value of the communication packet during subsequent communication.
  • FIG. 5 is a schematic flowchart diagram of another method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention.
  • the method shown in FIG. 5 is applied to the first NFC device as the initiator and the second NFC device as the target, wherein the first NFC device and the second NFC device are each composed of at least NFCC and DH, and the first The MAC layer is activated by both the NFC device and the second NFC device, that is, the first NFC device and the second NFC device have negotiated the maximum length value of the data packet transmitted in the subsequent communication process, that is, the second length, through the ATR_REQ and the ATR_RES.
  • the method for adjusting the packet length in the near field communication NFC may include the following steps:
  • the DH of the first NFC device sends an adjustment command including a first length value to the NFCC of the first NFC device.
  • the adjustment command is used to indicate that the NFCC of the first NFC device adjusts the maximum length value of the data packet transmitted in the subsequent communication process.
  • the adjustment command (eg, RF_LR_ADJUST_CMD or RF_LR_SWITCH_CMD) may be used in the RFST_DISCOVERY state, the RFST_W4_ALL_DISCOVERIES state, the RFST_W4_HOST_SELECT state, or the RFST_POLL_ACTIVE state defined by the NCI specification, and the format includes but is not limited to the formats shown in Tables 1 and 2 below.
  • the first length value in the adjustment command may be a value determined by the DH of the first NFC device that is less than or equal to the second length value and the third length value.
  • the NFCC of the first NFC device The radio interface activation notification including the first length value may be reported to the DH of the first NFC device before the step S501.
  • whether the first length value does not exceed the second length value and the third length value may not pass the first
  • the DH of an NFC device determines that the NFCC of the first NFC device may need to determine the length value itself after receiving the adjustment command.
  • the NFCC of the first NFC device receives the foregoing adjustment command.
  • the NFCC of the first NFC device sends a first request including a first length value to the NFCC of the second NFC device.
  • the first request is used to adjust a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication process to a first length value included in the first request,
  • the first length value is less than or equal to the second length value and less than or equal to the third length value, and the first request may further include the first DID.
  • the NFCC of the second NFC device receives the first request, and determines whether the NFCC of the second NFC device is responsible for responding to the first request.
  • step S504 when the determination result of step S504 is YES, the NFCC of the second NFC device Step S505 may be performed; when the determined result of step S504 is NO, the NFCC of the second NFC device may perform step S506.
  • the NFCC of the second NFC device sends a first response to the first request to the NFCC of the first NFC device.
  • the first response may include the second DID
  • the sending, by the NFCC of the second NFC device, the first response to the first request to the NFCC of the first NFC device may include:
  • the first response to the NFCC of the first NFC device is sent to instruct the second NFC device not to accept the maximum length value of the data packet transmitted in the subsequent communication process to be adjusted to the first length value.
  • the NFCC of the second NFC device may not return any response to the NFCC of the first NFC device.
  • the response error message may also be returned to the NFCC of the first NFC device, which is not limited in the embodiment of the present invention.
  • the NFCC of the second NFC device activates the first RF interface on the second NFC device.
  • the NFCC of the second NFC device sends a first notification including the foregoing first length value to the DH of the second NFC device.
  • the NFCC of the second NFC device sends a first notification including the foregoing first length value to the DH of the second NFC device to notify the first RF interface of the DN second NFC device of the second NFC device.
  • the DH of the second NFC device receives the first notification, and determines whether the first length value is less than or equal to the second length value and is less than or equal to the third length value.
  • the DH of the second NFC device may be To perform step S509; when the result of the determination in step S508 is NO, the DH of the second NFC device may return a response error message to the NFCC of the second NFC device.
  • the DH of the second NFC device sends a second response to the NFCC of the second NFC device by using a data packet.
  • the second response is used to indicate whether the DH of the second NFC device accepts to adjust the maximum length value of the data packet transmitted in the subsequent communication process to the first length value.
  • the NFCC of the second NFC device sends the foregoing second response to the NFCC of the first NFC device.
  • the NFCC of the first NFC device receives a response sent by the NFCC of the second NFC device.
  • the response received by the NFCC of the first NFC device is the first response or the second response.
  • the NFCC of the first NFC device uses the first length value as the data transmitted in the subsequent communication process. The maximum length of the packet.
  • the NFCC of the first NFC device returns an adjustment response including a status indication and/or the first length value to the DH of the first NFC device.
  • the status indication is used to indicate that the NFCC of the first NFC device has adjusted the maximum value to the first length value, that is, the adjustment has been completed between the first NFC device and the second NFC device.
  • the NFCC of the first NFC device may further perform the following operations:
  • the NFCC of the first NFC device may further perform the following operations:
  • the NFCC of the second NFC device can also perform the following operations:
  • the first length value is sent to the DH of the second NFC device by the third notification.
  • the NFCC of the first NFC device first activates the foregoing first RF interface, and sends the first notification to the DH of the first NFC device, and then performs the step S501 by the DH of the first NFC device.
  • the NFCC of the first NFC device may also perform the following operations:
  • the first data message sent by the DH of the first NFC device Receiving, by the foregoing second RF interface, the first data message sent by the DH of the first NFC device, and packaging the load in the first data message into the first data packet by using the first length value as the maximum length value, that is, the first data packet
  • the length value of a data packet is less than or equal to the first length value
  • the first data packet is sent to the NFCC of the second NFC device.
  • the operation of determining that the first length value is less than or equal to the second length value and less than or equal to the third length value is performed.
  • the NFCC of the first NFC device may also perform the following operations:
  • the fourth notification is used to notify that the DH third RF interface of the first NFC device has been activated
  • the second data packet is sent to the NFCC of the second NFC device.
  • the foregoing fourth notification may include the first length value, or may not include; the first data message and the second data message, the first data packet, and the second data packet are compared with the foregoing embodiment.
  • the data messages and data packets described above are the same, and are not described here.
  • the first request may be a PSL_REQ defined in the Digital specification
  • the first response and the second response may be a PSL_RES defined in the Digital specification
  • the first RF interface, the second RF interface, and the foregoing The third RF interface may be an NFC-DEP radio interface defined in the NCI specification
  • the first notification, the second notification, the third notification, and the fourth notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, and the embodiment of the present invention Not limited.
  • the first request may be a RATS Command or an ATTRIB Command defined in the Digital specification
  • the first response and the second response may be determined by the Digital specification.
  • the first RF interface, the second RF interface, and the third RF interface may be an ISO-DEP radio interface or an NDEF radio interface defined in the NCI specification, and the foregoing first notification, the foregoing
  • the second notification, the third notification, and the fourth notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
  • the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party.
  • FIG. 6 is a schematic structural diagram of an NFCC according to an embodiment of the present invention.
  • the NFCC is an NFCC in the first NFC device.
  • the NFCC may include a determining module 601, a communication module 602, and a determining module 603, where:
  • the determining module 601 is configured to determine whether the NFCC is responsible for determining a maximum length value of the data packet transmitted in the subsequent communication, wherein the maximum length value limits the first NFC device to the second NFC device. The length of the data packet transmitted in the direction and respectively from the second NFC device to the first NFC device.
  • the first NFC device and the second NFC device before the determining module 601 performs the corresponding operation, the first NFC device and the second NFC device have activated the MAC layer, that is, the first NFC device and the second NFC device have negotiated the ATR_REQ and the ATR_RES.
  • the maximum length value of the data packet transmitted during the communication that is, the second length value and the third length value, wherein the second length value is set by the first NFC device and is used to restrict the second NFC device from transmitting during the subsequent communication
  • the length of the data packet ie, the length of the data packet transmitted from the second NFC device to the direction of the first NFC device
  • the third length value being set by the second NFC device and used to limit the first NFC device in the subsequent communication process
  • the length of the data packet sent in the middle ie, the length of the data packet transmitted from the first NFC device to the second NFC device
  • the second length value, the length of the data packet sent by the first NFC device cannot exceed the third length value.
  • the communication module 602 is configured to: when the determination result of the determining module 601 is yes, send a first request including a first length value to the second NFC device, and receive a first response returned by the second NFC device for the first request,
  • the first request is used to indicate that the maximum length value of the data packet transmitted by the first NFC device and the second NFC device in the subsequent communication is adjusted to a first length value, and the first length value is one determined by the NFCC.
  • a value the first request may further include a first DID and the first response may include The second DID.
  • the first request may be a parameter selection request PSL_REQ defined in the Digital specification defined by the NFC Forum, wherein the fifth byte (Byte 5) represents an FSL parameter, and the value of the byte defines the command and response.
  • the maximum length value further, the values corresponding to the first and second bits in the byte (ie, b1 and b2 defined in the Digital specification) represent the maximum length value, for example, when the values of the two bits are here When it is 00b, the maximum length value is 64 bytes; when the value of the two bits is 01b, the maximum length value is 128 bytes; when the value of the two bits is 10b, the maximum length value is It is 192 bytes; when the value of two bits here is 11b, the maximum length value is 254 bytes.
  • adjusting the maximum length value by PSL_REQ and PSL_RES can be understood as switching from one length value to another length value, and can also be understood as renegotiation or modification of the maximum length value, etc., which is not correct in the embodiment of the present invention. Limit the meaning of the word "adjustment”.
  • the command and response may be commands and responses used for communication through the NFC-DEP protocol, such as DEP_REQ and DEP_RES.
  • the commands and responses may be encapsulated in data as payloads (upper layer application related business data).
  • the NFC-A technology ie the type A RF technology defined in the NFC Forum, corresponding to the abbreviation of Type A of ISO/IEC 14443) standard frame format or NFC-F technology (ie NFC Forum)
  • the defined type F radio frequency technology corresponding to the abbreviation of the 212 kbps and 424 kbps communication mechanism of ISO/IEC 18092
  • the above maximum length value can be understood as the maximum value of the packet length, and can also be understood as the above command and response.
  • the maximum number of payloads ie the type A RF technology defined in the NFC Forum, corresponding to the abbreviation of Type A of ISO/IEC 14443
  • NFC-F technology ie NFC Forum
  • the communication module 602 sends a first request including the first length value to the second NFC device, so that the second NFC device does not accept the maximum length value of the data packet transmitted during the subsequent communication process to The first length value does not return any response, or the second NFC device returns a response indicating that the maximum length value of the data packet transmitted during the subsequent communication is not accepted to be adjusted to the first length value, for example,
  • the DID included in the response is not equal to the DID included in the first request, to indicate that the second NFC device does not accept the first length value, or to cause the second NFC device to return to indicate acceptance in the subsequent communication process.
  • the maximum length value of the transmitted data packet is adjusted to the response of the first length value, for example, the device identifier DID included in the response is equal to the DID included in the first request, to indicate that the second NFC device accepts the foregoing A length value.
  • the determining module 603 is configured to use the first length value as the maximum length value of the data packet transmitted in the subsequent communication when the first DID is the same as the second DID.
  • the first response when the second DID included in the first response is the same as the first DID included in the first request, the first response is used to indicate that the second NFC device has transmitted the subsequent communication process.
  • the maximum length value of the data packet is adjusted to the first length value, wherein the first DID and the second DID are both device identifiers of the second NFC device, and for example, for the NFC-DEP protocol, the second DID is The first NFC device as the initiator, which is assigned to the second NFC device as the target when the MAC layer is activated by the ATR_REQ, is used to identify one identifier of the second NFC device; and for example, for the ISO-DEP protocol, The second DID is allocated to the second NFC device as a first NFC device as a reader/writer (Reader/Writer) when the second NFC device is activated as an NFC tag or a card emulation by the RATS Command or the ATTRIB Command. An identifier identifying the second NFC device.
  • the determining module 601 determines whether the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication, and the specific manner may be:
  • the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that the maximum length value of the data packet transmitted in the subsequent communication is determined by the NFCC in the first NFC device, and the first parameter
  • the value of the NFCC in the first NFC device may be the default value of the NFCC in the first NFC device (ie, the default value set in the NFCC when the NFC chip is shipped from the factory), or may be the value of the NFCC configured by the DH of the first NFC device to the first NFC device.
  • the embodiments of the present invention are not limited.
  • the communication module 602 is further configured to send, to the DH of the first NFC device, a first notification that includes the foregoing first length value, where the first notification is used to notify the first NFC device
  • the DH first RF interface has been activated and is also used to receive a data message sent by the DH of the first NFC device through the first RF interface.
  • the communication module 602 sends the foregoing first notification that includes the first length value to the DH of the first NFC device, and the purpose is to report the first NFC device and the second NFC to the DH of the first NFC device.
  • the maximum length of the data packet transmitted in the subsequent communication after the device is adjusted is the first length value, so that the DH of the first NFC device can obtain the first length value and can be used in the upper layer service, for example, estimating.
  • the data message may be a Data Message(s) defined in the NCI specification, where the Data Message(s) is transmitted between the DH and the NFCC by transmitting the Data Packet(s), and the load in the data message is (payload) can carry data related to upper layer services.
  • the NFCC may further include a package module 604, and the NFCC including the package module 604 may be as shown in FIG. 7.
  • FIG. 7 is a schematic structural diagram of another NFCC disclosed in the embodiment of the present invention. among them:
  • the encapsulating module 604 is configured to encapsulate the load in the data message into a data packet by using the first length value as the maximum length value.
  • the communication module 602 can also be configured to send the data packet to the second NFC device.
  • the first request may be a PSL_REQ defined in the Digital specification
  • the first response may be a PSL_RES defined in the Digital specification
  • the first RF interface may be an NFC-DEP radio interface defined in the NCI specification
  • the foregoing first notification may be a radio frequency interface activation notification RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
  • the foregoing first request may also be a RATS Command or an ATTRIB Command applicable to the ISO-DEP protocol defined in the Digital specification, where the FSDI (Frame Size for proximity Couple Device Integer) parameter is included for calculating work in polling.
  • FSDI Fram Size for proximity Couple Device Integer
  • the maximum length value FSD of a data packet (for example, an information block I-block or a load payload of the I-block) acceptable to an NFC device (for example, a reader/writer) in a (poll) mode; correspondingly, the first response described above It may also be a RATS Response or an ATTRIB Response defined in the Digital specification, which may include a FSCI (Frame Size for proximity Card Integer) parameter for calculating an acceptable NFC device (eg, NFC tag or card emulation) operating in poll mode.
  • FSCI Fram Size for proximity Card Integer
  • the maximum length value FSC of the data packet (for example, the information block I-block or the load payload of the I-block);
  • the first RF interface may be an ISO-DEP radio frequency interface or an NDEF radio frequency interface defined in the NCI specification, the first notification It can be RF_INTF_ACTIVATED_NTF as defined in the NCI regulations.
  • the “adjustment” used in the solution of the present invention can be understood as a negotiation, a limitation, and the like in addition to the meaning of the present invention, and the present invention does not limit this.
  • the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party.
  • FIG. 8 is a schematic structural diagram of another NFCC according to an embodiment of the present invention.
  • the NFCC is an NFCC in the first NFC device.
  • the NFCC may include a communication module. 801 and determining module 802, wherein:
  • the communication module 802 is configured to receive, by using the DH of the first NFC device, an adjustment command that includes a first length value, where the adjustment command is used to instruct the NFCC to adjust a maximum length value of the data packet transmitted during the subsequent communication, and the maximum The length value limits the length of the data packets respectively transmitted from the first NFC device to the second NFC device and from the second NFC device to the first NFC device.
  • the first NFC device and the second NFC device before the communication module 801 performs the corresponding operation, the first NFC device and the second NFC device have activated the MAC layer, that is, the first NFC device and the second NFC device have negotiated the ATR_REQ and the ATR_RES.
  • the maximum length value of the data packet transmitted during the communication that is, the second length value and the third length value, wherein the second length value is set by the first NFC device and is used to restrict the second NFC device from transmitting during the subsequent communication
  • the length of the data packet ie, the length of the data packet transmitted from the second NFC device to the direction of the first NFC device
  • the third length value being set by the second NFC device and used to limit the first NFC device in the subsequent communication process
  • the length of the data packet sent in the middle ie, the length of the data packet transmitted from the first NFC device to the second NFC device
  • the second length value, the length of the data packet sent by the first NFC device cannot exceed the third length value.
  • the communication module 801 is further configured to send a first request that includes the first length value to the second NFC device, and receive a first response that is returned by the second NFC device for the first request, where the first request is used to indicate that The maximum length value of the data packet transmitted during the subsequent communication between the first NFC device and the second NFC device is adjusted to a first length value, the first request may further include a first DID, and the first response may include a second DID .
  • the first request may be a parameter selection request PSL_REQ defined in the Digital specification defined by the NFC Forum, wherein the fifth byte (Byte 5) represents an FSL parameter, and the value of the byte defines the command and response.
  • the maximum length value further, the values corresponding to the first and second bits in the byte (ie, b1 and b2 defined in the Digital specification) represent the maximum length value, for example, when the values of the two bits are here When it is 00b, the maximum length value is 64 bytes; when the value of the two bits is 01b, the maximum length value is 128 bytes; when the value of the two bits is 10b, the maximum length value is It is 192 bytes; when the value of two bits here is 11b, the maximum length value is 254 bytes.
  • adjusting the maximum length value by PSL_REQ and PSL_RES can be understood as switching from one length value to another length value, and can also be understood as renegotiation or modification of the maximum length value, etc., which is not correct in the embodiment of the present invention. Limit the meaning of the word "adjustment”.
  • the command and response may be commands and responses used for communication through the NFC-DEP protocol, such as DEP_REQ and DEP_RES.
  • the commands and responses may be encapsulated in data as payloads (upper layer application related business data).
  • the NFC-A technology ie the type A RF technology defined in the NFC Forum, corresponding to the abbreviation of Type A of ISO/IEC 14443) standard frame format or NFC-F technology (ie NFC Forum)
  • the defined type F radio frequency technology corresponding to the abbreviation of the 212 kbps and 424 kbps communication mechanism of ISO/IEC 18092
  • the above maximum length value can be understood as the maximum value of the packet length, and can also be understood as the above command and response.
  • the maximum number of payloads ie the type A RF technology defined in the NFC Forum, corresponding to the abbreviation of Type A of ISO/IEC 14443
  • NFC-F technology ie NFC Forum
  • the communication module 801 sends a first request including the first length value to the second NFC device, so that the second NFC device does not accept the maximum length value of the data packet transmitted during the subsequent communication process to The first length value does not return any response, or the second NFC device returns a response indicating that the maximum length value of the data packet transmitted during the subsequent communication is not accepted to be adjusted to the first length value, for example,
  • the DID included in the response is not equal to the DID included in the first request, to indicate that the second NFC device does not accept the first length value, or to cause the second NFC device to return to indicate acceptance in the subsequent communication process.
  • the maximum length value of the transmitted data packet is adjusted to the response of the first length value, for example, the device identifier DID included in the response is equal to the DID included in the first request, to indicate that the second NFC device accepts the foregoing A length value.
  • the determining module 802 is configured to use the first length value as the maximum length value of the data packet transmitted in the subsequent communication when the first DID is the same as the second DID.
  • the first response when the second DID included in the first response is the same as the first DID included in the first request, the first response is used to indicate that the second NFC device has transmitted the subsequent communication process.
  • the maximum length value of the data packet is adjusted to the first length value, wherein the first DID and the second DID are both device identifiers of the second NFC device, and for example, for the NFC-DEP protocol, the second DID is The first NFC device as the initiator, which is assigned to the second NFC device as the target when the MAC layer is activated by the ATR_REQ, is used to identify one identifier of the second NFC device; and for example, for the ISO-DEP protocol, The second DID is allocated to the second NFC device as a first NFC device as a reader/writer (Reader/Writer) when the second NFC device is activated as an NFC tag or a card emulation by the RATS Command or the ATTRIB Command. An identifier identifying the second NFC device.
  • the communication module 801 can also be used to DH to the first NFC device. Transmitting an adjustment response including a status indication and/or the first length value, wherein the status indication is used to indicate that the NFCC has adjusted the maximum length value to the first length value, that is, the first NFC device and the second This adjustment has been completed between NFC devices.
  • the NFCC may further include the first activation module. 803, and the NFCC including the first activation module 803 can be as shown in FIG. 9, and FIG. 9 is a schematic structural diagram of another NFCC disclosed in the embodiment of the present invention. among them:
  • the first activation module 803 is configured to activate the first RF interface before the communication module 801 sends the first request including the first length value to the second NFC device.
  • the communication module 801 is further configured to send a first notification to the DH of the first NFC device, where the first notification is used to notify that the DH first RF interface of the first NFC device has been activated.
  • the first NFC device and the second NFC device activate the MAC layer between the first NFC device and the second NFC device by using ATR_REQ and ATR_RES, that is, the first NFC device and The second NFC device has negotiated the maximum length value of the data packets respectively transmitted in the two directions in the subsequent communication, that is, the second length value and the third length value in the above embodiment.
  • the parameter value in the ATR_RES may be carried, including the third length value.
  • the communication module 801 when the communication module 801 is further configured to send, to the DH of the first NFC device, an adjustment response including a status indication and/or the first length value, and the NFCC includes the first activation module 803, the communication is performed.
  • the module 801 is further configured to receive, by using the foregoing first RF interface, the first data message sent by the DH of the first NFC device.
  • the NFCC further includes a first encapsulation module 804, and the NFCC including the first encapsulation module 804 can be as shown in FIG. 10, and FIG. 10 is another NFCC disclosed in the embodiment of the present invention. Schematic. among them:
  • the first encapsulating module 804 is configured to encapsulate the load in the first data message into the first data packet by using the first length value as the maximum length value.
  • the communication module 801 is further configured to send the first data packet to the second NFC device.
  • the determining module 802 may also be in the communication module.
  • the 801 sends a first request including the foregoing first length value to the second NFC device. Before, determining that the first length value is less than or equal to the second length value and less than or equal to the third length value.
  • the NFCC further includes a second encapsulation module 805 and a second activation module 806, and the NFCC including the second encapsulation module 805 and the second activation module 806 can be as shown in FIG. 11, FIG. 11 is Another schematic diagram of the structure of the NFCC disclosed in the embodiment of the present invention. among them:
  • the second activation module 806 is configured to activate the second RF interface.
  • the communication module 801 is further configured to send a second notification to the DH of the first NFC device, where the second notification is used to notify that the DH second RF interface of the first NFC device has been activated, and receive the first through the second RF interface.
  • the second encapsulating module 805 is configured to encapsulate the load in the second data message into the second data packet by using the first length value as the maximum length value.
  • the communication module 801 is further configured to send the second data packet to the second NFC device.
  • sending the foregoing adjustment command to the NFCC of the first NFC device by the DH of the first NFC device may occur before the first NFC device directly activates the MAC layer by using the NFCC and the second NFC device. Or after that, because the DH of the first NFC device does not know the specificity of the second length value and the third length value that the NFCC of the first NFC device and the second NFC device are about to negotiate or have negotiated, the first NFC device The first length value of the adjustment command sent by the DH may be greater than, equal to, or less than the second length value or the third length value.
  • the NFCC of the first NFC device prevents the first length value from exceeding the second length value or The third length value, the NFCC of the first NFC device needs to perform the above operation to ensure that the first length value is less than or equal to the second length value and the third length value.
  • the second notification may include the first length value, or may not include; the first data message and the second data message, the first data packet and the second data packet, and
  • the data messages and data packets described in the foregoing embodiments are the same, and are not described here.
  • the first request may be a PSL_REQ defined in the Digital specification
  • the first response may be a PSL_RES defined in the Digital specification
  • the first RF interface and the second RF interface may be an NFC defined in the NCI specification.
  • the DEP radio interface, and the foregoing first notification and the second notification may be the radio interface activation notification RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
  • the first request may also be a RATS Command or an ATTRIB Command applicable to the ISO-DEP protocol defined in the Digital specification
  • the FSDI Frae Size for The proximity coupling Device Integer
  • the maximum length value FSD correspondingly, the first response may also be a RATS Response or an ATTRIB Response defined in the Digital specification, wherein the FSCI (Frame Size for proximity Card Integer) parameter may be included for calculating the operation in the poll mode.
  • the maximum length value FSC of a data packet (eg, an information block I-block or a load payload of the I-block) that can be accepted by an NFC device (eg, an NFC tag or card emulation);
  • the first RF interface described above and the above may be defined in the NCI specification
  • the first notification and the second notification described above may be RF_INTF_ACTIVATED_NTF defined in the NCI specification for the ISO-DEP radio interface or the NDEF radio interface.
  • the “adjustment” used in the solution of the present invention can be understood as a negotiation, a limitation, and the like in addition to the meaning of the present invention, and the present invention does not limit this.
  • the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party.
  • FIG. 12 is a schematic structural diagram of still another NFCC according to an embodiment of the present invention.
  • the NFCC may include at least one processor 1201, such as a CPU, a communication device 1202, and at least one communication bus 1203.
  • the first NFC device and the second NFC device have activated the MAC layer, that is, the first NFC device and the second NFC device have negotiated the maximum length value of the data packet transmitted in the subsequent communication process through the ATR_REQ and the ATR_RES, that is, the first a second length value and a third length value, wherein the second length value is set by the first NFC device and is used to limit the length of the data packet sent by the second NFC device during the subsequent communication (ie, from the second NFC device to the first The length of the data packet transmitted in the NFC device direction), the third length value being set by the second NFC device and used to limit the length of the data packet sent by the first NFC device during the subsequent communication (ie, from the first NFC device to The length of the data packet transmitted in the direction of the second NFC device, that is, the length of the data packet sent by the second NFC device in the subsequent communication cannot exceed the second length value, and the length of the data packet sent by the first NFC device Cannot exceed the third length value.
  • Communication bus 1203 is used to implement connection communication between these components.
  • the processor 1201 is configured to determine whether the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication.
  • the communication device 1202 is configured to: when the determination result of the processor 1201 is YES, send a first request including a first length value to the second NFC device, and receive a first response returned by the second NFC device for the first request, where
  • the first request is used to indicate that the maximum length value of the data packet transmitted by the first NFC device and the second NFC device in the subsequent communication is adjusted to a first length value, where the first length value is a value determined by the NFCC, and
  • the maximum length value limits the length of the data packet respectively transmitted from the first NFC device to the second NFC device direction and from the second NFC device to the first NFC device direction, and the first request may further include the first DID And the second response includes a second DID.
  • the communication device 1202 may include a first communication sub-device 12021 for communicating with the second NFC device (ie, transmitting data to and receiving data from the second NFC device), such as The transceiver circuit in the NFCC, etc., the operating frequency of the NFC antenna in the transceiver circuit may be 13.56 MHz, and the NFCC may send data to the second NFC device through the NFC antenna, or may receive data from the second NFC device.
  • the communication device 1202 may send the first request including the first length value to the second NFC device by using the first communication sub-device 12021 and receive the first response returned by the second NFC device for the first request.
  • the processor 1201 is further configured to: when the first DID is the same as the second DID, use the first length value as the maximum length value of the data packet transmitted in the subsequent communication.
  • the processor 1201 determines whether the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication:
  • the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that the maximum length value of the data packet transmitted in the subsequent communication is determined by the NFCC, and the value of the first parameter is the default of the NFCC.
  • the value ie, can be understood as the default value set to the NFCC when the NFC chip is shipped), or the value assigned to the NFCC by the DH of the first NFC device.
  • the communication device 1202 is further configured to send, to the DH of the first NFC device, a first notification that includes a first length value, where the first notification is used to notify the DH of the first NFC device.
  • the first RF interface is activated, and the data message sent by the first NFC device is received by the first RF interface, and the processor 1201 is further configured to encapsulate the load in the data message by using the first length value as the maximum length value.
  • the data packet, the communication device 1202 is further configured to send the data packet to the second NFC device by using the first communication sub-device 12021.
  • the communication device 1202 sends the first notification that includes the foregoing first length value to the DH of the first NFC device, and the first notification is to report the first NFC configuration to the DH of the first NFC device.
  • the maximum length of the data packet transmitted in the subsequent communication adjusted by the second NFC device is the first length value, so that the DH of the first NFC device obtains the first length value and can be performed in the upper layer service.
  • the NFCC is ready to receive the data message sent by the DH of the first NFC device.
  • the data message may be a Data Message(s) defined in the NCI specification, where the Data Message(s) is transmitted between the DH and the NFCC by transmitting the Data Packet(s), and the load in the data message is (payload) can carry data related to upper layer services.
  • the communication device 1202 may further include a second communication sub-device 12022 for communicating with the DH of the first NFC device, such as an interface between the DH and the NFCC, which may support the NCI at the upper layer.
  • the protocol can transmit data at the bottom layer using a Universal Asynchronous Receiver/Transmitter (UART), an I2C bus (Inter-Integrated Circuit), or a Half-Duplex Serial Peripheral Interface (SPI).
  • UART Universal Asynchronous Receiver/Transmitter
  • I2C bus Inter-Integrated Circuit
  • SPI Half-Duplex Serial Peripheral Interface
  • the communication device 1202 sends a first notification including the first length value to the DH of the first NFC device through the second communication sub-device 12022, and receives the data message sent by the DH through the second communication sub-device 12022, that is,
  • the first RF interface described above can be understood as the second communication sub-device 12022.
  • the data message and the data packet are the same as the data message and the data packet described in the foregoing embodiments, and details are not described herein again.
  • the first request may be a PSL_REQ defined in the Digital specification
  • the first response may be a PSL_RES defined in the Digital specification
  • the first RF interface may be an NFC-DEP radio interface defined in the NCI specification
  • the foregoing first notification may be a radio frequency interface activation notification RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
  • the foregoing first request may also be a RATS Command or an ATTRIB Command applicable to the ISO-DEP protocol defined in the Digital specification, where the FSDI (Frame Size for proximity Couple Device Integer) parameter is included for calculating work in polling.
  • FSDI Fram Size for proximity Couple Device Integer
  • the maximum length value FSD of a data packet (for example, an information block I-block or a load payload of the I-block) acceptable to an NFC device (for example, a reader/writer) in a (poll) mode; correspondingly, the first response described above It may also be a RATS Response or an ATTRIB Response defined in the Digital specification, which may include a FSCI (Frame Size for proximity Card Integer) parameter for calculating an acceptable NFC device (eg, NFC tag or card emulation) operating in poll mode.
  • FSCI Fram Size for proximity Card Integer
  • the maximum length value FSC of the load payload; the first RF interface may be an ISO-DEP radio interface or an NDEF radio interface defined in the NCI specification, and the first notification may be RF_INTF_ACTIVATED_NTF defined in the NCI specification.
  • the “adjustment” used in the solution of the present invention can be understood as a negotiation, a limitation, and the like in addition to the meaning of the present invention, and the present invention does not limit this.
  • the communication device 1202 is configured to receive, by the DH of the first NFC device, an adjustment command that includes a first length value, where the adjustment command is used to instruct the NFCC to adjust the data packet transmitted during the subsequent communication process.
  • the maximum length value is used to instruct the NFCC to adjust the data packet transmitted during the subsequent communication process.
  • the communication device 1202 may include a second communication sub-device 12022 for communicating with the DH of the first NFC device, such as an interface between the DH and the NFCC, the interface may support the NCI protocol at the upper layer, and may be used at the bottom layer.
  • the data is transmitted by an asynchronous transceiver (UART, Universal Asynchronous Receiver/Transmitter), an I2C bus (Inter-Integrated Circuit), or a half-duplex serial peripheral interface (SPI).
  • the communication device 1202 may receive, by using the second communication sub-device 12022, an adjustment command including a first length value sent by the DH of the first NFC device.
  • the communication device 1202 is further configured to send a first request including the foregoing first length value to the second NFC device, and receive a first response returned by the second NFC device for the first request, where the first request is used to indicate Adjusting a maximum length value of the data packet transmitted during the subsequent communication between the first NFC device and the second NFC device to a first length value, the first request may further include a first DID, and the first response further includes a second DID .
  • the communication device 1202 may further include a first communication sub-device 12021 for communicating with the second NFC device (ie, transmitting data to and receiving data from the second NFC device), such as a transceiver circuit in the NFCC.
  • the operating frequency of the NFC antenna in the transceiver circuit may be 13.56 MHz.
  • the NFCC may send data to the second NFC device through the NFC antenna, or may receive data from the second NFC device.
  • the communication device 1202 may send, by using the first communication sub-device 12021, the first length value to the second NFC device. The first request and receive a first response returned by the second NFC device for the first request.
  • the processor 1201 is configured to use the first length value as the maximum length value of the data packet transmitted in the subsequent communication when the first DID is the same as the second DID.
  • the communication device 1202 can also be used to install the second communication device.
  • the setting 12022 sends an adjustment response including a status indication and/or the first length value to the DH of the first NFC device, the status indication indicating that the NFCC has adjusted the maximum length value to the first length value.
  • the communication device 1202 when the communication device 1202 is further configured to send, by the second communication sub-device 12022, an adjustment response including a status indication and/or the first length value to the DH of the first NFC device, the processor 1201.
  • the first RF interface can also be activated before the first communication sub-device 12021 of the communication device 1202 sends the first request including the first length value to the second NFC device.
  • the communication device 1202 is further configured to send a first notification to the DH of the first NFC device, where the first notification is used to notify the DH that the first RF interface has been activated.
  • the communication device 1202 can pass the second communication.
  • the child device 12022 sends a first notification to the DH of the first NFC device.
  • the communication device 1202 is further configured to receive, by using the first RF interface, the first data message sent by the DH of the first NFC device, where the processor 1201 is further configured to The first length value is used as the maximum length value to encapsulate the load in the first data message into the first data packet.
  • the communication device 1202 is further configured to send the first data packet to the second by the first communication sub-device 12021. NFC device.
  • the processing is performed.
  • the device 1201 is further configured to: before the first communication sub-device 12021 of the communication device 1202 sends the first request including the first length value to the second NFC device, determine that the first length value is less than or equal to the second length value and is less than Or equal to the above third length value.
  • the communication device 1202 is further configured to send, by the second communication sub-device 12022, a second notification to the DH of the first NFC device, where the second notification is used to notify the first
  • the second RF interface of the NFC device DH has been activated, and receives the second data message sent by the first NFC device DH through the second RF interface.
  • the processor 1201 is further configured to use the first length value as the maximum length value.
  • the load in the two data messages is encapsulated into a second data packet; the communication device 1202 is further configured to send the second data packet to the second NFC device by using the first communication sub-device 12021.
  • the second notification may include the first length value, or may not include; the first data message and the second data message, the first data packet and the second data packet, and
  • the data messages and data packets described in the foregoing embodiments are the same, and are not described here.
  • the first request may be a PSL_REQ defined in the Digital specification
  • the first response may be a PSL_RES defined in the Digital specification
  • the first RF interface and the second RF interface may be an NCI.
  • the NFC-DEP radio interface is defined in the specification
  • the first notification and the second notification may be the radio interface activation notification RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
  • the foregoing first request may also be a RATS Command or an ATTRIB Command applicable to the ISO-DEP protocol defined in the Digital specification, where the FSDI (Frame Size for proximity Couple Device Integer) parameter is included for calculating work in polling.
  • FSDI Fram Size for proximity Couple Device Integer
  • the maximum length value FSD of a data packet (for example, an information block I-block or a load payload of the I-block) acceptable to an NFC device (for example, a reader/writer) in a (poll) mode; correspondingly, the first response described above It may also be a RATS Response or an ATTRIB Response defined in the Digital specification, which may include a FSCI (Frame Size for proximity Card Integer) parameter for calculating an acceptable NFC device (eg, NFC tag or card emulation) operating in poll mode.
  • FSCI Fram Size for proximity Card Integer
  • the maximum length value FSC of the data packet (for example, the information block I-block or the load payload of the I-block); the first RF interface and the second RF interface may be an ISO-DEP radio frequency interface or an NDEF radio frequency defined in the NCI specification.
  • the interface, the first notification and the second notification may be RF_INTF_ACTIVATED_NTF defined in the NCI specification.
  • the “adjustment” used in the solution of the present invention can be understood as a negotiation, a limitation, and the like in addition to the meaning of the present invention, and the present invention does not limit this.
  • the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party.
  • FIG. 13 is a schematic structural diagram of a system for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention.
  • the system may include a first NFC device 1301 as an initiator and a second NFC device 1302 as a target, wherein the first NFC device 1301 may include a first NFCC 13011 and a first DH 13012, a second NFC
  • the device 1302 may include a second NFCC 13021 and a second DH 13022, and the first NFC device 1301 and the second NFC device 1302 have activated the MAC layer, that is, the first NFC device 1301 and the second NFC device 1302 have negotiated with the ATR_RES through the ATR_REQ.
  • the maximum length value of the data packet transmitted during the subsequent communication that is, the second length value and the third length value, wherein the second length value is set by the first NFC device 1301 and is used to limit the second NFC device 1302 in subsequent communication.
  • the length of the data packet sent in the process the third length value being set by the second NFC device 1302 and used to limit the first NFC device 1301 in the subsequent communication process
  • the length of the sent packet is:
  • the first NFCC 13011 is configured to determine whether the first NFCC 13011 is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication, and if so, transmitting the first NFCC 13021 to the second NFC device 1302 to include the first a first request of the length value, wherein the first request is used to indicate that the maximum length value of the data packet transmitted by the first NFC device 1301 and the second NFC device 1302 in the subsequent communication is adjusted to a first length value, where The first length value is a value determined by the first NFCC 13011, and the first request may further include the first DID.
  • the second NFCC 13021 is configured to determine whether the second NFCC 13021 is responsible for responding to the first request, and when the determination result is yes, send a first response to the first request to the first NFCC 13011, and when the determination result is no, activate the second
  • the first RF interface on the NFC device 1302 transmits a first notification including the first length value to the second DH 13022.
  • the second DH 13022 is configured to determine, when the first notification is received, whether the first length value in the first notification is less than or equal to the second length value and is less than or equal to the third length value, when the determination result is yes At the time, a second response is returned to the second NFCC 13021.
  • the second NFCC 13021 is further configured to send the second response to the first NFCC 13011 after receiving the second response.
  • the first NFCC 13011 is further configured to: when receiving the response returned by the second NFCC 13021 and when the second DID included in the response is the same as the first DID included in the first request, using the first length value as the first NFC device The maximum length value of the data packet transmitted by the 1301 and the second NFC device 1302 in the subsequent communication, wherein the response is the first response or the second response.
  • the specific manner in which the first NFCC 13011 determines whether the first NFCC 13011 is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication may be:
  • the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that the maximum length value of the data packet transmitted in the subsequent communication is determined by the first NFCC 13011, and the value of the first parameter is the first
  • the default value of the NFCC 13011 that is, it can be understood as the default value set in the NFCC when the NFC chip is shipped), or the value assigned to the first NFCC 13011 by the first DH 13012, is not limited in the embodiment of the present invention.
  • the first NFCC 13011 may be further configured to use the first length value as the maximum length value of the data packet transmitted by the first NFC device 1301 and the second NFC device 1302 in subsequent communications, Transmitting, to the first DH 13012, a second notification including the first length value described above, The second notification is used to notify the first DH 13012 that the second RF interface of the first NFC device 1301 has been activated, and receives the data message sent by the first DH 13012 through the second RF interface, and the first length value is used as the maximum.
  • the length value encapsulates the payload in the data message into a data packet and sends the data packet to the second NFCC 1321 of the second NFC device 1302, wherein the data packet has a length value less than or equal to the third length value.
  • the first NFCC 13011 sends the foregoing second notification that includes the foregoing first length value to the first DH 13012.
  • the purpose of the first NFCC 13011 is to report the first NFC device 1301 and the second NFC device 1302 to the first DH 13012.
  • the maximum length of the data packet transmitted in the subsequent communication is the first length value, so that the first DH 13012 can obtain the first length value and can be used in the upper layer service, for example, estimating the upper layer in the current communication. What is the time required for the transmission of the service related data, and the like, and notifying the first DH 13012 that the above second RF interface has been activated, that is, the first NFCC 13011 is ready to receive the data message transmitted by the first DH 13012.
  • the data message may be a Data Message(s) defined in the NCI specification, where the Data Message(s) is transmitted between the first DH 13012 and the first NFCC 13011 by transmitting the Data Packet(s), and the data is implemented.
  • the payload in the message may carry data related to the upper layer service.
  • the specific manner in which the second NFCC 13021 determines whether the second NFCC 13021 is responsible for responding to the foregoing first request may be:
  • the second specific value is used to indicate that the second NFCC 13021 is responsible for responding to the first request, and the second specific value may be the second NFCC 13021
  • the default value that is, it can be understood as the default value set in the NFCC when the NFC chip is shipped from the factory), or the value assigned to the second NFCC 13021 by the second DH 13022, which is not limited in the embodiment of the present invention.
  • the second NFCC 13021 may be further configured to: after the first response to the first request is sent to the first NFCC 13011, and the first DID included in the first response is included in the first request When the second DIDs are the same, the first length value is sent to the second DH 13022 through the third notification.
  • the data message and the data packet are the same as the data message and the data packet described in the foregoing embodiments, and details are not described herein again.
  • the first request may be a PSL_REQ defined in the Digital specification
  • the first response and the second response may be a PSL_RES defined in the Digital specification
  • the first RF interface is The foregoing second RF interface may be an NFC-DEP radio interface defined in the NCI specification
  • the first notification, the second notification, and the third notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
  • the foregoing first request may be a RATS Command or an ATTRIB Command defined in the Digital specification
  • the foregoing first response and the second response may be a RATS Response or an ATTRIB Response defined in the Digital specification
  • the foregoing first RF interface and The foregoing second RF interface may be an ISO-DEP radio interface or an NDEF radio interface defined in the NCI specification
  • the first notification, the second notification, and the third notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, and the implementation of the present invention The example is not limited.
  • the first NFCC 13011 is configured to receive an adjustment command that is sent by the first DH 13012 and includes a first length value, where the adjustment command is used to instruct the first NFCC 13011 to adjust a maximum of data packets transmitted during a subsequent communication. a length value, if yes, transmitting a first request including a first length value to the second NFCC 13021, wherein the first request is for indicating a data packet transmitted in a subsequent communication between the first NFC device 1301 and the second NFC device 1302
  • the maximum length value is adjusted to a first length value, and the first request may further include a first DID.
  • the second NFCC 13021 is configured to determine whether the second NFCC 13021 is responsible for responding to the first request, and when the determination result is yes, send a first response to the first request to the first NFCC 13011, and when the determination result is no, activate the second
  • the first RF interface on the NFC device 1302 transmits a first notification including the first length value to the second DH 13022.
  • the second DH 13022 is configured to determine, when the first notification is received, whether the first length value in the first notification is less than or equal to the second length value and is less than or equal to the third length value, when the determination result is yes At the time, a second response is returned to the second NFCC 13021.
  • the second NFCC 13021 is further configured to send the second response to the first NFCC 13011 after receiving the second response.
  • the first NFCC 13011 is further configured to receive the response returned by the second NFCC 13021 and when the second DID included in the response is the same as the first DID included in the first request, the first length value is used as the first NFC device 1301 The maximum length value of the data packet transmitted by the second NFC device 1302 in the subsequent communication, wherein the response is the first response or the second response.
  • the first NFCC 13011 may be further configured to: after the foregoing first length value is used as a maximum length value of the data packet transmitted in the subsequent communication process, to the first DH 13012 And transmitting an adjustment response including a status indication and/or the first length value, the status indication indicating that the first NFCC 13011 has adjusted the maximum length value to the first length value.
  • the first NFCC 13011 when the first NFCC 13011 is further configured to send the first length value as the maximum length value of the data packet transmitted in the subsequent communication process, the first DH 13012 is sent with the status indication and/or Or the first NFCC 13011 may be configured to activate the second RF interface on the first NFC device 1301 before receiving the adjustment command including the first length value sent by the first DH 13012, and The first DH 13011 sends a second notification for informing the first DH 13011 that the second RF interface has been activated.
  • the first NFCC 13011 is further configured to receive, by using the foregoing second RF interface, the first data message sent by the first DH 13012, where the first length value is used as the maximum length value.
  • the load in the first data message is encapsulated into a first data packet, and the first data packet is sent to the second NFCC 13022 of the second NFC device 1302, where a maximum length value of the first data packet is less than or equal to the foregoing A length value.
  • the first NFCC 13011 may be further configured to: before sending the foregoing first request to the second NFCC 13021, determining that the first length value is less than or equal to the second length value and less than or equal to the third Length value.
  • the first NFCC 13011 is further configured to send a third notification to the first DH 13012, where the third notification is used to notify the first DH 13012 that the third RF interface has been activated, and Receiving, by the third RF interface, the second data message sent by the first DH 13012, using the first length value as the maximum length value to encapsulate the load in the second data message into a second data packet, and sending the second data packet In the second NFCC 13021 of the second NFC device 1302, wherein the length value of the second data packet is less than or equal to the first length value.
  • the specific manner in which the second NFCC 13021 determines whether the second NFCC 13021 is responsible for responding to the foregoing first request may be:
  • the value of the first parameter in the second NFCC 13021 is a first specific value, wherein the first specific value is used to indicate that the second NFCC 13021 is responsible for responding to the first request, and the second specific value may be the second NFCC 13021
  • the default value that is, it can be understood as the default value set in the NFCC when the NFC chip is shipped from the factory), or the value assigned to the second NFCC 13021 by the second DH 13022, which is not limited in the embodiment of the present invention.
  • the first parameter, the first specific value, and the foregoing may be different.
  • the third notification may include the first length value, or may not include; the first data message and the second data message, the first data packet and the second data packet, and the data message described in the foregoing embodiment, The data packets are the same, and will not be described here.
  • the second NFCC 13021 may be further configured to: after the first response to the first request is sent to the first NFCC 13011, and the second DID included in the first response is included in the first request When the first DIDs are the same, the first length value is sent to the second DH 13022 through the fourth notification.
  • the first request may be a PSL_REQ defined in the Digital specification
  • the first response and the second response may be a PSL_RES defined in the Digital specification
  • the RF interface and the foregoing third RF interface may be an NFC-DEP radio interface defined in the NCI specification
  • the first notification, the second notification, the third notification, and the fourth notification may be RF_INTF_ACTIVATED_NTF defined in the NCI specification, and the implementation of the present invention
  • the example is not limited.
  • the foregoing first request may be a RATS Command or an ATTRIB Command defined in the Digital specification
  • the first response and the second response may be a RATS Response or an ATTRIB Response defined in the Digital specification
  • the first RF interface, the second RF interface, and the third RF interface may be an ISO-DEP radio interface or an NDEF radio interface defined in the NCI specification
  • the foregoing fourth notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
  • the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party. It should be noted that, in the above embodiments, the descriptions of the various embodiments are different, and the parts that are not described in detail in a certain embodiment may be referred to the related descriptions of other embodiments. In addition, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
  • modules in the NFCC of the embodiment of the present invention may be combined, divided, and deleted according to actual needs.
  • the module in the embodiment of the present invention may be implemented by a general-purpose integrated circuit, such as a CPU (Central Processing Unit) or an ASIC (Application Specific Integrated Circuit).
  • a general-purpose integrated circuit such as a CPU (Central Processing Unit) or an ASIC (Application Specific Integrated Circuit).
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

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

Abstract

Disclosed are a method, device, and system for adjusting packet length in near field communication (NFC). The method comprises: an NFCC of a first NFC device determines whether or not self is responsible for determining the maximum length value of packets to be transmitted in subsequent communication; if yes, then a first request comprising a first length value is transmitted to a second NFC device, where the first request is used for indicating that the maximum length value of packets to be transmitted in subsequent communication between the first NFC device and the second NFC device be adjusted to the first length value, the first length value is one value determined by the NFCC, and the first request also comprises a first DID; and a first response returned by the second NFC device with respect to the first request and comprising a second DID is received, when the first DID is identical to the second DID, the first length value is used as the maximum length value of packets to be transmitted in subsequent communication. This shows that implementation of embodiments of the present invention allows by means of NCI specifications the implementation of the function for an NFCC and an NFC device serving as a target side to adjust the maximum length value of communication packets in subsequent communication.

Description

一种调整近场通信NFC中数据包长度的方法、装置及系统Method, device and system for adjusting data packet length in near field communication NFC 技术领域Technical field
本发明实施例涉及近场通信(NFC,Near Field Communication)技术领域,具体涉及一种调整近场通信NFC中数据包长度的方法、装置及系统。The present invention relates to the field of near field communication (NFC) technology, and in particular, to a method, device and system for adjusting the length of a data packet in a near field communication NFC.
背景技术Background technique
NFC技术是一种短距离无线连接技术,其可以利用磁场感应实现具有NFC功能的电子设备(又称“NFC设备”)间的近距离通信,且NFC设备主要包括三个功能实体:主机(DH,Device Host)、NFC控制器(NFCC,NFC Controller)以及NFC执行环境(NFCEE,NFC Execution Environment)。在NFC技术中,NFC控制器接口(NCI,NFC Controller Interface)协议主要定义了实现NFC设备中DH与NFCC之间通信的逻辑接口,且两个以点对点(P2P,Peer-to-Peer)模式进行通信的NFC设备须遵守近场通信数据交换协议(NFC-DEP,NFC-Data Exchange Protocol)。NFC technology is a short-range wireless connection technology that can realize close-range communication between NFC-enabled electronic devices (also known as "NFC devices") by magnetic field induction, and the NFC device mainly includes three functional entities: a host (DH) , Device Host), NFC Controller (NFCC, NFC Controller) and NFC Execution Environment (NFCEE, NFC Execution Environment). In the NFC technology, the NFC Controller Interface (NCI) interface mainly defines a logical interface for implementing communication between DH and NFCC in an NFC device, and two are implemented in a Peer-to-Peer (P2P) mode. The NFC device for communication is subject to the NFC-Data Exchange Protocol (NFC-DEP).
NFC论坛(NFC Forum)制定的Digital规范(其全称为NFC数字协议技术规范)规定,两个进行点对点通信的NFC设备在可以在通过NFC-DEP协议通信之前通过属性请求(ATR_REQ,Attribute Request)以及属性响应(ATR_RES,Attribute Response)来协商后续通信过程中传输的数据包的最大长度值LRI以及LRT,其中,LRI由作为发起方(initiator)的NFC设备设置且用于限制作为目标方(target)的NFC设备发送的数据包的长度,LRT由作为目标方的NFC设备设置且用于限制作为发起方的NFC设备发送的数据包的长度。之后,作为发起方的NFC设备还可以通过参数选择请求(PSL_REQ,Parameter Selection Request)与作为目标方的NFC设备调整后续通信过程中传输的数据包的最大长度值LR,其中,LR小于或等于LRI以及LRT,即LR为两个NFC芯片之间协商通信数据包长度的方法。The Digital Specification developed by the NFC Forum (the full name of the NFC Digital Protocol Specification) stipulates that two NFC devices that perform point-to-point communication can pass the attribute request (ATR_REQ, Attribute Request) before communicating through the NFC-DEP protocol. The attribute response (ATR_RES, Attribute Response) negotiates the maximum length values LR I and LR T of the data packets transmitted during the subsequent communication, wherein the LR I is set by the NFC device as an initiator and is used as a target The length of the data packet transmitted by the (target) NFC device, the LR T is set by the NFC device as the target and is used to limit the length of the data packet transmitted by the NFC device as the initiator. Then, the NFC device as the initiator can also adjust the maximum length value LR of the data packet transmitted in the subsequent communication process with the NFC device as the target through the parameter selection request (PSL_REQ, Parameter Selection Request), where LR is less than or equal to LR. I and LR T , LR, are methods for negotiating the length of a communication packet between two NFC chips.
NCI协议是用来规定NFC芯片在与对端的NFC芯片通信时所使用的参数、命令等如何配置的。当前,NCI协议并没有给出指导NFC芯片如何利用Digital协议定义的PSL_REQ调整后续通信过程中传输的数据包的最大长度值LR这一 功能。The NCI protocol is used to specify how parameters, commands, etc. are used when the NFC chip communicates with the NFC chip on the opposite end. Currently, the NCI protocol does not give a guide to how the NFC chip uses the PSL_REQ defined by the Digital protocol to adjust the maximum length value LR of packets transmitted during subsequent communication. Features.
发明内容Summary of the invention
本发明实施例公开了一种调整近场通信NFC中数据包长度的方法、装置及系统,能够通过NCI规范实现作为发起方的第一NFC设备通过其NFCC与作为目标方的第二NFC设备调整后续通信过程中传输的数据包的最大长度值的功能。The embodiment of the invention discloses a method, device and system for adjusting the length of a data packet in a near field communication NFC, which can realize the adjustment of the first NFC device as the initiator through the NCI specification and the second NFC device as the target by the NCI specification. The function of the maximum length value of packets transmitted during subsequent communications.
本发明实施例第一方面公开了一种调整近场通信NFC中数据包长度的方法,所述方法包括:A first aspect of the embodiments of the present invention discloses a method for adjusting a data packet length in a near field communication NFC, where the method includes:
第一NFC设备的NFCC判断是否由所述NFCC负责确定后续通信中所传输的数据包的最大长度值;The NFCC of the first NFC device determines whether the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication;
如果是由所述NFCC负责确定后续通信中所传输的数据包的最大长度值,则所述NFCC向第二NFC设备发送包含第一长度值的第一请求,所述第一请求用于指示将所述第一NFC设备与所述第二NFC设备在后续通信中所传输的数据包的最大长度值调整为所述第一长度值,且所述第一请求还包含第一设备标识DID,所述第一长度值是所述NFCC确定的一个值;If the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication, the NFCC sends a first request including the first length value to the second NFC device, the first request is used to indicate that The maximum length value of the data packet transmitted by the first NFC device and the second NFC device in the subsequent communication is adjusted to the first length value, and the first request further includes a first device identifier DID, where The first length value is a value determined by the NFCC;
所述NFCC接收所述第二NFC设备针对所述第一请求返回的第一响应,所述第一响应包含第二DID;The NFCC receives a first response returned by the second NFC device for the first request, and the first response includes a second DID;
如果所述第一DID与所述第二DID相同,则所述NFCC将所述第一长度值作为后续通信中所传输的数据包的最大长度值。If the first DID is the same as the second DID, the NFCC uses the first length value as the maximum length value of the data packet transmitted in the subsequent communication.
在本发明实施例第一方面的第一种可能的实现方式中,所述判断是否由所述NFCC负责确定后续通信中所传输的数据包的最大长度值,包括:In a first possible implementation manner of the first aspect of the embodiment, the determining, by the NFCC, is determining, by the NFCC, a maximum length value of the data packet transmitted in the subsequent communication, including:
判断第一参数的值是否为第一特定值,所述第一特定值用于表示后续通信中所传输的数据包的最大长度值由所述NFCC负责确定,其中,所述第一参数的值是所述NFCC的默认值,或者是由所述第一设备的DH配置给所述NFCC的值。Determining whether the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that a maximum length value of the data packet transmitted in the subsequent communication is determined by the NFCC, wherein the value of the first parameter Is the default value of the NFCC, or the value assigned to the NFCC by the DH of the first device.
结合本发明实施例第一方面,在本发明实施例第一方面的第二种可能的实现方式中,所述方法还包括:With reference to the first aspect of the embodiments of the present invention, in a second possible implementation manner of the first aspect of the embodiments, the method further includes:
所述NFCC向所述第一NFC设备的DH发送包含所述第一长度值的第一通知,所述第一通知用于告知所述DH第一射频RF接口已被激活; Transmitting, by the NFCC, a first notification that includes the first length value to a DH of the first NFC device, where the first notification is used to notify that the DH first radio frequency RF interface has been activated;
所述NFCC通过所述第一RF接口接收所述DH发送的数据消息,并以所述第一长度值作为所述最大长度值将所述数据消息中的负载封装成数据包;Receiving, by the NFCC, the data message sent by the DH by using the first RF interface, and encapsulating the load in the data message into a data packet by using the first length value as the maximum length value;
所述NFCC将所述数据包发送至所述第二NFC设备。The NFCC sends the data packet to the second NFC device.
结合本发明实施例第一方面的第一种可能的实现方式,在本发明实施例第一方面的第三种可能的实现方式中,所述方法还包括:With reference to the first possible implementation manner of the first aspect of the embodiments of the present invention, in a third possible implementation manner of the first aspect of the embodiments, the method further includes:
所述NFCC向所述DH发送包含所述第一长度值的第一通知,所述第一通知用于告知所述DH第一射频RF接口已被激活;The NFCC sends a first notification including the first length value to the DH, where the first notification is used to notify the DH that the first radio frequency RF interface has been activated;
所述NFCC通过所述第一RF接口接收所述DH发送的数据消息,并以所述第一长度值作为所述最大长度值将所述数据消息中的负载封装成数据包;Receiving, by the NFCC, the data message sent by the DH by using the first RF interface, and encapsulating the load in the data message into a data packet by using the first length value as the maximum length value;
所述NFCC将所述数据包发送至所述第二NFC设备。The NFCC sends the data packet to the second NFC device.
结合本发明实施例第一方面、本发明实施例第一方面的第一种可能的实现方式、本发明实施例第一方面的第二种可能的实现方式或本发明实施例第一方面的第三种可能的实现方式,在本发明实施例第一方面的第四种可能的实现方式中,所述方法还包括:With reference to the first aspect of the embodiments of the present invention, the first possible implementation manner of the first aspect of the embodiment of the present invention, the second possible implementation manner of the first aspect of the embodiment of the present invention, or the first aspect of the first aspect of the embodiment of the present invention In a fourth possible implementation manner of the first aspect of the embodiments, the method further includes:
如果不由所述NFCC负责确定后续通信中所传输的数据包的最大长度值,则所述NFCC不向所述第二NFC设备发送包含所述第一长度值的所述第一请求。If the NFCC is not responsible for determining the maximum length value of the data packet transmitted in the subsequent communication, the NFCC does not send the first request including the first length value to the second NFC device.
结合本发明实施例第一方面的第二种可能的实现方式或第三种可能的实现方式,在本发明实施例第一方面的第五种可能的实现方式中,所述第一请求是Digital规范中定义的参数选择请求PSL_REQ;With reference to the second possible implementation manner or the third possible implementation manner of the first aspect of the embodiments of the present invention, in a fifth possible implementation manner of the first aspect of the embodiments, the first request is Digital The parameter selection request defined in the specification is PSL_REQ;
所述第一响应是所述Digital规范中定义的参数选择响应PSL_RES;The first response is a parameter selection response PSL_RES defined in the Digital specification;
所述第一RF接口是NFC控制器接口NCI规范中定义的近场通信数据交换协议NFC-DEP射频接口;The first RF interface is a near field communication data exchange protocol NFC-DEP radio frequency interface defined in an NFC controller interface NCI specification;
所述第一通知是所述NCI规范中定义的射频接口激活通知RF_INTF_ACTIVATED_NTF。The first notification is a radio frequency interface activation notification RF_INTF_ACTIVATED_NTF defined in the NCI specification.
本发明实施例第二方面公开了一种调整近场通信NFC中数据包长度的方法,所述方法包括:A second aspect of the embodiments of the present invention discloses a method for adjusting a data packet length in a near field communication NFC, where the method includes:
第一NFC设备的NFCC接收所述第一NFC设备的DH发送的包含第一长度值的调整命令,所述调整命令用于指示所述NFCC调整后续通信过程中所传输的数据包的最大长度值; The NFCC of the first NFC device receives an adjustment command including a first length value sent by the DH of the first NFC device, where the adjustment command is used to instruct the NFCC to adjust a maximum length value of a data packet transmitted during a subsequent communication process. ;
所述NFCC向第二NFC设备发送包含所述第一长度值的第一请求,所述第一请求用于指示将所述第一NFC设备与所述第二NFC设备后续通信过程中所传输的数据包的最大长度值调整为所述第一长度值,所述第一请求还包含第一DID,所述第一长度值是所述NFCC确定的一个值;Sending, by the NFCC, a first request including the first length value to a second NFC device, where the first request is used to indicate that the first NFC device is transmitted during subsequent communication with the second NFC device The maximum length value of the data packet is adjusted to the first length value, the first request further includes a first DID, and the first length value is a value determined by the NFCC;
所述NFCC接收所述第二NFC设备针对所述第一请求返回的第一响应,所述第一响应包含第二DID;The NFCC receives a first response returned by the second NFC device for the first request, and the first response includes a second DID;
如果所述第一DID与所述第二DID相同,则所述NFCC将所述第一长度值作为后续通信中所传输的数据包的最大长度值。If the first DID is the same as the second DID, the NFCC uses the first length value as the maximum length value of the data packet transmitted in the subsequent communication.
在本发明实施例第二方面的第一种可能的实现方式中,所述方法还包括:In a first possible implementation manner of the second aspect of the embodiment, the method further includes:
所述NFCC向所述DH发送包含状态指示和/或所述第一长度值的调整响应,所述状态指示用于表示所述NFCC已将所述最大长度值调整为所述第一长度值。The NFCC sends an adjustment response including a status indication and/or the first length value to the DH, the status indication indicating that the NFCC has adjusted the maximum length value to the first length value.
结合本发明实施例第二方面的第一种可能的实现方式,在本发明实施例第二方面的第二种可能的实现方式中,所述接收所述第一NFC设备的DH发送的包含第一长度值的调整命令之前,所述方法还包括:With reference to the first possible implementation manner of the second aspect of the embodiment of the present invention, in a second possible implementation manner of the second aspect of the embodiment of the present disclosure, the receiving the DH of the first NFC device includes Before a length value adjustment command, the method further includes:
所述NFCC激活第一RF接口,并向所述DH发送第一通知,所述第一通知用于告知所述DH所述第一RF接口已被激活。The NFCC activates a first RF interface and sends a first notification to the DH, the first notification being used to inform the DH that the first RF interface has been activated.
结合本发明实施例第二方面的第一种可能的实现方式,在本发明实施例第二方面的第三种可能的实现方式中,所述向第二NFC设备发送包含所述第一长度值的第一请求之前,所述方法还包括:With reference to the first possible implementation manner of the second aspect of the embodiments of the present invention, in a third possible implementation manner of the second aspect of the embodiment, the sending, by the second NFC device, the first length value Before the first request, the method further includes:
确定所述第一长度值小于或等于第二长度值且小于或等于第三长度值。Determining that the first length value is less than or equal to the second length value and less than or equal to the third length value.
结合本发明实施例第二方面的第二种可能的实现方式,在本发明实施例第二方面的第四种可能的实现方式中,所述方法还包括:With reference to the second possible implementation manner of the second aspect of the embodiment of the present invention, in a fourth possible implementation manner of the second aspect of the embodiments, the method further includes:
所述NFCC通过所述第一RF接口接收所述DH发送的第一数据消息,并以所述第一长度值作为所述最大长度值将所述第一数据消息中的负载封装成第一数据包;The NFCC receives the first data message sent by the DH by using the first RF interface, and encapsulates the load in the first data message into the first data by using the first length value as the maximum length value. package;
所述NFCC将所述第一数据包发送至所述第二NFC设备。The NFCC sends the first data packet to the second NFC device.
结合本发明实施例第二方面的第三种可能的实现方式,在本发明实施例第二方面的第五种可能的实现方式中,所述方法还包括:With reference to the third possible implementation manner of the second aspect of the embodiments of the present invention, in a fifth possible implementation manner of the second aspect of the embodiments, the method further includes:
所述NFCC向所述DH发送第二通知,所述第二通知用于告知所述DH第二 RF接口已被激活,并通过所述第二RF接口接收所述DH发送的第二数据消息,并以所述第一长度值作为所述最大长度值将所述第二数据消息中的负载封装成第二数据包;The NFCC sends a second notification to the DH, the second notification being used to notify the DH of the second The RF interface has been activated, and receives the second data message sent by the DH through the second RF interface, and encapsulates the load in the second data message with the first length value as the maximum length value Into a second data packet;
所述NFCC将所述第二数据包发送至所述第二NFC设备。The NFCC sends the second data packet to the second NFC device.
结合本发明实施例第二方面的第二种可能的实现方式,在本发明实施例第二方面的第六种可能的实现方式中,所述第一请求是Digital规范中定义的PSL_REQ;With reference to the second possible implementation manner of the second aspect of the embodiment of the present invention, in a sixth possible implementation manner of the second aspect of the embodiment, the first request is a PSL_REQ defined in the Digital specification;
所述第一响应是所述Digital规范中定义的PSL_RES;The first response is a PSL_RES defined in the Digital specification;
所述第一RF接口是NCI规范中定义的NFC-DEP射频接口;The first RF interface is an NFC-DEP radio frequency interface defined in an NCI specification;
所述第一通知是所述NCI规范中定义的RF_INTF_ACTIVATED_NTF。The first notification is RF_INTF_ACTIVATED_NTF defined in the NCI specification.
本发明实施例第三方面公开了一种NFCC,所述NFCC为第一NFC设备中的NFCC,所述NFCC包括判断模块、通信模块以及确定模块,其中:The third aspect of the embodiment of the present invention discloses an NFCC, where the NFCC is an NFCC in a first NFC device, where the NFCC includes a determining module, a communication module, and a determining module, where:
所述判断模块,用于判断是否由所述NFCC负责确定后续通信中所传输的数据包的最大长度值;The determining module is configured to determine whether the NFCC is responsible for determining a maximum length value of the data packet transmitted in the subsequent communication;
所述通信模块,用于当所述判断模块的判断结果为是时,向第二NFC设备发送包含第一长度值的第一请求,并接收所述第二NFC设备针对所述第一请求返回的第一响应,所述第一请求用于指示将所述第一NFC设备与所述第二NFC设备在后续通信中所传输的数据包的最大长度值调整为所述第一长度值,且所述第一请求还包含第一DID,所述第一响应包含第二DID,所述第一长度值是所述NFCC确定的一个值;The communication module is configured to: when the determination result of the determining module is yes, send a first request including a first length value to the second NFC device, and receive the second NFC device to return for the first request a first response, the first request is used to indicate that a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication is adjusted to the first length value, and The first request further includes a first DID, the first response includes a second DID, and the first length value is a value determined by the NFCC;
所述确定模块,用于当所述第一DID与所述第二DID相同时,将所述第一长度值作为后续通信中所传输的数据包的最大长度值。The determining module is configured to use the first length value as a maximum length value of a data packet transmitted in a subsequent communication when the first DID is the same as the second DID.
在本发明实施例第三方面的第一种可能的实现方式中,所述判断模块判断是否由所述NFCC负责确定后续通信中所传输的数据包的最大长度值的具体方式为:In a first possible implementation manner of the third aspect of the embodiment of the present invention, the determining module determines whether the NFCC is responsible for determining a maximum length value of a data packet transmitted in a subsequent communication:
判断第一参数的值是否为第一特定值,所述第一特定值用于表示后续通信中所传输的数据包的最大长度值由所述NFCC负责确定,其中,所述第一参数的值是所述NFCC的默认值,或者是由所述第一NFC设备的DH配置给所述NFCC的值。Determining whether the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that a maximum length value of the data packet transmitted in the subsequent communication is determined by the NFCC, wherein the value of the first parameter Is the default value of the NFCC, or is the value assigned to the NFCC by the DH of the first NFC device.
结合本发明实施例第三方面,在本发明实施例第三方面的第二种可能的实 现方式中,所述通信模块,还用于向所述第一NFC设备的DH发送包含所述第一长度值的第一通知,所述第一通知用于告知所述DH第一射频RF接口已被激活,并通过所述第一RF接口接收所述DH发送的数据消息;With reference to the third aspect of the embodiments of the present invention, the second possible implementation in the third aspect of the embodiment of the present invention In the present mode, the communication module is further configured to send, to the DH of the first NFC device, a first notification that includes the first length value, where the first notification is used to notify the DH of the first radio frequency RF interface. Has been activated, and receives the data message sent by the DH through the first RF interface;
所述NFCC还包括封装模块,其中:The NFCC also includes a package module, wherein:
所述封装模块,用于以所述第一长度值作为所述最大长度值将所述数据消息中的负载封装成数据包;The encapsulating module is configured to encapsulate the load in the data message into a data packet by using the first length value as the maximum length value;
所述通信模块,还用于将所述数据包发送至所述第二NFC设备。The communication module is further configured to send the data packet to the second NFC device.
结合本发明实施例第三方面的第一种可能的实现方式,在本发明实施例第三方面的第三种可能的实现方式中,所述通信模块,还用于向所述DH发送包含所述第一长度值的第一通知,所述第一通知用于告知所述DH第一射频RF接口已被激活;With reference to the first possible implementation manner of the third aspect of the embodiments of the present invention, in a third possible implementation manner of the third aspect of the embodiments, the communications module is further configured to send the inclusion to the DH. a first notification of a first length value, the first notification being used to notify the DH that the first radio frequency RF interface has been activated;
所述通信模块,还用于通过所述第一RF接口接收所述DH发送的数据消息;The communication module is further configured to receive, by using the first RF interface, a data message sent by the DH;
所述NFCC还包括封装模块,其中:The NFCC also includes a package module, wherein:
所述封装模块,用于以所述第一长度值作为所述最大长度值将所述数据消息中的负载封装成数据包;The encapsulating module is configured to encapsulate the load in the data message into a data packet by using the first length value as the maximum length value;
所述通信模块,还用于将所述数据包发送至所述第二NFC设备。The communication module is further configured to send the data packet to the second NFC device.
结合本发明实施例第三方面的第二种可能的实现方式或第三种可能的实现方式,在本发明实施例第三方面的第四种可能的实现方式中,所述第一请求是Digital规范中定义的PSL_REQ;With reference to the second possible implementation manner or the third possible implementation manner of the third aspect of the embodiments of the present invention, in a fourth possible implementation manner of the third aspect of the embodiments, the first request is Digital PSL_REQ as defined in the specification;
所述第一响应是所述Digital规范中定义的PSL_RES;The first response is a PSL_RES defined in the Digital specification;
所述第一RF接口是NCI规范中定义的NFC-DEP射频接口;The first RF interface is an NFC-DEP radio frequency interface defined in an NCI specification;
所述第一通知是所述NCI规范中定义的RF_INTF_ACTIVATED_NTF。The first notification is RF_INTF_ACTIVATED_NTF defined in the NCI specification.
本发明实施例第四方面公开了一种NFCC,所述NFCC为第一NFC设备中的NFCC,所述NFCC包括通信模块以及确定模块,其中:A fourth aspect of the embodiments of the present invention discloses an NFCC, where the NFCC is an NFCC in a first NFC device, where the NFCC includes a communication module and a determining module, where:
所述通信模块,用于接收所述第一NFC设备的DH发送的包含第一长度值的调整命令,所述调整命令用于指示所述NFCC调整后续通信过程中所传输的数据包的最大长度值;The communication module is configured to receive an adjustment command including a first length value sent by the DH of the first NFC device, where the adjustment command is used to instruct the NFCC to adjust a maximum length of a data packet transmitted during a subsequent communication process. value;
所述通信模块,还用于向第二NFC设备发送包含所述第一长度值的第一请求,并接收所述第二NFC设备针对所述第一请求返回的第一响应,所述第一请 求用于指示将所述第一NFC设备与所述第二NFC设备后续通信过程中所传输的数据包的最大长度值调整为所述第一长度值,所述第一请求还包含括第一DID,所述第一响应包含第二DID;The communication module is further configured to send a first request that includes the first length value to a second NFC device, and receive a first response that is returned by the second NFC device for the first request, the first please And determining to adjust a maximum length value of the data packet transmitted during the subsequent communication between the first NFC device and the second NFC device to the first length value, where the first request further includes the first DID, the first response includes a second DID;
所述确定模块,用于当所述第一DID与所述第二DID相同时,将所述第一长度值作为后续通信中所传输的数据包的最大长度值。The determining module is configured to use the first length value as a maximum length value of a data packet transmitted in a subsequent communication when the first DID is the same as the second DID.
在本发明实施例第四方面的第一种可能的实现方式中,所述通信模块,还用于向所述DH发送包含状态指示和/或所述第一长度值的调整响应,所述状态指示用于表示所述NFCC已将所述最大长度值调整为所述第一长度值。In a first possible implementation manner of the fourth aspect of the embodiments, the communications module is further configured to send, to the DH, an adjustment response that includes a status indication and/or the first length value, where the status The indication is to indicate that the NFCC has adjusted the maximum length value to the first length value.
结合本发明实施例第四方面的第一种可能的实现方式,在本发明实施例第四方面的第二种可能的实现方式中,所述NFCC还包括激活模块,其中:With reference to the first possible implementation manner of the fourth aspect of the embodiments of the present invention, in a second possible implementation manner of the fourth aspect of the embodiments, the NFCC further includes an activation module, where:
所述激活模块,用于在所述通信模块接收所述第一NFC设备的DH发送的包含第一长度值的调整命令之前,激活第一RF接口;The activation module is configured to activate the first RF interface before the communication module receives the adjustment command including the first length value sent by the DH of the first NFC device;
所述通信模块,还用于向所述DH发送第一通知,所述第一通知用于告知所述DH所述第一RF接口已被激活。The communication module is further configured to send a first notification to the DH, where the first notification is used to notify the DH that the first RF interface has been activated.
结合本发明实施例第四方面的第一种可能的实现方式,在本发明实施例第四方面的第三种可能的实现方式中,所述确定模块,还用于在所述通信模块向所述第二NFC设备发送包括所述第一长度值的所述第一请求之前,确定所述第一长度值小于或等于第二长度值且小于或等于第三长度值。With reference to the first possible implementation manner of the fourth aspect of the embodiments of the present invention, in a third possible implementation manner of the fourth aspect of the embodiments, the determining module is further configured to: Before the second NFC device sends the first request including the first length value, determining that the first length value is less than or equal to the second length value and less than or equal to the third length value.
结合本发明实施例第四方面的第二种可能的实现方式,在本发明实施例第四方面的第四种可能的实现方式中,所述通信模块,还用于通过所述第一RF接口接收所述DH发送的第一数据消息;With reference to the second possible implementation manner of the fourth aspect of the embodiments of the present invention, in a fourth possible implementation manner of the fourth aspect of the embodiments, the communications module is further configured to pass the first RF interface. Receiving a first data message sent by the DH;
所述NFCC还包括第一封装模块,其中:The NFCC also includes a first encapsulation module, wherein:
所述第一封装模块,用于以所述第一长度值作为所述最大长度值将所述第一数据消息中的负载封装成第一数据包;The first encapsulating module is configured to encapsulate the load in the first data message into a first data packet by using the first length value as the maximum length value;
所述通信模块,还用于将所述第一数据包发送至所述第二NFC设备。The communication module is further configured to send the first data packet to the second NFC device.
结合本发明实施例第四方面的第三种可能的实现方式,在本发明实施例第四方面的第五种可能的实现方式中,所述通信模块,还用于向所述DH发送第二通知,所述第二通知用于告知所述DH第二RF接口已被激活,并通过所述第二RF接口接收所述DH发送的第二数据消息;With reference to the third possible implementation manner of the fourth aspect of the embodiments of the present invention, in a fifth possible implementation manner of the fourth aspect of the embodiments, the communications module is further configured to send a second to the DH. Notifying that the second notification is that the DH second RF interface has been activated, and receives the second data message sent by the DH by using the second RF interface;
所述NFCC还包括第二封装模块,其中: The NFCC further includes a second encapsulation module, wherein:
所述第二封装模块,用于以所述第一长度值作为所述最大长度值将所述第二数据消息中的负载封装成第二数据包;The second encapsulating module is configured to encapsulate the load in the second data message into a second data packet by using the first length value as the maximum length value;
所述通信模块,还用于将所述第二数据包发送至所述第二NFC设备。The communication module is further configured to send the second data packet to the second NFC device.
结合本发明实施例第四方面的第二种可能的实现方式,在本发明实施例第四方面的第六种可能的实现方式中,所述第一请求是Digital规范中定义的PSL_REQ;With reference to the second possible implementation manner of the fourth aspect of the embodiments of the present invention, in a sixth possible implementation manner of the fourth aspect, the first request is a PSL_REQ defined in the Digital specification;
所述第一响应是所述Digital规范中定义的PSL_RES;The first response is a PSL_RES defined in the Digital specification;
所述第一RF接口是NCI规范中定义的NFC-DEP射频接口;The first RF interface is an NFC-DEP radio frequency interface defined in an NCI specification;
所述第一通知是所述NCI规范中定义的RF_INTF_ACTIVATED_NTF。The first notification is RF_INTF_ACTIVATED_NTF defined in the NCI specification.
本发明实施例第五方面公开了一种NFCC,包括处理器以及通信装置,所述处理器,用于判断是否由所述NFCC负责确定后续通信中所传输的数据包的最大长度值;The fifth aspect of the embodiment of the present invention discloses an NFCC, including a processor and a communication device, where the processor is configured to determine whether the NFCC is responsible for determining a maximum length value of a data packet transmitted in a subsequent communication;
所述通信装置,用于当所述处理器的判断结果为是时,向第二NFC设备发送包含第一长度值的第一请求,并接收所述第二NFC设备针对所述第一请求返回的第一响应,所述第一请求用于指示将第一NFC设备与所述第二NFC设备在后续通信中所传输的数据包的最大长度值调整为所述第一长度值,所述第一长度值是所述NFCC确定的一个值,所述第一请求还包含第一DID,所述第一响应包含第二DID;The communication device is configured to: when the determination result of the processor is yes, send a first request including a first length value to the second NFC device, and receive the second NFC device to return for the first request a first response, the first request is used to indicate that a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication is adjusted to the first length value, where a length value is a value determined by the NFCC, the first request further includes a first DID, and the first response includes a second DID;
所述处理器,还用于当所述第一DID与所述第二DID相同时,将所述第一长度值作为后续通信中所传输的数据包的最大长度值。The processor is further configured to use, when the first DID is the same as the second DID, the first length value as a maximum length value of a data packet transmitted in a subsequent communication.
在本发明实施例第五方面的第一种可能的实现方式中,所述判断是否由所述NFCC负责确定后续通信中所传输的数据包的最大长度值,包括:In a first possible implementation manner of the fifth aspect of the embodiment of the present invention, the determining, by the NFCC, is determining, by the NFCC, a maximum length value of the data packet transmitted in the subsequent communication, including:
判断第一参数的值是否为第一特定值,所述第一特定值用于表示后续通信中所传输的数据包的最大长度值由所述N FCC负责确定,其中,所述第一参数的值是所述NFCC的默认值,或者是由第一NFC设备DH配置给所述NFCC的值。Determining whether the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that a maximum length value of the data packet transmitted in the subsequent communication is determined by the N FCC, wherein the first parameter is determined by The value is the default value of the NFCC or the value assigned to the NFCC by the first NFC device DH.
结合本发明实施例第五方面,在本发明实施例第五方面的第二种可能的实现方式中,所述通信装置,还用于向第一NFC设备的DH发送包含所述第一长度值的第一通知,所述第一通知用于告知所述DH第一RF接口已被激活;With reference to the fifth aspect of the embodiments of the present invention, in a second possible implementation manner of the fifth aspect of the embodiments, the communications apparatus is further configured to send, by the DH of the first NFC device, the first length value. a first notification, the first notification being used to notify that the DH first RF interface has been activated;
所述通信装置,还用于通过所述第一RF接口接收所述DH发送的数据消息; The communication device is further configured to receive, by using the first RF interface, a data message sent by the DH;
所述处理器,还用于以所述第一长度值作为所述最大长度值将所述数据消息中的负载封装成数据包;The processor is further configured to encapsulate the load in the data message into a data packet by using the first length value as the maximum length value;
所述通信装置,还用于将所述数据包发送至所述第二NFC设备。The communication device is further configured to send the data packet to the second NFC device.
结合本发明实施例第五方面的第一种可能的实现方式,在本发明实施例第五方面的第三种可能的实现方式中,所述通信装置,还用于向所述DH发送包含所述第一长度值的第一通知,所述第一通知用于告知所述DH第一RF接口已被激活;With reference to the first possible implementation manner of the fifth aspect of the embodiments of the present invention, in a third possible implementation manner of the fifth aspect of the embodiments, the communications apparatus is further configured to send the inclusion to the DH. Determining a first notification of a first length value, the first notification being used to notify the DH that the first RF interface has been activated;
所述通信装置,还用于通过所述第一RF接口接收所述DH发送的数据消息;The communication device is further configured to receive, by using the first RF interface, a data message sent by the DH;
所述处理器,还用于以所述第一长度值作为所述最大长度值将所述数据消息中的负载封装成数据包;The processor is further configured to encapsulate the load in the data message into a data packet by using the first length value as the maximum length value;
所述通信装置,还用于将所述数据包发送至所述第二NFC设备。The communication device is further configured to send the data packet to the second NFC device.
结合本发明实施例第五方面的第二种可能的实现方式或第三种可能的实现方式,在本发明实施例第五方面的第四种可能的实现方式中,所述第一请求是Digital规范中定义的PSL_REQ;With reference to the second possible implementation manner or the third possible implementation manner of the fifth aspect of the embodiments of the present invention, in a fourth possible implementation manner of the fifth aspect of the embodiments, the first request is Digital PSL_REQ as defined in the specification;
所述第一响应是所述Digital规范中定义的PSL_RES;The first response is a PSL_RES defined in the Digital specification;
所述第一RF接口是NCI规范中定义的NFC-DEP射频接口;The first RF interface is an NFC-DEP radio frequency interface defined in an NCI specification;
所述第一通知是所述NCI规范中定义的RF_INTF_ACTIVATED_NTF。The first notification is RF_INTF_ACTIVATED_NTF defined in the NCI specification.
本发明实施例第六方面公开了一种NFCC,包括处理器以及通信装置,所述通信装置,用于接收到第一NFC设备的DH发送的包含第一长度值的调整命令,所述调整命令用于指示所述NFCC调整后续通信过程中所传输的数据包的最大长度值;A sixth aspect of the embodiments of the present invention discloses an NFCC, including a processor and a communication device, configured to receive an adjustment command including a first length value sent by a DH of the first NFC device, where the adjustment command is And configured to instruct the NFCC to adjust a maximum length value of a data packet transmitted during a subsequent communication process;
所述通信装置,还用于向第二NFC设备发送包含所述第一长度值的第一请求,并接收所述第二NFC设备针对所述第一请求返回的第一响应,所述第一请求用于指示将所述第一NFC设备与所述第二NFC设备后续通信过程中所传输的数据包的最大长度值调整为所述第一长度值,所述第一请求还包含第一DID,所述第一响应包含第二DID;The communication device is further configured to send a first request that includes the first length value to a second NFC device, and receive a first response that is returned by the second NFC device for the first request, the first The request is used to indicate that a maximum length value of a data packet transmitted during a subsequent communication between the first NFC device and the second NFC device is adjusted to the first length value, and the first request further includes a first DID The first response includes a second DID;
所述处理器,用于当所述第一DID与所述第二DID相同时,将所述第一长度值作为后续通信中所传输的数据包的最大长度值。The processor is configured to use the first length value as a maximum length value of a data packet transmitted in a subsequent communication when the first DID is the same as the second DID.
在本发明实施例第六方面的第一种可能的实现方式中,所述通信装置,还 用于向所述DH发送包含状态指示和/或所述第一长度值的调整响应,所述状态指示用于表示所述NFCC已将所述最大长度值调整为所述第一长度值。In a first possible implementation manner of the sixth aspect of the embodiment of the present invention, the communication device is further And an adjustment response for transmitting, to the DH, a status indication and/or the first length value, the status indication is used to indicate that the NFCC has adjusted the maximum length value to the first length value.
结合本发明实施例第六方面的第一种可能的实现方式,在本发明实施例第六方面的第二种可能的实现方式中,所述处理器,还用于在所述通信装置接收所述第一NFC设备的DH发送的包含第一长度值的调整命令之前,激活第一RF接口;With reference to the first possible implementation manner of the sixth aspect of the embodiments of the present invention, in a second possible implementation manner of the sixth aspect of the embodiments, the processor is further configured to receive, at the communication device, Activating the first RF interface before the adjustment command including the first length value sent by the DH of the first NFC device;
所述通信装置,还用于向所述DH发送第一通知,所述第一通知用于告知所述DH所述第一RF接口已被激活。The communication device is further configured to send a first notification to the DH, where the first notification is used to notify the DH that the first RF interface has been activated.
结合本发明实施例第六方面的第一种可能的实现方式,在本发明实施例第六方面的第三种可能的实现方式中,所述处理器,还用于在所述通信装置向所述第二NFC设备发送包括所述第一长度值的所述第一请求之前,确定所述第一长度值小于或等于第二长度值且小于或等于第三长度值。With reference to the first possible implementation manner of the sixth aspect of the embodiments of the present invention, in a third possible implementation manner of the sixth aspect of the embodiments, the processor is further used in the communication device Before the second NFC device sends the first request including the first length value, determining that the first length value is less than or equal to the second length value and less than or equal to the third length value.
结合本发明实施例第六方面的第二种可能的实现方式,在本发明实施例第六方面的第四种可能的实现方式中,所述通信装置,还用于通过所述第一RF接口接收所述DH发送的第一数据消息;With reference to the second possible implementation manner of the sixth aspect of the embodiments of the present invention, in a fourth possible implementation manner of the sixth aspect of the embodiments, the communications device is further configured to pass the first RF interface. Receiving a first data message sent by the DH;
所述处理器,还用于以所述第一长度值作为所述最大长度值将所述第一数据消息中的负载封装成第一数据包;The processor is further configured to encapsulate the load in the first data message into a first data packet by using the first length value as the maximum length value;
所述通信装置,还用于将所述第一数据包发送至所述第二NFC设备。The communication device is further configured to send the first data packet to the second NFC device.
结合本发明实施例第六方面的第三种可能的实现方式,在本发明实施例第六方面的第五种可能的实现方式中,所述通信装置,还用于向所述DH发送第二通知,所述第二通知用于告知所述DH第二RF接口已被激活,并通过所述第二RF接口接收所述DH发送的第二数据消息;With reference to the third possible implementation manner of the sixth aspect of the embodiments of the present invention, in a fifth possible implementation manner of the sixth aspect of the embodiments, the communications device is further configured to send the second Notifying that the second notification is that the DH second RF interface has been activated, and receives the second data message sent by the DH by using the second RF interface;
所述处理器,还用于以所述第一长度值作为所述最大长度值将所述第二数据消息中的负载封装成第二数据包;The processor is further configured to encapsulate the load in the second data message into a second data packet by using the first length value as the maximum length value;
所述通信装置,还用于将所述第二数据包发送至所述第二NFC设备。The communication device is further configured to send the second data packet to the second NFC device.
结合本发明实施例第六方面的第二种可能的实现方式,在本发明实施例第六方面的第六种可能的实现方式中,所述第一请求是Digital规范中定义的PSL_REQ;With reference to the second possible implementation manner of the sixth aspect of the embodiment of the present invention, in a sixth possible implementation manner of the sixth aspect, the first request is a PSL_REQ defined in the Digital specification;
所述第一响应是所述Digital规范中定义的PSL_RES;The first response is a PSL_RES defined in the Digital specification;
所述第一RF接口是NCI规范中定义的NFC-DEP射频接口; The first RF interface is an NFC-DEP radio frequency interface defined in an NCI specification;
所述第一通知是所述NCI规范中定义的RF_INTF_ACTIVATED_NTF。The first notification is RF_INTF_ACTIVATED_NTF defined in the NCI specification.
本发明实施例中,作为发起方的第一NFC设备的NFCC判断是否由该NFCC负责确定后续通信中所传输的数据包的最大长度值,如果是,则向第二NFC设备发送包含第一长度值的第一请求,其中,该第一请求用于指示将第一NFC设备与第二NFC设备在后续通信中所传输的数据包的最大长度值调整为第一长度值,该第一长度值是第一NFC设备的NFCC确定的一个值且第一请求还包含第一设备标识DID,接收第二NFC设备针对该第一请求返回的包含第二DID的第一响应,当第一DID与上述第二DID相同时,将第一长度值作为后续通信中所传输的数据包的最大长度值。可见,实施本发明实施例能够通过NCI规范实现作为发起方的第一NFC设备通过其NFCC与作为目标方的第二NFC设备调整后续通信过程中的通信数据包的最大长度值的功能。In the embodiment of the present invention, the NFCC of the first NFC device as the initiator determines whether the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication, and if yes, transmitting the first length to the second NFC device. a first request of a value, wherein the first request is used to indicate that a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication is adjusted to a first length value, the first length value Is a value determined by the NFCC of the first NFC device, and the first request further includes a first device identifier DID, and receives a first response including the second DID returned by the second NFC device for the first request, when the first DID is the same as the foregoing When the second DID is the same, the first length value is taken as the maximum length value of the data packet transmitted in the subsequent communication. It can be seen that the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party.
附图说明DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings to be used in the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without paying any creative work.
图1是本发明实施例公开的一种调整近场通信NFC中数据包长度的方法的流程示意图;1 is a schematic flowchart of a method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention;
图2是本发明实施例公开的另一种调整近场通信NFC中数据包长度的方法的流程示意图;2 is a schematic flow chart of another method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention;
图3是本发明实施例公开的又一种调整近场通信NFC中数据包长度的方法的流程示意图;3 is a schematic flow chart of another method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention;
图4是本发明实施例公开的又一种调整近场通信NFC中数据包长度的方法的流程示意图;4 is a schematic flow chart of another method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention;
图5是本发明实施例公开的又一种调整近场通信NFC中数据包长度的方法的流程示意图;FIG. 5 is a schematic flowchart of still another method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present disclosure;
图6是本发明实施例公开的一种NFCC的结构示意图;6 is a schematic structural diagram of an NFCC according to an embodiment of the present invention;
图7是本发明实施例公开的另一种NFCC的结构示意图;7 is a schematic structural diagram of another NFCC according to an embodiment of the present invention;
图8是本发明实施例公开的又一种NFCC的结构示意图; FIG. 8 is a schematic structural diagram of still another NFCC according to an embodiment of the present invention; FIG.
图9是本发明实施例公开的又一种NFCC的结构示意图;FIG. 9 is a schematic structural diagram of still another NFCC according to an embodiment of the present invention; FIG.
图10是本发明实施例公开的又一种NFCC的结构示意图;FIG. 10 is a schematic structural diagram of still another NFCC according to an embodiment of the present invention; FIG.
图11是本发明实施例公开的又一种NFCC的结构示意图;11 is a schematic structural diagram of still another NFCC according to an embodiment of the present invention;
图12是本发明实施例公开的又一种NFCC的结构示意图;FIG. 12 is a schematic structural diagram of still another NFCC according to an embodiment of the present invention; FIG.
图13是本发明实施例公开的一种调整近场通信NFC中数据包长度的系统的结构示意图。FIG. 13 is a schematic structural diagram of a system for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。通过本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art without departing from the inventive scope are the scope of the invention.
本发明实施例公开了一种调整近场通信NFC中数据包长度的方法、装置及系统,能够通过NCI规范实现作为发起方的第一NFC设备通过其NFCC与作为目标方的第二NFC设备调整后续通信过程中的通信数据包的最大长度值的功能。以下分别进行详细说明。The embodiment of the invention discloses a method, device and system for adjusting the length of a data packet in a near field communication NFC, which can realize the adjustment of the first NFC device as the initiator through the NCI specification and the second NFC device as the target by the NCI specification. The function of the maximum length value of the communication packet during subsequent communication. The details are described below separately.
需要说明的是,本发明实施例中所使用的DH与NFCC是在NFC论坛(NFC Forum)制定的NCI协议中使用的术语。其中,DH用于负责整个NFC设备的管理,其中包括NFC控制器的管理,如初始化,配置或电源管理等,在智能手机中,它可以对应手机的CPU;DH可以对应欧洲电信标准协会(ETSI,European Telecommunication Standards Institute)制定的主机控制器接口(HCI,Host Controller Interface)规范中的终端主机(Terminal Host);此外,全球平台国际标准组织(GP,Global Platform)制定的规范中的管理实体(ME,Managing Entity)若实现在终端主机(Terminal Host)上,则也可以将DH称为管理主机(MH,Managing Host)。而NFCC是NFC芯片的负责数据传输的实体,通常直接用它来指代NFC芯片;NFCC可以对应欧洲电信标准协会(ETSI,European Telecommunication Standards Institute)制定的HCI规范中的非接触前端(CLF,Contactless Front-end),此时,HCI中的主机控制器(Host Controller)要实现在NFCC上。It should be noted that the DH and NFCC used in the embodiments of the present invention are terms used in the NCI protocol formulated by the NFC Forum. Among them, DH is responsible for the management of the entire NFC device, including the management of the NFC controller, such as initialization, configuration or power management, in the smart phone, it can correspond to the CPU of the mobile phone; DH can correspond to the European Telecommunications Standards Institute (ETSI) , the Terminal Host (HCI) in the Host Controller Interface (HCI) specification developed by the European Telecommunication Standards Institute; in addition, the management entity in the specifications developed by the Global Platform International Standards Organization (GP, Global Platform) ( ME, Managing Entity) If implemented on a Terminal Host, DH can also be referred to as a Management Host (MH). The NFCC is the entity responsible for data transmission of the NFC chip, and is usually used directly to refer to the NFC chip; the NFCC can correspond to the non-contact front end (CLF, Contactless) in the HCI specification developed by the European Telecommunication Standards Institute (ETSI). Front-end) At this time, the host controller in the HCI is implemented on the NFCC.
请参阅图1,图1是本发明实施例公开的一种调整近场通信NFC中数据包长 度的方法的流程示意图。其中,图1所示的方法应用于作为发起方的第一NFC设备的NFCC中。如图1所示,该调整近场通信NFC中数据包长度的方法可以包括以下步骤:Please refer to FIG. 1. FIG. 1 is a diagram of adjusting the length of a data packet in a near field communication NFC according to an embodiment of the present invention. Schematic diagram of the method of degree. Among them, the method shown in FIG. 1 is applied to the NFCC of the first NFC device as the initiator. As shown in FIG. 1, the method for adjusting the packet length in the near field communication NFC may include the following steps:
S101、判断是否由NFCC负责确定后续通信中所传输的数据包的最大长度值。S101. Determine whether the NFCC is responsible for determining a maximum length value of the data packet transmitted in the subsequent communication.
本发明实施例中,当步骤S101的判断结果为是时,第一NFC设备的NFCC可以执行步骤S102,即第一NFC设备的NFCC向作为目标方的第二NFC设备发送包含第一长度值的第一请求;当步骤S101的判断结果为否时,第一NFC设备的NFCC可以结束本次流程,即第一NFC设备的NFCC不向第二NFC设备发送包含第一长度值的第一请求。In the embodiment of the present invention, when the determination result of step S101 is YES, the NFCC of the first NFC device may perform step S102, that is, the NFCC of the first NFC device sends the first length value to the second NFC device as the target party. The first request; when the determination result of the step S101 is NO, the NFCC of the first NFC device may end the current process, that is, the NFCC of the first NFC device does not send the first request including the first length value to the second NFC device.
本发明实施例中,在第一NFC设备的NFCC执行步骤S101之前,第一NFC设备与第二NFC设备均已经激活了MAC层,即第一NFC设备与第二NFC设备通过ATR_REQ与ATR_RES已经协商好后续通信过程中所传输的数据包的最大长度值,即第二长度值以及第三长度值,其中,第二长度值由第一NFC设备设置且用于限制第二NFC设备在后续通信过程中发送的数据包的长度(即从第二NFC设备到第一NFC设备方向上所传输的数据包的长度),第三长度值由第二NFC设备设置且用于限制第一NFC设备在后续通信过程中发送的数据包的长度(即从第一NFC设备到第二NFC设备方向上所传输的数据包的长度),也就是说,后续通信中,第二NFC设备发送的数据包的长度不能超过第二长度值,第一NFC设备发送的数据包的长度不能超过第三长度值。In the embodiment of the present invention, before the NFCC of the first NFC device performs step S101, the first NFC device and the second NFC device have activated the MAC layer, that is, the first NFC device and the second NFC device have negotiated with the ATR_RES through ATR_REQ. The maximum length value of the data packet transmitted in the subsequent communication process, that is, the second length value and the third length value, wherein the second length value is set by the first NFC device and is used to limit the second NFC device in the subsequent communication process. The length of the data packet sent (ie, the length of the data packet transmitted from the second NFC device to the direction of the first NFC device), the third length value being set by the second NFC device and used to limit the first NFC device in subsequent The length of the data packet sent during the communication (ie the length of the data packet transmitted from the first NFC device to the second NFC device), that is, the length of the data packet sent by the second NFC device in subsequent communication The second length value cannot be exceeded, and the length of the data packet sent by the first NFC device cannot exceed the third length value.
本发明实施例中,步骤S101的判断结果为是意味着第一NFC设备的NFCC能够在MAC层激活之后调整第一NFC设备与第二NFC设备在后续通信过程中所传输的数据包的最大长度值,该最大长度值限制了从第一NFC设备到第二NFC设备方向上以及从第二NFC设备到第一NFC设备方向上分别传输的数据包的长度。In the embodiment of the present invention, the determination result of step S101 is that the NFCC of the first NFC device can adjust the maximum length of the data packet transmitted by the first NFC device and the second NFC device in the subsequent communication process after the MAC layer is activated. A value that limits the length of the data packets transmitted from the first NFC device to the second NFC device and from the second NFC device to the first NFC device, respectively.
S102、向第二NFC设备发送包含第一长度值的第一请求。S102. Send a first request that includes a first length value to the second NFC device.
本发明实施例中,该第一请求用于指示将第一NFC设备与第二NFC设备在后续通信过程中所传输的数据包的最大长度值调整为该第一请求中包含的第一长度值,其中,第一长度值是由第一NFC设备的NFCC确定出的一个长度值,第一长度值小于或等于上述第二长度值且小于或等于上述第三长度值,且该第 一请求还包含第一设备标识DID(Device Identification Number)。In the embodiment of the present invention, the first request is used to indicate that a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication process is adjusted to a first length value included in the first request. The first length value is a length value determined by the NFCC of the first NFC device, the first length value is less than or equal to the second length value and less than or equal to the third length value, and the first length value is A request further includes a first device identification DID (Device Identification Number).
本发明实施例中,该第一请求可以是NFC论坛定义的Digital规范中定义的参数选择请求PSL_REQ,其中第5个字节(Byte 5)表示FSL参数,该字节的值定义了命令与响应的最大长度值,进一步地,该字节中的第一和第二比特位(即Digital规范中定义的b1和b2)对应的值表示该最大长度值,例如,当这里两个比特位的值为00b时,该最大长度值为64字节;当这里两个比特位的值为01b时,该最大长度值为128字节;当这里两个比特位的值为10b时,该最大长度值为192字节;当这里两个比特位的值为11b时,该最大长度值为254字节。因此,通过PSL_REQ和PSL_RES调整该最大长度值,可以理解为从一个长度值切换(switch)到另一个长度值,也可以理解为该最大长度值的重新协商或修改等,本发明实施例不对“调整”一词的含义进行限制。In the embodiment of the present invention, the first request may be a parameter selection request PSL_REQ defined in the Digital specification defined by the NFC Forum, wherein the fifth byte (Byte 5) represents an FSL parameter, and the value of the byte defines the command and response. The maximum length value, further, the values corresponding to the first and second bits in the byte (ie, b1 and b2 defined in the Digital specification) represent the maximum length value, for example, when the values of the two bits are here When it is 00b, the maximum length value is 64 bytes; when the value of the two bits is 01b, the maximum length value is 128 bytes; when the value of the two bits is 10b, the maximum length value is It is 192 bytes; when the value of two bits here is 11b, the maximum length value is 254 bytes. Therefore, adjusting the maximum length value by PSL_REQ and PSL_RES can be understood as switching from one length value to another length value, and can also be understood as renegotiation or modification of the maximum length value, etc., which is not correct in the embodiment of the present invention. Limit the meaning of the word "adjustment".
其中,上述命令与响应可以是通过NFC-DEP协议进行通信时所使用的命令与响应,例如数据交换协议请求(DEP_REQ,Data Exchange Protocol Request)和数据交换协议响应(DEP_RES,Data Exchange Protocol Response)等;上述命令与响应可以作为负载(payload,即上层应用相关的业务数据)封装在数据包(Data)中,然后由NFC设备以NFC-A技术(即NFC论坛中定义的类型A射频技术,对应ISO/IEC 14443的类型A的缩写)标准帧格式(NFC-A Technology standard frame)或NFC-F技术(即NFC论坛中定义的类型F射频技术,对应ISO/IEC 18092的212kbps和424kbps通信机制的缩写)帧格式(NFC-F Technology frame)发送出去,因此,上述最大长度值可以理解为数据包长度的最大值,也可以理解为上述命令与响应的负载(payload)字节数的最大值。The command and response may be commands and responses used when communicating through the NFC-DEP protocol, such as a data exchange protocol request (DEP_REQ, Data Exchange Protocol Request) and a data exchange protocol response (DEP_RES, Data Exchange Protocol Response). The above command and response can be encapsulated in a data packet as a payload (the upper-layer application-related business data), and then NFC-A technology (ie, type A radio frequency technology defined in the NFC forum, corresponding to the NFC device) ISO/IEC 14443, abbreviated type A) NFC-A Technology standard frame or NFC-F technology (ie type F radio technology defined in the NFC Forum, corresponding to the 212 kbps and 424 kbps communication mechanisms of ISO/IEC 18092) Abbreviation) The frame format (NFC-F Technology frame) is sent out. Therefore, the above maximum length value can be understood as the maximum value of the packet length, and can also be understood as the maximum value of the number of payloads of the above command and response.
本发明实施例中,第一NFC设备的NFCC向第二NFC设备发送包含第一长度值的第一请求,以使第二NFC设备在不接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值时不返回任何响应,或者以使第二NFC设备返回用于表示不接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值的响应,例如,该响应中包含的DID不等于该第一请求中所包含的DID,以表示该第二NFC设备不接受上述第一长度值,或者以使第二NFC设备返回用于表示接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值的响应,例如,该响应中包含的设备标识DID等于该第一请求中所包含的DID,以表示该第二NFC设备接受上述第一长度值。 In the embodiment of the present invention, the NFCC of the first NFC device sends a first request including the first length value to the second NFC device, so that the second NFC device does not accept the maximum length of the data packet transmitted during the subsequent communication. When the value is adjusted to the first length value, no response is returned, or the second NFC device returns a response indicating that the maximum length value of the data packet transmitted during the subsequent communication is not accepted to be adjusted to the first length value. For example, the DID included in the response is not equal to the DID included in the first request, to indicate that the second NFC device does not accept the first length value, or that the second NFC device returns to indicate that the acceptance will be followed. The maximum length value of the data packet transmitted during the communication is adjusted to the response of the first length value, for example, the device identifier DID included in the response is equal to the DID included in the first request, to indicate the second NFC device. Accept the above first length value.
本发明实施例中,第一NFC设备的NFCC向第二NFC设备发送包含第一长度值的第一请求即是第一NFC设备的NFCC向第二NFC设备的NFCC发送包含第一长度值的第一请求。In the embodiment of the present invention, the NFCC of the first NFC device sends the first request including the first length value to the second NFC device, that is, the NFCC of the first NFC device sends the first length value to the NFCC of the second NFC device. A request.
S103、接收上述第二NFC设备针对上述第一请求返回的第一响应。S103. Receive a first response returned by the second NFC device for the first request.
本发明实施例中,该第一响应可以包含第二DID。In this embodiment of the present invention, the first response may include a second DID.
S104、当第一DID与第二DID相同时,将上述第一长度值作为后续通信中所传输的数据包的最大长度值。S104. When the first DID is the same as the second DID, the first length value is used as a maximum length value of the data packet transmitted in the subsequent communication.
本发明实施例中,当上述第一DID与上述第二DID相同时,该第一响应用于表示第二NFC设备已经将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值,其中,第一DID与第二DID均为上述第二NFC设备的设备标识,示例地,对于NFC-DEP协议而言,上述第二DID是作为发起方的第一NFC设备在通过ATR_REQ激活MAC层时为作为目标方的第二NFC设备分配的、用来标识第二NFC设备的一个标识;又示例地,对于ISO-DEP协议而言,上述第二DID是作为读写器(Reader/Writer)的第一NFC设备在通过RATS Command或ATTRIB Command激活作为NFC标签或者卡模拟的第二NFC设备时为该第二NFC设备分配的、用来标识该第二NFC设备的一个标识。In the embodiment of the present invention, when the first DID is the same as the second DID, the first response is used to indicate that the second NFC device has adjusted the maximum length value of the data packet transmitted in the subsequent communication process to the first a length value, wherein the first DID and the second DID are both device identifiers of the second NFC device, and for example, for the NFC-DEP protocol, the second DID is the first NFC device acting as the initiator in passing the ATR_REQ An identifier assigned to the second NFC device as the target when the MAC layer is activated to identify the second NFC device; and by way of example, for the ISO-DEP protocol, the second DID is used as a reader (Reader) The first NFC device of /Writer) is an identifier assigned to the second NFC device to identify the second NFC device when the second NFC device that is the NFC tag or the card emulation is activated by the RATS Command or the ATTRIB Command.
作为一种可选的实施方式,第一NFC设备的NFCC判断是否由其负责确定后续通信中所传输的数据包的最大长度值可以包括:As an optional implementation manner, whether the NFCC of the first NFC device determines whether it is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication may include:
判断第一参数的值是否为第一特定值,其中,该第一特定值用于表示后续通信中所传输的数据包的最大长度值由第一NFC设备中的NFCC负责确定,且第一参数的值可以是第一NFC设备中的NFCC的默认值(即NFC芯片出厂时设置到NFCC中的默认值),也可以是由第一NFC设备的DH配置给第一NFC设备的NFCC的值,本发明实施例不做限定。Determining whether the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that the maximum length value of the data packet transmitted in the subsequent communication is determined by the NFCC in the first NFC device, and the first parameter The value of the NFCC in the first NFC device may be the default value of the NFCC in the first NFC device (ie, the default value set in the NFCC when the NFC chip is shipped from the factory), or may be the value of the NFCC configured by the DH of the first NFC device to the first NFC device. The embodiments of the present invention are not limited.
作为一种可选的实施方式,第一NFC设备的NFCC在执行完毕步骤S104之后,第一NFC设备的NFCC还可以执行以下操作:As an optional implementation manner, after the NFCC of the first NFC device is executed, the NFCC of the first NFC device may further perform the following operations:
向第一NFC设备的DH发送包含上述第一长度值的第一通知,其中,该第一通知用于告知第一NFC设备的DH第一射频(RF,Radio Frequency)接口已经被激活;Sending, to the DH of the first NFC device, a first notification that includes the foregoing first length value, where the first notification is used to notify the first NFC device that the DH first radio frequency (RF) interface has been activated;
通过该第一RF接口接收第一NFC设备的DH发送的数据消息,并以上述第一长度值作为最大长度值将该数据消息中的负载封装成数据包,即该数据包的 长度值小于等于上述第一长度值;Receiving, by the first RF interface, a data message sent by the DH of the first NFC device, and encapsulating the load in the data message into a data packet by using the first length value as the maximum length value, that is, the data packet The length value is less than or equal to the first length value;
将该数据包发送至第二NFC设备。The data packet is sent to the second NFC device.
该可选的实施方式中,第一NFC设备的NFCC向第一NFC设备的DH发送包含上述第一长度值的上述第一通知的目的是向第一NFC设备的DH上报第一NFC设备与第二NFC设备调整后的后续通信中所传输的数据包的最大长度值为上述第一长度值,以使第一NFC设备的DH获取到该第一长度值后可以在上层业务中进行使用,例如,估算本次通信中完成上层业务相关数据的传输所需要的时间是多少等等,以及通知第一NFC设备的DH上述第一RF接口已被激活,也就是说,第一NFC设备的NFCC已准备好接收第一NFC设备的DH发送的数据消息。其中,该数据消息可以是NCI规范中定义的Data Message(s),其中,在DH与NFCC之间传输Data Message(s)是通过传输Data Packet(s)实现的,且该数据消息中的负载(payload)携带的可以是上层业务相关的数据。In the optional implementation, the NFCC of the first NFC device sends the foregoing first notification that includes the first length value to the DH of the first NFC device, and the first notification is to report the first NFC device to the DH of the first NFC device. The maximum length of the data packet transmitted in the subsequent communication of the second NFC device is the first length value, so that the DH of the first NFC device can obtain the first length value and can be used in the upper layer service, for example, , estimating the time required to complete the transmission of the upper layer service related data in the communication, and the like, and notifying the first NFC device that the first RF interface of the first NFC device has been activated, that is, the NFCC of the first NFC device has been Ready to receive the data message sent by the DH of the first NFC device. The data message may be a Data Message(s) defined in the NCI specification, where the Data Message(s) is transmitted between the DH and the NFCC by transmitting the Data Packet(s), and the load in the data message is (payload) can carry data related to upper layer services.
此外,该可选的实施方式中,可以如上所述将上述数据包理解成Digital规范中定义的以相应技术帧格式携带DEP_REQ的帧;为了描述简单,也可以将上述数据包理解为Digital规范中定义的DEP_REQ,那么,以上述第一长度值作为最大长度值将该数据消息中的负载封装成数据包,就是将该数据消息中的负载都封装在至少一个DEP_REQ中,同时保证这些DEP_REQ的长度不超过上述第一长度值,以保证第一NFC设备的NFCC能通过相应的帧格式(例如,NFC-A技术标准帧格式、NFC-F技术帧格式等)将这些DEP_REQ发送出去(即将这些DEP_REQ封装在相应格式的帧中发送出去)。因此,上述将该数据包发送至第二NFC设备及其后续的具体操作可以为:In addition, in the optional implementation manner, the foregoing data packet may be understood as a frame that carries the DEP_REQ in the corresponding technical frame format, as defined in the Digital specification, as described above; for the sake of simplicity of description, the foregoing data packet may also be understood as a Digital specification. Defining the DEP_REQ, the packet in the data message is encapsulated into a data packet by using the first length value as the maximum length value, that is, the load in the data message is encapsulated in at least one DEP_REQ, and the length of the DEP_REQ is guaranteed. The first length value is not exceeded to ensure that the NFCC of the first NFC device can send the DEP_REQs through corresponding frame formats (for example, NFC-A technical standard frame format, NFC-F technical frame format, etc.) (ie, these DEP_REQs) The encapsulation is sent out in the frame of the corresponding format). Therefore, the foregoing specific operation of sending the data packet to the second NFC device and subsequent steps thereof may be:
将DEP_REQ(以某种帧格式)发送至第二NFC设备,以使第二NFC设备在确定出该DEP_REQ的长度值小于或等于上述第一长度值时向第一NFC设备的NFCC返回DEP_RES;Sending DEP_REQ (in a certain frame format) to the second NFC device, so that the second NFC device returns DEP_RES to the NFCC of the first NFC device when determining that the length value of the DEP_REQ is less than or equal to the first length value;
接收第二NFC设备返回的DEP_RES,且判断该DEP_RES的长度是否小于或等于上述第一长度值;Receiving a DEP_RES returned by the second NFC device, and determining whether the length of the DEP_RES is less than or equal to the first length value;
当判断出该DEP_RES的长度小于或等于上述第一长度值时,获取该DEP_RES(具体地,是DEP_RES中与业务相关的数据),并将其转发给第一NFC设备的DH。When it is determined that the length of the DEP_RES is less than or equal to the first length value, the DEP_RES (specifically, the service-related data in the DEP_RES) is acquired and forwarded to the DH of the first NFC device.
可选的,上述第一请求可以为Digital规范中定义的PSL_REQ,上述第一响 应可以为该Digital规范中定义的PSL_RES,上述第一RF接口可以为NCI规范中定义的NFC-DEP射频接口,且上述第一通知可以为该NCI规范中定义的射频接口激活通知RF_INTF_ACTIVATED_NTF,本发明实施例不做限定。Optionally, the first request may be the PSL_REQ defined in the Digital specification, and the first ringing The first RF interface may be an NFC-DEP radio interface defined in the NCI specification, and the first notification may be a radio interface activation notification RF_INTF_ACTIVATED_NTF defined in the NCI specification, and the present invention is applicable to the PSL_RES defined in the Digital specification. The embodiment is not limited.
需要说明的是,上述第一请求也可以是Digital规范中定义的适用于ISO-DEP协议的RATS Command或ATTRIB Command,其中包含的FSDI(Frame Size for proximity coupling Device Integer)参数用于计算工作在轮询(poll)模式下的NFC设备(例如读写器等)所能接受的数据包(例如信息块I-block或该I-block的负载payload)的最大长度值FSD;相应的,上述第一响应也可以是Digital规范中定义的RATS Response或ATTRIB Response,其中可能包含的FSCI(Frame Size for proximity Card Integer)参数用于计算工作在poll模式下的NFC设备(例如NFC标签或卡模拟)能接受的数据包(例如信息块I-block或该I-block的负载payload)的最大长度值FSC;上述第一RF接口可以是NCI规范中定义的ISO-DEP射频接口或NDEF射频接口,上述第一通知可以是NCI规定中定义的RF_INTF_ACTIVATED_NTF。此时,本发明方案中所使用的“调整”,除了其本身的含义,也可以理解为协商、限定等,本发明方案对此不进行限制。It should be noted that the foregoing first request may also be a RATS Command or an ATTRIB Command applicable to the ISO-DEP protocol defined in the Digital specification, and the FSDI (Frame Size for proximity Couple Device Integer) parameter is included in the calculation work in the round. The maximum length value FSD of a data packet (for example, an information block I-block or a load payload of the I-block) that can be accepted by an NFC device (for example, a reader/writer) in a poll mode; correspondingly, the first The response may also be a RATS Response or an ATTRIB Response defined in the Digital specification, which may include a FSCI (Frame Size for proximity Card Integer) parameter for calculating that an NFC device (eg, an NFC tag or card emulation) operating in poll mode can accept The maximum length value FSC of the data packet (for example, the information block I-block or the load payload of the I-block); the first RF interface may be an ISO-DEP radio interface or an NDEF radio interface defined in the NCI specification, the first The notification can be RF_INTF_ACTIVATED_NTF as defined in the NCI regulations. In this case, the “adjustment” used in the solution of the present invention can be understood as a negotiation, a limitation, and the like in addition to the meaning of the present invention, and the present invention does not limit this.
此外,需要说明的是,本发明实施例中对于“调整”的理解、对于最大长度值、第一长度值、第二长度值、第三长度值的说明、对于第一请求与第一响应的说明、对于设备标识DID的描述以及对于第一RF接口与第一通知的解释等,同样适用于后面的发明实施例,后续将不再赘述。In addition, it should be noted that the understanding of “adjustment” in the embodiment of the present invention, the description of the maximum length value, the first length value, the second length value, and the third length value, for the first request and the first response The description, the description of the device identifier DID, and the explanation of the first RF interface and the first notification, and the like are also applicable to the following embodiments of the invention, and will not be described again.
本发明实施例中,第一NFC设备的NFCC判断是否由该NFCC负责确定后续通信中所传输的数据包的最大长度值,如果是,则向第二NFC设备发送包含第一长度值的第一请求,其中,该第一请求用于将第一NFC设备与第二NFC设备在后续通信中所传输的数据包的最大长度值调整为第一长度值,当接收到第二NFC设备针对该第一请求返回的第一响应且该第一响应中包含的第一DID与该第一请求中包含的第二DID相同时,第一NFC设备的NFCC将该第一请求中包含的第一长度值确定为第一NFC设备与第二NFC设备在后续通信过程中所传输的数据包的最大长度值。可见,实施本发明实施例能够通过NCI规范实现作为发起方的第一NFC设备通过其NFCC与作为目标方的第二NFC设备调整后续通信过程中的数据包的最大长度值的功能。 In the embodiment of the present invention, the NFCC of the first NFC device determines whether the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication, and if yes, transmitting the first length value including the first length value to the second NFC device. a request, wherein the first request is used to adjust a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication to a first length value, when receiving the second NFC device for the first When the first response returned by the request and the first DID included in the first response is the same as the second DID included in the first request, the NFCC of the first NFC device sets the first length value included in the first request Determining a maximum length value of a data packet transmitted by the first NFC device and the second NFC device during subsequent communication. It can be seen that the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the data packet in the subsequent communication process through the NFCC and the second NFC device as the target.
请参阅图2,图2是本发明实施例公开的另一种调整近场通信NFC中数据包长度的方法的流程示意图。其中,图2所示的方法应用于作为发起方的第一NFC设备的NFCC中。如图2所示,该调整近场通信NFC中数据包长度的方法可以包括以下步骤:Referring to FIG. 2, FIG. 2 is a schematic flowchart diagram of another method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention. Among them, the method shown in FIG. 2 is applied to the NFCC of the first NFC device as the initiator. As shown in FIG. 2, the method for adjusting the packet length in the near field communication NFC may include the following steps:
S201、接收第一NFC设备的DH发送的包含第一长度值的调整命令。S201. Receive an adjustment command that includes a first length value sent by the DH of the first NFC device.
本发明实施例中,该调整命令用于指示第一NFC设备的NFCC调整后续通信过程中所传输的数据包的最大长度值。In the embodiment of the present invention, the adjustment command is used to indicate that the NFCC of the first NFC device adjusts the maximum length value of the data packet transmitted in the subsequent communication process.
本发明实施例中,在第一NFC设备的NFCC在执行步骤S201之前,第一NFC设备与第二NFC设备均已经激活了MAC层,即第一NFC设备与第二NFC设备通过ATR_REQ与ATR_RES已经协商好后续通信过程中所传输的数据包的最大长度值,即第二长度值以及第三长度值,其中,第二长度值由第一NFC设备设置且用于限制第二NFC设备在后续通信过程中发送的数据包的长度(即从第二NFC设备到第一NFC设备方向上所传输的数据包的长度),第三长度值由第二NFC设备设置且用于限制第一NFC设备在后续通信过程中发送的数据包的长度(即从第一NFC设备到第二NFC设备方向上所传输的数据包的长度),也就是说,后续通信中,第二NFC设备发送的数据包的长度不能超过第二长度值,第一NFC设备发送的数据包的长度不能超过第三长度值。In the embodiment of the present invention, before the NFCC of the first NFC device performs the step S201, the first NFC device and the second NFC device have activated the MAC layer, that is, the first NFC device and the second NFC device have passed the ATR_REQ and the ATR_RES. Negotiating the maximum length value of the data packet transmitted during the subsequent communication, that is, the second length value and the third length value, wherein the second length value is set by the first NFC device and used to limit the second NFC device in subsequent communication The length of the data packet sent during the process (ie the length of the data packet transmitted from the second NFC device to the direction of the first NFC device), the third length value being set by the second NFC device and used to limit the first NFC device The length of the data packet sent during the subsequent communication (ie, the length of the data packet transmitted from the first NFC device to the second NFC device), that is, the data packet sent by the second NFC device in subsequent communication. The length cannot exceed the second length value, and the length of the data packet sent by the first NFC device cannot exceed the third length value.
本发明实施例中,第一NFC设备的NFCC接收到上述调整命令意味着第一NFC设备的NFCC能够在MAC层激活之后调整第一NFC设备与第二NFC设备在后续通信过程中所传输的数据包的最大长度值,该最大长度值限制了从第一NFC设备到第二NFC设备方向上以及从第二NFC设备到第一NFC设备方向上分别传输的数据包的长度。In the embodiment of the present invention, the NFCC of the first NFC device receiving the foregoing adjustment command means that the NFCC of the first NFC device can adjust the data transmitted by the first NFC device and the second NFC device in the subsequent communication process after the MAC layer is activated. The maximum length value of the packet, which limits the length of the data packets respectively transmitted from the first NFC device to the second NFC device and from the second NFC device to the first NFC device.
S202、向第二NFC设备发送包含上述第一长度值的第一请求。S202. Send a first request that includes the first length value to the second NFC device.
本发明实施例中,该第一请求用于指示将第一NFC设备与第二NFC设备在后续通信过程中所传输的数据包的最大长度值调整为该第一请求中包含的第一长度值,第一长度值小于或等于上述第二长度值且小于或等于上述第三长度值,且该第一请求还包含第一DID。In the embodiment of the present invention, the first request is used to indicate that a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication process is adjusted to a first length value included in the first request. The first length value is less than or equal to the second length value and less than or equal to the third length value, and the first request further includes the first DID.
本发明实施例中,第一NFC设备的NFCC向第二NFC设备发送包含第一长度值的第一请求,以使第二NFC设备在不接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值时不返回任何响应,或者以使第二NFC 设备返回用于表示不接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值的响应,例如,该响应中包含的DID不等于该第一请求中所包含的DID,以表示该第二NFC设备不接受上述第一长度值,或者以使第二NFC设备返回用于表示接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值的响应,例如,该响应中包含的DID等于该第一请求中所包含的DID,以表示该第二NFC设备接受上述第一长度值。In the embodiment of the present invention, the NFCC of the first NFC device sends a first request including the first length value to the second NFC device, so that the second NFC device does not accept the maximum length of the data packet transmitted during the subsequent communication. Does not return any response when the value is adjusted to the first length value above, or to make the second NFC The device returns a response indicating that the maximum length value of the data packet transmitted during the subsequent communication is not accepted to be adjusted to the first length value, for example, the DID included in the response is not equal to the DID included in the first request. To indicate that the second NFC device does not accept the first length value, or to cause the second NFC device to return to indicate that the maximum length value of the data packet transmitted during the subsequent communication is accepted to be the first length value. In response, for example, the DID included in the response is equal to the DID included in the first request to indicate that the second NFC device accepts the first length value.
本发明实施例中,第一NFC设备的NFCC向第二NFC设备发送包含上述第一长度值的第一请求即是第一NFC设备的NFCC向第二NFC设备的NFCC发送包括第一长度值的第一请求。In the embodiment of the present invention, the NFCC of the first NFC device sends the first request including the first length value to the second NFC device, that is, the NFCC of the first NFC device sends the NFCC of the second NFC device to include the first length value. First request.
S203、接收上述第二NFC设备针对上述第一请求返回的第一响应。S203. Receive a first response returned by the second NFC device for the first request.
本发明实施例中,该第一响应中包含第二DID。In the embodiment of the present invention, the first response includes a second DID.
S204、当第一DID与第二DID相同时,将上述第一长度值作为后续通信中所传输的数据包的最大长度值。S204. When the first DID is the same as the second DID, the first length value is used as a maximum length value of the data packet transmitted in the subsequent communication.
本发明实施例中,当第一响应中包含的第二DID与上述第一请求中包含的第一DID相同时,该第一响应用于表示第二NFC设备已经将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值,其中,第一DID与第二DID均为上述第二NFC设备的设备标识,示例地,对于NFC-DEP协议而言,上述第二DID是作为发起方的第一NFC设备在通过ATR_REQ激活MAC层时为作为目标方的第二NFC设备分配的、用来标识第二NFC设备的一个标识;又示例地,对于ISO-DEP协议而言,上述第二DID是作为读写器(Reader/Writer)的第一NFC设备在通过RATS Command或ATTRIB Command激活作为NFC标签或者卡模拟的第二NFC设备时为该第二NFC设备分配的、用来标识该第二NFC设备的一个标识。In the embodiment of the present invention, when the second DID included in the first response is the same as the first DID included in the first request, the first response is used to indicate that the second NFC device has transmitted the subsequent communication process. The maximum length value of the data packet is adjusted to the first length value, wherein the first DID and the second DID are both device identifiers of the second NFC device, and for example, for the NFC-DEP protocol, the second DID is The first NFC device as the initiator, which is assigned to the second NFC device as the target when the MAC layer is activated by the ATR_REQ, is used to identify one identifier of the second NFC device; and for example, for the ISO-DEP protocol, The second DID is allocated to the second NFC device as a first NFC device as a reader/writer (Reader/Writer) when the second NFC device is activated as an NFC tag or a card emulation by the RATS Command or the ATTRIB Command. An identifier identifying the second NFC device.
作为一种可选的实施方式,当第一NFC设备的NFCC在执行完毕步骤S204之后,第一NFC设备的NFCC还可以执行以下操作:As an optional implementation manner, after the NFCC of the first NFC device performs the step S204, the NFCC of the first NFC device may further perform the following operations:
向第一NFC设备的DH发送包含状态指示和/或上述第一长度值的调整响应,其中,该状态指示用于表示第一NFC设备的NFCC已将上述最大长度值调整为上述第一长度值,也就是说第一NFC设备与第二NFC设备之间已经完成本次调整。Transmitting, to the DH of the first NFC device, an adjustment response including a status indication and/or the first length value, wherein the status indication indicates that the NFCC of the first NFC device has adjusted the maximum length value to the first length value That is to say, this adjustment has been completed between the first NFC device and the second NFC device.
作为一种可选的实施方式,在执行步骤S201之前,第一NFC设备的NFCC 还可以执行以下操作:As an optional implementation manner, before performing step S201, the NFCC of the first NFC device You can also do the following:
激活第一RF接口,并向第一NFC设备的DH发送第一通知,其中,该第一通知用于告知第一NFC设备的DH该第一RF接口已被激活。The first RF interface is activated and a first notification is sent to the DH of the first NFC device, wherein the first notification is used to inform the DH of the first NFC device that the first RF interface has been activated.
需要说明的是,此时,第一NFC设备与第二NFC设备通过ATR_REQ和ATR_RES激活了第一NFC设备与第二NFC设备之间的MAC层,即第一NFC设备与第二NFC设备已经协商好后续通信中在两个方向上分别传输的数据包的最大长度值,即上述实施例中的第二长度值和第三长度值。本发明实施例中,第一NFC设备的NFCC向第一NFC设备的DH发送第一通知时,可以携带ATR_RES中的参数值,其中包括第三长度值,具体请参见NCI规范。It should be noted that, at this time, the first NFC device and the second NFC device activate the MAC layer between the first NFC device and the second NFC device by using ATR_REQ and ATR_RES, that is, the first NFC device and the second NFC device have negotiated The maximum length value of the data packets respectively transmitted in the two directions in the subsequent communication, that is, the second length value and the third length value in the above embodiment. In the embodiment of the present invention, when the NFCC of the first NFC device sends the first notification to the DH of the first NFC device, the parameter value in the ATR_RES may be carried, including the third length value. For details, refer to the NCI specification.
作为另一种可选的实施方式,在执行完毕步骤S201之后且在执行步骤S202之前,第一NFC设备的NFCC还可以执行以下操作:As another optional implementation manner, after performing step S201 and before performing step S202, the NFCC of the first NFC device may further perform the following operations:
确定上述第一长度值小于或等于上述第二长度值且小于或等于上述第三长度值。Determining that the first length value is less than or equal to the second length value and less than or equal to the third length value.
需要说明的是,该可选的实施方式中,第一NFC设备的DH向第一NFC设备的NFCC发送上述调整命令可以发生在第一NFC设备通过NFCC与第二NFC设备直接激活MAC层之前或之后,由于第一NFC设备的DH不知第一NFC设备的NFCC与第二NFC设备即将协商的或已经协商好的第二长度值与第三长度值具体是多少,因此,第一NFC设备的DH发送的该调整命令中的第一长度值可能大于、等于或小于该第二长度值或第三长度值,那么,第一NFC设备的NFCC为了防止第一长度值超过该第二长度值或第三长度值,第一NFC设备的NFCC需要执行上述操作以保证该第一长度值小于或等于第二长度值与第三长度值。It should be noted that, in the optional implementation manner, the sending, by the DH of the first NFC device, the foregoing adjustment command to the NFCC of the first NFC device may occur before the first NFC device directly activates the MAC layer by using the NFCC and the second NFC device, or After that, because the DH of the first NFC device does not know the second length value and the third length value that the NFCC of the first NFC device and the second NFC device are about to negotiate or have negotiated, the DH of the first NFC device is The first length value of the sent adjustment command may be greater than, equal to, or less than the second length value or the third length value, then the NFCC of the first NFC device prevents the first length value from exceeding the second length value or For a three-length value, the NFCC of the first NFC device needs to perform the above operations to ensure that the first length value is less than or equal to the second length value and the third length value.
作为一种可选的实施方式,在第一NFC设备的NFCC先激活上述第一RF接口并向第一NFC设备的DH发送上述第一通知,然后再执行步骤S201的情况下,在向第一NFC设备的DH发送包含状态指示和/或上述第一长度值的调整响应之后,第一NFC设备的NFCC还可以执行以下操作:As an optional implementation manner, in a case where the NFCC of the first NFC device first activates the first RF interface and sends the first notification to the DH of the first NFC device, and then performs step S201, After the DH of the NFC device sends an adjustment response including the status indication and/or the first length value, the NFCC of the first NFC device may also perform the following operations:
通过上述第一RF接口接收第一NFC设备的DH发送的第一数据消息,并以上述第一长度值作为最大长度值将该第一数据消息中的负载封装成第一数据包,即该第一数据包的长度值小于或等于上述第一长度值;Receiving, by the first RF interface, the first data message sent by the DH of the first NFC device, and encapsulating the load in the first data message into the first data packet by using the first length value as the maximum length value, that is, the first data packet The length value of a data packet is less than or equal to the first length value;
将该第一数据包发送至第二NFC设备。The first data packet is sent to the second NFC device.
作为一种可选的实施方式,在步骤S201之后且在步骤S202之前执行确定 上述第一长度值小于或等于上述第二长度值且小于或等于上述第三长度值的操作的情况下,在向第一NFC设备的DH发送包含状态指示和/或上述第一长度值的调整响应之后,第一NFC设备的NFCC还可以执行以下操作:As an alternative embodiment, the determination is performed after step S201 and before step S202 When the first length value is less than or equal to the second length value and less than or equal to the third length value, the adjustment of the status indication and/or the first length value is sent to the DH of the first NFC device. After the response, the NFCC of the first NFC device can also perform the following operations:
向第一NFC设备的DH发送第二通知,其中,该第二通知用于告知第一NFC设备的DH第二RF接口已被激活;Sending a second notification to the DH of the first NFC device, wherein the second notification is used to notify that the DH second RF interface of the first NFC device has been activated;
通过该第二RF接口接收第一NFC设备的DH发送的第二数据消息,并以上述第一长度值作为最大长度值将该第二数据消息中的负载封装成第二数据包,即第二数据包的长度值小于或等于上述第一长度值;Receiving, by the second RF interface, the second data message sent by the DH of the first NFC device, and packaging the load in the second data message into the second data packet by using the first length value as the maximum length value, that is, the second data packet The length value of the data packet is less than or equal to the first length value;
将该第二数据包发送至第二NFC设备。The second data packet is sent to the second NFC device.
需要说明的是,上述第二通知中可以包含上述第一长度值,也可以不包含。It should be noted that the first length value may be included in the second notification, and may not be included.
可选的,上述第一请求可以为Digital规范中定义的PSL_REQ,上述第一响应可以为该Digital规范中定义的PSL_RES,上述第一RF接口以及上述第二RF接口可以为NCI规范中定义的NFC-DEP射频接口,且上述第一通知以及上述第二通知可以为该NCI规范中定义的射频接口激活通知RF_INTF_ACTIVATED_NTF,本发明实施例不做限定。Optionally, the first request may be a PSL_REQ defined in the Digital specification, and the first response may be a PSL_RES defined in the Digital specification, and the first RF interface and the second RF interface may be an NFC defined in the NCI specification. The DEP radio interface, and the foregoing first notification and the second notification may be the radio interface activation notification RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
需要说明的是,上述第一请求也可以是Digital规范中定义的适用于ISO-DEP协议的RATS Command或ATTRIB Command,其中包含的FSDI(Frame Size for proximity coupling Device Integer)参数用于计算工作在轮询(poll)模式下的NFC设备(例如读写器等)所能接受的数据包(例如信息块I-block或该I-block的负载payload)的最大长度值FSD;相应的,上述第一响应也可以是Digital规范中定义的RATS Response或ATTRIB Response,其中可能包含的FSCI(Frame Size for proximity Card Integer)参数用于计算工作在poll模式下的NFC设备(例如NFC标签或卡模拟)能接受的数据包(例如信息块I-block或该I-block的负载payload)的最大长度值FSC;上述第一RF接口以及上述第二RF接口可以是NCI规范中定义的ISO-DEP射频接口或NDEF射频接口,上述第一通知以及上述第二通知可以是NCI规定中定义的RF_INTF_ACTIVATED_NTF。此时,本发明方案中所使用的“调整”,除了其本身的含义,也可以理解为协商、限定等,本发明方案对此不进行限制。It should be noted that the foregoing first request may also be a RATS Command or an ATTRIB Command applicable to the ISO-DEP protocol defined in the Digital specification, and the FSDI (Frame Size for proximity Couple Device Integer) parameter is included in the calculation work in the round. The maximum length value FSD of a data packet (for example, an information block I-block or a load payload of the I-block) that can be accepted by an NFC device (for example, a reader/writer) in a poll mode; correspondingly, the first The response may also be a RATS Response or an ATTRIB Response defined in the Digital specification, which may include a FSCI (Frame Size for proximity Card Integer) parameter for calculating that an NFC device (eg, an NFC tag or card emulation) operating in poll mode can accept The maximum length value FSC of the data packet (for example, the information block I-block or the load payload of the I-block); the first RF interface and the second RF interface may be an ISO-DEP radio interface or NDEF defined in the NCI specification. The radio frequency interface, the first notification and the second notification may be RF_INTF_ACTIVATED_NTF defined in the NCI specification. In this case, the “adjustment” used in the solution of the present invention can be understood as a negotiation, a limitation, and the like in addition to the meaning of the present invention, and the present invention does not limit this.
本发明实施例中,第一NFC设备的NFCC判断其是否接收到第一NFC设备的DH发送的包含第一长度值的调整命令,其中,该调整命令用于指示第一NFC 设备的NFCC调整后续通信过程中所传输的数据包的最大长度值,且当判断结果为是时,向第二NFC设备发送包含第一长度值的第一请求,其中,该第一请求用于将第一NFC设备与第二NFC设备后续通信过程中所传输的数据包的最大长度值调整为第一长度值,当接收到第二NFC设备针对第一请求返回的第一响应且该第一响应中包含的第一DID与该第一请求中包含的第二DID相同时,第一NFC设备的NFCC将该第一请求中包含的第一长度值确定为第一NFC设备与第二NFC设备在后续通信过程中所传输的数据包的最大长度值。可见,实施本发明实施例能够通过NCI规范实现作为发起方的第一NFC设备通过其NFCC与作为目标方的第二NFC设备调整后续通信过程中的通信数据包的最大长度值的功能。In the embodiment of the present invention, the NFCC of the first NFC device determines whether it receives the adjustment command including the first length value sent by the DH of the first NFC device, where the adjustment command is used to indicate the first NFC. The NFCC of the device adjusts the maximum length value of the data packet transmitted during the subsequent communication, and when the determination result is yes, sends a first request including the first length value to the second NFC device, where the first request is used for Adjusting a maximum length value of the data packet transmitted during the subsequent communication between the first NFC device and the second NFC device to a first length value, when receiving the first response returned by the second NFC device for the first request, and the first When the first DID included in the response is the same as the second DID included in the first request, the NFCC of the first NFC device determines the first length value included in the first request as the first NFC device and the second NFC device. The maximum length of the data packet transmitted during subsequent communications. It can be seen that the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party.
请参阅图3,图3是本发明实施例公开的又一种调整近场通信NFC中数据包长度的方法的流程示意图。其中,图3所示的方法应用于与上述实施例中作为发起方的第一NFC设备进行点对点通信的、作为目标方的第二NFC设备的NFCC中。如图3所示,该调整近场通信NFC中数据包长度的方法可以包括以下步骤:Please refer to FIG. 3. FIG. 3 is a schematic flowchart diagram of another method for adjusting the length of a data packet in a near field communication NFC according to an embodiment of the present invention. The method shown in FIG. 3 is applied to the NFCC of the second NFC device as the target party that performs point-to-point communication with the first NFC device as the initiator in the above embodiment. As shown in FIG. 3, the method for adjusting the packet length in the near field communication NFC may include the following steps:
S301、接收第一NFC设备的NFCC发送的包含第一长度值的第一请求。S301. Receive a first request that includes a first length value sent by an NFCC of the first NFC device.
本发明实施例中,第二NFC设备的NFCC执行步骤S301的前提是第一NFC设备与第二NFC设备均已经激活了MAC层,即第一NFC设备与第二NFC设备通过ATR_REQ与ATR_RES已经协商好后续通信过程中所传输的数据包的最大长度值,即第二长度值以及第三长度值,其中,第二长度值由第一NFC设备设置且用于限制第二NFC设备在后续通信过程中发送的数据包的长度(即从第二NFC设备到第一NFC设备方向上所传输的数据包的长度),第三长度值由第二NFC设备设置且用于限制第一NFC设备在后续通信过程中发送的数据包的长度(即从第一NFC设备到第二NFC设备方向上所传输的数据包的长度),也就是说,后续通信中,第二NFC设备发送的数据包的长度不能超过第二长度值,第一NFC设备发送的数据包的长度不能超过第三长度值。In the embodiment of the present invention, the NFCC of the second NFC device performs the step S301, that is, the first NFC device and the second NFC device have activated the MAC layer, that is, the first NFC device and the second NFC device have negotiated with the ATR_RES through the ATR_REQ. The maximum length value of the data packet transmitted in the subsequent communication process, that is, the second length value and the third length value, wherein the second length value is set by the first NFC device and is used to limit the second NFC device in the subsequent communication process. The length of the data packet sent (ie, the length of the data packet transmitted from the second NFC device to the direction of the first NFC device), the third length value being set by the second NFC device and used to limit the first NFC device in subsequent The length of the data packet sent during the communication (ie the length of the data packet transmitted from the first NFC device to the second NFC device), that is, the length of the data packet sent by the second NFC device in subsequent communication The second length value cannot be exceeded, and the length of the data packet sent by the first NFC device cannot exceed the third length value.
本发明实施例中,第二NFC设备的NFCC接收到的包含第一长度值的第一请求是由第一NFC设备的NFCC在判断出由该NFCC负责确定后续通信中所传输的数据包的最大长度值或在该NFCC接收到第一NFC设备的DH发送的包含 第一长度值且用于指示第一NFC设备的NFCC调整后续通信过程中所传输的数据包的最大长度值的调整命令之后发出的请求。且该第一请求用于指示将第一NFC设备与第二NFC设备在后续通信过程中所传输的数据包的最大长度值调整为该第一请求中包含的第一长度值,其中,第一长度值小于或等于上述第二长度值且小于或等于上述第三长度值,且该第一请求还可以包含第一DID。In the embodiment of the present invention, the first request that the NFCC of the second NFC device receives the first length value is determined by the NFCC of the first NFC device to determine that the NFCC is responsible for determining the maximum number of data packets transmitted in the subsequent communication. The length value or the inclusion of the DH transmission received by the NFCC at the first NFC device A first length value and a request issued after the adjustment command to instruct the NFCC of the first NFC device to adjust the maximum length value of the data packet transmitted during the subsequent communication. And the first request is used to indicate that the maximum length value of the data packet transmitted by the first NFC device and the second NFC device in the subsequent communication process is adjusted to a first length value included in the first request, where the first The length value is less than or equal to the second length value and less than or equal to the third length value, and the first request may further include the first DID.
S302、判断是否由第二NFC设备的NFCC负责响应上述第一请求。S302. Determine whether the NFCC of the second NFC device is responsible for responding to the first request.
本发明实施例中,当步骤S302的判断结果为是时,第二NFC设备的NFCC可以执行步骤S303;当步骤S302的判断结果为否时,第二NFC设备的NFCC可以执行步骤S304,可选的,第二NFC设备的NFCC也可以不向第一NFC设备返回任何响应,或者,向第一NFC设备返回错误,例如,第二NFC设备的NFCC通过将其中的DID设置成不等于上述第一请求中的DID表示存在错误。In the embodiment of the present invention, when the determination result of step S302 is YES, the NFCC of the second NFC device may perform step S303; when the determination result of step S302 is negative, the NFCC of the second NFC device may perform step S304, optionally The NFCC of the second NFC device may also not return any response to the first NFC device, or return an error to the first NFC device, for example, the NFCC of the second NFC device sets the DID therein to be not equal to the first The DID in the request indicates that there is an error.
本发明实施例中,第二NFC设备的NFCC判断是否由其负责响应上述第一请求即为第二NFC设备的NFCC判断是否由第二NFC设备的NFCC负责确认上述第一请求中包含的第一长度值。In the embodiment of the present invention, the NFCC of the second NFC device determines whether it is responsible for responding to the first request that the NFCC of the second NFC device determines whether the NFCC of the second NFC device is responsible for confirming the first content included in the first request. Length value.
作为一种可选的实施方式,第二NFC设备的NFCC判断是否由第二NFC设备的NFCC负责响应上述第一请求可以包括:As an optional implementation manner, determining, by the NFCC of the second NFC device, whether the NFCC of the second NFC device is responsible for responding to the foregoing first request may include:
判断第二NFC设备的NFCC中的第一参数的值是否为特定值,其中,该特定值用于表示由第二NFC设备的NFCC负责响应上述第一请求,且该第一参数的值可以是第二NFC设备的NFCC的默认值(即可以理解为在NFC芯片出厂时设置到NFCC中的默认值),也可以是由第二NFC设备的DH配置给第二NFC设备的NFCC的值,本发明实施例不做限定。Determining whether the value of the first parameter in the NFCC of the second NFC device is a specific value, wherein the specific value is used to indicate that the NFCC of the second NFC device is responsible for responding to the first request, and the value of the first parameter may be The default value of the NFCC of the second NFC device (ie, can be understood as the default value set in the NFCC when the NFC chip is shipped), or the value of the NFCC configured by the DH of the second NFC device to the second NFC device, The embodiments of the invention are not limited.
需要说明的是,本发明实施例中的第一参数与前面实施例中的第一参数可以不是同一个参数。It should be noted that the first parameter in the embodiment of the present invention may not be the same parameter as the first parameter in the previous embodiment.
S303、向第一NFC设备的NFCC发送针对上述第一请求的第一响应。S303. Send a first response to the first request according to the NFCC of the first NFC device.
本发明实施例中,该第一响应可以包括第二DID。In this embodiment of the present invention, the first response may include a second DID.
本发明实施例中,第二NFC设备的NFCC向第一NFC设备的NFCC发送针对上述第一请求的第一响应可以包括:In the embodiment of the present invention, the sending, by the NFCC of the second NFC device, the first response to the first request to the NFCC of the first NFC device may include:
判断上述第一请求中的第一长度值是否小于或等于上述第二长度值且小于或等于上述第三长度值;Determining whether the first length value in the first request is less than or equal to the second length value and less than or equal to the third length value;
当判断结果为是时,向第一NFC设备的NFCC发送用于指示第二NFC设备 接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值的第一响应,其中,该第一响应中包含的第二DID与上述第一请求中包含的第一DID相同,且该第一响应中包含的第二DID与上述第一请求中包含的第一DID均为第二NFC设备的设备标识;When the determination result is yes, sending to the NFCC of the first NFC device is used to indicate the second NFC device. Receiving a first response that adjusts a maximum length value of the data packet transmitted during the subsequent communication to the first length value, wherein the second DID included in the first response and the first DID included in the first request The same, and the second DID included in the first response and the first DID included in the first request are both device identifiers of the second NFC device;
当判断结果为否时,向第一NFC设备的NFCC发送用于指示第二NFC设备不接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值的第一响应,例如,该第一响应中包含的DID不等于该第一请求中所包含的DID,以表示该第二NFC设备不接受上述第一长度值。When the determination result is no, sending, to the NFCC of the first NFC device, a first response for indicating that the second NFC device does not accept the maximum length value of the data packet transmitted in the subsequent communication process to be adjusted to the first length value, For example, the DID included in the first response is not equal to the DID included in the first request, to indicate that the second NFC device does not accept the first length value.
可选的,在执行完毕步骤S303之后且上述第一响应用于指示第二NFC设备接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值,例如,该第一响应中包含的DID等于该第一请求中所包含的DID(即表示该第二NFC设备接受上述第一长度值)时,第二NFC设备的NFCC还可以执行以下操作:Optionally, after the step S303 is performed and the first response is used to indicate that the second NFC device accepts to adjust the maximum length value of the data packet transmitted in the subsequent communication process to the first length value, for example, the first When the DID included in the response is equal to the DID included in the first request (that is, the second NFC device accepts the first length value), the NFCC of the second NFC device may also perform the following operations:
将上述第一长度值通过第一通知发送至第二NFC设备的DH。The first length value is sent to the DH of the second NFC device by the first notification.
S304、激活第二NFC设备上的第一RF接口,并向第二NFC设备的DH发送包含上述第一长度值的第二通知。S304. Activate a first RF interface on the second NFC device, and send a second notification that includes the first length value to the DH of the second NFC device.
本发明实施例中,第二NFC设备的NFCC将包含上述第一长度值的第二通知发送至第二NFC设备的DH,以告知第二NFC设备的DH第二NFC设备上的第一RF接口已经被激活且使第二NFC设备的DH判断上述第一长度值是否小于或等于上述第二长度值且是否小于或等于上述第三长度值。In the embodiment of the present invention, the NFCC of the second NFC device sends a second notification including the foregoing first length value to the DH of the second NFC device to notify the first RF interface on the DN second NFC device of the second NFC device. Has been activated and causes the DH of the second NFC device to determine whether the first length value is less than or equal to the second length value and is less than or equal to the third length value.
S305、接收第二NFC设备的DH返回的第二响应。S305. Receive a second response returned by the DH of the second NFC device.
本发明实施例中,该第二响应用于指示第二NFC设备的DH是否接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值,且第二响应是由第二NFC设备的DH判断上述第一长度值是否小于或等于上述第二长度值且是否小于或等于上述第三长度值后通过数据报文(Data Message)返回的第二响应,即当上述第一长度值小于或等于上述第二长度值且小于或等于上述第三长度值时,第二响应用于指示第二NFC的DH接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值;当上述第一长度值大于上述第二长度值或上述第一长度值大于上述第三长度值时,该第二响应用于指示第二NFC设备的DH不接受将后续通信过程中所传输的数据包的最大长度值调整 为上述第一长度值。In the embodiment of the present invention, the second response is used to indicate whether the DH of the second NFC device accepts to adjust the maximum length value of the data packet transmitted in the subsequent communication process to the first length value, and the second response is The DH of the second NFC device determines whether the first length value is less than or equal to the second length value and is less than or equal to the third length value, and then returns a second response returned by the data message, that is, when the first When the length value is less than or equal to the second length value and less than or equal to the third length value, the second response is used to indicate that the DH accepting of the second NFC adjusts the maximum length value of the data packet transmitted in the subsequent communication process to the foregoing a first length value; when the first length value is greater than the second length value or the first length value is greater than the third length value, the second response is used to indicate that the DH of the second NFC device does not accept the subsequent communication process Maximum length adjustment of the packets transmitted in Is the first length value described above.
S306、将上述第二响应发送至第一NFC设备的NFCC。S306. Send the second response to the NFCC of the first NFC device.
可选的,上述第一请求可以为Digital规范中定义的PSL_REQ,上述第一响应以及上述第二响应可以为该Digital规范中定义的PSL_RES,上述第一RF接口可以为NCI规范中定义的NFC-DEP射频接口,且上述第一通知以及上述第二通知可以为该NCI规范中定义的RF_INTF_ACTIVATED_NTF,本发明实施例不做限定。Optionally, the first request may be a PSL_REQ defined in the Digital specification, and the first response and the second response may be PSL_RES defined in the Digital specification, and the first RF interface may be an NFC defined in the NCI specification. The DEP radio interface, and the foregoing first notification and the second notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
需要说明的是,可选的,第二NFC设备的NFCC还可以不按照上述步骤S304的方式,即不激活上述第一RF接口,而是通过NCI规范定义的数据包(Data Message/Packet)将上述第一长度值上报给DH。相应的,在上述步骤S305之后,第二NFC设备的NFCC可以向DH发送上述第二通知,以通知第二NFC设备的DH上述第一RF接口已激活。It should be noted that, optionally, the NFCC of the second NFC device may not follow the manner of the foregoing step S304, that is, the first RF interface is not activated, but the data packet defined by the NCI specification (Data Message/Packet) The first length value is reported to DH. Correspondingly, after the step S305, the NFCC of the second NFC device may send the second notification to the DH to notify the DH of the second NFC device that the first RF interface is activated.
此外,上述步骤S302是可选的,即NFCC默认有处理与响应上述第一请求的能力或权限。In addition, the above step S302 is optional, that is, the NFCC has the ability or authority to process and respond to the first request by default.
可选的,在第二NFC设备接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值之后,第二NFC设备的NFCC还可以执行以下操作:Optionally, after the second NFC device accepts to adjust the maximum length value of the data packet transmitted in the subsequent communication process to the foregoing first length value, the NFCC of the second NFC device may further perform the following operations:
接收第一NFC设备的NFCC发送的封装好的数据包(如前面实施例所述,该数据包可以理解为上述DEP_REQ);Receiving the encapsulated data packet sent by the NFCC of the first NFC device (as described in the foregoing embodiment, the data packet can be understood as the above DEP_REQ);
判断该数据包的长度值是否小于或等于上述第一长度值;Determining whether the length value of the data packet is less than or equal to the first length value;
当判断结果为是时,对该数据包进行解封装以获取其中与上层业务相关的数据,并通过上述第一RF接口将该与上层业务相关的数据发送至第二NFC设备的DH。When the determination result is yes, the data packet is decapsulated to obtain data related to the upper layer service, and the data related to the upper layer service is sent to the DH of the second NFC device by using the first RF interface.
本发明实施例中,作为目标方的第二NFC设备的NFCC接收作为发起方的第一NFC设备的NFCC发送的用于调整后续通信过程中所传输的数据包的最大长度值的第一请求,并判断第二NFC设备的NFCC是否负责响应该第一请求,当判断结果为是时,向第一NFC设备的NFCC返回针对该第一请求的响应,当判断结果为否时,激活第二NFC设备上的RF接口并向第二NFC设备的DH发送包含第一长度值的通知,接收第二NFC设备的DH返回的响应并将该响应发送至第一NFC设备的NFCC,其中,当该响应中包含的第一DID与第一请求包含的DID相同时,该响应用于指示第二NFC设备已经将后续通信过程中所传输的 数据包的最大长度值调整为第一长度值。可见,实施本发明实施例能够通过NCI规范实现作为发起方的第一NFC设备通过其NFCC与作为目标方的第二NFC设备调整后续通信过程中的通信数据包的最大长度值的功能。In the embodiment of the present invention, the NFCC of the second NFC device as the target party receives the first request for adjusting the maximum length value of the data packet transmitted in the subsequent communication process, which is sent by the NFCC of the first NFC device as the initiator, And determining whether the NFCC of the second NFC device is responsible for responding to the first request, and when the determination result is yes, returning a response to the first request to the NFCC of the first NFC device, and when the determination result is no, activating the second NFC An RF interface on the device and transmitting a notification including a first length value to the DH of the second NFC device, receiving a response returned by the DH of the second NFC device, and transmitting the response to the NFCC of the first NFC device, wherein the response When the first DID included in the first DID is the same as the DID included in the first request, the response is used to indicate that the second NFC device has transmitted the subsequent communication process. The maximum length value of the packet is adjusted to the first length value. It can be seen that the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party.
请参阅图4,图4是本发明实施例公开的又一种调整近场通信NFC中数据包长度的方法的流程示意图。其中,图4所示的方法应用于作为发起方的第一NFC设备以及作为目标方的第二NFC设备中,其中,第一NFC设备和第二NFC设备均至少由NFCC以及DH构成,且第一NFC设备与第二NFC设备均已经激活了MAC层,即第一NFC设备与第二NFC设备已经通过ATR_REQ与ATR_RES协商好后续通信过程中所传输的数据包的最大长度值,即第二长度值以及第三长度值,其中,第二长度值由第一NFC设备设置且用于限制第二NFC设备在后续通信过程中发送的数据包的长度(即从第二NFC设备到第一NFC设备方向上所传输的数据包的长度),第三长度值由第二NFC设备设置且用于限制第一NFC设备在后续通信过程中发送的数据包的长度(即从第一NFC设备到第二NFC设备方向上所传输的数据包的长度),也就是说,后续通信中,第二NFC设备发送的数据包的长度不能超过第二长度值,第一NFC设备发送的数据包的长度不能超过第三长度值。如图4所示,该调整近场通信NFC中数据包长度的方法可以包括以下步骤:Referring to FIG. 4, FIG. 4 is a schematic flowchart of another method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention. The method shown in FIG. 4 is applied to the first NFC device as the initiator and the second NFC device as the target, wherein the first NFC device and the second NFC device are each composed of at least NFCC and DH, and the first The MAC layer is activated by both the NFC device and the second NFC device, that is, the first NFC device and the second NFC device have negotiated the maximum length value of the data packet transmitted in the subsequent communication process, that is, the second length, through the ATR_REQ and the ATR_RES. And a third length value, wherein the second length value is set by the first NFC device and is used to limit the length of the data packet sent by the second NFC device during the subsequent communication (ie, from the second NFC device to the first NFC device a length of the data packet transmitted in the direction), the third length value being set by the second NFC device and used to limit the length of the data packet sent by the first NFC device during the subsequent communication (ie, from the first NFC device to the second The length of the data packet transmitted in the direction of the NFC device, that is, in the subsequent communication, the length of the data packet sent by the second NFC device cannot exceed the second length value, and the length of the data packet sent by the first NFC device cannot be Exceeded the third length value. As shown in FIG. 4, the method for adjusting the packet length in the near field communication NFC may include the following steps:
S401、第一NFC设备的NFCC判断是否由其负责确定后续通信中所传输的数据包的最大长度值。S401. The NFCC of the first NFC device determines whether it is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication.
本发明实施例中,当步骤S401的判断结果为是时,第一NFC设备的NFCC执行步骤S402;当步骤S401的判断结果为否时,第一NFC设备的NFCC可以结束本次流程。In the embodiment of the present invention, when the determination result in step S401 is YES, the NFCC of the first NFC device performs step S402; when the determination result in step S401 is negative, the NFCC of the first NFC device may end the current process.
S402、第一NFC设备的NFCC向第二NFC设备的NFCC发送包含第一长度值的第一请求。S402. The NFCC of the first NFC device sends a first request including a first length value to the NFCC of the second NFC device.
本发明实施例中,该第一请求用于指示将第一NFC设备与第二NFC设备在后续通信过程中所传输的数据包的最大长度值调整为该第一请求中包含的第一长度值,其中,第一长度值是由第一NFC设备的NFCC确定出的一个长度值,第一长度值小于或等于上述第二长度值且小于或等于上述第三长度值,且该第一请求中还可以包含第一DID。 In the embodiment of the present invention, the first request is used to indicate that a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication process is adjusted to a first length value included in the first request. The first length value is a length value determined by the NFCC of the first NFC device, the first length value is less than or equal to the second length value and less than or equal to the third length value, and the first request is It can also contain the first DID.
S403、第二NFC设备的NFCC接收上述第一请求,并判断是否由第二NFC设备的NFCC负责响应上述第一请求。S403. The NFCC of the second NFC device receives the first request, and determines whether the NFCC of the second NFC device is responsible for responding to the first request.
本发明实施例中,当步骤S403的判断结果为是时,第二NFC设备的NFCC可以执行步骤S404;当步骤S403的判断结果为否时,第二NFC设备的NFCC可以执行步骤S405。In the embodiment of the present invention, when the determination result of step S403 is YES, the NFCC of the second NFC device may perform step S404; when the determination result of step S403 is negative, the NFCC of the second NFC device may perform step S405.
S404、第二NFC设备的NFCC向第一NFC设备的NFCC发送针对上述第一请求的第一响应。S404. The NFCC of the second NFC device sends a first response to the first request to the NFCC of the first NFC device.
本发明实施例中,第二NFC设备的NFCC向第一NFC设备的NFCC发送针对上述第一请求的第一响应可以包括:In the embodiment of the present invention, the sending, by the NFCC of the second NFC device, the first response to the first request to the NFCC of the first NFC device may include:
判断上述第一请求中的第一长度值是否小于或等于上述第二长度值且小于或等于上述第三长度值;Determining whether the first length value in the first request is less than or equal to the second length value and less than or equal to the third length value;
当判断结果为是时,向第一NFC设备的NFCC发送用于指示第二NFC设备接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值的第一响应,其中,该第一响应中包含的第一DID与上述第一请求中包含的第二DID相同,且该第一响应中包含的第一DID与上述第一请求中包含的第二DID均为第二NFC设备的设备标识;When the determination result is yes, sending, to the NFCC of the first NFC device, a first response for instructing the second NFC device to accept the maximum length value of the data packet transmitted in the subsequent communication process to be adjusted to the first length value, where The first DID included in the first response is the same as the second DID included in the first request, and the first DID included in the first response and the second DID included in the first request are both second. Device identification of the NFC device;
当判断结果为否时,向第一NFC设备的NFCC发送用于指示第二NFC设备不接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值的第一响应。When the determination result is no, the first response to the NFCC of the first NFC device is sent to instruct the second NFC device not to accept the maximum length value of the data packet transmitted in the subsequent communication process to be adjusted to the first length value.
可选的,当上述第一请求中的第一长度值大于上述第二长度值或大于上述第三长度值时,第二NFC设备的NFCC还可以不向第一NFC设备的NFCC返回任何响应,也可以向第一NFC设备的NFCC返回应答错误消息,本发明实施例不做限定。Optionally, when the first length value in the first request is greater than the second length value or greater than the third length value, the NFCC of the second NFC device may not return any response to the NFCC of the first NFC device. The response error message may also be returned to the NFCC of the first NFC device, which is not limited in the embodiment of the present invention.
S405、第二NFC设备的NFCC激活第二NFC设备上的第一RF接口。S405. The NFCC of the second NFC device activates the first RF interface on the second NFC device.
S406、第二NFC设备的NFCC向第二NFC设备的DH发送包含上述第一长度值的第一通知。S406. The NFCC of the second NFC device sends a first notification including the foregoing first length value to the DH of the second NFC device.
本发明实施例中,第二NFC设备的NFCC将包含上述第一长度值的第一通知发送至第二NFC设备的DH,以告知第二NFC设备的DH第二NFC设备上的第一RF接口已经被激活且使第二NFC设备的DH判断上述第一长度值是否小于或等于上述第二长度值且是否小于或等于上述第三长度值。 In the embodiment of the present invention, the NFCC of the second NFC device sends a first notification including the foregoing first length value to the DH of the second NFC device to notify the first RF interface of the DN second NFC device of the second NFC device. Has been activated and causes the DH of the second NFC device to determine whether the first length value is less than or equal to the second length value and is less than or equal to the third length value.
S407、第二NFC设备的DH接收上述第一通知,并判断上述第一长度值是否小于或等于上述第二长度值且是否小于或等于上述第三长度值。S407. The DH of the second NFC device receives the first notification, and determines whether the first length value is less than or equal to the second length value and is less than or equal to the third length value.
本发明实施例中,当步骤S407的判断结果为是时,第二NFC设备的DH可以执行步骤S408;当步骤S407的判断结果为否时,第二NFC设备的DH可以向第二NFC设备的NFCC返回应答错误信息。In the embodiment of the present invention, when the determination result of step S407 is YES, the DH of the second NFC device may perform step S408; when the determination result of step S407 is negative, the DH of the second NFC device may be to the second NFC device. The NFCC returns a response error message.
S408、第二NFC设备的DH通过数据报文向第二NFC设备的NFCC发送第二响应。S408. The DH of the second NFC device sends a second response to the NFCC of the second NFC device by using a data packet.
本发明实施例中,该第二响应用于指示第二NFC设备的DH是否接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值。In the embodiment of the present invention, the second response is used to indicate whether the DH of the second NFC device accepts to adjust the maximum length value of the data packet transmitted in the subsequent communication process to the first length value.
S409、第二NFC设备的NFCC将上述第二响应发送至第一NFC设备的NFCC。S409. The NFCC of the second NFC device sends the foregoing second response to the NFCC of the first NFC device.
S410、第一NFC设备的NFCC接收第二NFC设备的NFCC发送的响应。S410. The NFCC of the first NFC device receives a response sent by the NFCC of the second NFC device.
本发明实施例中,第一NFC设备的NFCC接收到的响应为上述第一响应或上述第二响应。In the embodiment of the present invention, the response received by the NFCC of the first NFC device is the first response or the second response.
S411、当第一NFC设备的NFCC接收到的响应中包含的DID与上述第一请求中包含的DID相同时,第一NFC设备的NFCC将上述第一长度值作为后续通信过程中所传输的数据包的最大长度值。S411: When the DID included in the response received by the NFCC of the first NFC device is the same as the DID included in the first request, the NFCC of the first NFC device uses the first length value as the data transmitted in the subsequent communication process. The maximum length of the packet.
可选的,在执行完毕步骤S411之后,第一NFC设备的NFCC还可以执行步骤S412、步骤S413以及步骤S414,其中:Optionally, after the step S411 is performed, the NFCC of the first NFC device may further perform step S412, step S413, and step S414, where:
S412、第一NFC设备的NFCC向第一NFC设备的DH发送包含上述第一长度值的第二通知。S412. The NFCC of the first NFC device sends a second notification including the foregoing first length value to the DH of the first NFC device.
本发明实施例中,该第二通知用于告知第一NFC设备的DH该第一NFC设备中的第二RF接口已经被激活。In the embodiment of the present invention, the second notification is used to notify the DH of the first NFC device that the second RF interface in the first NFC device has been activated.
本发明实施例中,第一NFC设备的NFCC向第一NFC设备的DH发送包含上述第一长度值的上述第二通知的目的是向第一NFC设备的DH上报第一NFC设备与第二NFC设备调整后的后续通信中所传输的数据包的最大长度值为上述第一长度值,以使第一NFC设备的DH获取到该第一长度值后可以在上层业务中进行使用,例如,估算本次通信中完成上层业务相关数据的传输所需要的时间是多少等等,以及通知第一NFC设备的DH上述第二RF接口已被激活,也就是说,第一NFC设备的NFCC已准备好接收第一NFC设备的DH发送的数据消 息。其中,该数据消息可以是NCI规范中定义的Data Message(s),其中,在DH与NFCC之间传输Data Message(s)是通过传输Data Packet(s)实现的,且该数据消息中的负载(payload)携带的可以是上层业务相关的数据。In the embodiment of the present invention, the NFCC of the first NFC device sends the foregoing second notification that includes the first length value to the DH of the first NFC device, and the purpose is to report the first NFC device and the second NFC to the DH of the first NFC device. The maximum length of the data packet transmitted in the subsequent communication after the device is adjusted is the first length value, so that the DH of the first NFC device can obtain the first length value and can be used in the upper layer service, for example, estimating. What is the time required to complete the transmission of the upper layer service related data in this communication, and the DH of the first NFC device is notified that the second RF interface has been activated, that is, the NFCC of the first NFC device is ready. Receiving data sent by the DH of the first NFC device interest. The data message may be a Data Message(s) defined in the NCI specification, where the Data Message(s) is transmitted between the DH and the NFCC by transmitting the Data Packet(s), and the load in the data message is (payload) can carry data related to upper layer services.
S413、通过上述第二RF接口接收第一NFC设备的DH发送的数据消息,并以上述第一长度值作为最大长度值将该数据消息中的负载封装成数据包。S413. Receive, by using the foregoing second RF interface, a data message sent by the DH of the first NFC device, and encapsulate the load in the data message into a data packet by using the first length value as the maximum length value.
本发明实施例中,该数据消息与该数据包是前面实施例中描述的数据包,即该数据包可以理解为DEP_REQ,其长度值小于或等于上述第一长度值;In the embodiment of the present invention, the data packet and the data packet are the data packet described in the foregoing embodiment, that is, the data packet can be understood as DEP_REQ, and the length value thereof is less than or equal to the first length value;
S414、将上述数据包发送至第二NFC设备的NFCC。S414. Send the foregoing data packet to the NFCC of the second NFC device.
可选的,第一NFC设备的NFCC判断是否由其负责确定后续通信中所传输的数据包的最大长度值可以包括:Optionally, whether the NFCC of the first NFC device determines whether it is responsible for determining a maximum length value of the data packet transmitted in the subsequent communication may include:
判断第一NFC设备的NFCC中第一参数的值是否为第一特定值,其中,该第一特定值用于表示后续通信中所传输的数据包的最大长度值由第一NFC设备中的NFCC负责确定,且第一参数的值可以是第一NFC设备中的NFCC的默认值(即可以理解为在NFC芯片出厂时设置到NFCC中的默认值),也可以是由第一NFC设备的DH配置给第一NFC设备的NFCC的值,本发明实施例不做限定。Determining whether the value of the first parameter in the NFCC of the first NFC device is a first specific value, wherein the first specific value is used to indicate that the maximum length value of the data packet transmitted in the subsequent communication is from the NFCC in the first NFC device Responsible for determining, and the value of the first parameter may be the default value of the NFCC in the first NFC device (ie, may be understood as a default value set in the NFCC when the NFC chip is shipped), or may be the DH of the first NFC device. The value of the NFCC configured for the first NFC device is not limited in the embodiment of the present invention.
示例地,对于NFC-DEP协议,假设上述第一参数为PN_NFC_DEP_LENGTH,占1个字节(即八位字节octet),第一特定值为0x00(当然也可以是其他值,这里仅为示例),则当PN_NFC_DEP_LENGTH的值为0x00时表示后续通信中所传输的数据包的最大长度值由第一NFC设备中的NFCC负责确定,即该NFCC可以根据自身能力等条件确定调整该最大长度值。关于该第一参数PN_NFC_DEP_LENGTH的值,可以在NFC芯片出厂时就设置成一个默认值,如果该默认值就是上述第一特定值,则默认由第一NFC设备的NFCC负责确定后续通信中所传输的数据包的最大长度值,否则不能由第一NFC设备的NFCC负责确定该最大长度值,当然,DH可以通过NCI规范中定义的参数配置命令(例如CORE_SET_CONFIG_CMD)向NFCC配置(即修改)该第一参数的值。For example, for the NFC-DEP protocol, it is assumed that the first parameter is PN_NFC_DEP_LENGTH, which is 1 byte (ie, octet octet), and the first specific value is 0x00 (of course, other values may be used, here is only an example) When the value of PN_NFC_DEP_LENGTH is 0x00, it indicates that the maximum length value of the data packet transmitted in the subsequent communication is determined by the NFCC in the first NFC device, that is, the NFCC can determine to adjust the maximum length value according to conditions such as its own capability. The value of the first parameter PN_NFC_DEP_LENGTH may be set to a default value when the NFC chip is shipped from the factory. If the default value is the first specific value, the NFCC of the first NFC device is responsible for determining the transmission in the subsequent communication. The maximum length value of the data packet. Otherwise, the NFCC of the first NFC device cannot determine the maximum length value. Of course, the DH can configure (ie, modify) the first NFCC through a parameter configuration command (eg, CORE_SET_CONFIG_CMD) defined in the NCI specification. The value of the parameter.
可选的,第二NFC设备的NFCC判断是否由第二NFC设备的NFCC负责响应上述第一请求可以包括:Optionally, determining, by the NFCC of the second NFC device, whether the NFCC of the second NFC device is responsible for responding to the foregoing first request may include:
判断第二NFC设备的NFCC中的第二参数的值是否为第二特定值,其中, 该第二特定值用于表示由第二NFC设备的NFCC负责响应上述第一请求,且该第二特定值可以是第二NFC设备的NFCC的默认值,也可以是由第二NFC设备的DH配置给第二NFC设备的NFCC的值,本发明实施例不做限定。Determining whether a value of the second parameter in the NFCC of the second NFC device is a second specific value, where The second specific value is used to indicate that the NFCC of the second NFC device is responsible for responding to the first request, and the second specific value may be a default value of the NFCC of the second NFC device, or may be a DH of the second NFC device. The value of the NFCC configured for the second NFC device is not limited in the embodiment of the present invention.
示例地,对于NFC-DEP协议,假设上述第二参数为LN_NFC_DEP_LENGTH,占1个字节(即八位字节octet),第二特定值为0x00(当然也可以是其他值,这里仅为示例),则当LN_NFC_DEP_LENGTH的值为0x00时表示后续通信中所传输的数据包的最大长度值由第二NFC设备中的NFCC负责确认,即该NFCC可以根据自身能力等条件处理与响应上述第一请求。关于该第二参数LN_NFC_DEP_LENGTH的值,可以在NFC芯片出厂时就设置成一个默认值,如果该默认值就是上述第二特定值,则默认由第二NFC设备的NFCC负责确认后续通信中所传输的数据包的最大长度值,否则不能由第二NFC设备的NFCC负责确定该最大长度值,当然,DH可以通过NCI规范中定义的参数配置命令(例如CORE_SET_CONFIG_CMD)向NFCC配置(即修改)该第二参数的值。For example, for the NFC-DEP protocol, it is assumed that the second parameter is LN_NFC_DEP_LENGTH, which is 1 byte (ie, octet octet), and the second specific value is 0x00 (of course, it can be other values, here is only an example) When the value of LN_NFC_DEP_LENGTH is 0x00, it indicates that the maximum length value of the data packet transmitted in the subsequent communication is confirmed by the NFCC in the second NFC device, that is, the NFCC can process and respond to the first request according to conditions such as its own capability. The value of the second parameter LN_NFC_DEP_LENGTH may be set to a default value when the NFC chip is shipped from the factory. If the default value is the second specific value, the NFCC of the second NFC device is responsible for confirming the transmission in the subsequent communication. The maximum length value of the data packet. Otherwise, the NFCC of the second NFC device cannot determine the maximum length value. Of course, the DH can configure (ie, modify) the second NFCC through a parameter configuration command (eg, CORE_SET_CONFIG_CMD) defined in the NCI specification. The value of the parameter.
可选的,当第二NFC设备的NFCC执行完毕步骤S404之后且当上述第一响应用于指示第二NFC设备接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值时,第二NFC设备的NFCC还可以执行以下操作:Optionally, after the NFCC of the second NFC device performs step S404 and when the first response is used to indicate that the second NFC device accepts to adjust the maximum length value of the data packet transmitted during the subsequent communication to the first length. The value of the NFCC of the second NFC device can also perform the following operations:
将上述第一长度值通过第三通知发送至第二NFC设备的DH。The first length value is sent to the DH of the second NFC device by the third notification.
可选的,上述第一请求可以为Digital规范中定义的PSL_REQ,上述第一响应以及上述第二响应可以为该Digital规范中定义的PSL_RES,上述第一RF接口以及上述第二RF接口可以为NCI规范中定义的NFC-DEP射频接口,且上述第一通知、上述第二通知以及上述第三通知可以为该NCI规范中定义的RF_INTF_ACTIVATED_NTF,本发明实施例不做限定。Optionally, the first request may be a PSL_REQ defined in the Digital specification, and the first response and the second response may be PSL_RES defined in the Digital specification, and the first RF interface and the second RF interface may be NCI. The NFC-DEP radio interface is defined in the specification, and the first notification, the second notification, and the third notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
可选的,上述第一请求可以为Digital规范中定义的RATS Command或ATTRIB Command,上述第一响应以及上述第二响应可以为该Digital规范中定义的RATS Response或ATTRIB Response,上述第一RF接口以及上述第二RF接口可以为NCI规范中定义的ISO-DEP射频接口或NDEF射频接口,且上述第一通知、上述第二通知以及上述第三通知可以为该NCI规范中定义的RF_INTF_ACTIVATED_NTF,本发明实施例不做限定。Optionally, the foregoing first request may be a RATS Command or an ATTRIB Command defined in the Digital specification, and the foregoing first response and the second response may be a RATS Response or an ATTRIB Response defined in the Digital specification, and the foregoing first RF interface and The foregoing second RF interface may be an ISO-DEP radio interface or an NDEF radio interface defined in the NCI specification, and the first notification, the second notification, and the third notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, and the implementation of the present invention The example is not limited.
可见,实施本发明实施例能够通过NCI规范实现NFCC与作为目标方的 NFC设备调整后续通信过程中的通信数据包的最大长度值的功能。It can be seen that the implementation of the embodiments of the present invention can implement the NFCC and the target party through the NCI specification. The NFC device adjusts the maximum length value of the communication packet during subsequent communication.
请参阅图5,图5是本发明实施例公开的又一种调整近场通信NFC中数据包长度的方法的流程示意图。其中,图5所示的方法应用于作为发起方的第一NFC设备以及作为目标方的第二NFC设备中,其中,第一NFC设备和第二NFC设备均至少由NFCC以及DH构成,且第一NFC设备与第二NFC设备均已经激活了MAC层,即第一NFC设备与第二NFC设备已经通过ATR_REQ与ATR_RES协商好后续通信过程中所传输的数据包的最大长度值,即第二长度值以及第三长度值,其中,第二长度值由第一NFC设备设置且用于限制第二NFC设备在后续通信过程中发送的数据包的长度(即从第二NFC设备到第一NFC设备方向上所传输的数据包的长度),第三长度值由第二NFC设备设置且用于限制第一NFC设备在后续通信过程中发送的数据包的长度(即从第一NFC设备到第二NFC设备方向上所传输的数据包的长度),也就是说,后续通信中,第二NFC设备发送的数据包的长度不能超过第二长度值,第一NFC设备发送的数据包的长度不能超过第三长度值。如图5所示,该调整近场通信NFC中数据包长度的方法可以包括以下步骤:Referring to FIG. 5, FIG. 5 is a schematic flowchart diagram of another method for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention. The method shown in FIG. 5 is applied to the first NFC device as the initiator and the second NFC device as the target, wherein the first NFC device and the second NFC device are each composed of at least NFCC and DH, and the first The MAC layer is activated by both the NFC device and the second NFC device, that is, the first NFC device and the second NFC device have negotiated the maximum length value of the data packet transmitted in the subsequent communication process, that is, the second length, through the ATR_REQ and the ATR_RES. And a third length value, wherein the second length value is set by the first NFC device and is used to limit the length of the data packet sent by the second NFC device during the subsequent communication (ie, from the second NFC device to the first NFC device a length of the data packet transmitted in the direction), the third length value being set by the second NFC device and used to limit the length of the data packet sent by the first NFC device during the subsequent communication (ie, from the first NFC device to the second The length of the data packet transmitted in the direction of the NFC device, that is, in the subsequent communication, the length of the data packet sent by the second NFC device cannot exceed the second length value, and the length of the data packet sent by the first NFC device cannot be Exceeded the third length value. As shown in FIG. 5, the method for adjusting the packet length in the near field communication NFC may include the following steps:
S501、第一NFC设备的DH向第一NFC设备的NFCC发送包含第一长度值的调整命令。S501. The DH of the first NFC device sends an adjustment command including a first length value to the NFCC of the first NFC device.
本发明实施例中,该调整命令用于指示第一NFC设备的NFCC调整后续通信过程中所传输的数据包的最大长度值。In the embodiment of the present invention, the adjustment command is used to indicate that the NFCC of the first NFC device adjusts the maximum length value of the data packet transmitted in the subsequent communication process.
需要说明的是,该调整命令(例如RF_LR_ADJUST_CMD或RF_LR_SWITCH_CMD)可以在NCI规范定义的RFST_DISCOVERY状态、RFST_W4_ALL_DISCOVERIES状态、RFST_W4_HOST_SELECT状态或者RFST_POLL_ACTIVE状态下使用,其格式包括但不限于如下表格1与2所示的格式。 It should be noted that the adjustment command (eg, RF_LR_ADJUST_CMD or RF_LR_SWITCH_CMD) may be used in the RFST_DISCOVERY state, the RFST_W4_ALL_DISCOVERIES state, the RFST_W4_HOST_SELECT state, or the RFST_POLL_ACTIVE state defined by the NCI specification, and the format includes but is not limited to the formats shown in Tables 1 and 2 below.
表格1:调整命令RF_LR_ADJUST_CMDTable 1: Adjustment command RF_LR_ADJUST_CMD
Figure PCTCN2015079847-appb-000001
Figure PCTCN2015079847-appb-000001
表格2:参数的标识、长度与值Table 2: Identification, length and value of parameters
标识IDIdentification ID 长度lenLength len 值valValue val
0x000x00 1Octet1Octet 第一长度值First length value
0x01-0x7F0x01-0x7F   预留Reserved
0x80-0xFF0x80-0xFF   专用dedicated
本实施例中,上述调整命令中的第一长度值可以是第一NFC设备的DH确定的小于或等于上述第二长度值以及第三长度值的一个值,此时,第一NFC设备的NFCC可能需要在步骤S501之前向第一NFC设备的DH上报包括上述第一长度值的射频接口激活通知,当然,该第一长度值是否不超过上述第二长度值以及第三长度值可以不经过第一NFC设备的DH判断,此时,第一NFC设备的NFCC可能需要在接收到上述调整命令后自己进行上述长度值的判断。In this embodiment, the first length value in the adjustment command may be a value determined by the DH of the first NFC device that is less than or equal to the second length value and the third length value. At this time, the NFCC of the first NFC device The radio interface activation notification including the first length value may be reported to the DH of the first NFC device before the step S501. Of course, whether the first length value does not exceed the second length value and the third length value may not pass the first The DH of an NFC device determines that the NFCC of the first NFC device may need to determine the length value itself after receiving the adjustment command.
S502、第一NFC设备的NFCC接收上述调整命令。S502. The NFCC of the first NFC device receives the foregoing adjustment command.
S503、第一NFC设备的NFCC向第二NFC设备的NFCC发送包含第一长度值的第一请求。S503. The NFCC of the first NFC device sends a first request including a first length value to the NFCC of the second NFC device.
本发明实施例中,该第一请求用于将第一NFC设备与第二NFC设备在后续通信过程中所传输的数据包的最大长度值调整为该第一请求中包含的第一长度值,其中,第一长度值小于或等于上述第二长度值且小于或等于上述第三长度值,且该第一请求还可以包含第一DID。In the embodiment of the present invention, the first request is used to adjust a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication process to a first length value included in the first request, The first length value is less than or equal to the second length value and less than or equal to the third length value, and the first request may further include the first DID.
S504、第二NFC设备的NFCC接收上述第一请求,并判断是否由第二NFC设备的NFCC负责响应上述第一请求。S504. The NFCC of the second NFC device receives the first request, and determines whether the NFCC of the second NFC device is responsible for responding to the first request.
本发明实施例中,当步骤S504的判断结果为是时,第二NFC设备的NFCC 可以执行步骤S505;当步骤S504的判断结果为否时,第二NFC设备的NFCC可以执行步骤S506。In the embodiment of the present invention, when the determination result of step S504 is YES, the NFCC of the second NFC device Step S505 may be performed; when the determined result of step S504 is NO, the NFCC of the second NFC device may perform step S506.
S505、第二NFC设备的NFCC向第一NFC设备的NFCC发送针对上述第一请求的第一响应。S505. The NFCC of the second NFC device sends a first response to the first request to the NFCC of the first NFC device.
本发明实施例中,该第一响应可以包括第二DID,且第二NFC设备的NFCC向第一NFC设备的NFCC发送针对上述第一请求的第一响应可以包括:In this embodiment, the first response may include the second DID, and the sending, by the NFCC of the second NFC device, the first response to the first request to the NFCC of the first NFC device may include:
判断上述第一请求中的第一长度值是否小于或等于上述第二长度值且小于或等于上述第三长度值;Determining whether the first length value in the first request is less than or equal to the second length value and less than or equal to the third length value;
当判断结果为是时,向第一NFC设备的NFCC发送用于指示第二NFC设备接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值的第一响应,其中,该第一响应中包含的DID与上述第一请求中包含的DID相同,且该第一响应中包含的DID与上述第一请求中包含的DID均为第二NFC设备的设备标识;When the determination result is yes, sending, to the NFCC of the first NFC device, a first response for instructing the second NFC device to accept the maximum length value of the data packet transmitted in the subsequent communication process to be adjusted to the first length value, where The DID included in the first response is the same as the DID included in the first request, and the DID included in the first response and the DID included in the first request are both device identifiers of the second NFC device;
当判断结果为否时,向第一NFC设备的NFCC发送用于指示第二NFC设备不接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值的第一响应。When the determination result is no, the first response to the NFCC of the first NFC device is sent to instruct the second NFC device not to accept the maximum length value of the data packet transmitted in the subsequent communication process to be adjusted to the first length value.
可选的,当上述第一请求中的第一长度值大于上述第二长度值或大于上述第三长度值时,第二NFC设备的NFCC还可以不向第一NFC设备的NFCC返回任何响应,也可以向第一NFC设备的NFCC返回应答错误消息,本发明实施例不做限定。Optionally, when the first length value in the first request is greater than the second length value or greater than the third length value, the NFCC of the second NFC device may not return any response to the NFCC of the first NFC device. The response error message may also be returned to the NFCC of the first NFC device, which is not limited in the embodiment of the present invention.
S506、第二NFC设备的NFCC激活第二NFC设备上的第一RF接口。S506. The NFCC of the second NFC device activates the first RF interface on the second NFC device.
S507、第二NFC设备的NFCC向第二NFC设备的DH发送包含上述第一长度值的第一通知。S507. The NFCC of the second NFC device sends a first notification including the foregoing first length value to the DH of the second NFC device.
本发明实施例中,第二NFC设备的NFCC将包含上述第一长度值的第一通知发送至第二NFC设备的DH,以告知第二NFC设备的DH第二NFC设备上的第一RF接口已经被激活且使第二NFC设备的DH判断上述第一长度值是否小于或等于上述第二长度值且是否小于或等于上述第三长度值。In the embodiment of the present invention, the NFCC of the second NFC device sends a first notification including the foregoing first length value to the DH of the second NFC device to notify the first RF interface of the DN second NFC device of the second NFC device. Has been activated and causes the DH of the second NFC device to determine whether the first length value is less than or equal to the second length value and is less than or equal to the third length value.
S508、第二NFC设备的DH接收上述第一通知,并判断上述第一长度值是否小于或等于上述第二长度值且是否小于或等于上述第三长度值。S508. The DH of the second NFC device receives the first notification, and determines whether the first length value is less than or equal to the second length value and is less than or equal to the third length value.
本发明实施例中,当步骤S508的判断结果为是时,第二NFC设备的DH可 以执行步骤S509;当步骤S508的判断结果为否时,第二NFC设备的DH可以向第二NFC设备的NFCC返回应答错误信息。In the embodiment of the present invention, when the determination result of step S508 is YES, the DH of the second NFC device may be To perform step S509; when the result of the determination in step S508 is NO, the DH of the second NFC device may return a response error message to the NFCC of the second NFC device.
S509、第二NFC设备的DH通过数据报文向第二NFC设备的NFCC发送第二响应。S509. The DH of the second NFC device sends a second response to the NFCC of the second NFC device by using a data packet.
本发明实施例中,该第二响应用于指示第二NFC设备的DH是否接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值。In the embodiment of the present invention, the second response is used to indicate whether the DH of the second NFC device accepts to adjust the maximum length value of the data packet transmitted in the subsequent communication process to the first length value.
S510、第二NFC设备的NFCC将上述第二响应发送至第一NFC设备的NFCC。S510. The NFCC of the second NFC device sends the foregoing second response to the NFCC of the first NFC device.
S511、第一NFC设备的NFCC接收第二NFC设备的NFCC发送的响应。S511. The NFCC of the first NFC device receives a response sent by the NFCC of the second NFC device.
本发明实施例中,第一NFC设备的NFCC接收到的响应为上述第一响应或上述第二响应。In the embodiment of the present invention, the response received by the NFCC of the first NFC device is the first response or the second response.
S512、当第一NFC设备的NFCC接收到的响应中包含的DID与上述第一请求中包含的DID相同时,第一NFC设备的NFCC将上述第一长度值作为后续通信过程中所传输的数据包的最大长度值。S512. When the DID included in the response received by the NFCC of the first NFC device is the same as the DID included in the first request, the NFCC of the first NFC device uses the first length value as the data transmitted in the subsequent communication process. The maximum length of the packet.
S513、第一NFC设备的NFCC向第一NFC设备的DH返回包含状态指示和/或上述第一长度值的调整响应。S513. The NFCC of the first NFC device returns an adjustment response including a status indication and/or the first length value to the DH of the first NFC device.
本发明实施例中,上述状态指示用于表示第一NFC设备的NFCC已将上述最大值调整为上述第一长度值,也就是说第一NFC设备与第二NFC设备之间已经完成本次调整。In the embodiment of the present invention, the status indication is used to indicate that the NFCC of the first NFC device has adjusted the maximum value to the first length value, that is, the adjustment has been completed between the first NFC device and the second NFC device. .
作为一种可选的实施方式,在第一NFC设备的DH执行步骤S501之前,第一NFC设备的NFCC还可以执行以下操作:As an optional implementation manner, before the DH of the first NFC device performs step S501, the NFCC of the first NFC device may further perform the following operations:
激活第一NFC设备上的第二RF接口,并向第一NFC设备的DH发送第二通知,其中,该第二通知用于告知第一NFC设备的DH该第一NFC设备中的第二RF接口已被激活。Activating a second RF interface on the first NFC device and transmitting a second notification to the DH of the first NFC device, wherein the second notification is used to notify the DH of the first NFC device of the second RF in the first NFC device The interface has been activated.
作为另一种可选的实施方式,在执行完毕步骤S502之后,在执行步骤S503之前,第一NFC设备的NFCC还可以执行以下操作:As another optional implementation manner, after performing step S502, before performing step S503, the NFCC of the first NFC device may further perform the following operations:
确定上述第一长度值小于或等于上述第二长度值且小于或等于上述第三长度值。Determining that the first length value is less than or equal to the second length value and less than or equal to the third length value.
作为一种可选的实施方式,当第二NFC设备的NFCC执行完毕步骤S505之后且当上述第一响应用于指示第二NFC设备接受将后续通信过程中所传输的 数据包的最大长度值调整为上述第一长度值时,第二NFC设备的NFCC还可以执行以下操作:As an optional implementation manner, after the NFCC of the second NFC device performs step S505 and when the first response is used to indicate that the second NFC device accepts the transmission that will be transmitted during the subsequent communication When the maximum length value of the data packet is adjusted to the above first length value, the NFCC of the second NFC device can also perform the following operations:
将上述第一长度值通过第三通知发送至第二NFC设备的DH。The first length value is sent to the DH of the second NFC device by the third notification.
作为一种可选的实施方式,在第一NFC设备的NFCC先激活上述第一RF接口并向第一NFC设备的DH发送上述第一通知,然后再由第一NFC设备的DH执行步骤S501的情况下,在向第一NFC设备的DH发送包含状态指示和/或上述第一长度值的调整响应之后,第一NFC设备的NFCC还可以执行以下操作:As an optional implementation manner, the NFCC of the first NFC device first activates the foregoing first RF interface, and sends the first notification to the DH of the first NFC device, and then performs the step S501 by the DH of the first NFC device. In the case, after transmitting the adjustment response including the status indication and/or the first length value to the DH of the first NFC device, the NFCC of the first NFC device may also perform the following operations:
通过上述第二RF接口接收第一NFC设备的DH发送的第一数据消息,并以上述第一长度值作为最大长度值将该第一数据消息中的负载封装成第一数据包,即该第一数据包的长度值小于或等于上述第一长度值;Receiving, by the foregoing second RF interface, the first data message sent by the DH of the first NFC device, and packaging the load in the first data message into the first data packet by using the first length value as the maximum length value, that is, the first data packet The length value of a data packet is less than or equal to the first length value;
将该第一数据包发送至第二NFC设备的NFCC。The first data packet is sent to the NFCC of the second NFC device.
作为一种可选的实施方式,在步骤S502之后且在步骤S503之前执行确定上述第一长度值小于或等于上述第二长度值且小于或等于上述第三长度值的操作的情况下,在向第一NFC设备的DH发送包含状态指示和/或上述第一长度值的调整响应之后,第一NFC设备的NFCC还可以执行以下操作:As an optional implementation manner, after the step S502 and before the step S503, the operation of determining that the first length value is less than or equal to the second length value and less than or equal to the third length value is performed. After the DH of the first NFC device sends an adjustment response including the status indication and/or the first length value, the NFCC of the first NFC device may also perform the following operations:
向第一NFC设备的DH发送第四通知,该第四通知用于告知第一NFC设备的DH第三RF接口已被激活;Sending a fourth notification to the DH of the first NFC device, the fourth notification is used to notify that the DH third RF interface of the first NFC device has been activated;
通过该第三RF接口接收第一NFC设备的DH发送的第二数据消息,并以上述第一长度值作为最大长度值将该第二数据消息中的负载封装成第二数据包;Receiving, by the third RF interface, the second data message sent by the DH of the first NFC device, and packaging the load in the second data message into the second data packet by using the first length value as the maximum length value;
将该第二数据包发送至第二NFC设备的NFCC。The second data packet is sent to the NFCC of the second NFC device.
本发明实施例中,上述第四通知中可以包含上述第一长度值,也可以不包含;上述第一数据消息与第二数据消息、第一数据包与第二数据包与前面实施例中所述的数据消息、数据包分别相同,这里不再赘述。可选的,上述第一请求可以为Digital规范中定义的PSL_REQ,上述第一响应以及上述第二响应可以为该Digital规范中定义的PSL_RES,上述第一RF接口、上述第二RF接口以及上述第三RF接口可以为NCI规范中定义的NFC-DEP射频接口,且上述第一通知、上述第二通知、上述第三通知以及上述第四通知可以为该NCI规范中定义的RF_INTF_ACTIVATED_NTF,本发明实施例不做限定。In the embodiment of the present invention, the foregoing fourth notification may include the first length value, or may not include; the first data message and the second data message, the first data packet, and the second data packet are compared with the foregoing embodiment. The data messages and data packets described above are the same, and are not described here. Optionally, the first request may be a PSL_REQ defined in the Digital specification, and the first response and the second response may be a PSL_RES defined in the Digital specification, the first RF interface, the second RF interface, and the foregoing The third RF interface may be an NFC-DEP radio interface defined in the NCI specification, and the first notification, the second notification, the third notification, and the fourth notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, and the embodiment of the present invention Not limited.
可选的,上述第一请求可以为Digital规范中定义的RATS Command或ATTRIB Command,上述第一响应以及上述第二响应可以为该Digital规范中定 义的RATS Response或ATTRIB Response,上述第一RF接口、上述第二RF接口以及上述第三RF接口可以为NCI规范中定义的ISO-DEP射频接口或NDEF射频接口,且上述第一通知、上述第二通知、上述第三通知以及上述第四通知可以为该NCI规范中定义的RF_INTF_ACTIVATED_NTF,本发明实施例不做限定。Optionally, the first request may be a RATS Command or an ATTRIB Command defined in the Digital specification, and the first response and the second response may be determined by the Digital specification. The first RF interface, the second RF interface, and the third RF interface may be an ISO-DEP radio interface or an NDEF radio interface defined in the NCI specification, and the foregoing first notification, the foregoing The second notification, the third notification, and the fourth notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
可见,实施本发明实施例能够通过NCI规范实现作为发起方的第一NFC设备通过其NFCC与作为目标方的第二NFC设备调整后续通信过程中的通信数据包的最大长度值的功能。It can be seen that the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party.
请参阅图6,图6是本发明实施例公开的一种NFCC的结构示意图。其中,该NFCC为第一NFC设备中的NFCC。如图6所示,该NFCC可以包括判断模块601、通信模块602以及确定模块603,其中:Please refer to FIG. 6. FIG. 6 is a schematic structural diagram of an NFCC according to an embodiment of the present invention. Wherein, the NFCC is an NFCC in the first NFC device. As shown in FIG. 6, the NFCC may include a determining module 601, a communication module 602, and a determining module 603, where:
在一个实施例中,判断模块601,用于判断是否由该NFCC负责确定后续通信中所传输的数据包的最大长度值,其中,该最大长度值限制了从第一NFC设备到第二NFC设备方向上以及从第二NFC设备到第一NFC设备方向上分别传输的数据包的长度。In an embodiment, the determining module 601 is configured to determine whether the NFCC is responsible for determining a maximum length value of the data packet transmitted in the subsequent communication, wherein the maximum length value limits the first NFC device to the second NFC device. The length of the data packet transmitted in the direction and respectively from the second NFC device to the first NFC device.
本发明实施例中,在判断模块601执行相应的操作之前,第一NFC设备与第二NFC设备均已经激活了MAC层,即第一NFC设备与第二NFC设备通过ATR_REQ与ATR_RES已经协商好后续通信过程中所传输的数据包的最大长度值,即第二长度值以及第三长度值,其中,第二长度值由第一NFC设备设置且用于限制第二NFC设备在后续通信过程中发送的数据包的长度(即从第二NFC设备到第一NFC设备方向上所传输的数据包的长度),第三长度值由第二NFC设备设置且用于限制第一NFC设备在后续通信过程中发送的数据包的长度(即从第一NFC设备到第二NFC设备方向上所传输的数据包的长度),也就是说,后续通信中,第二NFC设备发送的数据包的长度不能超过第二长度值,第一NFC设备发送的数据包的长度不能超过第三长度值。In the embodiment of the present invention, before the determining module 601 performs the corresponding operation, the first NFC device and the second NFC device have activated the MAC layer, that is, the first NFC device and the second NFC device have negotiated the ATR_REQ and the ATR_RES. The maximum length value of the data packet transmitted during the communication, that is, the second length value and the third length value, wherein the second length value is set by the first NFC device and is used to restrict the second NFC device from transmitting during the subsequent communication The length of the data packet (ie, the length of the data packet transmitted from the second NFC device to the direction of the first NFC device), the third length value being set by the second NFC device and used to limit the first NFC device in the subsequent communication process The length of the data packet sent in the middle (ie, the length of the data packet transmitted from the first NFC device to the second NFC device), that is, the length of the data packet sent by the second NFC device cannot exceed the length of the subsequent communication. The second length value, the length of the data packet sent by the first NFC device cannot exceed the third length value.
通信模块602,用于当判断模块601的判断结果为是时,向第二NFC设备发送包含第一长度值的第一请求,并接收第二NFC设备针对该第一请求返回的第一响应,其中,该第一请求用于指示将第一NFC设备与第二NFC设备在后续通信中所传输的数据包的最大长度值调整为第一长度值,且第一长度值是该NFCC确定的一个值,该第一请求还可以包含第一DID且该第一响应可以包含 第二DID。The communication module 602 is configured to: when the determination result of the determining module 601 is yes, send a first request including a first length value to the second NFC device, and receive a first response returned by the second NFC device for the first request, The first request is used to indicate that the maximum length value of the data packet transmitted by the first NFC device and the second NFC device in the subsequent communication is adjusted to a first length value, and the first length value is one determined by the NFCC. a value, the first request may further include a first DID and the first response may include The second DID.
本发明实施例中,该第一请求可以是NFC论坛定义的Digital规范中定义的参数选择请求PSL_REQ,其中第5个字节(Byte 5)表示FSL参数,该字节的值定义了命令与响应的最大长度值,进一步地,该字节中的第一和第二比特位(即Digital规范中定义的b1和b2)对应的值表示该最大长度值,例如,当这里两个比特位的值为00b时,该最大长度值为64字节;当这里两个比特位的值为01b时,该最大长度值为128字节;当这里两个比特位的值为10b时,该最大长度值为192字节;当这里两个比特位的值为11b时,该最大长度值为254字节。因此,通过PSL_REQ和PSL_RES调整该最大长度值,可以理解为从一个长度值切换(switch)到另一个长度值,也可以理解为该最大长度值的重新协商或修改等,本发明实施例不对“调整”一词的含义进行限制。In the embodiment of the present invention, the first request may be a parameter selection request PSL_REQ defined in the Digital specification defined by the NFC Forum, wherein the fifth byte (Byte 5) represents an FSL parameter, and the value of the byte defines the command and response. The maximum length value, further, the values corresponding to the first and second bits in the byte (ie, b1 and b2 defined in the Digital specification) represent the maximum length value, for example, when the values of the two bits are here When it is 00b, the maximum length value is 64 bytes; when the value of the two bits is 01b, the maximum length value is 128 bytes; when the value of the two bits is 10b, the maximum length value is It is 192 bytes; when the value of two bits here is 11b, the maximum length value is 254 bytes. Therefore, adjusting the maximum length value by PSL_REQ and PSL_RES can be understood as switching from one length value to another length value, and can also be understood as renegotiation or modification of the maximum length value, etc., which is not correct in the embodiment of the present invention. Limit the meaning of the word "adjustment".
其中,上述命令与响应可以是通过NFC-DEP协议进行通信时所使用的命令与响应,例如DEP_REQ和DEP_RES等;上述命令与响应可以作为负载(payload,即上层应用相关的业务数据)封装在数据包(Data)中,然后由NFC设备以NFC-A技术(即NFC论坛中定义的类型A射频技术,对应ISO/IEC14443的类型A的缩写)标准帧格式或NFC-F技术(即NFC论坛中定义的类型F射频技术,对应ISO/IEC 18092的212kbps和424kbps通信机制的缩写)帧格式发送出去,因此,上述最大长度值可以理解为数据包长度的最大值,也可以理解为上述命令与响应的负载(payload)字节数的最大值。The command and response may be commands and responses used for communication through the NFC-DEP protocol, such as DEP_REQ and DEP_RES. The commands and responses may be encapsulated in data as payloads (upper layer application related business data). In the Data, then the NFC-A technology (ie the type A RF technology defined in the NFC Forum, corresponding to the abbreviation of Type A of ISO/IEC 14443) standard frame format or NFC-F technology (ie NFC Forum) The defined type F radio frequency technology, corresponding to the abbreviation of the 212 kbps and 424 kbps communication mechanism of ISO/IEC 18092) is transmitted in the frame format. Therefore, the above maximum length value can be understood as the maximum value of the packet length, and can also be understood as the above command and response. The maximum number of payloads.
本发明实施例中,通信模块602向第二NFC设备发送包含第一长度值的第一请求,以使第二NFC设备在不接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值时不返回任何响应,或者以使第二NFC设备返回用于表示不接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值的响应,例如,该响应中包含的DID不等于该第一请求中所包含的DID,以表示该第二NFC设备不接受上述第一长度值,或者以使第二NFC设备返回用于表示接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值的响应,例如,该响应中包含的设备标识DID等于该第一请求中所包含的DID,以表示该第二NFC设备接受上述第一长度值。In the embodiment of the present invention, the communication module 602 sends a first request including the first length value to the second NFC device, so that the second NFC device does not accept the maximum length value of the data packet transmitted during the subsequent communication process to The first length value does not return any response, or the second NFC device returns a response indicating that the maximum length value of the data packet transmitted during the subsequent communication is not accepted to be adjusted to the first length value, for example, The DID included in the response is not equal to the DID included in the first request, to indicate that the second NFC device does not accept the first length value, or to cause the second NFC device to return to indicate acceptance in the subsequent communication process. The maximum length value of the transmitted data packet is adjusted to the response of the first length value, for example, the device identifier DID included in the response is equal to the DID included in the first request, to indicate that the second NFC device accepts the foregoing A length value.
确定模块603,用于当上述第一DID与上述第二DID相同时,将上述第一长度值作为后续通信中所传输的数据包的最大长度值。 The determining module 603 is configured to use the first length value as the maximum length value of the data packet transmitted in the subsequent communication when the first DID is the same as the second DID.
本发明实施例中,当第一响应中包含的第二DID与上述第一请求中包含的第一DID相同时,该第一响应用于表示第二NFC设备已经将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值,其中,第一DID与第二DID均为上述第二NFC设备的设备标识,示例地,对于NFC-DEP协议而言,上述第二DID是作为发起方的第一NFC设备在通过ATR_REQ激活MAC层时为作为目标方的第二NFC设备分配的、用来标识第二NFC设备的一个标识;又示例地,对于ISO-DEP协议而言,上述第二DID是作为读写器(Reader/Writer)的第一NFC设备在通过RATS Command或ATTRIB Command激活作为NFC标签或者卡模拟的第二NFC设备时为该第二NFC设备分配的、用来标识该第二NFC设备的一个标识。In the embodiment of the present invention, when the second DID included in the first response is the same as the first DID included in the first request, the first response is used to indicate that the second NFC device has transmitted the subsequent communication process. The maximum length value of the data packet is adjusted to the first length value, wherein the first DID and the second DID are both device identifiers of the second NFC device, and for example, for the NFC-DEP protocol, the second DID is The first NFC device as the initiator, which is assigned to the second NFC device as the target when the MAC layer is activated by the ATR_REQ, is used to identify one identifier of the second NFC device; and for example, for the ISO-DEP protocol, The second DID is allocated to the second NFC device as a first NFC device as a reader/writer (Reader/Writer) when the second NFC device is activated as an NFC tag or a card emulation by the RATS Command or the ATTRIB Command. An identifier identifying the second NFC device.
作为一种可选的实施方式,判断模块601判断是否由该NFCC负责确定后续通信中所传输的数据包的最大长度值的具体方式可以为:As an optional implementation manner, the determining module 601 determines whether the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication, and the specific manner may be:
判断第一参数的值是否为第一特定值,其中,该第一特定值用于表示后续通信中所传输的数据包的最大长度值由第一NFC设备中的NFCC负责确定,且第一参数的值可以是第一NFC设备中的NFCC的默认值(即NFC芯片出厂时设置到NFCC中的默认值),也可以是由第一NFC设备的DH配置给第一NFC设备的NFCC的值,本发明实施例不做限定。Determining whether the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that the maximum length value of the data packet transmitted in the subsequent communication is determined by the NFCC in the first NFC device, and the first parameter The value of the NFCC in the first NFC device may be the default value of the NFCC in the first NFC device (ie, the default value set in the NFCC when the NFC chip is shipped from the factory), or may be the value of the NFCC configured by the DH of the first NFC device to the first NFC device. The embodiments of the present invention are not limited.
作为一种可选的实施方式,通信模块602,还可以用于向第一NFC设备的DH发送包含上述第一长度值的第一通知,其中,该第一通知用于告知第一NFC设备的DH第一RF接口已经被激活,且还用于通过该第一RF接口接收第一NFC设备的DH发送的数据消息。As an optional implementation manner, the communication module 602 is further configured to send, to the DH of the first NFC device, a first notification that includes the foregoing first length value, where the first notification is used to notify the first NFC device The DH first RF interface has been activated and is also used to receive a data message sent by the DH of the first NFC device through the first RF interface.
在该可选的实施方式中,通信模块602向第一NFC设备的DH发送包含上述第一长度值的上述第一通知的目的是向第一NFC设备的DH上报第一NFC设备与第二NFC设备调整后的后续通信中所传输的数据包的最大长度值为上述第一长度值,以使第一NFC设备的DH获取到该第一长度值后可以在上层业务中进行使用,例如,估算本次通信中完成上层业务相关数据的传输所需要的时间是多少等等,以及通知第一NFC设备的DH上述第一RF接口已被激活,也就是说,通信模块602已准备好接收第一NFC设备的DH发送的数据消息。其中,该数据消息可以是NCI规范中定义的Data Message(s),其中,在DH与NFCC之间传输Data Message(s)是通过传输Data Packet(s)实现的,且该数据消息中的负载 (payload)携带的可以是上层业务相关的数据。In the optional implementation, the communication module 602 sends the foregoing first notification that includes the first length value to the DH of the first NFC device, and the purpose is to report the first NFC device and the second NFC to the DH of the first NFC device. The maximum length of the data packet transmitted in the subsequent communication after the device is adjusted is the first length value, so that the DH of the first NFC device can obtain the first length value and can be used in the upper layer service, for example, estimating. What is the time required to complete the transmission of the upper layer service related data in this communication, and the like, and the first RF interface of the first NFC device is notified that the first RF interface has been activated, that is, the communication module 602 is ready to receive the first A data message sent by the DH of the NFC device. The data message may be a Data Message(s) defined in the NCI specification, where the Data Message(s) is transmitted between the DH and the NFCC by transmitting the Data Packet(s), and the load in the data message is (payload) can carry data related to upper layer services.
且在该可选的实施方式中,该NFCC还可以包括封装模块604,且包括封装模块604的NFCC可以如图7所示,图7是本发明实施例公开的另一种NFCC的结构示意图。其中:In this alternative embodiment, the NFCC may further include a package module 604, and the NFCC including the package module 604 may be as shown in FIG. 7. FIG. 7 is a schematic structural diagram of another NFCC disclosed in the embodiment of the present invention. among them:
封装模块604,用于以上述第一长度值作为最大长度值将该数据消息中的负载封装成数据包。The encapsulating module 604 is configured to encapsulate the load in the data message into a data packet by using the first length value as the maximum length value.
在该可选的实施方式中,通信模块602还可以用于将该数据包发送至第二NFC设备。In this optional implementation, the communication module 602 can also be configured to send the data packet to the second NFC device.
可选的,上述第一请求可以为Digital规范中定义的PSL_REQ,上述第一响应可以为该Digital规范中定义的PSL_RES,上述第一RF接口可以为NCI规范中定义的NFC-DEP射频接口,且上述第一通知可以为该NCI规范中定义的射频接口激活通知RF_INTF_ACTIVATED_NTF,本发明实施例不做限定。Optionally, the first request may be a PSL_REQ defined in the Digital specification, and the first response may be a PSL_RES defined in the Digital specification, and the first RF interface may be an NFC-DEP radio interface defined in the NCI specification, and The foregoing first notification may be a radio frequency interface activation notification RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
可选的,上述第一请求也可以是Digital规范中定义的适用于ISO-DEP协议的RATS Command或ATTRIB Command,其中包含的FSDI(Frame Size for proximity coupling Device Integer)参数用于计算工作在轮询(poll)模式下的NFC设备(例如读写器等)所能接受的数据包(例如信息块I-block或该I-block的负载payload)的最大长度值FSD;相应的,上述第一响应也可以是Digital规范中定义的RATS Response或ATTRIB Response,其中可能包含的FSCI(Frame Size for proximity Card Integer)参数用于计算工作在poll模式下的NFC设备(例如NFC标签或卡模拟)能接受的数据包(例如信息块I-block或该I-block的负载payload)的最大长度值FSC;上述第一RF接口可以是NCI规范中定义的ISO-DEP射频接口或NDEF射频接口,上述第一通知可以是NCI规定中定义的RF_INTF_ACTIVATED_NTF。此时,本发明方案中所使用的“调整”,除了其本身的含义,也可以理解为协商、限定等,本发明方案对此不进行限制。Optionally, the foregoing first request may also be a RATS Command or an ATTRIB Command applicable to the ISO-DEP protocol defined in the Digital specification, where the FSDI (Frame Size for proximity Couple Device Integer) parameter is included for calculating work in polling. The maximum length value FSD of a data packet (for example, an information block I-block or a load payload of the I-block) acceptable to an NFC device (for example, a reader/writer) in a (poll) mode; correspondingly, the first response described above It may also be a RATS Response or an ATTRIB Response defined in the Digital specification, which may include a FSCI (Frame Size for proximity Card Integer) parameter for calculating an acceptable NFC device (eg, NFC tag or card emulation) operating in poll mode. The maximum length value FSC of the data packet (for example, the information block I-block or the load payload of the I-block); the first RF interface may be an ISO-DEP radio frequency interface or an NDEF radio frequency interface defined in the NCI specification, the first notification It can be RF_INTF_ACTIVATED_NTF as defined in the NCI regulations. In this case, the “adjustment” used in the solution of the present invention can be understood as a negotiation, a limitation, and the like in addition to the meaning of the present invention, and the present invention does not limit this.
可见,实施本发明实施例能够通过NCI规范实现作为发起方的第一NFC设备通过其NFCC与作为目标方的第二NFC设备调整后续通信过程中的通信数据包的最大长度值的功能。It can be seen that the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party.
请参阅图8,图8是本发明实施例公开的又一种NFCC的结构示意图。其中,该NFCC为第一NFC设备中的NFCC。如图8所示,该NFCC可以包括通信模块 801以及确定模块802,其中:Please refer to FIG. 8. FIG. 8 is a schematic structural diagram of another NFCC according to an embodiment of the present invention. Wherein, the NFCC is an NFCC in the first NFC device. As shown in FIG. 8, the NFCC may include a communication module. 801 and determining module 802, wherein:
通信模块802,用接收第一NFC设备的DH发送的包含第一长度值的调整命令,其中,该调整命令用于指示NFCC调整后续通信过程中所传输的数据包的最大长度值,且该最大长度值限制了从第一NFC设备到第二NFC设备方向上以及从第二NFC设备到第一NFC设备方向上分别传输的数据包的长度。The communication module 802 is configured to receive, by using the DH of the first NFC device, an adjustment command that includes a first length value, where the adjustment command is used to instruct the NFCC to adjust a maximum length value of the data packet transmitted during the subsequent communication, and the maximum The length value limits the length of the data packets respectively transmitted from the first NFC device to the second NFC device and from the second NFC device to the first NFC device.
本发明实施例中,在通信模块801执行相应的操作之前,第一NFC设备与第二NFC设备均已经激活了MAC层,即第一NFC设备与第二NFC设备通过ATR_REQ与ATR_RES已经协商好后续通信过程中所传输的数据包的最大长度值,即第二长度值以及第三长度值,其中,第二长度值由第一NFC设备设置且用于限制第二NFC设备在后续通信过程中发送的数据包的长度(即从第二NFC设备到第一NFC设备方向上所传输的数据包的长度),第三长度值由第二NFC设备设置且用于限制第一NFC设备在后续通信过程中发送的数据包的长度(即从第一NFC设备到第二NFC设备方向上所传输的数据包的长度),也就是说,后续通信中,第二NFC设备发送的数据包的长度不能超过第二长度值,第一NFC设备发送的数据包的长度不能超过第三长度值。In the embodiment of the present invention, before the communication module 801 performs the corresponding operation, the first NFC device and the second NFC device have activated the MAC layer, that is, the first NFC device and the second NFC device have negotiated the ATR_REQ and the ATR_RES. The maximum length value of the data packet transmitted during the communication, that is, the second length value and the third length value, wherein the second length value is set by the first NFC device and is used to restrict the second NFC device from transmitting during the subsequent communication The length of the data packet (ie, the length of the data packet transmitted from the second NFC device to the direction of the first NFC device), the third length value being set by the second NFC device and used to limit the first NFC device in the subsequent communication process The length of the data packet sent in the middle (ie, the length of the data packet transmitted from the first NFC device to the second NFC device), that is, the length of the data packet sent by the second NFC device cannot exceed the length of the subsequent communication. The second length value, the length of the data packet sent by the first NFC device cannot exceed the third length value.
通信模块801,还用于向第二NFC设备发送包含第一长度值的第一请求,并接收第二NFC设备针对该第一请求返回的第一响应,其中,该第一请求用于指示将第一NFC设备与第二NFC设备后续通信过程中所传输的数据包的最大长度值调整为第一长度值,该第一请求还可以包含第一DID,且该第一响应可以包含第二DID。The communication module 801 is further configured to send a first request that includes the first length value to the second NFC device, and receive a first response that is returned by the second NFC device for the first request, where the first request is used to indicate that The maximum length value of the data packet transmitted during the subsequent communication between the first NFC device and the second NFC device is adjusted to a first length value, the first request may further include a first DID, and the first response may include a second DID .
本发明实施例中,该第一请求可以是NFC论坛定义的Digital规范中定义的参数选择请求PSL_REQ,其中第5个字节(Byte 5)表示FSL参数,该字节的值定义了命令与响应的最大长度值,进一步地,该字节中的第一和第二比特位(即Digital规范中定义的b1和b2)对应的值表示该最大长度值,例如,当这里两个比特位的值为00b时,该最大长度值为64字节;当这里两个比特位的值为01b时,该最大长度值为128字节;当这里两个比特位的值为10b时,该最大长度值为192字节;当这里两个比特位的值为11b时,该最大长度值为254字节。因此,通过PSL_REQ和PSL_RES调整该最大长度值,可以理解为从一个长度值切换(switch)到另一个长度值,也可以理解为该最大长度值的重新协商或修改等,本发明实施例不对“调整”一词的含义进行限制。 In the embodiment of the present invention, the first request may be a parameter selection request PSL_REQ defined in the Digital specification defined by the NFC Forum, wherein the fifth byte (Byte 5) represents an FSL parameter, and the value of the byte defines the command and response. The maximum length value, further, the values corresponding to the first and second bits in the byte (ie, b1 and b2 defined in the Digital specification) represent the maximum length value, for example, when the values of the two bits are here When it is 00b, the maximum length value is 64 bytes; when the value of the two bits is 01b, the maximum length value is 128 bytes; when the value of the two bits is 10b, the maximum length value is It is 192 bytes; when the value of two bits here is 11b, the maximum length value is 254 bytes. Therefore, adjusting the maximum length value by PSL_REQ and PSL_RES can be understood as switching from one length value to another length value, and can also be understood as renegotiation or modification of the maximum length value, etc., which is not correct in the embodiment of the present invention. Limit the meaning of the word "adjustment".
其中,上述命令与响应可以是通过NFC-DEP协议进行通信时所使用的命令与响应,例如DEP_REQ和DEP_RES等;上述命令与响应可以作为负载(payload,即上层应用相关的业务数据)封装在数据包(Data)中,然后由NFC设备以NFC-A技术(即NFC论坛中定义的类型A射频技术,对应ISO/IEC14443的类型A的缩写)标准帧格式或NFC-F技术(即NFC论坛中定义的类型F射频技术,对应ISO/IEC 18092的212kbps和424kbps通信机制的缩写)帧格式发送出去,因此,上述最大长度值可以理解为数据包长度的最大值,也可以理解为上述命令与响应的负载(payload)字节数的最大值。The command and response may be commands and responses used for communication through the NFC-DEP protocol, such as DEP_REQ and DEP_RES. The commands and responses may be encapsulated in data as payloads (upper layer application related business data). In the Data, then the NFC-A technology (ie the type A RF technology defined in the NFC Forum, corresponding to the abbreviation of Type A of ISO/IEC 14443) standard frame format or NFC-F technology (ie NFC Forum) The defined type F radio frequency technology, corresponding to the abbreviation of the 212 kbps and 424 kbps communication mechanism of ISO/IEC 18092) is transmitted in the frame format. Therefore, the above maximum length value can be understood as the maximum value of the packet length, and can also be understood as the above command and response. The maximum number of payloads.
本发明实施例中,通信模块801向第二NFC设备发送包含第一长度值的第一请求,以使第二NFC设备在不接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值时不返回任何响应,或者以使第二NFC设备返回用于表示不接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值的响应,例如,该响应中包含的DID不等于该第一请求中所包含的DID,以表示该第二NFC设备不接受上述第一长度值,或者以使第二NFC设备返回用于表示接受将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值的响应,例如,该响应中包含的设备标识DID等于该第一请求中所包含的DID,以表示该第二NFC设备接受上述第一长度值。In the embodiment of the present invention, the communication module 801 sends a first request including the first length value to the second NFC device, so that the second NFC device does not accept the maximum length value of the data packet transmitted during the subsequent communication process to The first length value does not return any response, or the second NFC device returns a response indicating that the maximum length value of the data packet transmitted during the subsequent communication is not accepted to be adjusted to the first length value, for example, The DID included in the response is not equal to the DID included in the first request, to indicate that the second NFC device does not accept the first length value, or to cause the second NFC device to return to indicate acceptance in the subsequent communication process. The maximum length value of the transmitted data packet is adjusted to the response of the first length value, for example, the device identifier DID included in the response is equal to the DID included in the first request, to indicate that the second NFC device accepts the foregoing A length value.
确定模块802,用于当上述第第一DID与上述第二DID相同时,将第一长度值作为后续通信中所传输的数据包的最大长度值。The determining module 802 is configured to use the first length value as the maximum length value of the data packet transmitted in the subsequent communication when the first DID is the same as the second DID.
本发明实施例中,当第一响应中包含的第二DID与上述第一请求中包含的第一DID相同时,该第一响应用于表示第二NFC设备已经将后续通信过程中所传输的数据包的最大长度值调整为上述第一长度值,其中,第一DID与第二DID均为上述第二NFC设备的设备标识,示例地,对于NFC-DEP协议而言,上述第二DID是作为发起方的第一NFC设备在通过ATR_REQ激活MAC层时为作为目标方的第二NFC设备分配的、用来标识第二NFC设备的一个标识;又示例地,对于ISO-DEP协议而言,上述第二DID是作为读写器(Reader/Writer)的第一NFC设备在通过RATS Command或ATTRIB Command激活作为NFC标签或者卡模拟的第二NFC设备时为该第二NFC设备分配的、用来标识该第二NFC设备的一个标识。In the embodiment of the present invention, when the second DID included in the first response is the same as the first DID included in the first request, the first response is used to indicate that the second NFC device has transmitted the subsequent communication process. The maximum length value of the data packet is adjusted to the first length value, wherein the first DID and the second DID are both device identifiers of the second NFC device, and for example, for the NFC-DEP protocol, the second DID is The first NFC device as the initiator, which is assigned to the second NFC device as the target when the MAC layer is activated by the ATR_REQ, is used to identify one identifier of the second NFC device; and for example, for the ISO-DEP protocol, The second DID is allocated to the second NFC device as a first NFC device as a reader/writer (Reader/Writer) when the second NFC device is activated as an NFC tag or a card emulation by the RATS Command or the ATTRIB Command. An identifier identifying the second NFC device.
作为一种可选的实施方式,通信模块801还可以用于向第一NFC设备的DH 发送包含状态指示和/或上述第一长度值的调整响应,其中,该状态指示用于表示该NFCC已将上述最大长度值调整为上述第一长度值,也就是说第一NFC设备与第二NFC设备之间已经完成本次调整。As an optional implementation manner, the communication module 801 can also be used to DH to the first NFC device. Transmitting an adjustment response including a status indication and/or the first length value, wherein the status indication is used to indicate that the NFCC has adjusted the maximum length value to the first length value, that is, the first NFC device and the second This adjustment has been completed between NFC devices.
作为一种可选的实施方式,当通信模块801还可以用于向第一NFC设备的DH发送包含状态指示和/或上述第一长度值的调整响应时,该NFCC还可以包括第一激活模块803,且包括第一激活模块803的NFCC可以如图9所示,图9是本发明实施例公开的又一种NFCC的结构示意图。其中:As an optional implementation manner, when the communication module 801 is further configured to send an adjustment response including a status indication and/or the foregoing first length value to the DH of the first NFC device, the NFCC may further include the first activation module. 803, and the NFCC including the first activation module 803 can be as shown in FIG. 9, and FIG. 9 is a schematic structural diagram of another NFCC disclosed in the embodiment of the present invention. among them:
第一激活模块803,用于在通信模块801向第二NFC设备发送包括第一长度值的第一请求之前,激活第一RF接口。The first activation module 803 is configured to activate the first RF interface before the communication module 801 sends the first request including the first length value to the second NFC device.
通信模块801,还可以用于向第一NFC设备的DH发送第一通知,其中,该第一通知用于告知第一NFC设备的DH第一RF接口已被激活。The communication module 801 is further configured to send a first notification to the DH of the first NFC device, where the first notification is used to notify that the DH first RF interface of the first NFC device has been activated.
需要说明的是,在该可选的实施方式中,第一NFC设备与第二NFC设备通过ATR_REQ和ATR_RES激活了第一NFC设备与第二NFC设备之间的MAC层,即第一NFC设备与第二NFC设备已经协商好后续通信中在两个方向上分别传输的数据包的最大长度值,即上述实施例中的第二长度值和第三长度值。本发明实施例中,第一NFC设备的NFCC向第一NFC设备的DH发送第一通知时,可以携带ATR_RES中的参数值,其中包括第三长度值,具体请参见NCI规范。It should be noted that, in the optional implementation, the first NFC device and the second NFC device activate the MAC layer between the first NFC device and the second NFC device by using ATR_REQ and ATR_RES, that is, the first NFC device and The second NFC device has negotiated the maximum length value of the data packets respectively transmitted in the two directions in the subsequent communication, that is, the second length value and the third length value in the above embodiment. In the embodiment of the present invention, when the NFCC of the first NFC device sends the first notification to the DH of the first NFC device, the parameter value in the ATR_RES may be carried, including the third length value. For details, refer to the NCI specification.
作为一种可选的实施方式,当通信模块801还可以用于向第一NFC设备的DH发送包含状态指示和/或上述第一长度值的调整响应且NFCC包括第一激活模块803时,通信模块801,还可以用于通过上述第一RF接口接收第一NFC设备的DH发送的第一数据消息。As an optional implementation manner, when the communication module 801 is further configured to send, to the DH of the first NFC device, an adjustment response including a status indication and/or the first length value, and the NFCC includes the first activation module 803, the communication is performed. The module 801 is further configured to receive, by using the foregoing first RF interface, the first data message sent by the DH of the first NFC device.
且在该可选的实施方式中,该NFCC还包括第一封装模块804,且包括第一封装模块804的NFCC可以如图10所示,图10是本发明实施例公开的又一种NFCC的结构示意图。其中:In this optional embodiment, the NFCC further includes a first encapsulation module 804, and the NFCC including the first encapsulation module 804 can be as shown in FIG. 10, and FIG. 10 is another NFCC disclosed in the embodiment of the present invention. Schematic. among them:
第一封装模块804,用于以上述第一长度值作为最大长度值将该第一数据消息中的负载封装成第一数据包。The first encapsulating module 804 is configured to encapsulate the load in the first data message into the first data packet by using the first length value as the maximum length value.
且通信模块801,还可以用于将第一数据包发送至第二NFC设备。And the communication module 801 is further configured to send the first data packet to the second NFC device.
作为另一种可选的实施方式,当通信模块801还可以用于向第一NFC设备的DH发送包含状态指示和/或上述第一长度值的调整响应时,确定模块802还可以在通信模块801向第二NFC设备发送包括上述第一长度值的第一请求之 前,确定上述第一长度值小于或等于第二长度值且小于或等于第三长度值。As another optional implementation manner, when the communication module 801 is further configured to send an adjustment response including a status indication and/or the foregoing first length value to the DH of the first NFC device, the determining module 802 may also be in the communication module. The 801 sends a first request including the foregoing first length value to the second NFC device. Before, determining that the first length value is less than or equal to the second length value and less than or equal to the third length value.
在该可选的实施方式中,该NFCC还包括第二封装模块805以及第二激活模块806,且包括第二封装模块805以及第二激活模块806的NFCC可以如图11所示,图11是本发明实施例公开的又一种NFCC的结构示意图。其中:In this optional implementation, the NFCC further includes a second encapsulation module 805 and a second activation module 806, and the NFCC including the second encapsulation module 805 and the second activation module 806 can be as shown in FIG. 11, FIG. 11 is Another schematic diagram of the structure of the NFCC disclosed in the embodiment of the present invention. among them:
第二激活模块806,用于激活第二RF接口。The second activation module 806 is configured to activate the second RF interface.
通信模块801,还可以用于向第一NFC设备的DH发送第二通知,该第二通知用于告知第一NFC设备的DH第二RF接口已被激活,并通过该第二RF接口接收第一NFC设备的DH发送的第二数据消息。The communication module 801 is further configured to send a second notification to the DH of the first NFC device, where the second notification is used to notify that the DH second RF interface of the first NFC device has been activated, and receive the first through the second RF interface. A second data message sent by the DH of an NFC device.
第二封装模块805,用于以上述第一长度值作为最大长度值将上述第二数据消息中的负载封装成第二数据包。The second encapsulating module 805 is configured to encapsulate the load in the second data message into the second data packet by using the first length value as the maximum length value.
通信模块801,还可以用于将上述第二数据包发送至第二NFC设备。The communication module 801 is further configured to send the second data packet to the second NFC device.
需要说明的是,在该可选的实施方式中,第一NFC设备的DH向第一NFC设备的NFCC发送上述调整命令可以发生在第一NFC设备通过NFCC与第二NFC设备直接激活MAC层之前或之后,由于第一NFC设备的DH不知第一NFC设备的NFCC与第二NFC设备即将协商的或已经协商好的第二长度值与第三长度值具体是多少,因此,第一NFC设备的DH发送的该调整命令中的第一长度值可能大于、等于或小于该第二长度值或第三长度值,那么,第一NFC设备的NFCC为了防止第一长度值超过该第二长度值或第三长度值,第一NFC设备的NFCC需要执行上述操作以保证该第一长度值小于或等于第二长度值与第三长度值。It should be noted that, in the optional implementation manner, sending the foregoing adjustment command to the NFCC of the first NFC device by the DH of the first NFC device may occur before the first NFC device directly activates the MAC layer by using the NFCC and the second NFC device. Or after that, because the DH of the first NFC device does not know the specificity of the second length value and the third length value that the NFCC of the first NFC device and the second NFC device are about to negotiate or have negotiated, the first NFC device The first length value of the adjustment command sent by the DH may be greater than, equal to, or less than the second length value or the third length value. Then, the NFCC of the first NFC device prevents the first length value from exceeding the second length value or The third length value, the NFCC of the first NFC device needs to perform the above operation to ensure that the first length value is less than or equal to the second length value and the third length value.
需要说明的是,本发明实施例中,上述第二通知可以包含上述第一长度值,也可以不包含;上述第一数据消息与第二数据消息、上述第一数据包与第二数据包与前面实施例所述的数据消息、数据包分别相同,这里不再赘述。It should be noted that, in the embodiment of the present invention, the second notification may include the first length value, or may not include; the first data message and the second data message, the first data packet and the second data packet, and The data messages and data packets described in the foregoing embodiments are the same, and are not described here.
可选的,上述第一请求可以为Digital规范中定义的PSL_REQ,上述第一响应可以为该Digital规范中定义的PSL_RES,上述第一RF接口以及上述第二RF接口可以为NCI规范中定义的NFC-DEP射频接口,且上述第一通知以及上述第二通知可以为该NCI规范中定义的射频接口激活通知RF_INTF_ACTIVATED_NTF,本发明实施例不做限定。Optionally, the first request may be a PSL_REQ defined in the Digital specification, and the first response may be a PSL_RES defined in the Digital specification, and the first RF interface and the second RF interface may be an NFC defined in the NCI specification. The DEP radio interface, and the foregoing first notification and the second notification may be the radio interface activation notification RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
可选的,上述第一请求也可以是Digital规范中定义的适用于ISO-DEP协议的RATS Command或ATTRIB Command,其中包含的FSDI(Frame Size for  proximity coupling Device Integer)参数用于计算工作在轮询(poll)模式下的NFC设备(例如读写器等)所能接受的数据包(例如信息块I-block或该I-block的负载payload)的最大长度值FSD;相应的,上述第一响应也可以是Digital规范中定义的RATS Response或ATTRIB Response,其中可能包含的FSCI(Frame Size for proximity Card Integer)参数用于计算工作在poll模式下的NFC设备(例如NFC标签或卡模拟)能接受的数据包(例如信息块I-block或该I-block的负载payload)的最大长度值FSC;上述第一RF接口以及上述可以是NCI规范中定义的ISO-DEP射频接口或NDEF射频接口,上述第一通知以及上述第二通知可以是NCI规定中定义的RF_INTF_ACTIVATED_NTF。此时,本发明方案中所使用的“调整”,除了其本身的含义,也可以理解为协商、限定等,本发明方案对此不进行限制。Optionally, the first request may also be a RATS Command or an ATTRIB Command applicable to the ISO-DEP protocol defined in the Digital specification, and the FSDI (Frame Size for The proximity coupling Device Integer) parameter is used to calculate a packet acceptable to an NFC device (eg, a reader or the like) operating in a poll mode (eg, a block I-block or a load payload of the I-block). The maximum length value FSD; correspondingly, the first response may also be a RATS Response or an ATTRIB Response defined in the Digital specification, wherein the FSCI (Frame Size for proximity Card Integer) parameter may be included for calculating the operation in the poll mode. The maximum length value FSC of a data packet (eg, an information block I-block or a load payload of the I-block) that can be accepted by an NFC device (eg, an NFC tag or card emulation); the first RF interface described above and the above may be defined in the NCI specification The first notification and the second notification described above may be RF_INTF_ACTIVATED_NTF defined in the NCI specification for the ISO-DEP radio interface or the NDEF radio interface. In this case, the “adjustment” used in the solution of the present invention can be understood as a negotiation, a limitation, and the like in addition to the meaning of the present invention, and the present invention does not limit this.
可见,实施本发明实施例能够通过NCI规范实现作为发起方的第一NFC设备通过其NFCC与作为目标方的第二NFC设备调整后续通信过程中的通信数据包的最大长度值的功能。It can be seen that the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party.
请参阅图12,图12是本发明实施例公开的又一种NFCC的结构示意图。如图12所示,该NFCC可以包括:至少一个处理器1201,如CPU,通信装置1202以及至少一个通信总线1203。且第一NFC设备与第二NFC设备均已经激活了MAC层,即第一NFC设备与第二NFC设备通过ATR_REQ与ATR_RES已经协商好后续通信过程中所传输的数据包的最大长度值,即第二长度值以及第三长度值,其中,第二长度值由第一NFC设备设置且用于限制第二NFC设备在后续通信过程中发送的数据包的长度(即从第二NFC设备到第一NFC设备方向上所传输的数据包的长度),第三长度值由第二NFC设备设置且用于限制第一NFC设备在后续通信过程中发送的数据包的长度(即从第一NFC设备到第二NFC设备方向上所传输的数据包的长度),也就是说,后续通信中,第二NFC设备发送的数据包的长度不能超过第二长度值,第一NFC设备发送的数据包的长度不能超过第三长度值。其中:Please refer to FIG. 12. FIG. 12 is a schematic structural diagram of still another NFCC according to an embodiment of the present invention. As shown in FIG. 12, the NFCC may include at least one processor 1201, such as a CPU, a communication device 1202, and at least one communication bus 1203. And the first NFC device and the second NFC device have activated the MAC layer, that is, the first NFC device and the second NFC device have negotiated the maximum length value of the data packet transmitted in the subsequent communication process through the ATR_REQ and the ATR_RES, that is, the first a second length value and a third length value, wherein the second length value is set by the first NFC device and is used to limit the length of the data packet sent by the second NFC device during the subsequent communication (ie, from the second NFC device to the first The length of the data packet transmitted in the NFC device direction), the third length value being set by the second NFC device and used to limit the length of the data packet sent by the first NFC device during the subsequent communication (ie, from the first NFC device to The length of the data packet transmitted in the direction of the second NFC device, that is, the length of the data packet sent by the second NFC device in the subsequent communication cannot exceed the second length value, and the length of the data packet sent by the first NFC device Cannot exceed the third length value. among them:
通信总线1203用于实现这些组件之间的连接通信。 Communication bus 1203 is used to implement connection communication between these components.
在一个实施例中,处理器1201,用于判断是否由NFCC负责确定后续通信中所传输的数据包的最大长度值。 In one embodiment, the processor 1201 is configured to determine whether the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication.
通信装置1202,用于当处理器1201的判断结果为是时,向第二NFC设备发送包含第一长度值的第一请求并接收第二NFC设备针对该第一请求返回的第一响应,其中,该第一请求用于指示将第一NFC设备与第二NFC设备在后续通信中所传输的数据包的最大长度值调整为第一长度值,第一长度值是NFCC确定的一个值,且该该最大长度值限制了从第一NFC设备到第二NFC设备方向上以及从第二NFC设备到第一NFC设备方向上分别传输的数据包的长度,该第一请求还可以包含第一DID且该第二响应包含第二DID。The communication device 1202 is configured to: when the determination result of the processor 1201 is YES, send a first request including a first length value to the second NFC device, and receive a first response returned by the second NFC device for the first request, where The first request is used to indicate that the maximum length value of the data packet transmitted by the first NFC device and the second NFC device in the subsequent communication is adjusted to a first length value, where the first length value is a value determined by the NFCC, and The maximum length value limits the length of the data packet respectively transmitted from the first NFC device to the second NFC device direction and from the second NFC device to the first NFC device direction, and the first request may further include the first DID And the second response includes a second DID.
具体的,如图12所示,通信装置1202可以包括用于与第二NFC设备进行通信(即向第二NFC设备发送数据以及从第二NFC设备接收数据)的第一通信子装置12021,如NFCC中的收发电路等,该收发电路中NFC天线的工作频率可以是13.56MHz,NFCC通过该NFC天线可以向第二NFC设备发送数据,也可以从第二NFC设备接收数据。本发明实施例中,通信装置1202可以通过第一通信子装置12021向第二NFC设备发送包含第一长度值的第一请求并接收第二NFC设备针对上述第一请求返回的上述第一响应。Specifically, as shown in FIG. 12, the communication device 1202 may include a first communication sub-device 12021 for communicating with the second NFC device (ie, transmitting data to and receiving data from the second NFC device), such as The transceiver circuit in the NFCC, etc., the operating frequency of the NFC antenna in the transceiver circuit may be 13.56 MHz, and the NFCC may send data to the second NFC device through the NFC antenna, or may receive data from the second NFC device. In the embodiment of the present invention, the communication device 1202 may send the first request including the first length value to the second NFC device by using the first communication sub-device 12021 and receive the first response returned by the second NFC device for the first request.
处理器1201,还用于当上述第一DID与上述第二DID相同时,将第一长度值作为后续通信中所传输的数据包的最大长度值。The processor 1201 is further configured to: when the first DID is the same as the second DID, use the first length value as the maximum length value of the data packet transmitted in the subsequent communication.
作为一种可选的实施方式,处理器1201判断是否由NFCC负责确定后续通信中所传输的数据包的最大长度值的具体方式为:As an optional implementation manner, the processor 1201 determines whether the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication:
判断第一参数的值是否为第一特定值,其中,该第一特定值用于表示后续通信中所传输的数据包的最大长度值由NFCC负责确定,该第一参数的值是NFCC的默认值(即可以理解为在NFC芯片出厂时设置到NFCC中的默认值),或者是由第一NFC设备的DH配置给NFCC的值。Determining whether the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that the maximum length value of the data packet transmitted in the subsequent communication is determined by the NFCC, and the value of the first parameter is the default of the NFCC. The value (ie, can be understood as the default value set to the NFCC when the NFC chip is shipped), or the value assigned to the NFCC by the DH of the first NFC device.
作为一种可选的实施方式,通信装置1202,还可以用于向第一NFC设备的DH发送包含第一长度值的第一通知,其中,该第一通知用于告知第一NFC设备的DH第一RF接口已被激活,并通过该第一RF接口接收第一NFC设备发送的数据消息,处理器1201还可以用于以上述第一长度值作为最大长度值将该数据消息中的负载封装成数据包,通信装置1202,还用于通过第一通信子装置12021将该数据包发送至第二NFC设备。As an optional implementation, the communication device 1202 is further configured to send, to the DH of the first NFC device, a first notification that includes a first length value, where the first notification is used to notify the DH of the first NFC device. The first RF interface is activated, and the data message sent by the first NFC device is received by the first RF interface, and the processor 1201 is further configured to encapsulate the load in the data message by using the first length value as the maximum length value. The data packet, the communication device 1202 is further configured to send the data packet to the second NFC device by using the first communication sub-device 12021.
在该可选的实施方式中,通信装置1202向第一NFC设备的DH发送包含上述第一长度值的上述第一通知的目的是向第一NFC设备的DH上报第一NFC设 备与第二NFC设备调整后的后续通信中所传输的数据包的最大长度值为上述第一长度值,以使第一NFC设备的DH获取到该第一长度值后可以在上层业务中进行使用,例如,估算本次通信中完成上层业务相关数据的传输所需要的时间是多少等等,以及通知第一NFC设备的DH上述第一RF接口已被激活,也就是说,第一NFC设备的NFCC已准备好接收第一NFC设备的DH发送的数据消息。其中,该数据消息可以是NCI规范中定义的Data Message(s),其中,在DH与NFCC之间传输Data Message(s)是通过传输Data Packet(s)实现的,且该数据消息中的负载(payload)携带的可以是上层业务相关的数据。In the optional implementation manner, the communication device 1202 sends the first notification that includes the foregoing first length value to the DH of the first NFC device, and the first notification is to report the first NFC configuration to the DH of the first NFC device. The maximum length of the data packet transmitted in the subsequent communication adjusted by the second NFC device is the first length value, so that the DH of the first NFC device obtains the first length value and can be performed in the upper layer service. Using, for example, estimating the time required to complete the transmission of the upper layer service related data in the current communication, and the like, and notifying the DN of the first NFC device that the first RF interface has been activated, that is, the first NFC device The NFCC is ready to receive the data message sent by the DH of the first NFC device. The data message may be a Data Message(s) defined in the NCI specification, where the Data Message(s) is transmitted between the DH and the NFCC by transmitting the Data Packet(s), and the load in the data message is (payload) can carry data related to upper layer services.
具体的,如图12所示,通信装置1202还可以包括用于与第一NFC设备的DH进行通信的第二通信子装置12022,如DH与NFCC之间的接口,该接口在上层可以支持NCI协议,在底层可以使用通用异步收发传输器(UART,Universal Asynchronous Receiver/Transmitter)、I2C总线(Inter-Integrated Circuit)或半双工串行外设接口(SPI,Serial Peripheral Interface)等传输数据。本发明实施例中,通信装置1202通过第二通信子装置12022向第一NFC设备的DH发送包含第一长度值的第一通知,并通过第二通信子装置12022接收DH发送的数据消息,即上述第一RF接口即可以理解为第二通信子装置12022。Specifically, as shown in FIG. 12, the communication device 1202 may further include a second communication sub-device 12022 for communicating with the DH of the first NFC device, such as an interface between the DH and the NFCC, which may support the NCI at the upper layer. The protocol can transmit data at the bottom layer using a Universal Asynchronous Receiver/Transmitter (UART), an I2C bus (Inter-Integrated Circuit), or a Half-Duplex Serial Peripheral Interface (SPI). In the embodiment of the present invention, the communication device 1202 sends a first notification including the first length value to the DH of the first NFC device through the second communication sub-device 12022, and receives the data message sent by the DH through the second communication sub-device 12022, that is, The first RF interface described above can be understood as the second communication sub-device 12022.
需要说明的是,本发明实施例中,上述数据消息和数据包分别与前面实施例所述的数据消息和数据包相同,这里不再赘述。It should be noted that, in the embodiment of the present invention, the data message and the data packet are the same as the data message and the data packet described in the foregoing embodiments, and details are not described herein again.
可选的,上述第一请求可以为Digital规范中定义的PSL_REQ,上述第一响应可以为该Digital规范中定义的PSL_RES,上述第一RF接口可以为NCI规范中定义的NFC-DEP射频接口,且上述第一通知可以为该NCI规范中定义的射频接口激活通知RF_INTF_ACTIVATED_NTF,本发明实施例不做限定。Optionally, the first request may be a PSL_REQ defined in the Digital specification, and the first response may be a PSL_RES defined in the Digital specification, and the first RF interface may be an NFC-DEP radio interface defined in the NCI specification, and The foregoing first notification may be a radio frequency interface activation notification RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
可选的,上述第一请求也可以是Digital规范中定义的适用于ISO-DEP协议的RATS Command或ATTRIB Command,其中包含的FSDI(Frame Size for proximity coupling Device Integer)参数用于计算工作在轮询(poll)模式下的NFC设备(例如读写器等)所能接受的数据包(例如信息块I-block或该I-block的负载payload)的最大长度值FSD;相应的,上述第一响应也可以是Digital规范中定义的RATS Response或ATTRIB Response,其中可能包含的FSCI(Frame Size for proximity Card Integer)参数用于计算工作在poll模式下的NFC设备(例如NFC标签或卡模拟)能接受的数据包(例如信息块I-block或该I-block 的负载payload)的最大长度值FSC;上述第一RF接口可以是NCI规范中定义的ISO-DEP射频接口或NDEF射频接口,上述第一通知可以是NCI规定中定义的RF_INTF_ACTIVATED_NTF。此时,本发明方案中所使用的“调整”,除了其本身的含义,也可以理解为协商、限定等,本发明方案对此不进行限制。Optionally, the foregoing first request may also be a RATS Command or an ATTRIB Command applicable to the ISO-DEP protocol defined in the Digital specification, where the FSDI (Frame Size for proximity Couple Device Integer) parameter is included for calculating work in polling. The maximum length value FSD of a data packet (for example, an information block I-block or a load payload of the I-block) acceptable to an NFC device (for example, a reader/writer) in a (poll) mode; correspondingly, the first response described above It may also be a RATS Response or an ATTRIB Response defined in the Digital specification, which may include a FSCI (Frame Size for proximity Card Integer) parameter for calculating an acceptable NFC device (eg, NFC tag or card emulation) operating in poll mode. Packet (such as information block I-block or the I-block) The maximum length value FSC of the load payload; the first RF interface may be an ISO-DEP radio interface or an NDEF radio interface defined in the NCI specification, and the first notification may be RF_INTF_ACTIVATED_NTF defined in the NCI specification. In this case, the “adjustment” used in the solution of the present invention can be understood as a negotiation, a limitation, and the like in addition to the meaning of the present invention, and the present invention does not limit this.
在另一个实施例中,通信装置1202,用于接收第一NFC设备的DH发送的包含第一长度值的调整命令,其中,该调整命令用于指示NFCC调整后续通信过程中所传输的数据包的最大长度值。In another embodiment, the communication device 1202 is configured to receive, by the DH of the first NFC device, an adjustment command that includes a first length value, where the adjustment command is used to instruct the NFCC to adjust the data packet transmitted during the subsequent communication process. The maximum length value.
具体的,通信装置1202可以包括用于与第一NFC设备的DH进行通信的第二通信子装置12022,如DH与NFCC之间的接口,该接口在上层可以支持NCI协议,在底层可以使用通用异步收发传输器(UART,Universal Asynchronous Receiver/Transmitter)、I2C总线(Inter-Integrated Circuit)或半双工串行外设接口(SPI,Serial Peripheral Interface)等传输数据。本发明实施例中,通信装置1202可以通过第二通信子装置12022接收第一NFC设备的DH发送的包含第一长度值的调整命令。Specifically, the communication device 1202 may include a second communication sub-device 12022 for communicating with the DH of the first NFC device, such as an interface between the DH and the NFCC, the interface may support the NCI protocol at the upper layer, and may be used at the bottom layer. The data is transmitted by an asynchronous transceiver (UART, Universal Asynchronous Receiver/Transmitter), an I2C bus (Inter-Integrated Circuit), or a half-duplex serial peripheral interface (SPI). In the embodiment of the present invention, the communication device 1202 may receive, by using the second communication sub-device 12022, an adjustment command including a first length value sent by the DH of the first NFC device.
通信装置1202,还用于向第二NFC设备发送包含上述第一长度值的第一请求,并接收第二NFC设备针对该第一请求返回的第一响应,其中,该第一请求用于指示将第一NFC设备与第二NFC设备后续通信过程中所传输的数据包的最大长度值调整为第一长度值,该第一请求还可以包含第一DID且该第一响应还包含第二DID。The communication device 1202 is further configured to send a first request including the foregoing first length value to the second NFC device, and receive a first response returned by the second NFC device for the first request, where the first request is used to indicate Adjusting a maximum length value of the data packet transmitted during the subsequent communication between the first NFC device and the second NFC device to a first length value, the first request may further include a first DID, and the first response further includes a second DID .
具体的,通信装置1202还可以包括用于与第二NFC设备进行通信(即向第二NFC设备发送数据以及从第二NFC设备接收数据)的第一通信子装置12021,如NFCC中的收发电路等,该收发电路中NFC天线的工作频率可以是13.56MHz,NFCC通过该NFC天线可以向第二NFC设备发送数据,也可以从第二NFC设备接收数据。本发明实施例中,在接收第一NFC设备的DH发送的包含第一长度值的调整命令之后,通信装置1202可以通过第一通信子装置12021向第二NFC设备发送包含上述第一长度值的第一请求并接收第二NFC设备针对该第一请求返回的第一响应。Specifically, the communication device 1202 may further include a first communication sub-device 12021 for communicating with the second NFC device (ie, transmitting data to and receiving data from the second NFC device), such as a transceiver circuit in the NFCC. The operating frequency of the NFC antenna in the transceiver circuit may be 13.56 MHz. The NFCC may send data to the second NFC device through the NFC antenna, or may receive data from the second NFC device. In the embodiment of the present invention, after receiving the adjustment command including the first length value sent by the DH of the first NFC device, the communication device 1202 may send, by using the first communication sub-device 12021, the first length value to the second NFC device. The first request and receive a first response returned by the second NFC device for the first request.
处理器1201,用于当上述第一DID与上述第二DID相同时,将上述第一长度值作为后续通信中所传输的数据包的最大长度值。The processor 1201 is configured to use the first length value as the maximum length value of the data packet transmitted in the subsequent communication when the first DID is the same as the second DID.
作为一种可选的实施方式,通信装置1202,还可以用于通过第二通信子装 置12022向第一NFC设备的DH发送包含状态指示和/或上述第一长度值的调整响应,该状态指示用于表示NFCC已将最大长度值调整为第一长度值。As an optional implementation manner, the communication device 1202 can also be used to install the second communication device. The setting 12022 sends an adjustment response including a status indication and/or the first length value to the DH of the first NFC device, the status indication indicating that the NFCC has adjusted the maximum length value to the first length value.
作为一种可选的实施方式,当通信装置1202还可以用于通过第二通信子装置12022向第一NFC设备的DH发送包含状态指示和/或上述第一长度值的调整响应时,处理器1201,还可以用于在通信装置1202的第一通信子装置12021向第二NFC设备发送包括第一长度值的第一请求之前,激活第一RF接口。通信装置1202,还可以用于向第一NFC设备的DH发送第一通知,其中,该第一通知用于告知该DH第一RF接口已被激活,具体的,通信装置1202可以通过第二通信子装置12022向第一NFC设备的DH发送第一通知。As an optional implementation manner, when the communication device 1202 is further configured to send, by the second communication sub-device 12022, an adjustment response including a status indication and/or the first length value to the DH of the first NFC device, the processor 1201. The first RF interface can also be activated before the first communication sub-device 12021 of the communication device 1202 sends the first request including the first length value to the second NFC device. The communication device 1202 is further configured to send a first notification to the DH of the first NFC device, where the first notification is used to notify the DH that the first RF interface has been activated. Specifically, the communication device 1202 can pass the second communication. The child device 12022 sends a first notification to the DH of the first NFC device.
在该可选的实施方式中,进一步可选的,通信装置1202,还可以用于通过第一RF接口接收第一NFC设备的DH发送的第一数据消息;处理器1201,还可以用于以上述第一长度值作为最大长度值将该第一数据消息中的负载封装成第一数据包;通信装置1202,还可以用于通过第一通信子装置12021将该第一数据包发送至第二NFC设备。In the optional implementation, the communication device 1202 is further configured to receive, by using the first RF interface, the first data message sent by the DH of the first NFC device, where the processor 1201 is further configured to The first length value is used as the maximum length value to encapsulate the load in the first data message into the first data packet. The communication device 1202 is further configured to send the first data packet to the second by the first communication sub-device 12021. NFC device.
作为另一种可选的实施方式,当通信装置1202还可以用于通过第二通信子装置12022向第一NFC设备的DH发送包含状态指示和/或上述第一长度值的调整响应时,处理器1201,还可以用于在通信装置1202的第一通信子装置12021向第二NFC设备发送包括第一长度值的第一请求之前,确定第一长度值小于或等于上述第二长度值且小于或等于上述第三长度值。As another optional implementation manner, when the communication device 1202 is further configured to send, by the second communication sub-device 12022, an adjustment response including a status indication and/or the first length value to the DH of the first NFC device, the processing is performed. The device 1201 is further configured to: before the first communication sub-device 12021 of the communication device 1202 sends the first request including the first length value to the second NFC device, determine that the first length value is less than or equal to the second length value and is less than Or equal to the above third length value.
在该可选的实施方式中,进一步可选的,通信装置1202,还可以用于通过第二通信子装置12022向第一NFC设备的DH发送第二通知,该第二通知用于告知第一NFC设备DH第二RF接口已被激活,并通过第二RF接口接收第一NFC设备DH发送的第二数据消息;处理器1201,还用于以上述第一长度值作为最大长度值将该第二数据消息中的负载封装成第二数据包;通信装置1202,还可以用于通过第一通信子装置12021将改第二数据包发送至第二NFC设备。In the optional implementation, the communication device 1202 is further configured to send, by the second communication sub-device 12022, a second notification to the DH of the first NFC device, where the second notification is used to notify the first The second RF interface of the NFC device DH has been activated, and receives the second data message sent by the first NFC device DH through the second RF interface. The processor 1201 is further configured to use the first length value as the maximum length value. The load in the two data messages is encapsulated into a second data packet; the communication device 1202 is further configured to send the second data packet to the second NFC device by using the first communication sub-device 12021.
需要说明的是,本发明实施例中,上述第二通知可以包含上述第一长度值,也可以不包含;上述第一数据消息与第二数据消息、上述第一数据包与第二数据包与前面实施例所述的数据消息、数据包分别相同,这里不再赘述。可选的,上述第一请求可以为Digital规范中定义的PSL_REQ,上述第一响应可以为该Digital规范中定义的PSL_RES,上述第一RF接口以及第二RF接口可以为NCI 规范中定义的NFC-DEP射频接口,且上述第一通知以及第二通知可以为该NCI规范中定义的射频接口激活通知RF_INTF_ACTIVATED_NTF,本发明实施例不做限定。It should be noted that, in the embodiment of the present invention, the second notification may include the first length value, or may not include; the first data message and the second data message, the first data packet and the second data packet, and The data messages and data packets described in the foregoing embodiments are the same, and are not described here. Optionally, the first request may be a PSL_REQ defined in the Digital specification, the first response may be a PSL_RES defined in the Digital specification, and the first RF interface and the second RF interface may be an NCI. The NFC-DEP radio interface is defined in the specification, and the first notification and the second notification may be the radio interface activation notification RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
可选的,上述第一请求也可以是Digital规范中定义的适用于ISO-DEP协议的RATS Command或ATTRIB Command,其中包含的FSDI(Frame Size for proximity coupling Device Integer)参数用于计算工作在轮询(poll)模式下的NFC设备(例如读写器等)所能接受的数据包(例如信息块I-block或该I-block的负载payload)的最大长度值FSD;相应的,上述第一响应也可以是Digital规范中定义的RATS Response或ATTRIB Response,其中可能包含的FSCI(Frame Size for proximity Card Integer)参数用于计算工作在poll模式下的NFC设备(例如NFC标签或卡模拟)能接受的数据包(例如信息块I-block或该I-block的负载payload)的最大长度值FSC;上述第一RF接口以及上述第二RF接口可以是NCI规范中定义的ISO-DEP射频接口或NDEF射频接口,上述第一通知以及上述第二通知可以是NCI规定中定义的RF_INTF_ACTIVATED_NTF。此时,本发明方案中所使用的“调整”,除了其本身的含义,也可以理解为协商、限定等,本发明方案对此不进行限制。Optionally, the foregoing first request may also be a RATS Command or an ATTRIB Command applicable to the ISO-DEP protocol defined in the Digital specification, where the FSDI (Frame Size for proximity Couple Device Integer) parameter is included for calculating work in polling. The maximum length value FSD of a data packet (for example, an information block I-block or a load payload of the I-block) acceptable to an NFC device (for example, a reader/writer) in a (poll) mode; correspondingly, the first response described above It may also be a RATS Response or an ATTRIB Response defined in the Digital specification, which may include a FSCI (Frame Size for proximity Card Integer) parameter for calculating an acceptable NFC device (eg, NFC tag or card emulation) operating in poll mode. The maximum length value FSC of the data packet (for example, the information block I-block or the load payload of the I-block); the first RF interface and the second RF interface may be an ISO-DEP radio frequency interface or an NDEF radio frequency defined in the NCI specification. The interface, the first notification and the second notification may be RF_INTF_ACTIVATED_NTF defined in the NCI specification. In this case, the “adjustment” used in the solution of the present invention can be understood as a negotiation, a limitation, and the like in addition to the meaning of the present invention, and the present invention does not limit this.
可见,实施本发明实施例能够通过NCI规范实现作为发起方的第一NFC设备通过其NFCC与作为目标方的第二NFC设备调整后续通信过程中的通信数据包的最大长度值的功能。It can be seen that the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party.
请参阅图13,图13是本发明实施例公开的一种调整近场通信NFC中数据包长度的系统的结构示意图。如图13所示,该系统可以包括作为发起方的第一NFC设备1301以及作为目标方的第二NFC设备1302,其中,第一NFC设备1301可以包括第一NFCC13011以及第一DH13012,第二NFC设备1302可以包括第二NFCC13021以及第二DH13022,且第一NFC设备1301与第二NFC设备1302均已经激活了MAC层,即第一NFC设备1301与第二NFC设备1302已经通过ATR_REQ与ATR_RES协商好后续通信过程中所传输的数据包的最大长度值,即第二长度值以及第三长度值,其中,第二长度值由第一NFC设备1301设置且用于限制第二NFC设备1302在后续通信过程中发送的数据包的长度,第三长度值由第二NFC设备1302设置且用于限制第一NFC设备1301在后续通信过程中 发送的数据包的长度其中:Please refer to FIG. 13. FIG. 13 is a schematic structural diagram of a system for adjusting a data packet length in a near field communication NFC according to an embodiment of the present invention. As shown in FIG. 13, the system may include a first NFC device 1301 as an initiator and a second NFC device 1302 as a target, wherein the first NFC device 1301 may include a first NFCC 13011 and a first DH 13012, a second NFC The device 1302 may include a second NFCC 13021 and a second DH 13022, and the first NFC device 1301 and the second NFC device 1302 have activated the MAC layer, that is, the first NFC device 1301 and the second NFC device 1302 have negotiated with the ATR_RES through the ATR_REQ. The maximum length value of the data packet transmitted during the subsequent communication, that is, the second length value and the third length value, wherein the second length value is set by the first NFC device 1301 and is used to limit the second NFC device 1302 in subsequent communication. The length of the data packet sent in the process, the third length value being set by the second NFC device 1302 and used to limit the first NFC device 1301 in the subsequent communication process The length of the sent packet is:
在一个实施例中,第一NFCC13011用于判断是否由第一NFCC13011负责确定后续通信中所传输的数据包的最大长度值,如果是,则向第二NFC设备1302的第二NFCC13021发送包含第一长度值的第一请求,其中,该第一请求用于指示将第一NFC设备1301与第二NFC设备1302在后续通信中所传输的数据包的最大长度值调整为第一长度值,其中,该第一长度值是第一NFCC13011确定的一个值,且第一请求还可以包含第一DID。In one embodiment, the first NFCC 13011 is configured to determine whether the first NFCC 13011 is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication, and if so, transmitting the first NFCC 13021 to the second NFC device 1302 to include the first a first request of the length value, wherein the first request is used to indicate that the maximum length value of the data packet transmitted by the first NFC device 1301 and the second NFC device 1302 in the subsequent communication is adjusted to a first length value, where The first length value is a value determined by the first NFCC 13011, and the first request may further include the first DID.
第二NFCC13021用于判断是否由第二NFCC13021负责响应上述第一请求,当判断结果为是时,向第一NFCC13011发送针对上述第一请求的第一响应,当判断结果为否时,激活第二NFC设备1302上的第一RF接口,并向第二DH13022发送包含上述第一长度值的第一通知。The second NFCC 13021 is configured to determine whether the second NFCC 13021 is responsible for responding to the first request, and when the determination result is yes, send a first response to the first request to the first NFCC 13011, and when the determination result is no, activate the second The first RF interface on the NFC device 1302 transmits a first notification including the first length value to the second DH 13022.
第二DH13022用于当接收到上述第一通知时,判断上述第一通知中的第一长度值是否小于或等于上述第二长度值且是否小于或等于上述第三长度值,当判断结果为是时,向第二NFCC13021返回第二响应。The second DH 13022 is configured to determine, when the first notification is received, whether the first length value in the first notification is less than or equal to the second length value and is less than or equal to the third length value, when the determination result is yes At the time, a second response is returned to the second NFCC 13021.
第二NFCC13021还用于当接收到上述第二响应后将上述第二响应发送至第一NFCC13011。The second NFCC 13021 is further configured to send the second response to the first NFCC 13011 after receiving the second response.
第一NFCC13011还用于当接收到第二NFCC13021返回的响应且当该响应中包含的第二DID与上述第一请求中包含的第一DID相同时,将上述第一长度值作为第一NFC设备1301与第二NFC设备1302在后续通信中所传输的数据包的最大长度值,其中,该响应为上述第一响应或上述第二响应。The first NFCC 13011 is further configured to: when receiving the response returned by the second NFCC 13021 and when the second DID included in the response is the same as the first DID included in the first request, using the first length value as the first NFC device The maximum length value of the data packet transmitted by the 1301 and the second NFC device 1302 in the subsequent communication, wherein the response is the first response or the second response.
作为一种可选的实施方式,第一NFCC13011判断是否由第一NFCC13011负责确定后续通信中所传输的数据包的最大长度值的具体方式可以为:As an optional implementation manner, the specific manner in which the first NFCC 13011 determines whether the first NFCC 13011 is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication may be:
判断第一参数的值是否为第一特定值,其中,该第一特定值用于表示后续通信中所传输的数据包的最大长度值由第一NFCC13011负责确定,第一参数的值是第一NFCC13011的默认值(即可以理解为在NFC芯片出厂时设置到NFCC中的默认值),或者是由第一DH13012配置给第一NFCC13011的值,本发明实施例不做限定。Determining whether the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that the maximum length value of the data packet transmitted in the subsequent communication is determined by the first NFCC 13011, and the value of the first parameter is the first The default value of the NFCC 13011 (that is, it can be understood as the default value set in the NFCC when the NFC chip is shipped), or the value assigned to the first NFCC 13011 by the first DH 13012, is not limited in the embodiment of the present invention.
作为一种可选的实施方式,第一NFCC13011还可以用于在将上述第一长度值作为第一NFC设备1301与第二NFC设备1302在后续通信中所传输的数据包的最大长度值之后,向第一DH13012发送包含上述第一长度值的第二通知,其 中,该第二通知用于告知第一DH13012第一NFC设备1301的第二RF接口已经被激活,并通过该第二RF接口接收第一DH13012发送的数据消息,以上述第一长度值作为最大长度值将该数据消息中的负载封装成数据包并将该数据包发送至第二NFC设备1302的第二NFCC1321,其中,该数据包的长度值小于或等于上述第三长度值。As an optional implementation manner, the first NFCC 13011 may be further configured to use the first length value as the maximum length value of the data packet transmitted by the first NFC device 1301 and the second NFC device 1302 in subsequent communications, Transmitting, to the first DH 13012, a second notification including the first length value described above, The second notification is used to notify the first DH 13012 that the second RF interface of the first NFC device 1301 has been activated, and receives the data message sent by the first DH 13012 through the second RF interface, and the first length value is used as the maximum. The length value encapsulates the payload in the data message into a data packet and sends the data packet to the second NFCC 1321 of the second NFC device 1302, wherein the data packet has a length value less than or equal to the third length value.
在该可选的实施方式中,第一NFCC13011向向第一DH13012发送包含上述第一长度值的上述第二通知的目的是向第一DH13012上报第一NFC设备1301与第二NFC设备1302调整后的后续通信中所传输的数据包的最大长度值为上述第一长度值,以使第一DH13012获取到该第一长度值后可以在上层业务中进行使用,例如,估算本次通信中完成上层业务相关数据的传输所需要的时间是多少等等,以及通知第一DH13012上述第二RF接口已被激活,也就是说,第一NFCC13011已准备好接收第一DH13012发送的数据消息。其中,该数据消息可以是NCI规范中定义的Data Message(s),其中,在第一DH13012与第一NFCC13011之间传输Data Message(s)是通过传输Data Packet(s)实现的,且该数据消息中的负载(payload)携带的可以是上层业务相关的数据。In the optional implementation manner, the first NFCC 13011 sends the foregoing second notification that includes the foregoing first length value to the first DH 13012. The purpose of the first NFCC 13011 is to report the first NFC device 1301 and the second NFC device 1302 to the first DH 13012. The maximum length of the data packet transmitted in the subsequent communication is the first length value, so that the first DH 13012 can obtain the first length value and can be used in the upper layer service, for example, estimating the upper layer in the current communication. What is the time required for the transmission of the service related data, and the like, and notifying the first DH 13012 that the above second RF interface has been activated, that is, the first NFCC 13011 is ready to receive the data message transmitted by the first DH 13012. The data message may be a Data Message(s) defined in the NCI specification, where the Data Message(s) is transmitted between the first DH 13012 and the first NFCC 13011 by transmitting the Data Packet(s), and the data is implemented. The payload in the message may carry data related to the upper layer service.
作为一种可选的实施方式,第二NFCC13021判断是否由第二NFCC13021负责响应上述第一请求的具体方式可以为:As an optional implementation manner, the specific manner in which the second NFCC 13021 determines whether the second NFCC 13021 is responsible for responding to the foregoing first request may be:
判断第二NFCC13021中的第二参数的值是否为第二特定值,其中,该第二特定值用于表示由第二NFCC13021负责响应上述第一请求,且该第二特定值可以是第二NFCC13021的默认值(即可以理解为在NFC芯片出厂时设置到NFCC中的默认值),也可以是由第二DH13022配置给第二NFCC13021的值,本发明实施例不做限定。Determining whether the value of the second parameter in the second NFCC 13021 is a second specific value, wherein the second specific value is used to indicate that the second NFCC 13021 is responsible for responding to the first request, and the second specific value may be the second NFCC 13021 The default value (that is, it can be understood as the default value set in the NFCC when the NFC chip is shipped from the factory), or the value assigned to the second NFCC 13021 by the second DH 13022, which is not limited in the embodiment of the present invention.
作为一种可选的实施方式,第二NFCC13021还可以用于在向第一NFCC13011发送针对上述第一请求的第一响应之后且该第一响应中包含的第一DID与上述第一请求中包含的第二DID相同时,将上述第一长度值通过第三通知发送至第二DH13022。As an optional implementation manner, the second NFCC 13021 may be further configured to: after the first response to the first request is sent to the first NFCC 13011, and the first DID included in the first response is included in the first request When the second DIDs are the same, the first length value is sent to the second DH 13022 through the third notification.
需要说明的是,本发明实施例中,上述数据消息和数据包分别与前面实施例所述的数据消息和数据包相同,这里不再赘述。It should be noted that, in the embodiment of the present invention, the data message and the data packet are the same as the data message and the data packet described in the foregoing embodiments, and details are not described herein again.
可选的,上述第一请求可以为Digital规范中定义的PSL_REQ,上述第一响应及上述第二响应可以为该Digital规范中定义的PSL_RES,上述第一RF接口以 及上述第二RF接口可以为NCI规范中定义的NFC-DEP射频接口,上述第一通知、第二通知以及第三通知可以为该NCI规范中定义的RF_INTF_ACTIVATED_NTF,本发明实施例不做限定。Optionally, the first request may be a PSL_REQ defined in the Digital specification, and the first response and the second response may be a PSL_RES defined in the Digital specification, where the first RF interface is The foregoing second RF interface may be an NFC-DEP radio interface defined in the NCI specification, and the first notification, the second notification, and the third notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
可选的,上述第一请求可以为Digital规范中定义的RATS Command或ATTRIB Command,上述第一响应以及上述第二响应可以为该Digital规范中定义的RATS Response或ATTRIB Response,上述第一RF接口以及上述第二RF接口可以为NCI规范中定义的ISO-DEP射频接口或NDEF射频接口,且上述第一通知、上述第二通知以及上述第三通知可以为该NCI规范中定义的RF_INTF_ACTIVATED_NTF,本发明实施例不做限定。Optionally, the foregoing first request may be a RATS Command or an ATTRIB Command defined in the Digital specification, and the foregoing first response and the second response may be a RATS Response or an ATTRIB Response defined in the Digital specification, and the foregoing first RF interface and The foregoing second RF interface may be an ISO-DEP radio interface or an NDEF radio interface defined in the NCI specification, and the first notification, the second notification, and the third notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, and the implementation of the present invention The example is not limited.
在另一个实施例中,第一NFCC13011用于接收第一DH13012发送的包含第一长度值的调整命令,其中,该调整命令用于指示第一NFCC13011调整后续通信过程中所传输的数据包的最大长度值,如果是,向第二NFCC13021发送包含第一长度值的第一请求,其中,该第一请求用于指示将第一NFC设备1301与第二NFC设备1302后续通信中所传输的数据包的最大长度值调整为第一长度值,且该第一请求还可以包含第一DID。In another embodiment, the first NFCC 13011 is configured to receive an adjustment command that is sent by the first DH 13012 and includes a first length value, where the adjustment command is used to instruct the first NFCC 13011 to adjust a maximum of data packets transmitted during a subsequent communication. a length value, if yes, transmitting a first request including a first length value to the second NFCC 13021, wherein the first request is for indicating a data packet transmitted in a subsequent communication between the first NFC device 1301 and the second NFC device 1302 The maximum length value is adjusted to a first length value, and the first request may further include a first DID.
第二NFCC13021用于判断是否由第二NFCC13021负责响应上述第一请求,当判断结果为是时,向第一NFCC13011发送针对上述第一请求的第一响应,当判断结果为否时,激活第二NFC设备1302上的第一RF接口,并向第二DH13022发送包含上述第一长度值的第一通知。The second NFCC 13021 is configured to determine whether the second NFCC 13021 is responsible for responding to the first request, and when the determination result is yes, send a first response to the first request to the first NFCC 13011, and when the determination result is no, activate the second The first RF interface on the NFC device 1302 transmits a first notification including the first length value to the second DH 13022.
第二DH13022用于当接收到上述第一通知时,判断上述第一通知中的第一长度值是否小于或等于上述第二长度值且是否小于或等于上述第三长度值,当判断结果为是时,向第二NFCC13021返回第二响应。The second DH 13022 is configured to determine, when the first notification is received, whether the first length value in the first notification is less than or equal to the second length value and is less than or equal to the third length value, when the determination result is yes At the time, a second response is returned to the second NFCC 13021.
第二NFCC13021还用于当接收到上述第二响应后将上述第二响应发送至第一NFCC13011。The second NFCC 13021 is further configured to send the second response to the first NFCC 13011 after receiving the second response.
第一NFCC13011还用于接收第二NFCC13021返回的响应且当该响应中包含的第二DID与上述第一请求中包含的第一DID相同时,将上述第一长度值作为第一NFC设备1301与第二NFC设备1302在后续通信中所传输的数据包的最大长度值,其中,该响应为上述第一响应或上述第二响应。The first NFCC 13011 is further configured to receive the response returned by the second NFCC 13021 and when the second DID included in the response is the same as the first DID included in the first request, the first length value is used as the first NFC device 1301 The maximum length value of the data packet transmitted by the second NFC device 1302 in the subsequent communication, wherein the response is the first response or the second response.
作为一种可选的实施方式,第一NFCC13011还可以用于在将上述第一长度值作为后续通信过程中所传输的数据包的最大长度值之后,向第一DH13012 发送包含状态指示和/或上述第一长度值的调整响应,该状态指示用于第一NFCC13011已将上述最大长度值调整为上述第一长度值。As an optional implementation manner, the first NFCC 13011 may be further configured to: after the foregoing first length value is used as a maximum length value of the data packet transmitted in the subsequent communication process, to the first DH 13012 And transmitting an adjustment response including a status indication and/or the first length value, the status indication indicating that the first NFCC 13011 has adjusted the maximum length value to the first length value.
作为一种可选的实施方式,当第一NFCC13011还可以用于在将上述第一长度值作为后续通信过程中所传输的数据包的最大长度值之后,向第一DH13012发送包含状态指示和/或上述第一长度值的调整响应时,第一NFCC13011还可以用于在接收第一DH13012发送的包含第一长度值的调整命令之前,激活第一NFC设备1301上的第二RF接口,并向第一DH13011发送第二通知,该第二通知用于告知第一DH13011第二RF接口已被激活。As an optional implementation manner, when the first NFCC 13011 is further configured to send the first length value as the maximum length value of the data packet transmitted in the subsequent communication process, the first DH 13012 is sent with the status indication and/or Or the first NFCC 13011 may be configured to activate the second RF interface on the first NFC device 1301 before receiving the adjustment command including the first length value sent by the first DH 13012, and The first DH 13011 sends a second notification for informing the first DH 13011 that the second RF interface has been activated.
在该可选的实施方式中,进一步可选的,第一NFCC13011,还可以用于通过上述第二RF接口接收第一DH13012发送的第一数据消息,以上述第一长度值作为最大长度值将该第一数据消息中的负载封装成第一数据包,并将该第一数据包发送至第二NFC设备1302的第二NFCC13022,其中,该第一数据包的最长度值小于或等于上述第一长度值。In the optional implementation, the first NFCC 13011 is further configured to receive, by using the foregoing second RF interface, the first data message sent by the first DH 13012, where the first length value is used as the maximum length value. The load in the first data message is encapsulated into a first data packet, and the first data packet is sent to the second NFCC 13022 of the second NFC device 1302, where a maximum length value of the first data packet is less than or equal to the foregoing A length value.
作为另一种可选的实施方式,第一NFCC13011还可以用于在向第二NFCC13021发送上述第一请求之前,确定上述第一长度值小于或等于上述第二长度值且小于或等于上述第三长度值。As another optional implementation manner, the first NFCC 13011 may be further configured to: before sending the foregoing first request to the second NFCC 13021, determining that the first length value is less than or equal to the second length value and less than or equal to the third Length value.
在该可选的实施方式中,进一步可选的,第一NFCC13011还可以用于向第一DH13012发送的第三通知,该第三通知用于告知第一DH13012第三RF接口已被激活,并通过该第三RF接口接收第一DH13012发送的第二数据消息,以上述第一长度值作为最大长度值将该第二数据消息中的负载封装成第二数据包并将该第二数据包发送至第二NFC设备1302的第二NFCC13021中,其中,该第二数据包的长度值小于或等于上述第一长度值。In this optional embodiment, further optionally, the first NFCC 13011 is further configured to send a third notification to the first DH 13012, where the third notification is used to notify the first DH 13012 that the third RF interface has been activated, and Receiving, by the third RF interface, the second data message sent by the first DH 13012, using the first length value as the maximum length value to encapsulate the load in the second data message into a second data packet, and sending the second data packet In the second NFCC 13021 of the second NFC device 1302, wherein the length value of the second data packet is less than or equal to the first length value.
作为一种可选的实施方式,第二NFCC13021判断是否由第二NFCC13021负责响应上述第一请求的具体方式可以为:As an optional implementation manner, the specific manner in which the second NFCC 13021 determines whether the second NFCC 13021 is responsible for responding to the foregoing first request may be:
判断第二NFCC13021中的第一参数的值是否为第一特定值,其中,该第一特定值用于表示由第二NFCC13021负责响应上述第一请求,且该第二特定值可以是第二NFCC13021的默认值(即可以理解为在NFC芯片出厂时设置到NFCC中的默认值),也可以是由第二DH13022配置给第二NFCC13021的值,本发明实施例不做限定。Determining whether the value of the first parameter in the second NFCC 13021 is a first specific value, wherein the first specific value is used to indicate that the second NFCC 13021 is responsible for responding to the first request, and the second specific value may be the second NFCC 13021 The default value (that is, it can be understood as the default value set in the NFCC when the NFC chip is shipped from the factory), or the value assigned to the second NFCC 13021 by the second DH 13022, which is not limited in the embodiment of the present invention.
需要说明的是,本发明实施例中的上述第一参数、第一特定值,与上述发 明实施例中的第一参数、第一特定值可以是不同的。此外,上述第三通知可以包含上述第一长度值,也可以不包含;上述第一数据消息与第二数据消息、上述第一数据包与第二数据包与前面实施例所述的数据消息、数据包分别相同,这里不再赘述。It should be noted that, in the embodiment of the present invention, the first parameter, the first specific value, and the foregoing The first parameter, the first specific value in the embodiment may be different. In addition, the third notification may include the first length value, or may not include; the first data message and the second data message, the first data packet and the second data packet, and the data message described in the foregoing embodiment, The data packets are the same, and will not be described here.
作为一种可选的实施方式,第二NFCC13021还可以用于在向第一NFCC13011发送针对上述第一请求的第一响应之后且该第一响应中包含的第二DID与上述第一请求中包含的第一DID相同时,将上述第一长度值通过第四通知发送至第二DH13022。As an optional implementation manner, the second NFCC 13021 may be further configured to: after the first response to the first request is sent to the first NFCC 13011, and the second DID included in the first response is included in the first request When the first DIDs are the same, the first length value is sent to the second DH 13022 through the fourth notification.
作为一种可选的实施方式,上述第一请求可以为Digital规范中定义的PSL_REQ,上述第一响应及上述第二响应可以为该Digital规范中定义的PSL_RES,上述第一RF接口、上述第二RF接口以及上述第三RF接口可以为NCI规范中定义的NFC-DEP射频接口,上述第一通知、第二通知、第三通知以及第四通知可以为该NCI规范中定义的RF_INTF_ACTIVATED_NTF,本发明实施例不做限定。As an optional implementation manner, the first request may be a PSL_REQ defined in the Digital specification, and the first response and the second response may be a PSL_RES defined in the Digital specification, the first RF interface, and the second The RF interface and the foregoing third RF interface may be an NFC-DEP radio interface defined in the NCI specification, and the first notification, the second notification, the third notification, and the fourth notification may be RF_INTF_ACTIVATED_NTF defined in the NCI specification, and the implementation of the present invention The example is not limited.
作为另一种可选的实施方式,上述第一请求可以为Digital规范中定义的RATS Command或ATTRIB Command,上述第一响应以及上述第二响应可以为该Digital规范中定义的RATS Response或ATTRIB Response,上述第一RF接口、上述第二RF接口以及上述第三RF接口可以为NCI规范中定义的ISO-DEP射频接口或NDEF射频接口,且上述第一通知、上述第二通知、上述第三通知以及上述第四通知可以为该NCI规范中定义的RF_INTF_ACTIVATED_NTF,本发明实施例不做限定。As another optional implementation manner, the foregoing first request may be a RATS Command or an ATTRIB Command defined in the Digital specification, and the first response and the second response may be a RATS Response or an ATTRIB Response defined in the Digital specification. The first RF interface, the second RF interface, and the third RF interface may be an ISO-DEP radio interface or an NDEF radio interface defined in the NCI specification, and the first notification, the second notification, the third notification, and the foregoing The foregoing fourth notification may be the RF_INTF_ACTIVATED_NTF defined in the NCI specification, which is not limited in the embodiment of the present invention.
可见,实施本发明实施例能够通过NCI规范实现作为发起方的第一NFC设备通过其NFCC与作为目标方的第二NFC设备调整后续通信过程中的通信数据包的最大长度值的功能。需要说明的是,在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详细描述的部分,可以参见其他实施例的相关描述。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。It can be seen that the embodiment of the present invention can implement the function of the first NFC device as the initiator through the NCI specification to adjust the maximum length value of the communication data packet in the subsequent communication process through the NFCC and the second NFC device as the target party. It should be noted that, in the above embodiments, the descriptions of the various embodiments are different, and the parts that are not described in detail in a certain embodiment may be referred to the related descriptions of other embodiments. In addition, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
本发明实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。The steps in the method of the embodiment of the present invention may be sequentially adjusted, merged, and deleted according to actual needs.
本发明实施例NFCC中的模块可以根据实际需要进行合并、划分和删减。 The modules in the NFCC of the embodiment of the present invention may be combined, divided, and deleted according to actual needs.
本发明实施例中所述模块,可以通过通用集成电路,例如CPU(Central Processing Unit,中央处理器),或通过ASIC(Application Specific Integrated Circuit,专用集成电路)来实现。The module in the embodiment of the present invention may be implemented by a general-purpose integrated circuit, such as a CPU (Central Processing Unit) or an ASIC (Application Specific Integrated Circuit).
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。A person skilled in the art can understand that all or part of the process of implementing the above embodiment method can be completed by a computer program to instruct related hardware, and the program can be stored in a computer readable storage medium. When executed, the flow of an embodiment of the methods as described above may be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
以上对本发明实施例公开的一一种调整近场通信NFC中数据包长度的方法、装置及系统进行了详细介绍,本文中应用了具体实例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。 The method, device and system for adjusting the data packet length in the near field communication NFC disclosed in the embodiment of the present invention are described in detail. The principles and implementation manners of the present invention are described in the specific examples. The description is only for helping to understand the present invention and its core ideas; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific embodiments and application scopes. The contents of this specification are not to be construed as limiting the invention.

Claims (37)

  1. 一种调整近场通信NFC中数据包长度的方法,其特征在于,所述方法包括:A method for adjusting a data packet length in a near field communication NFC, the method comprising:
    第一NFC设备的NFCC判断是否由所述NFCC负责确定后续通信中所传输的数据包的最大长度值;The NFCC of the first NFC device determines whether the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication;
    如果是由所述NFCC负责确定后续通信中所传输的数据包的最大长度值,则所述NFCC向第二NFC设备发送包含第一长度值的第一请求,所述第一请求用于指示将所述第一NFC设备与所述第二NFC设备在后续通信中所传输的数据包的最大长度值调整为所述第一长度值,且所述第一请求还包含第一设备标识DID,所述第一长度值是所述NFCC确定的一个值;If the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication, the NFCC sends a first request including the first length value to the second NFC device, the first request is used to indicate that The maximum length value of the data packet transmitted by the first NFC device and the second NFC device in the subsequent communication is adjusted to the first length value, and the first request further includes a first device identifier DID, where The first length value is a value determined by the NFCC;
    所述NFCC接收所述第二NFC设备针对所述第一请求返回的第一响应,所述第一响应包含第二DID;The NFCC receives a first response returned by the second NFC device for the first request, and the first response includes a second DID;
    如果所述第一DID与所述第二DID相同,则所述NFCC将所述第一长度值作为后续通信中所传输的数据包的最大长度值。If the first DID is the same as the second DID, the NFCC uses the first length value as the maximum length value of the data packet transmitted in the subsequent communication.
  2. 根据权利要求1所述的方法,其特征在于,所述判断是否由所述NFCC负责确定后续通信中所传输的数据包的最大长度值,包括:The method according to claim 1, wherein said determining whether said NFCC is responsible for determining a maximum length value of a data packet transmitted in a subsequent communication comprises:
    判断第一参数的值是否为第一特定值,所述第一特定值用于表示后续通信中所传输的数据包的最大长度值由所述NFCC负责确定,其中,所述第一参数的值是所述NFCC的默认值,或者是由所述第一NFC设备的主机DH配置给所述NFCC的值。Determining whether the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that a maximum length value of the data packet transmitted in the subsequent communication is determined by the NFCC, wherein the value of the first parameter Is the default value of the NFCC, or is the value assigned to the NFCC by the host DH of the first NFC device.
  3. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    所述NFCC向所述第一NFC设备的DH发送包含所述第一长度值的第一通知,所述第一通知用于告知所述DH第一射频RF接口已被激活;Transmitting, by the NFCC, a first notification that includes the first length value to a DH of the first NFC device, where the first notification is used to notify that the DH first radio frequency RF interface has been activated;
    所述NFCC通过所述第一RF接口接收所述DH发送的数据消息,并以所述第一长度值作为所述最大长度值将所述数据消息中的负载封装成数据包;Receiving, by the NFCC, the data message sent by the DH by using the first RF interface, and encapsulating the load in the data message into a data packet by using the first length value as the maximum length value;
    所述NFCC将所述数据包发送至所述第二NFC设备。The NFCC sends the data packet to the second NFC device.
  4. 根据权利要求2所述的方法,其特征在于,所述方法还包括: The method of claim 2, wherein the method further comprises:
    所述NFCC向所述DH发送包含所述第一长度值的第一通知,所述第一通知用于告知所述DH第一射频RF接口已被激活;The NFCC sends a first notification including the first length value to the DH, where the first notification is used to notify the DH that the first radio frequency RF interface has been activated;
    所述NFCC通过所述第一RF接口接收所述DH发送的数据消息,并以所述第一长度值作为所述最大长度值将所述数据消息中的负载封装成数据包;Receiving, by the NFCC, the data message sent by the DH by using the first RF interface, and encapsulating the load in the data message into a data packet by using the first length value as the maximum length value;
    所述NFCC将所述数据包发送至所述第二NFC设备。The NFCC sends the data packet to the second NFC device.
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 4, wherein the method further comprises:
    如果不由所述NFCC负责确定后续通信中所传输的数据包的最大长度值,则所述NFCC不向所述第二NFC设备发送包含所述第一长度值的所述第一请求。If the NFCC is not responsible for determining the maximum length value of the data packet transmitted in the subsequent communication, the NFCC does not send the first request including the first length value to the second NFC device.
  6. 根据权利要求3或4所述的方法,其特征在于,所述第一请求是Digital规范中定义的参数选择请求PSL_REQ;The method according to claim 3 or 4, wherein the first request is a parameter selection request PSL_REQ defined in the Digital specification;
    所述第一响应是所述Digital规范中定义的参数选择响应PSL_RES;The first response is a parameter selection response PSL_RES defined in the Digital specification;
    所述第一RF接口是NFC控制器接口NCI规范中定义的近场通信数据交换协议NFC-DEP射频接口;The first RF interface is a near field communication data exchange protocol NFC-DEP radio frequency interface defined in an NFC controller interface NCI specification;
    所述第一通知是所述NCI规范中定义的射频接口激活通知RF_INTF_ACTIVATED_NTF。The first notification is a radio frequency interface activation notification RF_INTF_ACTIVATED_NTF defined in the NCI specification.
  7. 一种调整近场通信NFC中数据包长度的方法,其特征在于,所述方法包括:A method for adjusting a data packet length in a near field communication NFC, the method comprising:
    第一NFC设备的NFCC接收所述第一NFC设备的DH发送的包含第一长度值的调整命令,所述调整命令用于指示所述NFCC调整后续通信过程中所传输的数据包的最大长度值;The NFCC of the first NFC device receives an adjustment command including a first length value sent by the DH of the first NFC device, where the adjustment command is used to instruct the NFCC to adjust a maximum length value of a data packet transmitted during a subsequent communication process. ;
    所述NFCC向第二NFC设备发送包含所述第一长度值的第一请求,所述第一请求用于指示将所述第一NFC设备与所述第二NFC设备后续通信过程中所传输的数据包的最大长度值调整为所述第一长度值,所述第一请求还包含第一DID;Sending, by the NFCC, a first request including the first length value to a second NFC device, where the first request is used to indicate that the first NFC device is transmitted during subsequent communication with the second NFC device The maximum length value of the data packet is adjusted to the first length value, and the first request further includes a first DID;
    所述NFCC接收所述第二NFC设备针对所述第一请求返回的第一响应,所述第一响应包含第二DID; The NFCC receives a first response returned by the second NFC device for the first request, and the first response includes a second DID;
    如果所述第一DID与所述第二DID相同,则所述NFCC将所述第一长度值作为后续通信中所传输的数据包的最大长度值。If the first DID is the same as the second DID, the NFCC uses the first length value as the maximum length value of the data packet transmitted in the subsequent communication.
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:The method of claim 7, wherein the method further comprises:
    所述NFCC向所述DH发送包含状态指示和/或所述第一长度值的调整响应,所述状态指示用于表示所述NFCC已将所述最大长度值调整为所述第一长度值。The NFCC sends an adjustment response including a status indication and/or the first length value to the DH, the status indication indicating that the NFCC has adjusted the maximum length value to the first length value.
  9. 根据权利要求8所述的方法,其特征在于,所述接收所述第一NFC设备的DH发送的包含第一长度值的调整命令之前,所述方法还包括:The method according to claim 8, wherein before the receiving the adjustment command including the first length value sent by the DH of the first NFC device, the method further includes:
    所述NFCC激活第一RF接口,并向所述DH发送第一通知,所述第一通知用于告知所述DH所述第一RF接口已被激活。The NFCC activates a first RF interface and sends a first notification to the DH, the first notification being used to inform the DH that the first RF interface has been activated.
  10. 根据权利要求8所述的方法,其特征在于,所述向第二NFC设备发送包含所述第一长度值的第一请求之前,所述方法还包括:The method according to claim 8, wherein before the sending the first request including the first length value to the second NFC device, the method further comprises:
    所述NFCC确定所述第一长度值小于或等于第二长度值且小于或等于第三长度值。The NFCC determines that the first length value is less than or equal to a second length value and less than or equal to a third length value.
  11. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method of claim 9 wherein the method further comprises:
    所述NFCC通过所述第一RF接口接收所述DH发送的第一数据消息,并以所述第一长度值作为所述最大长度值将所述第一数据消息中的负载封装成第一数据包;The NFCC receives the first data message sent by the DH by using the first RF interface, and encapsulates the load in the first data message into the first data by using the first length value as the maximum length value. package;
    所述NFCC将所述第一数据包发送至所述第二NFC设备。The NFCC sends the first data packet to the second NFC device.
  12. 根据权利要求10所述的方法,其特征在于,所述方法还包括:The method of claim 10, wherein the method further comprises:
    所述NFCC向所述DH发送第二通知,所述第二通知用于告知所述DH第二RF接口已被激活;The NFCC sends a second notification to the DH, where the second notification is used to notify that the DH second RF interface has been activated;
    所述NFCC通过所述第二RF接口接收所述DH发送的第二数据消息,并以所述第一长度值作为所述最大长度值将所述第二数据消息中的负载封装成第二数据包; Receiving, by the NFCC, the second data message sent by the DH by using the second RF interface, and encapsulating the load in the second data message into the second data by using the first length value as the maximum length value Package
    所述NFCC将所述第二数据包发送至所述第二NFC设备。The NFCC sends the second data packet to the second NFC device.
  13. 根据权利要求9所述的方法,其特征在于,所述第一请求是Digital规范中定义的PSL_REQ;The method according to claim 9, wherein said first request is PSL_REQ defined in the Digital specification;
    所述第一响应是所述Digital规范中定义的PSL_RES;The first response is a PSL_RES defined in the Digital specification;
    所述第一RF接口是NCI规范中定义的NFC-DEP射频接口;The first RF interface is an NFC-DEP radio frequency interface defined in an NCI specification;
    所述第一通知是所述NCI规范中定义的RF_INTF_ACTIVATED_NTF。The first notification is RF_INTF_ACTIVATED_NTF defined in the NCI specification.
  14. 一种NFCC,其特征在于,所述NFCC为第一NFC设备中的NFCC,所述NFCC包括判断模块、通信模块以及确定模块,其中:An NFCC, wherein the NFCC is an NFCC in a first NFC device, the NFCC includes a judging module, a communication module, and a determining module, where:
    所述判断模块,用于判断是否由所述NFCC负责确定后续通信中所传输的数据包的最大长度值;The determining module is configured to determine whether the NFCC is responsible for determining a maximum length value of the data packet transmitted in the subsequent communication;
    所述通信模块,用于当所述判断模块的判断结果为是时,向第二NFC设备发送包含第一长度值的第一请求,并接收所述第二NFC设备针对所述第一请求返回的第一响应,所述第一请求用于指示将所述第一NFC设备与所述第二NFC设备在后续通信中所传输的数据包的最大长度值调整为所述第一长度值,且所述第一请求还包含第一DID,所述第一响应包含第二DID,所述第一长度值是所述NFCC确定的一个值;The communication module is configured to: when the determination result of the determining module is yes, send a first request including a first length value to the second NFC device, and receive the second NFC device to return for the first request a first response, the first request is used to indicate that a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication is adjusted to the first length value, and The first request further includes a first DID, the first response includes a second DID, and the first length value is a value determined by the NFCC;
    所述确定模块,用于当所述第一DID与所述第二DID相同时,将所述第一长度值作为后续通信中所传输的数据包的最大长度值。The determining module is configured to use the first length value as a maximum length value of a data packet transmitted in a subsequent communication when the first DID is the same as the second DID.
  15. 根据权利要求14所述的NFCC,其特征在于,所述判断模块判断是否由所述NFCC负责确定后续通信中所传输的数据包的最大长度值的具体方式为:The NFCC according to claim 14, wherein the determining module determines whether the NFCC is responsible for determining the maximum length value of the data packet transmitted in the subsequent communication:
    判断第一参数的值是否为第一特定值,所述第一特定值用于表示后续通信中所传输的数据包的最大长度值由所述NFCC负责确定,其中,所述第一参数的值是所述NFCC的默认值,或者是由所述第一NFC设备的DH配置给所述NFCC的值。Determining whether the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that a maximum length value of the data packet transmitted in the subsequent communication is determined by the NFCC, wherein the value of the first parameter Is the default value of the NFCC, or is the value assigned to the NFCC by the DH of the first NFC device.
  16. 根据权利要求14所述的NFCC,其特征在于,所述通信模块,还用于 向所述第一NFC设备的DH发送包含所述第一长度值的第一通知,所述第一通知用于告知所述DH第一射频RF接口已被激活,并通过所述第一RF接口接收所述DH发送的数据消息;The NFCC according to claim 14, wherein said communication module is further used for Transmitting, to the DH of the first NFC device, a first notification that includes the first length value, the first notification is used to notify the DH that the first radio frequency RF interface has been activated, and passes the first RF interface Receiving a data message sent by the DH;
    所述NFCC还包括封装模块,其中:The NFCC also includes a package module, wherein:
    所述封装模块,用于以所述第一长度值作为所述最大长度值将所述数据消息中的负载封装成数据包;The encapsulating module is configured to encapsulate the load in the data message into a data packet by using the first length value as the maximum length value;
    所述通信模块,还用于将所述数据包发送至所述第二NFC设备。The communication module is further configured to send the data packet to the second NFC device.
  17. 根据权利要求15所述的NFCC,其特征在于,所述通信模块,还用于向所述DH发送包含所述第一长度值的第一通知,所述第一通知用于告知所述DH第一射频RF接口已被激活,并通过所述第一RF接口接收所述DH发送的数据消息;The NFCC according to claim 15, wherein the communication module is further configured to send a first notification including the first length value to the DH, where the first notification is used to notify the DH An RF RF interface has been activated, and receives the data message sent by the DH through the first RF interface;
    所述NFCC还包括封装模块,其中:The NFCC also includes a package module, wherein:
    所述封装模块,用于以所述第一长度值作为所述最大长度值将所述数据消息中的负载封装成数据包;The encapsulating module is configured to encapsulate the load in the data message into a data packet by using the first length value as the maximum length value;
    所述通信模块,还用于将所述数据包发送至所述第二NFC设备。The communication module is further configured to send the data packet to the second NFC device.
  18. 根据权利要求16或17所述的NFCC,其特征在于,所述第一请求是Digital规范中定义的PSL_REQ;The NFCC according to claim 16 or 17, wherein said first request is PSL_REQ defined in the Digital specification;
    所述第一响应是所述Digital规范中定义的PSL_RES;The first response is a PSL_RES defined in the Digital specification;
    所述第一RF接口是NCI规范中定义的NFC-DEP射频接口;The first RF interface is an NFC-DEP radio frequency interface defined in an NCI specification;
    所述第一通知是所述NCI规范中定义的RF_INTF_ACTIVATED_NTF。The first notification is RF_INTF_ACTIVATED_NTF defined in the NCI specification.
  19. 一种NFCC,其特征在于,所述NFCC为第一NFC设备中的NFCC,所述NFCC包括通信模块以及确定模块,其中:An NFCC, characterized in that the NFCC is an NFCC in a first NFC device, the NFCC comprising a communication module and a determining module, wherein:
    所述通信模块,用于接收所述第一NFC设备的DH发送的包含第一长度值的调整命令,所述调整命令用于指示所述NFCC调整后续通信过程中所传输的数据包的最大长度值;The communication module is configured to receive an adjustment command including a first length value sent by the DH of the first NFC device, where the adjustment command is used to instruct the NFCC to adjust a maximum length of a data packet transmitted during a subsequent communication process. value;
    所述通信模块,还用于向第二NFC设备发送包含所述第一长度值的第一请求,并接收所述第二NFC设备针对所述第一请求返回的第一响应,所述第一请 求用于指示将所述第一NFC设备与所述第二NFC设备后续通信过程中所传输的数据包的最大长度值调整为所述第一长度值,所述第一请求还包含括第一DID,所述第一响应包含第二DID;The communication module is further configured to send a first request that includes the first length value to a second NFC device, and receive a first response that is returned by the second NFC device for the first request, the first please And determining to adjust a maximum length value of the data packet transmitted during the subsequent communication between the first NFC device and the second NFC device to the first length value, where the first request further includes the first DID, the first response includes a second DID;
    所述确定模块,用于当所述第一DID与所述第二DID相同时,将所述第一长度值作为后续通信中所传输的数据包的最大长度值。The determining module is configured to use the first length value as a maximum length value of a data packet transmitted in a subsequent communication when the first DID is the same as the second DID.
  20. 根据权利要求19所述的NFCC,其特征在于,所述通信模块,还用于向所述DH发送包含状态指示和/或所述第一长度值的调整响应,所述状态指示用于表示所述NFCC已将所述最大长度值调整为所述第一长度值。The NFCC according to claim 19, wherein the communication module is further configured to send, to the DH, an adjustment response including a status indication and/or the first length value, the status indication being used to indicate The NFCC has adjusted the maximum length value to the first length value.
  21. 根据权利要求20所述的NFCC,其特征在于,所述NFCC还包括激活模块,其中:The NFCC of claim 20 wherein said NFCC further comprises an activation module, wherein:
    所述激活模块,用于在所述通信模块接收所述第一NFC设备的DH发送的包含第一长度值的调整命令之前,激活第一RF接口;The activation module is configured to activate the first RF interface before the communication module receives the adjustment command including the first length value sent by the DH of the first NFC device;
    所述通信模块,还用于向所述DH发送第一通知,所述第一通知用于告知所述DH所述第一RF接口已被激活。The communication module is further configured to send a first notification to the DH, where the first notification is used to notify the DH that the first RF interface has been activated.
  22. 根据权利要求20所述的NFCC,其特征在于,所述确定模块,还用于在所述通信模块向所述第二NFC设备发送包括所述第一长度值的所述第一请求之前,确定所述第一长度值小于或等于第二长度值且小于或等于第三长度值。The NFCC according to claim 20, wherein the determining module is further configured to: before the communication module sends the first request including the first length value to the second NFC device, The first length value is less than or equal to the second length value and less than or equal to the third length value.
  23. 根据权利要求21所述的NFCC,其特征在于,所述通信模块,还用于通过所述第一RF接口接收所述DH发送的第一数据消息;The NFCC according to claim 21, wherein the communication module is further configured to receive, by using the first RF interface, a first data message sent by the DH;
    所述NFCC还包括第一封装模块,其中:The NFCC also includes a first encapsulation module, wherein:
    所述第一封装模块,用于以所述第一长度值作为所述最大长度值将所述第一数据消息中的负载封装成第一数据包;The first encapsulating module is configured to encapsulate the load in the first data message into a first data packet by using the first length value as the maximum length value;
    所述通信模块,还用于将所述第一数据包发送至所述第二NFC设备。The communication module is further configured to send the first data packet to the second NFC device.
  24. 根据权利要求22所述的NFCC,其特征在于,所述通信模块,还用于 向所述DH发送第二通知,所述第二通知用于告知所述DH第二RF接口已被激活,并通过所述第二RF接口接收所述DH发送的第二数据消息;The NFCC according to claim 22, wherein said communication module is further used for Transmitting, to the DH, a second notification, where the second notification is used to notify that the DH second RF interface has been activated, and receiving, by using the second RF interface, the second data message sent by the DH;
    所述NFCC还包括第二封装模块,其中:The NFCC further includes a second encapsulation module, wherein:
    所述第二封装模块,用于以所述第一长度值作为所述最大长度值将所述第二数据消息中的负载封装成第二数据包;The second encapsulating module is configured to encapsulate the load in the second data message into a second data packet by using the first length value as the maximum length value;
    所述通信模块,还用于将所述第二数据包发送至所述第二NFC设备。The communication module is further configured to send the second data packet to the second NFC device.
  25. 根据权利要求21所述的NFCC,其特征在于,所述第一请求是Digital规范中定义的PSL_REQ;The NFCC according to claim 21, wherein said first request is PSL_REQ defined in the Digital specification;
    所述第一响应是所述Digital规范中定义的PSL_RES;The first response is a PSL_RES defined in the Digital specification;
    所述第一RF接口是NCI规范中定义的NFC-DEP射频接口;The first RF interface is an NFC-DEP radio frequency interface defined in an NCI specification;
    所述第一通知是所述NCI规范中定义的RF_INTF_ACTIVATED_NTF。The first notification is RF_INTF_ACTIVATED_NTF defined in the NCI specification.
  26. 一种NFCC,包括处理器以及通信装置,其特征在于,An NFCC comprising a processor and a communication device, characterized in that
    所述处理器,用于判断是否由所述NFCC负责确定后续通信中所传输的数据包的最大长度值;The processor is configured to determine whether the NFCC is responsible for determining a maximum length value of a data packet transmitted in a subsequent communication;
    所述通信装置,用于当所述处理器的判断结果为是时,向第二NFC设备发送包含第一长度值的第一请求,并接收所述第二NFC设备针对所述第一请求返回的第一响应,所述第一请求用于指示将第一NFC设备与所述第二NFC设备在后续通信中所传输的数据包的最大长度值调整为所述第一长度值,所述第一长度值是所述NFCC确定的一个值,所述第一请求还包含第一DID,所述第一响应包含第二DID;The communication device is configured to: when the determination result of the processor is yes, send a first request including a first length value to the second NFC device, and receive the second NFC device to return for the first request a first response, the first request is used to indicate that a maximum length value of a data packet transmitted by the first NFC device and the second NFC device in a subsequent communication is adjusted to the first length value, where a length value is a value determined by the NFCC, the first request further includes a first DID, and the first response includes a second DID;
    所述处理器,还用于当所述第一DID与所述第二DID相同时,将所述第一长度值作为后续通信中所传输的数据包的最大长度值。The processor is further configured to use, when the first DID is the same as the second DID, the first length value as a maximum length value of a data packet transmitted in a subsequent communication.
  27. 根据权利要求26所述的NFCC,其特征在于,所述判断是否由所述NFCC负责确定后续通信中所传输的数据包的最大长度值,包括:The NFCC according to claim 26, wherein said determining whether said NFCC is responsible for determining a maximum length value of a data packet transmitted in a subsequent communication comprises:
    判断第一参数的值是否为第一特定值,所述第一特定值用于表示后续通信中所传输的数据包的最大长度值由所述N FCC负责确定,其中,所述第一参数的值是所述NFCC的默认值,或者是由第一NFC设备DH配置给所述NFCC的值。 Determining whether the value of the first parameter is a first specific value, wherein the first specific value is used to indicate that a maximum length value of the data packet transmitted in the subsequent communication is determined by the N FCC, wherein the first parameter is determined by The value is the default value of the NFCC or the value assigned to the NFCC by the first NFC device DH.
  28. 根据权利要求26所述的NFCC,其特征在于,所述通信装置,还用于向第一NFC设备的DH发送包含所述第一长度值的第一通知,所述第一通知用于告知所述DH第一RF接口已被激活;The NFCC according to claim 26, wherein the communication device is further configured to send a first notification including the first length value to a DH of the first NFC device, where the first notification is used to notify the Said that the DH first RF interface has been activated;
    所述通信装置,还用于通过所述第一RF接口接收所述DH发送的数据消息;The communication device is further configured to receive, by using the first RF interface, a data message sent by the DH;
    所述处理器,还用于以所述第一长度值作为所述最大长度值将所述数据消息中的负载封装成数据包;The processor is further configured to encapsulate the load in the data message into a data packet by using the first length value as the maximum length value;
    所述通信装置,还用于将所述数据包发送至所述第二NFC设备。The communication device is further configured to send the data packet to the second NFC device.
  29. 根据权利要求27所述的NFCC,其特征在于,所述通信装置,还用于向所述DH发送包含所述第一长度值的第一通知,所述第一通知用于告知所述DH第一RF接口已被激活;The NFCC according to claim 27, wherein the communication device is further configured to send a first notification including the first length value to the DH, the first notification being used to notify the DH An RF interface has been activated;
    所述通信装置,还用于通过所述第一RF接口接收所述DH发送的数据消息;The communication device is further configured to receive, by using the first RF interface, a data message sent by the DH;
    所述处理器,还用于以所述第一长度值作为所述最大长度值将所述数据消息中的负载封装成数据包;The processor is further configured to encapsulate the load in the data message into a data packet by using the first length value as the maximum length value;
    所述通信装置,还用于将所述数据包发送至所述第二NFC设备。The communication device is further configured to send the data packet to the second NFC device.
  30. 根据权利要求28或29所述的NFCC,其特征在于,所述第一请求是Digital规范中定义的PSL_REQ;The NFCC according to claim 28 or 29, wherein said first request is PSL_REQ defined in the Digital specification;
    所述第一响应是所述Digital规范中定义的PSL_RES;The first response is a PSL_RES defined in the Digital specification;
    所述第一RF接口是NCI规范中定义的NFC-DEP射频接口;The first RF interface is an NFC-DEP radio frequency interface defined in an NCI specification;
    所述第一通知是所述NCI规范中定义的RF_INTF_ACTIVATED_NTF。The first notification is RF_INTF_ACTIVATED_NTF defined in the NCI specification.
  31. 一种NFCC,包括处理器以及通信装置,其特征在于,An NFCC comprising a processor and a communication device, characterized in that
    所述通信装置,用于接收第一NFC设备的DH发送的包含第一长度值的调整命令,所述调整命令用于指示所述NFCC调整后续通信过程中所传输的数据包的最大长度值;The communication device is configured to receive an adjustment command including a first length value sent by a DH of the first NFC device, where the adjustment command is used to instruct the NFCC to adjust a maximum length value of a data packet transmitted in a subsequent communication process;
    所述通信装置,还用于向第二NFC设备发送包含所述第一长度值的第一请 求,并接收所述第二NFC设备针对所述第一请求返回的第一响应,所述第一请求用于指示将所述第一NFC设备与所述第二NFC设备后续通信过程中所传输的数据包的最大长度值调整为所述第一长度值,所述第一请求还包含第一DID,所述第一响应包含第二DID;The communication device is further configured to send, to the second NFC device, the first request that includes the first length value And receiving, by the second NFC device, a first response returned by the first request, where the first request is used to indicate that the first NFC device is transmitted during subsequent communication with the second NFC device The maximum length value of the data packet is adjusted to the first length value, the first request further includes a first DID, and the first response includes a second DID;
    所述处理器,用于当所述第一DID与所述第二DID相同时,将所述第一长度值作为后续通信中所传输的数据包的最大长度值。The processor is configured to use the first length value as a maximum length value of a data packet transmitted in a subsequent communication when the first DID is the same as the second DID.
  32. 根据权利要求31所述的NFCC,其特征在于,所述通信装置,还用于向所述DH发送包含状态指示和/或所述第一长度值的调整响应,所述状态指示用于表示所述NFCC已将所述最大长度值调整为所述第一长度值。The NFCC according to claim 31, wherein the communication device is further configured to send, to the DH, an adjustment response including a status indication and/or the first length value, the status indication being used to indicate The NFCC has adjusted the maximum length value to the first length value.
  33. 根据权利要求32所述的NFCC,其特征在于,所述处理器,还用于在所述通信装置接收所述第一NFC设备的DH发送的包含第一长度值的调整命令之前,激活第一RF接口;The NFCC according to claim 32, wherein the processor is further configured to activate the first before the communication device receives the adjustment command including the first length value sent by the DH of the first NFC device. RF interface;
    所述通信装置,还用于向所述DH发送第一通知,所述第一通知用于告知所述DH所述第一RF接口已被激活。The communication device is further configured to send a first notification to the DH, where the first notification is used to notify the DH that the first RF interface has been activated.
  34. 根据权利要求32所述的NFCC,其特征在于,所述处理器,还用于在所述通信装置向所述第二NFC设备发送包括所述第一长度值的所述第一请求之前,确定所述第一长度值小于或等于第二长度值且小于或等于第三长度值。The NFCC according to claim 32, wherein said processor is further configured to determine before said communication device transmits said first request including said first length value to said second NFC device The first length value is less than or equal to the second length value and less than or equal to the third length value.
  35. 根据权利要求33所述的NFCC,其特征在于,所述通信装置,还用于通过所述第一RF接口接收所述DH发送的第一数据消息;The NFCC according to claim 33, wherein the communication device is further configured to receive, by using the first RF interface, a first data message sent by the DH;
    所述处理器,还用于以所述第一长度值作为所述最大长度值将所述第一数据消息中的负载封装成第一数据包;The processor is further configured to encapsulate the load in the first data message into a first data packet by using the first length value as the maximum length value;
    所述通信装置,还用于将所述第一数据包发送至所述第二NFC设备。The communication device is further configured to send the first data packet to the second NFC device.
  36. 根据权利要求34所述的NFCC,其特征在于,所述通信装置,还用于向所述DH发送第二通知,所述第二通知用于告知所述DH第二RF接口已被激 活,并通过所述第二RF接口接收所述DH发送的第二数据消息;The NFCC according to claim 34, wherein said communication device is further configured to send a second notification to said DH, said second notification being used to inform said DH that said second RF interface has been activated Live and receive the second data message sent by the DH through the second RF interface;
    所述处理器,还用于以所述第一长度值作为所述最大长度值将所述第二数据消息中的负载封装成第二数据包;The processor is further configured to encapsulate the load in the second data message into a second data packet by using the first length value as the maximum length value;
    所述通信装置,还用于将所述第二数据包发送至所述第二NFC设备。The communication device is further configured to send the second data packet to the second NFC device.
  37. 根据权利要求33所述的NFCC,其特征在于,所述第一请求是Digital规范中定义的PSL_REQ;The NFCC according to claim 33, wherein said first request is PSL_REQ defined in the Digital specification;
    所述第一响应是所述Digital规范中定义的PSL_RES;The first response is a PSL_RES defined in the Digital specification;
    所述第一RF接口是NCI规范中定义的NFC-DEP射频接口;The first RF interface is an NFC-DEP radio frequency interface defined in an NCI specification;
    所述第一通知是所述NCI规范中定义的RF_INTF_ACTIVATED_NTF。 The first notification is RF_INTF_ACTIVATED_NTF defined in the NCI specification.
PCT/CN2015/079847 2015-05-26 2015-05-26 Method, device, and system for adjusting packet length in near field communication (nfc) WO2016187821A1 (en)

Priority Applications (8)

Application Number Priority Date Filing Date Title
KR1020207005978A KR102256450B1 (en) 2015-05-26 2015-05-26 Method, device, and system for adjusting packet length in near field communication (nfc)
JP2017561382A JP6564070B2 (en) 2015-05-26 2015-05-26 Method, apparatus, and system for adjusting data packet length in near field communication NFC
PCT/CN2015/079847 WO2016187821A1 (en) 2015-05-26 2015-05-26 Method, device, and system for adjusting packet length in near field communication (nfc)
KR1020177036894A KR102085175B1 (en) 2015-05-26 2015-05-26 Method, apparatus, and system for adjusting data packet length in near field communication (NCF)
EP15892902.6A EP3297176B1 (en) 2015-05-26 2015-05-26 Method, device, and system for adjusting packet length in near field communication (nfc)
CN201580045514.1A CN106605371B (en) 2015-05-26 2015-05-26 Method, device and system for adjusting length of data packet in Near Field Communication (NFC)
US15/576,649 US10470019B2 (en) 2015-05-26 2015-05-26 Method, device, and system for adjusting packet length in near field communication (NFC)
US16/597,511 US11166137B2 (en) 2015-05-26 2019-10-09 Method, device, and system for adjusting packet length in near field communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/079847 WO2016187821A1 (en) 2015-05-26 2015-05-26 Method, device, and system for adjusting packet length in near field communication (nfc)

Related Child Applications (2)

Application Number Title Priority Date Filing Date
US15/576,649 A-371-Of-International US10470019B2 (en) 2015-05-26 2015-05-26 Method, device, and system for adjusting packet length in near field communication (NFC)
US16/597,511 Continuation US11166137B2 (en) 2015-05-26 2019-10-09 Method, device, and system for adjusting packet length in near field communication

Publications (1)

Publication Number Publication Date
WO2016187821A1 true WO2016187821A1 (en) 2016-12-01

Family

ID=57392334

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/079847 WO2016187821A1 (en) 2015-05-26 2015-05-26 Method, device, and system for adjusting packet length in near field communication (nfc)

Country Status (6)

Country Link
US (2) US10470019B2 (en)
EP (1) EP3297176B1 (en)
JP (1) JP6564070B2 (en)
KR (2) KR102085175B1 (en)
CN (1) CN106605371B (en)
WO (1) WO2016187821A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190148978A1 (en) * 2016-07-29 2019-05-16 Hewlett-Packard Development Company, Lp. Wireless charging

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11363455B2 (en) * 2019-01-11 2022-06-14 Qualcomm Incorporated Near field communication forum data exchange format (NDEF) messages with authenticated encryption
CN111510394B (en) 2019-01-31 2022-04-12 华为技术有限公司 Message scheduling method, related equipment and computer storage medium
CN110059514B (en) * 2019-04-18 2021-06-08 珠海美佳音科技有限公司 Data writing method, NFC tag, NFC device and storage medium
KR102593207B1 (en) 2021-09-16 2023-10-23 자이가이스트 주식회사 Customized architectural design system and architectural design method using the same
CN115022252B (en) * 2022-05-31 2024-04-09 青岛海信移动通信技术有限公司 Method and equipment for configuring maximum length of transmission data packet

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101010887A (en) * 2004-09-08 2007-08-01 诺基亚公司 Electronic near field communication enabled multifunctional device and method of its operation
CN101675428A (en) * 2006-12-22 2010-03-17 Nxp股份有限公司 A method for storing data as well as a transponder, a read/write-device, a computer readable medium including a program element and such a program element adapted to perform this method
CN102170300A (en) * 2010-02-26 2011-08-31 通用汽车环球科技运作有限责任公司 Multiple near field communication tags in a pairing domain
CN103187998A (en) * 2011-12-29 2013-07-03 国民技术股份有限公司 Near field communication system and near field communication method
WO2015027801A1 (en) * 2013-08-29 2015-03-05 华为终端有限公司 Near field communication-based data transmission method and apparatus, and near field communication device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4367349B2 (en) 2005-01-31 2009-11-18 ソニー株式会社 COMMUNICATION DEVICE, COMMUNICATION METHOD, AND PROGRAM
US20100183033A1 (en) * 2009-01-20 2010-07-22 Nokia Corporation Method and apparatus for encapsulation of scalable media
US8989658B2 (en) * 2011-06-24 2015-03-24 Qualcomm Incorporated Methods and apparatuses for improving NFC parameter update mechanisms
JP6019675B2 (en) * 2012-03-30 2016-11-02 ブラザー工業株式会社 Function execution device
US20140120961A1 (en) * 2012-10-26 2014-05-01 Lookout, Inc. System and method for secure message composition of security messages
JP6086255B2 (en) 2014-10-16 2017-03-01 ソニー株式会社 COMMUNICATION DEVICE, COMMUNICATION DEVICE COMMUNICATION METHOD, COMMUNICATION SYSTEM, SEMICONDUCTOR, SEMICONDUCTOR COMMUNICATION METHOD, AND PROGRAM

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101010887A (en) * 2004-09-08 2007-08-01 诺基亚公司 Electronic near field communication enabled multifunctional device and method of its operation
CN101675428A (en) * 2006-12-22 2010-03-17 Nxp股份有限公司 A method for storing data as well as a transponder, a read/write-device, a computer readable medium including a program element and such a program element adapted to perform this method
CN102170300A (en) * 2010-02-26 2011-08-31 通用汽车环球科技运作有限责任公司 Multiple near field communication tags in a pairing domain
CN103187998A (en) * 2011-12-29 2013-07-03 国民技术股份有限公司 Near field communication system and near field communication method
WO2015027801A1 (en) * 2013-08-29 2015-03-05 华为终端有限公司 Near field communication-based data transmission method and apparatus, and near field communication device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190148978A1 (en) * 2016-07-29 2019-05-16 Hewlett-Packard Development Company, Lp. Wireless charging
US10693320B2 (en) * 2016-07-29 2020-06-23 Hewlett-Packard Development Company, L.P. Wireless charging

Also Published As

Publication number Publication date
US11166137B2 (en) 2021-11-02
KR102256450B1 (en) 2021-05-25
EP3297176B1 (en) 2022-01-26
CN106605371A (en) 2017-04-26
JP6564070B2 (en) 2019-08-21
JP2018523358A (en) 2018-08-16
EP3297176A4 (en) 2018-06-13
CN106605371B (en) 2020-01-10
KR20180011233A (en) 2018-01-31
US10470019B2 (en) 2019-11-05
EP3297176A1 (en) 2018-03-21
US20180132089A1 (en) 2018-05-10
KR102085175B1 (en) 2020-03-05
KR20200023558A (en) 2020-03-04
US20200045523A1 (en) 2020-02-06

Similar Documents

Publication Publication Date Title
US11166137B2 (en) Method, device, and system for adjusting packet length in near field communication
US10893401B2 (en) Method and system for communication in near field communication network
EP2961220B1 (en) Connection switching method and corresponding apparatuses based on near field communication
CN103503323B (en) Radio frequency communication method, device, and terminal equipment for near field communication
CA2628235A1 (en) Near field communication host controller interface
CN105309036A (en) Mac layer transport for wi-fi direct services application service platform without internet protocol
CN103326749B (en) A kind of control method of NFC radio frequency communication, Apparatus and system
US8725074B2 (en) Communication device, communication system, communication method and program
US9628149B2 (en) Emulation of multiple NFC devices inside a communication device
JP2019512977A (en) Method for routing data frames, near field communication controller and terminal
CN114006638B (en) NFC-based unidirectional data transmission method and system
WO2023078383A1 (en) Relay communication method, communication apparatus, chip, and module device thereof
WO2016165093A1 (en) Service discovery method based on logical link control protocol (llcp) and nfc controller

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: 15892902

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 15576649

Country of ref document: US

ENP Entry into the national phase

Ref document number: 2017561382

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2015892902

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 20177036894

Country of ref document: KR

Kind code of ref document: A