WO2016165093A1 - 一种基于逻辑链路控制协议llcp的服务发现方法及nfc控制器 - Google Patents

一种基于逻辑链路控制协议llcp的服务发现方法及nfc控制器 Download PDF

Info

Publication number
WO2016165093A1
WO2016165093A1 PCT/CN2015/076693 CN2015076693W WO2016165093A1 WO 2016165093 A1 WO2016165093 A1 WO 2016165093A1 CN 2015076693 W CN2015076693 W CN 2015076693W WO 2016165093 A1 WO2016165093 A1 WO 2016165093A1
Authority
WO
WIPO (PCT)
Prior art keywords
pdu
nfcc
nfc
service discovery
discovery process
Prior art date
Application number
PCT/CN2015/076693
Other languages
English (en)
French (fr)
Inventor
赵晓娜
常新苗
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP15888798.4A priority Critical patent/EP3276984B1/en
Priority to KR1020177032783A priority patent/KR101923093B1/ko
Priority to JP2017554340A priority patent/JP6511540B2/ja
Priority to PCT/CN2015/076693 priority patent/WO2016165093A1/zh
Priority to CN201580039545.6A priority patent/CN106664506B/zh
Priority to US15/566,974 priority patent/US10237902B2/en
Publication of WO2016165093A1 publication Critical patent/WO2016165093A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/322Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions
    • H04L69/324Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions in the data link layer [OSI layer 2], e.g. HDLC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • 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
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/04Protocols specially adapted for terminals or networks with limited capabilities; specially adapted for terminal portability

Definitions

  • the present invention relates to the field of near field communication (NFC) technology, and in particular, to a service discovery method and an NFC controller based on the logical link control protocol LLCP.
  • 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") using magnetic field induction.
  • NFC Controller Interface (NCI) interface mainly defines a logical interface for implementing communication between a host (DH, Device Host) and an NFC controller (NFC, NFC Controller) in an NFC device.
  • LLCP Logical Link Control Protocol
  • SAP service access point
  • SDP Service Discovery Procedure
  • LLC PDU Logical Link Control Protocol Data Unit
  • Service Name Lookup Protocol Data Unit including a Service Discovery Request (SDRE), or includes a service name (SN) , CONNECT PDU (CONNECT Protocol Data Unit) of the Service Name
  • SNL PDU Service Name Lookup Protocol Data Unit
  • SDRE Service Discovery Request
  • SN service name
  • CONNECT PDU CONNECT Protocol Data Unit
  • the NFCC of the NFC device forwards it to the DH, waits for the DH to respond, and then feeds the response to the peer through the NFCC.
  • multiple interactions between NFCC and DH result in higher resource overhead. Big problem.
  • the embodiment of the invention discloses a service discovery method and an NFC controller based on the logical link control protocol LLCP, which can reduce the interaction between the NFCC and the DH in the NFC device and save resource overhead.
  • a first aspect of the embodiments of the present invention discloses a service discovery method based on a logical link control protocol (LLCP), which is applied to an NFC controller NFCC of a first near field communication NFC device, where the first NFC device further includes Host DH, the method includes:
  • the NFCC receives a logical link control protocol data unit LLC PDU;
  • the NFCC Determining, by the NFCC, whether the LLC PDU is a target LLC PDU according to a type identifier in a header of the LLC PDU, where the target LLC PDU includes a first connection protocol data unit CONNECT sent by the DH or a second NFC device a PDU, a service name discovery protocol data unit SNL PDU sent by the second NFC device, or an aggregated frame protocol data unit AGF PDU sent by the second NFC device;
  • the target LLC PDU includes a first connection protocol data unit CONNECT sent by the DH or a second NFC device a PDU, a service name discovery protocol data unit SNL PDU sent by the second NFC device, or an aggregated frame protocol data unit AGF PDU sent by the second NFC device;
  • the NFCC determines whether a service discovery process needs to be performed
  • the NFCC performs the service discovery process.
  • the NFCC determines whether a service discovery process needs to be performed, including:
  • the NFCC performs the service discovery process, including:
  • a first service access point SAP corresponding to the first service name SN included in the first SDREQ from the pre-stored service information, where the service information includes at least one SN and corresponding to each of the SNs SAP;
  • the NFCC generates a first service discovery response SDRES including the first SAP, and transmits the first SDRES to the second NFC device.
  • the NFCC determines whether service discovery needs to be performed. Process, including:
  • the NFCC determines whether the second SN can be parsed from the information field of the first CONNECT PDU;
  • the NFCC performs the service discovery process, including:
  • the NFCC generates a second SDREQ including the second SN, and sends the second SDREQ to the second NFC device;
  • the NFCC receives the second SDRES sent by the second NFC device in response to the second SDREQ, and the second SDRES includes a second SAP.
  • the method further includes:
  • a source service access point SSAP in the second CONNECT PDU is an SSAP in the first CONNECT PDU or
  • the DSAP in the second CONNECT PDU is the second SAP
  • the service information includes at least one SN and The SAP corresponding to each of the SNs.
  • the first CONNECT PDU is sent by the second NFC device After the NFCC performs the service discovery process, the method further includes:
  • the NFCC generates a connection completion protocol data unit CC PDU, and sends the CC PDU to the second NFC device, where the SSAP in the CC PDU is a pre-stored service information corresponding to the second SN a fourth SAP, the DSAP in the CC PDU is the second SAP, the CC PDU is used to indicate that a data link connection between the first NFC device and the second NFC device is successfully established, and the service information is Include at least one SN and an SAP corresponding to each of the SNs;
  • the NFCC sends the indication information corresponding to the first CONNECT PDU and the indication information that is used to indicate that the data link connection is successfully established, and the indication information corresponding to the first CONNECT PDU includes the second SAP.
  • the AGF PDU includes at least one SNL PDU and/or at least one CONNECT PDU.
  • the method before the NFCC performs the service discovery process, the method further includes:
  • the NFCC determines that the NFCC has the ability to perform the service discovery process.
  • the service information is sent by the DH to the NFCC.
  • the method before the NFCC receives the logical link control protocol data unit LLC PDU, the method further includes:
  • the NFCC reports capability information to the DH, where the capability information is used to indicate that the NFCC has the capability to perform a service discovery process.
  • the second aspect of the embodiment of the present invention discloses an NFC controller, where the NFC controller is an NFC controller in the first NFC device, the first NFC device further includes a DH, and the NFC controller includes:
  • a communication module configured to receive an LLC PDU
  • a first determining module configured to determine, according to a type identifier in a packet header of the LLC PDU, whether the LLC PDU is a target LLC PDU, where the target LLC PDU includes the first CONNECT sent by the DH or the second NFC device a PDU, an SNL PDU sent by the second NFC device, or an AGF PDU sent by the second NFC device;
  • a second determining module configured to determine, when the determination result of the first determining module is yes, whether to perform a service discovery process
  • an execution module configured to execute a service discovery process when the determination result of the second determining module is YES.
  • the specific manner in which the second determining module determines whether the service discovery process needs to be performed is:
  • the second determining module determines whether The specific way to perform the service discovery process is:
  • the NFC controller further includes a first generating module, where:
  • the first generating module is configured to generate a second CONNECT PDU when the first CONNECT PDU is sent by the DH and after the performing module performs a service discovery process, where the SSAP in the second CONNECT PDU is The third SAP corresponding to the second SN is queried by the SSAP or the NFC controller in the first CONNECT PDU from the pre-stored service information, and the DSAP in the second CONNECT PDU is the a second SAP, the service information includes at least one SN and an SAP corresponding to each of the SNs;
  • the communication module is further configured to send the second CONNECT PDU to the second NFC device.
  • the NFC controller further includes a second generating module, where:
  • the second generating module is configured to generate a CC PDU when the first CONNECT PDU is sent by the second NFC device, and after the performing module performs a service discovery process, where the SSAP in the CC PDU is a pre- a fourth SAP corresponding to the second SN, the DSAP in the CC PDU is the second SAP, and the CC PDU is used to indicate the first NFC device and the second NFC.
  • the data link connection between the devices is successfully established, and the service information includes at least one SN and an SAP corresponding to each of the SNs;
  • the communication module is further configured to send the CC PDU to the second NFC device, and send indication information corresponding to the first CONNECT PDU and indication information used to indicate that the data link connection is successfully established.
  • the indication information corresponding to the first CONNECT PDU includes the second SAP.
  • the AGF PDU includes at least one SNL PDU and/or at least one CONNECT PDU.
  • the communications module is further configured to receive the DH before the executing module performs a service discovery process. Sending an open command, the open command is used to command the NFC controller to start the function of executing the service discovery process; or
  • the NFC controller also includes a determination module, wherein:
  • the determining module is configured to determine that the NFC controller has the capability to perform the service discovery process.
  • the service information is sent by the DH to the NFC controller.
  • the communications module is further configured to report capability information to the DH, where the capability information is used to indicate The NFC controller has the ability to perform a service discovery process.
  • a third aspect of the embodiments of the present invention discloses an NFC controller, including a memory, a processor, and a communication device, where the NFC controller is an NFC controller in the first NFC device, and the first NFC device The device further includes a DH, and the communication device is configured to receive an LLC PDU;
  • the program stores a set of program codes
  • the processor is configured to call program code stored in the memory to perform the following operations:
  • the LLC PDU Determining whether the LLC PDU is a target LLC PDU according to a type identifier in a header of the LLC PDU, where the target LLC PDU includes a first CONNECT PDU, the second NFC sent by the DH or a second NFC device The SNL PDU sent by the device or the AGF PDU sent by the second NFC device;
  • the LLC PDU is the target LLC PDU, it is determined whether the service discovery process needs to be performed, and if so, the service discovery process is performed.
  • the specific manner of the processor determining whether the service discovery process needs to be performed is:
  • the processor determines whether the service needs to be performed.
  • the specific way of the discovery process is:
  • the processor is configured to invoke the program code stored in the memory, Also used to do the following:
  • the controller queries the third SAP corresponding to the second SN from the pre-stored service information, the DSAP in the second CONNECT PDU is the second SAP, and the service information includes at least one SN and each The SAP corresponding to the SN;
  • the communication device is further configured to send the second CONNECT PDU to the second NFC device.
  • the processor is configured to invoke the program code stored in the memory, Also used to do the following:
  • the fourth SAP, the DSAP in the CC PDU is the second SAP, and the CC PDU is used to indicate that the data link connection between the first NFC device and the second NFC device is successfully established, the service is
  • the information includes at least one SN and an SAP corresponding to each of the SNs;
  • the communication device is further configured to send the CC PDU to the second NFC device, and send indication information corresponding to the first CONNECT PDU and indication information used to indicate that the data link connection is successfully established.
  • the indication information corresponding to the first CONNECT PDU includes the second SAP.
  • the AGF PDU includes at least one SNL PDU and/or at least one CONNECT PDU.
  • the communications apparatus is further configured to receive the DH before the processor performs a service discovery process. Sending an open command, the open command is used to command the NFC controller to start the function of executing the service discovery process; or
  • the processor is configured to invoke program code stored in the memory, and is further configured to:
  • the NFC controller has the ability to perform the service discovery process.
  • the service information is sent by the DH to the NFC controller.
  • the communications apparatus is further configured to report capability information to the DH, where the capability information is used to indicate The NFC controller has the ability to perform a service discovery process.
  • the NFCC determines whether the LLC PDU is the target LLC PDU according to the type identifier in the header of the LLC PDU, where the target LLC PDU includes the CONNECT PDU sent by the DH or the second NFC device, and the second The SFC PDU sent by the NFC device or the AGF PDU sent by the second NFC device, and when the LLC PDU is the target LLC PDU, the NFCC determines whether the service discovery process needs to be performed, and if so, the NFCC performs the service discovery process.
  • the implementation of the embodiment of the present invention enables the NFCC to perform the service discovery process, reduces the interaction between the NFCC and the DH, saves resource overhead, and improves communication efficiency.
  • the NFCC can share part of the functions of the DH, such as service discovery.
  • the process also conforms to the trend of the upward development of the logical interface between DH and NFCC in the peer-to-peer mode.
  • FIG. 1 is a schematic flowchart of a service discovery method based on a logical link control protocol (LLCP) according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of another service discovery method based on the logical link control protocol LLCP according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of another service discovery method based on the logical link control protocol LLCP according to an embodiment of the present invention
  • FIG. 4 is a schematic flowchart of another service discovery method based on the logical link control protocol LLCP according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of an NFC controller according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of another NFC controller according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of still another NFC controller disclosed in an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of still another NFC controller according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of still another NFC controller according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a communication module in an NFC controller according to an embodiment of the present invention.
  • the embodiment of the invention discloses a service discovery method and an NFC controller based on the logical link control protocol LLCP, which enables the NFCC to perform the service discovery process, reduces the interaction between the NFCC and the DH, saves resource overhead, and improves communication. effectiveness. 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 schematic flowchart of a service discovery method based on a logical link control protocol LLCP according to an embodiment of the present invention. Wherein, the method shown in FIG. 1 is applied to the NFCC of the first NFC device, and the first NFC device further includes DH. As shown in FIG. 1, the service discovery method based on the logical link control protocol LLCP may include the following steps:
  • the NFCC receives the LLC PDU.
  • the NFCC determines, according to the type identifier in the header of the LLC PDU, whether the LLC PDU is a target LLC PDU.
  • the NFCC when the determination result in step S102 is YES, the NFCC performs step S103; when the determination result in step S102 is NO and the LLC PDU is a PDU sent by the second NFC device, the NFCC sends the LLC PDU to the
  • the above-mentioned DH, or the function corresponding to the above-mentioned LLC PDU can be used as a radio interface function extension (ie, NCI protocol definition) under the currently activated radio interface (that is, the RF interface defined by the NCI protocol, see NCI protocol, and will not be described here). For details, see the NCI protocol, which is not mentioned here.
  • the NFCC When processing on the NFCC, the NFCC directly processes and responds to the above LLC PDU; when the judgment result in step S102 is NO and the above LLC PDU is sent in the above DH At the time of the PDU, the NFCC sends the above LLC PDU to the second NFC device.
  • the radio frequency interface may be a frame RF interface or a NFC-DEP RF Interface (NFC-DEP RF Interface), or may be The LLCC High RF Interface (LLCP) is not specifically defined by the NCI protocol, that is, the NFCC is responsible for implementing most or all of the functions of the LLCP protocol.
  • LLCP LLCC High RF Interface
  • the target LLC PDU may include, but is not limited to, the first CONNECT PDU sent by the DH or the second NFC device, the SNL PDU sent by the second NFC device, or the aggregated frame protocol data unit sent by the second NFC device (AGF).
  • PDU, Aggregated Frame PDU, etc. that is, the target LLC PDU may be any one of the first CONNECT PDU sent by the DH transmission or the second NFC device, the SNL PDU sent by the second NFC device, and the AGF PDU sent by the second NFC device.
  • the CONNECT PDU and/or the SNL PDU may be included in the AGF PDU, which is not limited in the embodiment of the present invention.
  • CONNECT PDU is used to request to create a data link connection on the LLCP link between the two NFC devices in order to use a connection-oriented service on two NFC devices.
  • the NFCC determines whether a service discovery process needs to be performed.
  • step S104 when the determination result in step S103 is YES, the NFCC performs step S104; when the determination result in step S103 is NO and the LLC PDU is an LLC PDU sent by the second NFC device, the NFCC sends the LLC PDU. To the above DH; when the result of the determination in step S103 is NO and the LLC PDU is the LLC PDU transmitted by the DH, the NFCC sends the LLC PDU to the second NFC device.
  • the NFCC performs a service discovery process.
  • the NFCC can also perform the following operations before performing the service discovery process:
  • the NFCC receives the open command sent by the DH, where the open command is used to command the NFCC to start the function of performing the service discovery process, and the NFCC receives the open command sent by the DH, and the DH determines that the NFCC has the capability of performing the service discovery process.
  • the foregoing DH determines that the NFCC has the capability to perform the service discovery process, including but not limited to the following two types: 1.
  • the DH actively sends an NFCC to query whether the NFCC has an execution service discovery process before determining that the NFCC needs to perform the service discovery process.
  • the DH reports capability information, which is used to indicate that the NFCC has the capability to perform a service discovery process.
  • the NFCC receives the start command of the DH, and the frame radio interface, the NFC-DEP radio interface, or the LLCC high radio interface has been activated, and the NFCC receives the DH sending start command may occur before step S101. It may also occur after step S101 and before step S102, and may also occur after the determination result of step S102 is YES and before step S103, and may also occur after the determination result of step S103 is YES and before step S104, The embodiments of the invention are not limited.
  • the NFCC may also perform the following operations before performing the service discovery process:
  • the NFCC determines that the NFCC has the ability to perform a service discovery process.
  • the NFCC determines that its ability to perform the service discovery process may occur before step 101, or may occur after step S101 and before step S102, and may also occur in After the determination result of the step S102 is YES and before the step S103, the embodiment of the present invention is not limited after the determination result of the step S103 is YES and before the step S104.
  • the NFCC when the NFCC determines that it has the capability of performing the service discovery process, after the NFCC performs the service discovery process, the NFCC may activate the above-mentioned LLCP high radio frequency interface and report it to the DH.
  • the NFCC may also perform the following operations:
  • the NFCC reports capability information to the DH, where the capability information is used to indicate that the NFCC has the capability to perform a service discovery process.
  • the NFCC can report the capability information to the DH by using the initialization response CORE_INIT_RSP (the complete field composition is shown in the NCI protocol, which is not described here), that is, the NFC-DEP radio interface or the frame radio interface, or even the LLCP high.
  • the RF interface can extend the RF interface required by the embodiment of the present invention when the RF interface extension corresponding to the radio interface is reported to the DH through the CORE_INIT_RSP (for example, the logical link control protocol service discovery process RF interface extension LLCCP SDP RF Interface Extension) Report one of the extended lists in CORE_INIT_RSP (partially related fields in CORE_INIT_RSP as shown in Table 1 below) to DH:
  • the radio interface extension list [0...x] indicates the extension of the radio interface supported by the NFCC when a radio interface is activated.
  • the types of radio interface extensions are shown in Table 2 below.
  • Table 2 is the table 132 defined in the NCI protocol. :
  • Types of 0x00 Frame aggregation radio interface extension 0x01 LLCP heartbeat maintains RF interface expansion 0x02 LLCP Service Discovery Process RF Interface Extension 0x03–0x7F Reserved 0x80-0xFE dedicated 0xFF Reserved
  • the NFCC determines whether the LLC PDU is the target LLC PDU according to the type identifier in the header of the LLC PDU, where the target LLC PDU includes the CONNECT PDU sent by the DH or the second NFC device, and the second The SFC PDU sent by the NFC device or the AGF PDU sent by the second NFC device, and when the LLC PDU is the target LLC PDU, the NFCC determines whether the service discovery process needs to be performed, and if so, the NFCC performs the service discovery process.
  • the implementation of the embodiment of the present invention enables the NFCC to perform the service discovery process, reduces the interaction between the NFCC and the DH, saves resource overhead, and improves communication efficiency.
  • the NFCC can share part of the functions of the DH, such as service discovery.
  • the process is also in line with the DH and NFCC in point-to-point mode. The trend of the logical interface to the upper layer.
  • FIG. 2 is a schematic flowchart diagram of another service discovery method based on the logical link control protocol LLCP according to an embodiment of the present invention.
  • the flow diagram shown in FIG. 2 is a schematic flowchart of a service discovery method based on the logical link control protocol (LLCP) when the LLC PDU received by the NFCC is the SNL PDU sent by the second NFC device, and the NFCC in FIG. 2 is The NFCC of the first NFC device, DH in FIG. 2, is the DH in the first NFC device.
  • the service discovery method based on the logical link control protocol LLCP may include the following steps:
  • the NFCC reports the capability information indicating that the NFCC has the capability of performing the service discovery process to the DH through the CORE_INIT_RSP.
  • the specific manner of reporting the capability information by the NFCC is as described in the foregoing embodiment, and details are not described herein again.
  • the embodiments of the present invention are described by way of example only. Of course, other reporting manners as described in the foregoing embodiments may also be used.
  • the NFCC receives the service information configured by the DH through CORE_SET_CONFIG_CMD.
  • the service information may include at least one SN, and may include at least one SN and an SAP corresponding to each SN, and may further include one or more SNs and each of the partial SNs of the one or more SNs.
  • the SAPs corresponding to the SNs are not limited in the embodiment of the present invention.
  • the NFCC allocates a corresponding SAP for each SN in the service information after receiving the service information.
  • the DH may configure the service information for the NFCC by using the configuration parameter command after receiving the capability information, where the configuration parameter command may be CORE_SET_CONFIG_CMD defined in the NCI protocol, or may be specifically configured to configure the service information.
  • the command of the present invention such as CORE_CONFIG_LLCP_SDP_CMD, is not limited in the embodiment of the present invention.
  • the configuration parameter command is CORE_SET_CONFIG_CMD and the service information includes at least one SN and the SAP corresponding to each SN
  • the configuration parameter command may be as shown in Table 3:
  • Table 3 is Table 11 in the NCI protocol.
  • the parameter used to configure the service information in this embodiment may be the LLCP service discovery process operation parameter LLCP_SDP_OP, as shown in Table 4:
  • Table 4 is a table 134 in the NCI protocol.
  • the NCI protocol can be configured as a parameter required for the NFCC to perform a service discovery process on the NFC-DEP radio interface, and can also be used as a radio interface (such as a frame radio interface). , LLCP high RF interface, etc.)
  • the parameters required for the NFCC to perform the service discovery process are configured.
  • the parameter LLCCP_SDP_OP is configured through the above Table 3
  • the specific parameters ie, the content of the service information and the length of the content
  • corresponding value (Val) field may be as shown in Table 5:
  • Service List[n] 1 byte Number of SN-SAP pairs SN y byte
  • the first NFC device is a service access point address bound to the service corresponding to the SN.
  • the NFCC receives the open command sent by the DH to start the NFCC execution service discovery. The ability of the process.
  • the open command sent by the NFCC to the DH may be the RF_INTF_EXT_START_CMD defined by the NCI protocol (as shown in Table 6 below), and the Extension field included may be the LLCCP service discovery process radio interface extension identifier LLCP SDP RF IF Ext,
  • the open parameter Start Parameter can be empty.
  • the NFCC receives the LLC PDU sent by the second NFC device.
  • the NFCC determines, by using the type identifier in the LLC PDU header, whether the received LLC PDU is an SNL PDU.
  • step S206 when the determined result of step S205 is YES, the NFCC performs step S206; when the determined result of step S205 is negative, the NFCC determines whether the LLC PDU is a CONNECT PDU or includes at least one SNL PDU and/or at least The AGF PDU of a CONNECT PDU, if yes, the NFCC performs the corresponding operation. If not, the NFCC determines whether the function corresponding to the LLC PDU is on the currently activated radio interface (ie, the RF interface defined by the NCI protocol. For details, see the NCI protocol.
  • the details of the RF interface extension (that is, the RF interface extension defined by the NCI protocol, please refer to the NCI protocol, which will not be described here) are handled on the NFCC. If so, the NFCC directly processes the response, if No, the NFCC forwards the above LLC PDU directly to DH.
  • this step may also include the following situation: if the LLC PDU is determined to be an AGF PDU by using the type identifier in the header of the LLC PDU, the NFCC may parse at least one LLC PDU carried in the information field of the AGF PDU. To determine if there is an SNL PDU.
  • the NFCC determines whether the parameter included in the information field of the SNL PDU is the first SDREQ.
  • the NFCC when the type parameter type in the information field of the SNL PDU is 08h, the NFCC can determine that the parameter included in the information field of the SNL PDU is the first SDREQ.
  • step S206 when the determined result of step S206 is YES, the NFCC performs step S207; when the determined result of step S206 is negative, the NFCC forwards the SNL PDU to DH, so that the DH processes and responds.
  • the NFCC determines, from the service information, a first SAP corresponding to the first SN included in the first SDREQ.
  • the NFCC generates a first service discovery response (SDRES, Service Discovery Response) including the foregoing first SAP, and returns the first SDRES to the second NFC device by using the SNL PDU.
  • SDRES Service Discovery Response
  • step S207 if the NFCC does not query the first SAP corresponding to the first SN in the service information, the NFCC does not respond, or directly generates response information including an error indication and the response is generated.
  • the information is returned to the second NFC device, or the corresponding first SAP is allocated to the first SN, and the DRES is reported to the second NFC device.
  • step S202 and step S203 may be combined into one step, that is, after the NFCC reports to the DH that the NFCC has the capability information to perform the service discovery process, the NFCC receives the RF_INTF_EXT_START_CMD sent by the DH to enable the NFCC.
  • the ability to perform the service discovery process, wherein the RF parameter of the RF_INTF_EXT_START_CMD may include the above service information.
  • the RF_INTF_EXT_START_CMD may be as shown in Table 6:
  • Table 7 Open parameters corresponding to the RF interface extension of the LLCP service discovery
  • Service List[n] 1 byte Number of SN-SAP pairs SN y byte
  • the first NFC device is a service access point address bound to the service corresponding to the SN.
  • step S206 is a step for the NFCC to determine whether a service discovery process needs to be performed
  • steps S207 and S208 are steps for the NFCC to perform a service discovery process.
  • Step 203 in the embodiment of the present invention is to explain that the DH sends an open command to the NFCC after a certain radio interface (such as an NFC-DEP radio interface, a frame radio interface, or an LLCCP high radio interface) is activated.
  • a certain radio interface such as an NFC-DEP radio interface, a frame radio interface, or an LLCCP high radio interface
  • the embodiment of the present invention may also perform a service discovery process on the NFCC before activating a certain radio interface (such as a high RF interface of the LLCP).
  • the NFCC needs to determine that it has any time before performing the service discovery process. The ability to perform the service discovery process is not mentioned here.
  • the NCI protocol in the embodiment of the present invention refers to the current NCI 2.0 version draft 9.
  • the protocol version is also referred to, and details are not described herein.
  • the embodiment of the invention reduces the number of interactions between the NFCC and the DH, that is, the NFCC performs a service discovery process, so that there is no need to interact with the DH, and the resource overhead of the DH is reduced.
  • the NFCC needs to have the ability to parse LLC PDUs during the service discovery process, the NFCC only needs to parse the header of the LLC PDU first, and then parse the individual LLC PDUs, such as the SNL PDU containing the SN.
  • the information fields of all (currently 14 types) LLC PDUs specified by the LLCP are all parsed.
  • the NFCC of the NFCC parsing the individual LLC PDUs has a small overhead and does not affect the RF communication, and the embodiment of the present invention can also make
  • the NFCC shares part of the DH functions, such as the service discovery process, and also conforms to the upward trend of the logical interface between DH and NFCC in the peer-to-peer mode.
  • the NFCC can complete the service discovery process, thereby preparing for the subsequent interaction of the upper layer information.
  • FIG. 3 is a schematic flowchart of another service discovery method based on the logical link control protocol LLCP according to an embodiment of the present invention.
  • the schematic diagram of the process shown in FIG. 3 is a schematic flowchart of a service discovery method based on the logical link control protocol (LLCP) when the LLC PDU received by the NFCC is the second NFC device or the first CONNECT PDU sent by the DH, and FIG. 3
  • the NFCC in the NFCC is the NFCC of the first NFC device
  • the DH in FIG. 3 is the DH in the first NFC device.
  • the service discovery method based on the logical link control protocol LLCP may include the following steps:
  • the NFCC reports the capability information indicating that the NFCC has the capability of performing the service discovery process to the DH through the CORE_INIT_RSP.
  • the specific manner of reporting the capability information by the NFCC is as described in the foregoing embodiment, and details are not described herein again.
  • the embodiments of the present invention are described by way of example only. Of course, other reporting manners as described in the foregoing embodiments may also be used.
  • the NFCC receives the service information configured by the DH through CORE_SET_CONFIG_CMD.
  • the manner in which the NFCC receives the service information sent by the DH is the same as that in the foregoing embodiment, and details are not described herein again.
  • the NFCC receives the open command sent by the DH to enable the NFCC to perform the service discovery process.
  • the manner in which the NFCC receives the open command sent by the DH is the same as that in the foregoing embodiment, and details are not described herein again.
  • the NFCC receives the LLC PDU sent by the second NFC device or the DH.
  • the NFCC determines, by using the type identifier in the LLC PDU header, whether the LLC PDU is the first CONNECT PDU.
  • step S306 when the determination result in step S305 is YES, the NFCC performs step S306; when the determination result in step S305 is negative, the NFCC determines whether the LLC PDU is the SNL PDU sent by the second device or the second device sends the AGF. PDU, if yes, the NFCC performs a corresponding operation. For example, when the LLC PDU is the SNL PDU sent by the second device, the NFCC performs the operations corresponding to steps S206 to S208 shown in FIG. 2. If not, the NFCC determines the LLC PDU.
  • the NFCC is directly After processing, if not, when the LLC PDU is the PDU sent by the second NFC device, the NFCC directly forwards the LLC PDU to the DH. When the LLC PDU is the PDU sent by the DH, the NFCC directly sends the LLC PDU. To the second NFC device.
  • the NFCC determines whether the value of the DSAP field in the header of the first CONNECT PDU is equal to the preset value 01h.
  • step S306 when the result of the determination in step S306 is YES, the NFCC performs step S307; when the result of the determination in step S306 is no and the first CONNECT PDU is the PDU sent by the second NFC device, the NFCC determines the first
  • the function of the CONNECT PDU can be processed on the NFCC as a radio interface function extension under the currently activated radio interface (that is, the RF interface defined by the NCI protocol, see NCI protocol, and will not be described here).
  • the NFCC After the direct processing, the NFCC directly forwards the LLC PDU to the DH; if the result of the determination in the step S306 is NO and the first CONNECT PDU is the PDU sent by the DH, the NFCC directly directly A CONNECT PDU is sent to the second NFC device.
  • the NFCC determines whether the second SN can be parsed from the information field of the first CONNECT PDU.
  • the NFCC when the determination result in the step S307 is YES, the NFCC performs the step S308; when the determination result in the step S307 is NO and the first CONNECT PDU is the PDU sent by the second NFC device, the NFCC is not the first The CONNECT PDU responds, or directly generates the response information including the error indication and returns the response information to the second NFC device; when the determination result in the step S306 is NO and the first CONNECT PDU is the PDU transmitted by the DH, the NFCC does not The first CONNECT PDU responds, or directly generates response information including an error indication and returns the response information to DH.
  • the NFCC When parsing the second SN, the NFCC generates a second SDREQ including the foregoing second SN, and sends the second SDREQ to the second NFC device by using the SNL PDU.
  • the NFCC receives the SNL PDU including the second SDRES sent by the second NFC device in response to the foregoing second SDREQ.
  • the second SDRES includes a second SAP, where the second SAP may be the SAP allocated by the NFCC of the second NFC device to the second SN, or may be the NFCC of the second NFC device from the NFCC.
  • the SAP corresponding to the second SN that is queried in the stored service information is not limited in the embodiment of the present invention.
  • step S306 and step S307 are steps for the NFCC to determine whether a service discovery process needs to be performed
  • steps S308 and S309 are steps for the NFCC to perform a service discovery process.
  • the NFCC may also perform the following operations:
  • the NFCC generates a second CONNECT PDU, and sends the second CONNECT PDU to the second NFC device, where the DSAP in the second CONNECT PDU is the second SAP in the second SDRES, and when the first CONNECT PDU is When the value of the source service access point (SSAP) field in the packet header is an invalid value (such as 00h or 01h, etc.), the SSAP in the second CONNECT PDU is NFCC and is queried from the service information.
  • the third SAP corresponding to the second SN when the value of the SSAP field in the header of the first CONNECT PDU is a valid value, the SSAP in the second CONNECT PDU is the SSAP in the header of the first CONNECT PDU.
  • the NFCC determines the received LLC. After the PDU is the CONNECT PDU sent by the DH, it can also determine whether the DSAP in the header of the CONNECT PDU is 01h and whether the SSAP is a valid value (ie, other values other than 00h and non-01h).
  • the CONNECT PDU is sent to the second NFC device of the peer end, and the SN in the information field of the CONNECT PDU and the SSAP in the header of the CONNECT PDU are first determined to be a pair in the service information saved in the NFCC, and if so, The CONNECT PDU is sent to the second NFC device of the opposite end.
  • the service discovery process described in steps S308-S309 and the operation of regenerating the CONNECT PDU are performed; if the DSAP in the header of the CONNECT PDU is 01h and the SSAP For a non-effective value (such as 00h or 01h), the NFCC may directly send the CONNECT PDU to the second NFC device, or perform the service discovery process described in steps S308-S309 above and the operation of regenerating the CONNECT PDU. After the SN in the information field of the CONNECT PDU is parsed, the corresponding SAP is found or assigned a corresponding SAP, and then the above-mentioned operation of regenerating the CONNECT PDU is performed. ; DSAP if the header of the other values of a non-CONNECT PDU as well as non 00h 01h, the NFCC second NFC device directly sends the CONNECT PDU to the peer.
  • the NFCC may also perform the following operations:
  • the NFCC reports the result of the NFCC performing the service discovery process (ie, the second SAP in the second SDRES described above) and the request message for regenerating the CONNECT PDU to the DH, and receives the DH regenerated CONNECT PDU and the regenerated CONNECT PDU.
  • the NFCC may further perform the following operations:
  • the NFCC generates a CONNECT Complete PDU (CC PDU), and sends the CC PDU to the second NFC device, where the SSAP in the CC PDU is the fourth of the service information corresponding to the second SN.
  • the DSAP in the CC PDU is the second SAP in the second SDRES, and the CC PDU is used to indicate that the data link connection between the first NFC device and the second NFC device is successfully established.
  • the NFCC sends the indication information corresponding to the first CONNECT PDU and the indication information indicating that the data link connection is successfully established to the DH, where the first CONNECT PDU corresponds to
  • the indication information may include, but is not limited to, the foregoing second SAP, or the PDU type of the foregoing second SAP and the first CONNECT PDU, where the PDU type of the first CONNECT PDU is used to indicate that the second NFC device requests to establish with the first NFC. Data link connection between devices.
  • the NFCC may also determine whether the DSAP in the header of the CONNECT PDU is 01h and the SSAP Whether it is a valid value (that is, other values other than 00h and non-01h), if yes, that is, the DSAP is 01h and the SSAP is a valid value, the NFCC may directly perform the above steps S307-S309, or may parse out the CONNECT PDU.
  • the NFCC After the SN in the information field finds the corresponding SAP or assigns the corresponding SAP to it, and then directly forwards it to DH; if the DSAP is 01h and the SSAP is not a valid value, the NFCC can directly perform the above steps S307-S309 and The operation of generating and responding to the CC PDU; if the DSAP is other values other than 00h and not 01h, and the SSAP is a valid value, the NFCC may forward the CONNECT PDU directly to the DH; if the DSAP is non-00h and non-01h For other values, and the SSAP is a non-significant value, the NFCC may perform the above steps S308-S309 and the above-mentioned operation of generating and answering the CC PDU after finding the corresponding SN for the DSAP from the service information held by the NFCC.
  • the NFCC may also perform the following operations:
  • the NFCC reports the result of the NFCC performing the service discovery process and the indication information corresponding to the first CONNECT PDU to the DH, and waits for the DH to generate the CC PDU, where the indication information corresponding to the first CONNECT PDU may include but is not limited to the foregoing second SAP. Or the PDU type of the foregoing second SAP and the foregoing first CONNECT PDU, wherein the PDU type of the first CONNECT PDU is used to indicate that the second NFC device requests to establish a data link connection with the first NFC device.
  • the indication information corresponding to the foregoing first CONNECT PDU may also be the first CONNECT PDU, which is not limited by the present invention.
  • the NFCC parses each LLC PDU in the information field of the AGF PDU, and then performs Figure 2 on each of the parsed SNL PDUs. In the operations corresponding to steps S206 to S208, the operations corresponding to steps S306 to S309 in FIG. 3 are performed on each of the parsed CONNECT PDUs. In addition, the NFCC can also parse the AGF PDU sent by the DH. If the AGF PDU is parsed to include the CONNECT PDU, the NFCC can also perform Figure 3 for each CONNECT PDU that is parsed. The operations corresponding to steps S306-S309 in the middle.
  • the embodiment of the invention reduces the number of interactions between the NFCC and the DH, that is, the NFCC performs a service discovery process, so that there is no need to interact with the DH, and the resource overhead of the DH is reduced.
  • the NFCC needs to have the ability to resolve LLC PDUs during the NFCC execution service discovery process, the NFCC only needs to parse the header of the LLC PDU first, and then parse the individual LLC PDUs, such as the CONNECT PDU containing the SN.
  • the information field of all (currently 14 types) LLC PDUs specified by the LLCP is to be parsed.
  • the NFCC has less overhead to resolve the NFCC caused by the individual LLC PDUs, and does not affect the RF communication, and the embodiment of the present invention can also Part of the function of the NFCC to share the DH, such as the service discovery process, is also in line with the upward trend of the logical interface between the DH and the NFCC in the peer-to-peer mode.
  • the NFCC before the two parties transmit the upper layer information, even if the DH is in the dormant state, the NFCC can complete the service discovery process, thereby preparing for the subsequent interaction of the upper layer information.
  • FIG. 4 is a schematic flowchart of another service discovery method based on the logical link control protocol LLCP according to an embodiment of the present invention.
  • the flow diagram shown in FIG. 4 is a schematic flowchart of a service discovery method based on the logical link control protocol LLCP before the NFCC activates a certain radio interface (such as a high RF interface of the LLCP), and the NFCC in FIG. 4 is the first.
  • the NFCC of the NFC device, DH in Figure 4 is the DH in the first NFC device.
  • the service discovery method based on the logical link control protocol LLCP may include the following steps:
  • the NFCC reports the indication information indicating that the NFCC supports the high RF interface of the LLCP to the DH.
  • the NFCC can report the indication information of the high-frequency interface supporting the LLCP to the DH through the table 1 in the foregoing embodiment.
  • the value of the radio interface that occupies 1 byte in the interface field indicates the indication information.
  • the value is 0x04, it indicates that the high RF interface of the LLCP is supported, as shown in Table 8 below:
  • the foregoing Table 8 is a table 131 of the NCI protocol.
  • the 0x04 and the corresponding LLCC high radio frequency interface in the embodiment of the present invention are newly added in the table 131 of the NCI protocol.
  • the NFCC receives the service information configured by the DH through the CORE_SET_CONFIG_CMD.
  • the manner in which the NFCC receives the service information sent by the DH is the same as that in the foregoing embodiment, and details are not described herein again.
  • the NFCC completes the LLCP link activation in the RF discovery process.
  • the NFCC receives the LLC PDU sent by the second NFC device.
  • the NFCC determines the type of the above LLC PDU.
  • the NFCC may determine, by using the type identifier PTYPE in the header of the LLC PDU, which type of PDU the LLC PDU is.
  • the NFCC performs step S406; when the LLC PDU is a CONNECT PDU, the NFCC performs step S413; when the LLC PDU is an AGF PDU including at least one SNL PDU and/or at least one CONNECT PDU,
  • the NFCC first parses each LLC PDU in the information field of the AGF PDU.
  • the parsed LLC PDU is an SNL PDU
  • the NFCC performs step S406.
  • the parsed LLC PDU is a CONNECT PDU
  • the NFCC performs step S413;
  • the NFCC may perform step S412 (not shown in FIG. 4).
  • the NFCC determines whether the parameter included in the information field of the LLC PDU is SDREQ.
  • step S406 when the determined result of step S406 is YES, the NFCC performs step S407; when the determined result of step S406 is negative, the NFCC performs step S412.
  • the NFCC searches for the SAP corresponding to the SN included in the SDREQ from the service information.
  • the method for obtaining the foregoing service information is the same as the foregoing embodiment, and details are not described herein again.
  • the NFCC determines whether the SAP corresponding to the SN included in the SDREQ can be found.
  • step S409 when the determined result of step S408 is YES, the NFCC performs step S409; when the determined result of step S408 is negative, the NFCC performs step S411.
  • the NFCC may also allocate a corresponding SAP to the SN, and then perform step S409.
  • the NFCC generates an SDRES including the SAP, and returns the SDRES to the second NFC device through the SNL PDU, and waits for other LLC PDUs sent by the second NFC device.
  • S410 and NFCC activate the high RF interface of the LLCP and report it to the above DH.
  • the NFCC does not respond, or directly generates response information including an error indication and returns the response information to the second NFC device.
  • the NFCC processes the LLC PDU and activates the LLCC high radio interface.
  • the NFCC determines whether the value of the DSAP field in the header of the LLC PDU is equal to 01h.
  • step S413 when the determined result of step S413 is YES, the NFCC performs step S414; when the determined result of step S413 is negative, the NFCC performs step S412.
  • the NFCC determines whether the SN can be parsed from the information field of the LLC PDU.
  • step S414 when the determined result of step S414 is YES, the NFCC performs step S415; when the determined result of step S414 is NO, the NFCC performs step S411.
  • the NFCC searches for the SN and/or the SAP corresponding to the SN from the service information.
  • the NFCC checks whether the service name of the first NFC device is the service of the foregoing SN, or further, checks whether the first NFC device is allocated for the service whose service name is the SN. Corresponding SAP.
  • the NFCC determines whether the SN and/or the SAP corresponding to the SN can be found.
  • step S416 when the determination result in step S416 is YES, the NFCC performs step S417; when the determination result in step S416 is no (ie, the NFCC does not find the service whose service name is the above SN, or does not find the service)
  • the name is the SAP corresponding to the service of the above SN, and the NFCC performs step S420.
  • the NFCC performs a service discovery process, that is, generates an SDREQ including the foregoing SN, sends the SDREQ to the second NFC device through the SNL PDU, and receives an SNL PDU including the SDRES sent by the second NFC device in response to the SDREQ.
  • the SDRES includes the SAP corresponding to the SN in step S416 that is queried by the NFCC of the second NFC device from the service information stored in the NFCC, or the NFCC of the second NFC device is the SN in step S416. Assigned SAP.
  • S418 and NFCC activate the high RF interface of the LLCP and report it to DH.
  • the manner in which the NFCC activates the high-frequency interface of the LLCP is similar to the manner in which the other radio interfaces are activated in the NCI protocol, and the manner of reporting the DH after the activation of the radio interface is similar. I won't go into details here.
  • the NFCC sends the result of the service discovery process and the received or parsed CONNECT PDU to the DH, or modifies the received or parsed CONNECT PDU according to the SDRES (ie, the DSAP in the CONNECT PDU is updated to the received SDRES. SAP) and send it to DH, so that DH generates CC PDU to reply; or generate CC PDU and send the CC PDU to the second NFC device, and then the indication information corresponding to the LLC PDU (same as LLC in the above embodiment)
  • the indication information corresponding to the PDU which is not described herein again, and the indication information for indicating that the data link connection is successfully established are sent to the DH.
  • the NFCC generates a Disconnected Mode Protocol Data Unit (DM PDU) including a reason for rejection, and sends the DM PDU to the second NFC device.
  • DM PDU Disconnected Mode Protocol Data Unit
  • the reason for the rejection in the DM PDU is used to indicate the specific reason why the first NFC device does not establish a data link connection with the second NFC device.
  • the implementation of the embodiments of the present invention enables the NFCC to perform the service discovery process before activating the NFCP-supported high-frequency interface of the NFCP, and activates the high-frequency interface of the LLCP and reports it to the DH after performing the service discovery process. Therefore, the NFCC can be reduced before the radio interface is activated.
  • the interaction between the DH and the NFCC reduces the resource overhead of the DH, enabling the NFCC to interact with the peer NFC device to a certain extent, that is, enabling the NFCC to share some functions of the DH, such as the service discovery process, and also conforming to the point-to-point
  • the trend of the logical interface between DH and NFCC in the mode is upward.
  • FIG. 5 is a schematic structural diagram of an NFC controller according to an embodiment of the present invention.
  • the NFC controller shown in FIG. 5 is an NFC controller in the first NFC device, and the first NFC device further includes a DH.
  • the NFC controller may include a communication module 501, a first determining module 502, a second determining module 503, and an executing module 504, where:
  • the communication module 501 is configured to receive an LLC PDU.
  • the communication module 501 may be composed of a first communication sub-module 5011 for communicating with the DH and a second communication sub-module 5012 for communicating with the second NFC device.
  • FIG. 10 is a schematic structural diagram of a communication module in an NFC controller according to an embodiment of the present invention. The specific manner of the communication module 501 receiving the LLC PDU is: the first communication sub-module 5011 receives the LLC PDU sent by the DH, and the second communication sub-module 5012 receives the LLC PDU sent by the second NFC device.
  • the first determining module 502 is configured to determine, according to the type identifier in the header of the LLC PDU, whether the LLC PDU is a target LLC PDU.
  • the second determining module 503 determines whether the service discovery process needs to be performed; when the determining result of the first determining module 502 is no and the LLC PDU is the second
  • the NFC controller may send the LLC PDU to the DH through the first communication submodule 5011 of the communication module 501, or when the function corresponding to the LLC PDU can be on the currently activated radio interface (ie, NCI)
  • the RF interface defined by the protocol please refer to the NCI protocol, which is not mentioned here. It can be used as a radio interface extension (that is, the RF Interface Extension defined by the NCI protocol.
  • the NFC controller directly processes and responds to the LLC PDU; when the judgment result of the first determining module 502 is NO and the LLC PDU is the PDU sent by the DH, the NFC controller may pass the second of the communication module 501.
  • the communication sub-module 5012 transmits the above-mentioned LLC PDU to the second NFC device.
  • the target LLC PDU may include, but is not limited to, the first CONNECT PDU sent by the DH or the second NFC device, the SNL PDU sent by the second NFC device, or the aggregated frame protocol data unit sent by the second NFC device (AGF).
  • the second determining module 503 is configured to determine whether the service discovery process needs to be performed when the determination result of the first determining module 502 is YES.
  • the execution module 504 of the NFC controller performs a service discovery process; when the judgment result of the second judging module 503 is NO and the LLC PDU is the second NFC
  • the NFC controller may send the LLC PDU to the DH through the first communication submodule 5011 of the communication module 501; when the second determination module 503 determines No, the LLC PDU is sent by the DH.
  • the LLC PDU transmits the above-mentioned LLC PDU to the second NFC device through the second communication sub-module 5012 of the communication module 501.
  • the executing module 504 is configured to execute a service discovery process when the determination result of the second determining module 503 is YES.
  • the first communication submodule 5011 of the communication module 501 is further configured to receive an open command sent by the DH before the execution module 504 performs a service discovery process, where the open command is used to command the NFC.
  • the controller starts the function of performing the service discovery process, and the communication module
  • the premise that the first communication sub-module 5011 of the 501 receives the open command sent by the DH is that the DH determines that the NFC controller has the capability of performing a service discovery process, and the DH determines that the NFC controller has the capability to perform the service discovery process. It is not limited to the following two types: 1.
  • the above DH actively sends a query request to the NFC controller for querying whether the NFC controller has the capability of executing the service discovery process before determining that the service discovery process needs to be performed by the NFC controller, so that the NFC control is performed.
  • the capability information is used to indicate that the NFC controller has the capability to perform a service discovery process; and, when the NFC controller is initialized, The NFC controller reports capability information to the DH through the first communication sub-module 5011 of the communication module 501, and the capability information is used to indicate that the NFCC has the capability to perform a service discovery process.
  • the first communication sub-module 5011 of the communication module 501 of the NFC controller receives the open command of the DH, and the frame radio interface, the NFC-DEP radio interface, or the LLCC high radio interface has been activated.
  • the NFC controller may further include a determining module 505, and the structure of the NFC controller including the determining module 505 is as shown in FIG. 6.
  • 6 is a schematic structural diagram of another NFC controller disclosed in an embodiment of the present invention, where:
  • a determination module 505 is configured to determine that the NFC controller has the ability to perform a service discovery process.
  • the NFC controller when the determining module 505 determines that the NFC controller has the capability of performing the service discovery process, after the executing module 504 performs the service discovery process, the NFC controller may activate the above-mentioned LLCP high radio frequency interface and pass the communication module 501.
  • a communication sub-module 5011 reports to the above DH.
  • the first communication submodule 5011 of the communication module 501 is further configured to report capability information to the DH before receiving the LLC PDU, where the capability information is used to indicate that the NFC controller has an execution service. The ability to discover processes.
  • the specific manner in which the first communication sub-module 5011 of the communication module 501 reports the capability information to the DH is as shown in the above embodiment, and details are not described herein again.
  • the specific manner of the second determining module 503 determining whether the service discovery process needs to be performed may be:
  • the specific manner in which the execution module 504 performs the service discovery process may be:
  • a first SDRES including the first SAP described above is generated, and the first SDRES is transmitted to the second NFC device through the second communication submodule 5012 of the communication module 501.
  • the service information may be service information that is received by the first communication sub-module 5011 of the communication module 501 and configured by the DH to be directly configured by the NFC controller after receiving the capability information, where the communication module 501 is configured.
  • the manner in which the communication sub-module 5011 receives the service information sent by the DH is as described in the above embodiment, and is not described here.
  • the first communication sub-module 5011 of the communication module 501 may be included in the DH transmission start command.
  • the service information may include at least one SN, and may include at least one SN and an SAP corresponding to each SN, and may further include one or more SNs and each SN of the partial SNs of the one or more SNs.
  • the corresponding SAP is not limited in the embodiment of the present invention, and when the service information includes at least one SN, after the first communication submodule 5011 of the communication module 501 receives the service information, the NFC controller is each of the service information. The SN assigns the corresponding SAP.
  • the specific manner of the second determining module 503 determining whether the service discovery process needs to be performed is:
  • the specific manner in which the executing module 504 performs the service discovery process is:
  • the second NFC device responds to the second SDRES sent by the second SDREQ, wherein the second SDRES includes the second SAP, and the second SAP may be the SAP allocated by the NFC controller of the second NFC device for the second SN,
  • the SAP corresponding to the second SN that is queried from the stored service information may be the NFC controller of the second NFC device.
  • the NFC controller may further include a first generation module 506, and the structure of the NFC controller including the first generation module 506 is as follows.
  • FIG. 7 is a schematic structural diagram of still another NFC controller disclosed in an embodiment of the present invention, among them:
  • the first generating module 506 is configured to generate a second CONNECT PDU when the first CONNECT PDU is sent by the DH and after the performing module 504 performs a service discovery process, where the SSAP in the second CONNECT PDU is the first CONNECT
  • the SSAP in the PDU or the NFC controller shown in FIG. 7 is the third SAP corresponding to the second SN that is queried from the pre-stored service information, and the DSAP in the second CONNECT PDU is the second SAP, and the service is The information includes at least one SN and an SAP corresponding to each SN.
  • the service information is service information of the DH configuration received by the first communication submodule 5011 of the communication module 501, and the first communication submodule 5011 of the communication module 501 receives
  • the specific manner of the service information is as described in the above embodiment, and details are not described herein again.
  • the second communication sub-module 5012 of the communication module 501 is further configured to send the second CONNECT PDU to the second NFC device.
  • the second determining module 503 may be further configured to determine whether the DSAP in the header of the CONNECT PDU is 01h and the SSAP is a valid value (ie, not 00h and Other values other than 01h), if yes, the second communication sub-module 5012 of the communication module 501 of the NFC controller may directly send the CONNECT PDU to the second NFC device of the opposite end, or the second determining module 503 first determines the CONNECT Whether the SN in the information field of the PDU and the SSAP in the packet header are one of the service information stored in the NFC controller, and if so, the second communication sub-module 5012 of the communication module 501 of the NFC controller sends the CONNECT PDU to the The second NFC device of the peer end, if not, the service discovery process is performed by the execution module 504 and after the execution module 504 performs the service discovery process, the CON
  • the service discovery process may be performed by the execution module 504 and after the execution module 504 performs the service discovery process, the CONNECT PDU is regenerated by the first generation module 506, and may also be found after the SN in the information field of the CONNECT PDU is parsed.
  • the corresponding SAP or the corresponding SAP is assigned to it, and then the CONNECT PDU is regenerated by the first generation module 506; if the DSAP in the header of the CONNECT PDU is other values other than 00h and other than 01h, the communication module 501 of the NFC controller
  • the second communication sub-module 5012 directly sends the CONNECT PDU to the second NFC device at the opposite end.
  • NFC The controller may further include a second generation module 507, and the structure of the NFC controller including the second generation module 507 is as shown in FIG. 8.
  • FIG. 8 is a schematic structural diagram of another NFC controller disclosed in the embodiment of the present invention, wherein :
  • the second generation module 507 is configured to generate a CC PDU when the first CONNECT PDU is sent by the second NFC device, and after the execution module 504 performs the service discovery process, where the SSAP in the CC PDU is pre-stored service information.
  • a fourth SAP corresponding to the foregoing second SN where the DSAP in the CC PDU is the foregoing second SAP, and the CC PDU is used to indicate that the data link connection between the first NFC device and the second NFC device is successfully established, and the
  • the service information includes at least one SN and an SAP corresponding to each SN.
  • the service information is the service information of the DH configuration received by the first communication submodule 5011 of the communication module 501, and the first communication submodule 5011 of the communication module 501.
  • the specific manner of receiving the service information is as described in the foregoing embodiment, and details are not described herein again.
  • the second communication sub-module 5012 of the communication module 501 is further configured to send the CC PDU to the second NFC device
  • the first communication sub-module 5011 of the communication module 501 is further configured to use the foregoing
  • the indication information corresponding to a CONNECT PDU and the indication information for indicating that the data link connection is successfully established is sent to the DH
  • the indication information corresponding to the first CONNECT PDU may include, but is not limited to, the foregoing second SAP and the foregoing first The PDU type of the CONNECT PDU, wherein the PDU type of the first CONNECT PDU is used to indicate that the second NFC device requests to establish a data link connection with the first NFC device.
  • the second determining module 503 may further determine whether the DSAP in the header of the CONNECT PDU is 01h and the SSAP is The valid value (ie, other values other than 00h and non-01h), if yes, that is, the DSAP is 01h and the SSAP is a valid value, the execution module 504 of the NFC controller performs the service discovery process, and may also parse out the CONNECT PDU.
  • the SN in the information field is then found for the corresponding SAP or assigned to the corresponding SAP, and then directly forwarded to the DH by the first communication sub-module 5011 of the communication module 501; if the DSAP is 01h and the SSAP is not a valid value
  • the first communication sub-module 5011 of the communication module 501 of the NFC controller may directly connect the CONNECT PDU Issued to DH; non if the DSAP and other non-value 00h 01h of And the SSAP is a non-effective value, the NFC controller may perform a service discovery process by the execution module 504 after finding the corresponding SN for the DSAP in the service information saved from the NFCC, and then generate the CC PDU by the second generation module 507. Finally, the CC PDU is sent by the second communication sub-module 5012 of the communication module 501 to the second NFC device of the opposite end.
  • the embodiment of the present invention reduces the number of interactions between the NFC controller and the DH, that is, the NFCC performs a service discovery process, thereby eliminating the need for interaction with the DH and reducing the resource overhead of the DH.
  • the NFC controller needs to have the ability to parse LLC PDUs during the service discovery process, the NFC controller only needs to parse the header of the LLC PDU first, and then parse the individual LLC PDUs, and does not need to specify the LLCP.
  • the information fields of all (currently 14 types) LLC PDUs are all parsed.
  • the NFC controller parses the LLCC of the individual LLC PDUs to have a small overhead, and does not affect the RF communication, and the embodiment of the present invention can also make the NFC.
  • the controller shares some of the functions of the DH, such as the service discovery process, and also conforms to the upward trend of the logical interface between the DH and the NFC controller in the peer-to-peer mode.
  • the NFCC can complete the service discovery process, thereby preparing for the subsequent interaction of the upper layer information.
  • FIG. 9 is a schematic structural diagram of still another NFC controller according to an embodiment of the present invention.
  • the NFC controller shown in FIG. 9 is an NFC controller in the first NFC device, and the first NFC device further includes a DH.
  • the NFC controller may include: at least one processor 901, such as a CPU, communication device 902, and the communication device 902 may include a first communication sub-device 9021 for communicating with the DH, such as DH and The interface between NFCCs, which can support the NCI protocol at the upper layer, and the Universal Asynchronous Receiver/Transmitter (UART), I2C bus (Inter-Integrated Circuit) or half-duplex serial peripherals can be used at the bottom layer.
  • UART Universal Asynchronous Receiver/Transmitter
  • I2C bus Inter-Integrated Circuit
  • half-duplex serial peripherals can be used at the bottom layer.
  • An interface transmits data
  • a second communication sub-device 9022 for communicating with the second NFC device such as a transceiver circuit in the NFC controller, wherein the operating frequency of the NFC antenna in the transceiver circuit can be Is 13.56 MHz
  • the NFC controller can send data to the second NFC device through the NFC antenna, and can also receive data from the second NFC device, the memory 903 and the at least one communication bus 904.
  • the memory 903 can be a high speed RAM memory or a non- Non-volatile memory, such as at least one disk storage, optionally, the memory 903 may also be at least one Storage means located remote from the processor 901. among them:
  • Communication bus 904 is used to implement connection communication between these components.
  • the communication device 902 is configured to receive an LLC PDU.
  • the first communication sub-device 9021 of the communication device 902 is configured to receive the LLC PDU transmitted by the DH
  • the second communication sub-device 9022 of the communication device 902 is configured to receive the LLC PDU sent by the second NFC device.
  • a set of program codes is stored in the memory 903, and the processor 901 calls the program code stored in the memory 903 for performing the following operations:
  • the target LLC PDU includes the first CONNECT PDU sent by the DH or the second NFC device, the SNL PDU sent by the second NFC device, or
  • the AGF PDU is sent by the second NFC device, and the CONNECT PDU and/or the SNL PDU may be included in the AGF PDU, which is not limited in the embodiment of the present invention.
  • the service discovery process is performed.
  • the specific manner in which the processor 901 determines whether the service discovery process needs to be performed may be:
  • the processor 901 needs to perform a service discovery process
  • the specific manner in which the processor 901 performs the service discovery process may be:
  • a first SDRES comprising the first SAP described above is generated and transmitted by the second communication sub-device 9022 of the communication device 902 to the second NFC device.
  • the specific manner in which the processor 901 determines whether the service discovery process needs to be performed may be:
  • the processor 901 needs to perform a service discovery process.
  • the second SDRES sent by the second NFC device in response to the second SDREQ wherein the second SDRES includes the second SAP
  • the second SAP may be the NFC of the second NFC device
  • the SAP allocated by the controller to the second SN may be the SAP corresponding to the second SN that is queried from the stored service information by the NFC controller of the second NFC device.
  • the processor 901 is configured to call the program code stored in the memory 903, and is also configured to perform the following operations:
  • the second communication sub-device 9022 of the communication device 902 can also be configured to send the second CONNECT PDU to the second NFC device.
  • the processor 901 is configured to call the program code stored in the memory 903, and is also configured to perform the following operations:
  • a CC PDU when the first CONNECT PDU is sent by the second NFC device and after performing the service discovery process, where the SSAP in the CC PDU is a fourth SAP corresponding to the second SN in the pre-stored service information.
  • the DSAP in the CC PDU is the foregoing second SAP, and the CC PDU is used to indicate that the data link connection between the first NFC device and the second NFC device is successfully established, and the service information includes at least one SN and corresponding to each SN. SAP.
  • the second communication sub-device 9022 of the communication device 902 can also be configured to send the CC PDU to the second NFC device, and the first communication sub-device 9021 of the communication device 902 can also be used to indicate the first CONNECT PDU.
  • the information and the indication information for indicating that the data link connection is successfully established is sent to the DH, where the indication information corresponding to the first CONNECT PDU may include, but is not limited to, the second SAP and the PDU type of the first CONNECT PDU.
  • the PDU type of the first CONNECT PDU is used to indicate that the second NFC device requests to establish and first. Data link connection between NFC devices.
  • the first communication sub-device 9021 of the communication device 902 may be further configured to receive an open command of the DH transmission before the processor 901 performs a service discovery process, where the open command is used to command the NFC controller. Turn on the function of performing the service discovery process.
  • the processor 901 is configured to call the program code stored in the memory 903, and is also configured to perform the following operations:
  • the first communication sub-device 9021 of the communication device 902 can also be used to report capability information to the DH, wherein the capability information is used to indicate that the NFC controller has the capability to perform a service discovery process.
  • the service information may be service information that is received by the first communication sub-device 9021 of the communication device 902 and configured by the DH to directly configure the NFC controller after receiving the capability information, where the communication device 902 is configured.
  • the manner in which the communication sub-device 9021 receives the service information sent by the DH is as described in the above embodiment, and is not described here.
  • the first communication sub-device 9021 of the communication device 902 may be included in the DH transmission start command.
  • the service information may include at least one SN, and may include at least one SN and an SAP corresponding to each SN, and may further include one or more SNs and each SN of the partial SNs of the one or more SNs.
  • the corresponding SAP is not limited in the embodiment of the present invention, and when the service information includes at least one SN, after the first communication sub-device 9021 of the communication device 902 receives the service information, the processor 901 of the NFC controller is the service information. Each SN in the group is assigned a corresponding SAP.
  • the embodiment of the present invention reduces the number of interactions between the NFC controller and the DH, that is, the NFCC performs a service discovery process, thereby eliminating the need for interaction with the DH and reducing the resource overhead of the DH.
  • the NFC controller needs to have the ability to parse LLC PDUs during the service discovery process, the NFC controller only needs to parse the header of the LLC PDU first, and then parse the individual LLC PDUs, and does not need to specify the LLCP.
  • the information fields of all (currently 14 types) LLC PDUs are all parsed.
  • the NFC controller parses the LLCC of the individual LLC PDUs to have a small overhead, and does not affect the RF communication, and the embodiment of the present invention can also make the NFC.
  • the controller shares some of the functions of the DH, such as the service discovery process, and also conforms to the upward trend of the logical interface between the DH and the NFC controller in the peer-to-peer mode.
  • the NFCC can complete the service discovery process, thereby preparing for the subsequent interaction of the upper layer information.
  • the NFC device (the first NFC device and the second NFC device) mentioned in the foregoing embodiments are devices that are NFC-enabled or authenticated by the NFC Forum, and may include but are not limited to mobile.
  • the embodiment of the present invention is not limited in terms of a telephone, a mobile computer, a tablet telegraph, a personal digital assistant (PDA, Personal Digital Assistant), or a wearable device.
  • PDA Personal Digital Assistant
  • the modules and sub-modules in the NFC controller of the embodiment of the present invention can be combined, divided, and deleted according to actual needs.
  • modules and sub-modules in the embodiments 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)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

本发明实施例公开了一种基于逻辑链路控制协议LLCP的服务发现方法及NFC控制器,该方法包括NFCC接收到LLC PDU后,根据LLC PDU的包头中的类型标识判断LLC PDU是否为目标LLC PDU,其中,目标LLC PDU包括DH或第二NFC设备发送的CONNECT PDU、第二NFC设备发送的SNL PDU或第二NFC设备发送的AGF PDU,且当LLC PDU为目标LLC PDU时,NFCC判断是否需要执行服务发现过程,若是,则NFCC执行服务发现过程。可见,实施本发明实施例能够使NFCC执行服务发现过程,减少了NFCC与DH之间的交互,节省资源开销,且提高了通信效率。

Description

一种基于逻辑链路控制协议LLCP的服务发现方法及NFC控制器 技术领域
本发明实施例涉及近场通信(NFC,Near Field Communication)技术领域,具体涉及一种基于逻辑链路控制协议LLCP的服务发现方法及NFC控制器。
背景技术
NFC技术是一种短距离无线连接技术,其可以利用磁场感应实现具有NFC功能的电子设备(又称“NFC设备”)间的近距离通信。在NFC技术中,NFC控制器接口(NCI,NFC Controller Interface)协议主要定义了实现NFC设备中主机(DH,Device Host)与NFC控制器(NFCC,NFC Controller)之间通信的逻辑接口。
若两个进行点对点通信的NFC设备采用逻辑链路控制协议(LLCP,Logical Link Control Protocol),则根据LLCP可知,在两个进行点对点通信的NFC设备通过一种服务(无连接服务或面向连接服务)进行上层信息单元的交互之前,每个NFC设备均要获知另一个NFC设备为上述服务分配的服务访问点(SAP,Service Access Point)。若其中一个NFC设备未获知另一个NFC设备为上述服务分配的SAP,则该其中一个NFC设备需要通过服务发现过程(SDP,Service Discovery Procedure)来获知另一个NFC设备为上述服务分配的SAP。
根据现有的NCI协议,其中一个NFC设备在接收到对端的另一个NFC设备发送的一个逻辑链路控制协议数据单元(LLC PDU,Logical Link Control Protocol Data Unit)之后,该NFC设备的NFCC都要将该LLC PDU转发给DH,以使DH进行处理与应答,然后再将DH的应答发送给对端。对于服务发现过程,例如,每当其中一个NFC设备接收到包括服务发现请求(SDREQ,Service Discovery Request)的服务名称发现协议数据单元(SNL PDU,Service Name Lookup Protocol Data Unit)或包括服务名称(SN,Service Name)的连接协议数据单元(CONNECT PDU,CONNECT Protocol Data Unit)时,该NFC设备的NFCC都要将其转发给DH,以等待DH做出应答,然后再通过NFCC向对端反馈该应答。在上述服务发现过程中NFCC与DH间的多次交互导致了资源开销较 大的问题。
发明内容
本发明实施例公开了一种基于逻辑链路控制协议LLCP的服务发现方法及NFC控制器,能够减少NFC设备中NFCC与DH之间的交互,节省资源开销。
本发明实施例第一方面公开了一种基于逻辑链路控制协议LLCP的服务发现方法,所述方法应用于第一近场通信NFC设备的NFC控制器NFCC中,所述第一NFC设备还包括主机DH,所述方法包括:
所述NFCC接收逻辑链路控制协议数据单元LLC PDU;
所述NFCC根据所述LLC PDU的包头中的类型标识判断所述LLC PDU是否为目标LLC PDU,其中,所述目标LLC PDU包括所述DH或第二NFC设备发送的第一连接协议数据单元CONNECT PDU、所述第二NFC设备发送的服务名称发现协议数据单元SNL PDU或所述第二NFC设备发送的聚合帧协议数据单元AGF PDU;
当所述LLC PDU为所述目标LLC PDU时,所述NFCC判断是否需要执行服务发现过程;
若是,则所述NFCC执行所述服务发现过程。
在本发明实施例第一方面的第一种可能的实现方式中,当所述LLC PDU为所述SNL PDU时,所述NFCC判断是否需要执行服务发现过程,包括:
所述NFCC判断所述SNL PDU的信息字段中包含的参数是否为第一服务发现请求SDREQ;
所述NFCC执行所述服务发现过程,包括:
所述NFCC从预先存储的服务信息中确定出与所述第一SDREQ包括的第一服务名称SN对应的第一服务访问点SAP,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
所述NFCC生成包括所述第一SAP的第一服务发现响应SDRES,并将所述第一SDRES发送至所述第二NFC设备。
结合本发明实施例第一方面,在本发明实施例第一方面的第二种可能的实现方式中,当所述LLC PDU为所述第一CONNECT PDU时,所述NFCC判断是否需要执行服务发现过程,包括:
所述NFCC判断所述第一CONNECT PDU的包头中的目的服务访问点DSAP字段的值是否等于预设值;
当所述DSAP字段的值等于所述预设值时,所述NFCC判断是否能够从所述第一CONNECT PDU的信息字段中解析出第二SN;
所述NFCC执行所述服务发现过程,包括:
所述NFCC生成包括所述第二SN的第二SDREQ,并将所述第二SDREQ发送至所述第二NFC设备;
所述NFCC接收所述第二NFC设备响应所述第二SDREQ发送的第二SDRES,所述第二SDRES中包括第二SAP。
结合本发明实施例第一方面的第二种可能的实现方式,在本发明实施例第一方面的第三种可能的实现方式中,当所述第一CONNECT PDU由所述DH发送时,所述NFCC执行所述服务发现过程之后,所述方法还包括:
所述NFCC生成第二CONNECT PDU,并将所述第二CONNECT PDU发送至所述第二NFC设备,所述第二CONNECT PDU中的源服务访问点SSAP为所述第一CONNECT PDU中的SSAP或所述NFCC从预先存储的服务信息中查询出的与所述第二SN对应的第三SAP,所述第二CONNECT PDU中的DSAP为所述第二SAP,所述服务信息包括至少一个SN以及每个所述SN对应的SAP。
结合本发明实施例第一方面的第二种可能的实现方式,在本发明实施例第一方面的第四种可能的实现方式中,当所述第一CONNECT PDU由所述第二NFC设备发送时,所述NFCC执行所述服务发现过程之后,所述方法还包括:
所述NFCC生成连接完成协议数据单元CC PDU,并将所述CC PDU发送至所述第二NFC设备,所述CC PDU中的SSAP为预先储存的服务信息中与所述第二SN对应的第四SAP,所述CC PDU中的DSAP为所述第二SAP,所述CC PDU用于指示所述第一NFC设备与所述第二NFC设备间的数据链路连接建立成功,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
所述NFCC将所述第一CONNECT PDU对应的指示信息以及用于指示所述数据链路连接建立成功的指示信息发送至所述DH,所述第一CONNECT PDU对应的指示信息包括所述第二SAP。
结合本发明实施例第一方面,在本发明实施例第一方面的第五种可能的实现方式中,所述AGF PDU包括至少一个SNL PDU和/或至少一个CONNECT  PDU。
结合本发明实施例第一方面,在本发明实施例第一方面的第六种可能的实现方式中,所述NFCC执行所述服务发现过程之前,所述方法还包括:
所述NFCC接收所述DH发送的开启命令,所述开启命令用于命令所述NFCC开启执行所述服务发现过程的功能;或者,
所述NFCC确定所述NFCC具有执行所述服务发现过程的能力。
结合本发明实施例第一方面的第一种可能的实现方式、第三种可能的实现方式或第四种可能的实现方式,在本发明实施例第一方面的第七种可能的实现方式中,所述服务信息是由所述DH发送给所述NFCC的。
结合本发明实施例第一方面,在本发明实施例第一方面的第八种可能的实现方式中,所述NFCC接收逻辑链路控制协议数据单元LLC PDU之前,所述方法还包括:
所述NFCC向所述DH上报能力信息,所述能力信息用于指示所述NFCC具有执行服务发现过程的能力。
本发明实施例第二方面公开了一种NFC控制器,所述NFC控制器为第一NFC设备中的NFC控制器,所述第一NFC设备还包括DH,所述NFC控制器包括:
通信模块,用于接收LLC PDU;
第一判断模块,用于根据所述LLC PDU的包头中的类型标识判断所述LLC PDU是否为目标LLC PDU,其中,所述目标LLC PDU包括所述DH或第二NFC设备发送的第一CONNECT PDU、所述第二NFC设备发送的SNL PDU或所述第二NFC设备发送的AGF PDU;
第二判断模块,用于当所述第一判断模块的判断结果为是时,判断是否需要执行服务发现过程;
执行模块,用于当所述第二判断模块的判断结果为是时,执行服务发现过程。
在本发明实施例第二方面的第一种可能的实现方式中,
当所述LLC PDU为所述SNL PDU时,所述第二判断模块判断是否需要执行服务发现过程的具体方式为:
判断所述SNL PDU的信息字段中包含的参数是否为第一服务发现请求 SDREQ;
所述执行模块执行服务发现过程的具体方式为:
从预先存储的服务信息中确定出与所述第一SDREQ包括的第一SN对应的第一SAP,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
生成包括所述第一SAP的第一SDRES,并通过所述通信模块将所述第一SDRES发送至所述第二NFC设备。
结合本发明实施例第二方面,在本发明实施例第二方面的第二种可能的实现方式中,当所述LLC PDU为所述第一CONNECT PDU时,所述第二判断模块判断是否需要执行服务发现过程的具体方式为:
判断所述第一CONNECT PDU的包头中的DSAP字段的值是否等于预设值;
当所述DSAP字段的值等于所述预设值时,判断是否能够从所述第一CONNECT PDU的信息字段中解析出第二SN;
所述执行模块执行服务发现过程的具体方式为:
生成包括所述第二SN的第二SDREQ,并通过所述通信模块将所述第二SDREQ发送至所述第二NFC设备;
通过所述通信模块接收所述第二NFC设备响应所述第二SDREQ发送的第二SDRES,所述第二SDRES中包括第二SAP。
结合本发明实施例第二方面的第二种可能的实现方式,在本发明实施例第二方面的第三种可能的实现方式中,所述NFC控制器还包括第一生成模块,其中:
所述第一生成模块,用于当所述第一CONNECT PDU由所述DH发送时且在所述执行模块执行服务发现过程之后,生成第二CONNECT PDU,所述第二CONNECT PDU中的SSAP为所述第一CONNECT PDU中的SSAP或所述NFC控制器从预先存储的服务信息中查询出的与所述第二SN对应的第三SAP,所述第二CONNECT PDU中的DSAP为所述第二SAP,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
所述通信模块,还用于将所述第二CONNECT PDU发送至所述第二NFC设备。
结合本发明实施例第二方面的第二种可能的实现方式,在本发明实施例第 二方面的第四种可能的实现方式中,所述NFC控制器还包括第二生成模块,其中:
所述第二生成模块,用于当所述第一CONNECT PDU由所述第二NFC设备发送时且在所述执行模块执行服务发现过程之后,生成CC PDU,所述CC PDU中的SSAP为预先储存的服务信息中与所述第二SN对应的第四SAP,所述CC PDU中的DSAP为所述第二SAP,所述CC PDU用于指示所述第一NFC设备与所述第二NFC设备间的数据链路连接建立成功,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
所述通信模块,还用于将所述CC PDU发送至所述第二NFC设备,并将所述第一CONNECT PDU对应的指示信息以及用于指示所述数据链路连接建立成功的指示信息发送至所述DH,所述第一CONNECT PDU对应的指示信息包括所述第二SAP。
结合本发明实施例第二方面,在本发明实施例第二方面的第五种可能的实现方式中,所述AGF PDU包括至少一个SNL PDU和/或至少一个CONNECT PDU。
结合本发明实施例第二方面,在本发明实施例第二方面的第六种可能的实现方式中,所述通信模块,还用于在所述执行模块执行服务发现过程之前,接收所述DH发送的开启命令,所述开启命令用于命令所述NFC控制器开启执行所述服务发现过程的功能;或者,
所述NFC控制器还包括确定模块,其中:
所述确定模块,用于确定所述NFC控制器具有执行所述服务发现过程的能力。
结合本发明实施例第二方面的第一种可能的实现方式、第三种可能的实现方式或第四种可能的实现方式,在本发明实施例第二方面的第七种可能的实现方式中,所述服务信息是由所述DH发送给所述NFC控制器的。
结合本发明实施例第二方面,在本发明实施例第二方面的第八种可能的实现方式中,所述通信模块,还用于向所述DH上报能力信息,所述能力信息用于指示所述NFC控制器具有执行服务发现过程的能力。
本发明实施例第三方面公开了一种NFC控制器,包括存储器、处理器以及通信装置,所述NFC控制器为第一NFC设备中的NFC控制器,所述第一NFC设 备还包括DH,所述通信装置,用于接收LLC PDU;
所述存储器中存储一组程序代码,且所述处理器用于调用所述存储器中存储的程序代码,用于执行以下操作:
根据所述LLC PDU的包头中的类型标识判断所述LLC PDU是否为目标LLC PDU,其中,所述目标LLC PDU包括所述DH或第二NFC设备发送的第一CONNECT PDU、所述第二NFC设备发送的SNL PDU或所述第二NFC设备发送的AGF PDU;
当所述LLC PDU为所述目标LLC PDU时,判断是否需要执行服务发现过程,若是,则执行服务发现过程。
在本发明实施例第三方面的第一种可能的实现方式中,当所述LLC PDU为所述SNL PDU时,所述处理器判断是否需要执行服务发现过程的具体方式为:
判断所述SNL PDU的信息字段中包含的参数是否为第一SDREQ;
所述处理器执行服务发现过程的具体方式为:
从预先存储的服务信息中确定出与所述第一SDREQ包括的第一SN对应的第一SAP,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
生成包括所述第一SAP的第一SDRES,并通过所述通信装置将所述第一SDRES发送至所述第二NFC设备。
结合本发明实施例第三方面,在本发明实施例第三方面的第二种可能的实现方式中,当所述LLC PDU为所述第一CONNECT PDU时,所述处理器判断是否需要执行服务发现过程的具体方式为:
判断所述第一CONNECT PDU的包头中的DSAP字段的值是否等于预设值;
当所述DSAP字段的值等于所述预设值时,判断是否能够从所述第一CONNECT PDU的信息字段中解析出第二SN;
所述处理器执行服务发现过程的具体方式为:
生成包括所述第二SN的第二SDREQ,并通过所述通信装置将所述第二SDREQ发送至所述第二NFC设备;
通过所述通信装置接收所述第二NFC设备响应所述第二SDREQ发送的第二SDRES,所述第二SDRES中包括第二SAP。
结合本发明实施例第三方面的第二种可能的实现方式,在本发明实施例第三方面的第三种可能的实现方式中,所述处理器用于调用所述存储器中存储的程序代码,还用于执行以下操作:
当所述第一CONNECT PDU由所述DH发送时且在执行服务发现过程之后,生成第二CONNECT PDU,所述第二CONNECT PDU中的SSAP为所述第一CONNECT PDU中的SSAP或所述NFC控制器从预先存储的服务信息中查询出的与所述第二SN对应的第三SAP,所述第二CONNECT PDU中的DSAP为所述第二SAP,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
所述通信装置,还用于将所述第二CONNECT PDU发送至所述第二NFC设备。
结合本发明实施例第三方面的第二种可能的实现方式,在本发明实施例第三方面的第四种可能的实现方式中,所述处理器用于调用所述存储器中存储的程序代码,还用于执行以下操作:
当所述第一CONNECT PDU由所述第二NFC设备发送时且在执行服务发现过程之后,生成CC PDU,所述CC PDU中的SSAP为预先储存的服务信息中与所述第二SN对应的第四SAP,所述CC PDU中的DSAP为所述第二SAP,所述CC PDU用于指示所述第一NFC设备与所述第二NFC设备间的数据链路连接建立成功,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
所述通信装置,还用于将所述CC PDU发送至所述第二NFC设备,并将所述第一CONNECT PDU对应的指示信息以及用于指示所述数据链路连接建立成功的指示信息发送至所述DH,所述第一CONNECT PDU对应的指示信息包括所述第二SAP。
结合本发明实施例第三方面,在本发明实施例第三方面的第五种可能的实现方式中,所述AGF PDU包括至少一个SNL PDU和/或至少一个CONNECTPDU。
结合本发明实施例第三方面,在本发明实施例第三方面的第六种可能的实现方式中,所述通信装置,还用于在所述处理器执行服务发现过程之前,接收所述DH发送的开启命令,所述开启命令用于命令所述NFC控制器开启执行所述服务发现过程的功能;或者,
所述处理器用于调用所述存储器中存储的程序代码,还用于执行以下操作:
确定所述NFC控制器具有执行所述服务发现过程的能力。
结合本发明实施例第三方面的第一种可能的实现方式、第三种可能的实现方式或第四种可能的实现方式,在本发明实施例第三方面的第七种可能的实现方式中,所述服务信息是由所述DH发送给所述NFC控制器的。
结合本发明实施例第三方面,在本发明实施例第三方面的第八种可能的实现方式中,所述通信装置,还用于向所述DH上报能力信息,所述能力信息用于指示所述NFC控制器具有执行服务发现过程的能力。
本发明实施例中,NFCC接收到LLC PDU后,根据LLC PDU的包头中的类型标识判断LLC PDU是否为目标LLC PDU,其中,目标LLC PDU包括DH或第二NFC设备发送的CONNECT PDU、第二NFC设备发送的SNL PDU或第二NFC设备发送的AGF PDU,且当LLC PDU为目标LLC PDU时,NFCC判断是否需要执行服务发现过程,若是,则NFCC执行服务发现过程。可见,实施本发明实施例能够使NFCC执行服务发现过程,减少了NFCC与DH之间的交互,节省资源开销,且提高了通信效率,此外,还能够使NFCC分担DH的一部分功能,如服务发现过程,也符合了点对点模式下DH与NFCC之间逻辑接口向上层发展的趋势。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本发明实施例公开的一种基于逻辑链路控制协议LLCP的服务发现方法的流程示意图;
图2是本发明实施例公开的另一种基于逻辑链路控制协议LLCP的服务发现方法的流程示意图;
图3是本发明实施例公开的又一种基于逻辑链路控制协议LLCP的服务发现方法的流程示意图;
图4是本发明实施例公开的又一种基于逻辑链路控制协议LLCP的服务发现方法的流程示意图;
图5是本发明实施例公开的一种NFC控制器的结构示意图;
图6是本发明实施例公开的另一种NFC控制器的结构示意图;
图7是本发明实施例公开的又一种NFC控制器的结构示意图;
图8是本发明实施例公开的又一种NFC控制器的结构示意图;
图9是本发明实施例公开的又一种NFC控制器的结构示意图;
图10是本发明实施例公开的一种NFC控制器中通信模块的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例公开了一种基于逻辑链路控制协议LLCP的服务发现方法及NFC控制器,能够使NFCC执行服务发现过程,减少了NFCC与DH之间的交互,节省资源开销,且提高了通信效率。以下分别进行详细说明。
需要说明的是,本发明实施例中所使用的主机DH与NFC控制器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上。
请参阅图1,图1是本发明实施例公开的一种基于逻辑链路控制协议LLCP的服务发现方法的流程示意图。其中,图1所示的方法应用于第一NFC设备的NFCC中,且第一NFC设备还包括DH。如图1所示,该基于逻辑链路控制协议LLCP的服务发现方法可以包括以下步骤:
S101、NFCC接收LLC PDU。
S102、NFCC根据上述LLC PDU的包头中的类型标识判断上述LLC PDU是否为目标LLC PDU。
本发明实施例中,当步骤S102的判断结果为是时,NFCC执行步骤S103;当步骤S102的判断结果为否且上述LLC PDU为第二NFC设备发送的PDU时,NFCC将上述LLC PDU发送至上述DH,或当上述LLC PDU对应的功能在当前已激活的射频接口(即NCI协议定义的RF Interface,具体请见NCI协议,这里不再赘述)下可作为射频接口功能扩展(即NCI协议定义的RF Interface Extension,具体请见NCI协议,这里不再赘述)在NFCC上处理时,NFCC直接对上述LLC PDU进行处理并应答;当步骤S102的判断结果为否且上述LLC PDU为上述DH发送的PDU时,NFCC将上述LLC PDU发送至第二NFC设备。
需要说明的是,对于点对点模式,上述射频接口可以是帧射频接口(Frame RF Interface)或NFC数据交换协议射频接口(NFC-DEP RF Interface,Near Field Communication-Data Exchange Protocol RF Interface),也可以是NCI协议还未具体定义的LLCP高射频接口(LLCP High RF Interface),即NFCC要承担LLCP协议中大部分或者全部功能的实现。
本发明实施例中,目标LLC PDU可以包括但不限于上述DH或第二NFC设备发送的第一CONNECT PDU、第二NFC设备发送的SNL PDU或第二NFC设备发送的聚合帧协议数据单元(AGF PDU,Aggregated Frame PDU)等,即目标LLC PDU可以是上述DH发送或第二NFC设备发送的第一CONNECT PDU、第二NFC设备发送的SNL PDU以及第二NFC设备发送的AGF PDU中的任意一种,其中,AGF PDU中可以包括CONNECT PDU和/或SNL PDU,本发明实施例不做限定。
需要说明的是,上述CONNECT PDU是用于为了使用两个NFC设备上的某个面向连接的服务而请求在这两个NFC设备之间的LLCP链路之上创建数据链路连接的。
S103、当上述LLC PDU为上述目标LLC PDU时,NFCC判断是否需要执行服务发现过程。
本发明实施例中,当步骤S103的判断结果为是时,NFCC执行步骤S104;当步骤S103的判断结果为否且上述LLC PDU为第二NFC设备发送的LLC PDU时,NFCC将上述LLC PDU发送至上述DH;当步骤S103的判断结果为否且上述LLC PDU为上述DH发送的LLC PDU时,NFCC将上述LLC PDU发送至第二NFC设备。
S104、若判断出需要执行服务发现过程,则NFCC执行服务发现过程。
作为一种可选的实施方式,在执行服务发现过程之前,NFCC还可以执行以下操作:
NFCC接收上述DH发送的开启命令,其中,该开启命令用于命令NFCC开启执行服务发现过程的功能,且NFCC接收上述DH发送的开启命令的前提为上述DH确定NFCC具有执行服务发现过程的能力,上述DH确定NFCC具有执行服务发现过程的能力的具体方式包括但不限于以下两种:一、上述DH在确定需要由NFCC执行服务发现过程之前主动向NFCC发送用于查询NFCC是否具有执行服务发现过程的能力的查询请求,以使NFCC响应该查询请求向上述DH上报能力信息,该能力信息用于指示NFCC具有执行服务发现过程的能力;二、在第一NFC设备的NFCC初始化时,NFCC向上述DH上报能力信息,该能力信息用于指示NFCC具有执行服务发现过程的能力。
本发明实施例中,NFCC接收上述DH发送的开启命令的前提是帧射频接口、NFC-DEP射频接口或者LLCP高射频接口已经被激活,且NFCC接收上述DH发送的开启命令可以发生在步骤S101之前,也可以发生在步骤S101之后以及步骤S102之前,还可以发生在当步骤S102的判断结果为是之后以及步骤S103之前,还可以发生在当步骤S103的判断结果为是之后以及步骤S104之前,本发明实施例不做限定。
作为另一种可选的实施方式,在执行服务发现过程之前,NFCC还可以执行以下操作:
NFCC确定NFCC具有执行服务发现过程的能力。
本发明实施例中,NFCC确定其具有执行服务发现过程的能力可以发生在步骤101之前,也可以发生在步骤S101之后以及步骤S102之前,还可以发生在 当步骤S102的判断结果为是之后以及步骤S103之前,还可以发生在当步骤S103的判断结果为是之后以及步骤S104之前,本发明实施例不做限定。
本发明实施例中,当NFCC确定其具有执行服务发现过程的能力时,在NFCC执行完服务发现过程之后,NFCC可以激活上述LLCP高射频接口并上报至上述DH。
作为一个可选的实施方式,在执行步骤S101之前,NFCC还可以执行以下操作:
NFCC向上述DH上报能力信息,其中,该能力信息用于指示NFCC具有执行服务发现过程的能力。
本发明实施例中,NFCC可以通过初始化响应CORE_INIT_RSP(其完整的字段组成请参见NCI协议,这里不再赘述)向上述DH上报能力信息,即对于NFC-DEP射频接口或帧射频接口、甚至LLCP高射频接口,在通过CORE_INIT_RSP向DH上报这些射频接口对应的射频接口扩展时,可以将本发明实施例所需的射频接口扩展(如逻辑链路控制协议服务发现过程射频接口扩展LLCP SDP RF Interface Extension)作为CORE_INIT_RSP中的扩展列表(如下表1所示的CORE_INIT_RSP中的部分相关字段)中的一个上报给DH:
表1:CORE_INIT_RSP
Figure PCTCN2015076693-appb-000001
Figure PCTCN2015076693-appb-000002
其中,射频接口扩展列表[0…x]表示NFCC针对某个射频接口被激活时所支持的射频接口扩展,射频接口扩展的类型详见如下表2,该表2为NCI协议中定义的表格132:
表2:射频接口扩展
类型
0x00 帧聚合射频接口扩展
0x01 LLCP心跳维持射频接口扩展
0x02 LLCP服务发现过程射频接口扩展
0x03–0x7F 预留
0x80-0xFE 专用
0xFF 预留
本发明实施例中,NFCC接收到LLC PDU后,根据LLC PDU的包头中的类型标识判断LLC PDU是否为目标LLC PDU,其中,目标LLC PDU包括DH或第二NFC设备发送的CONNECT PDU、第二NFC设备发送的SNL PDU或第二NFC设备发送的AGF PDU,且当LLC PDU为目标LLC PDU时,NFCC判断是否需要执行服务发现过程,若是,则NFCC执行服务发现过程。可见,实施本发明实施例能够使NFCC执行服务发现过程,减少了NFCC与DH之间的交互,节省资源开销,且提高了通信效率,此外,还能够使NFCC分担DH的一部分功能,如服务发现过程,也符合了点对点模式下DH与NFCC之 间逻辑接口向上层发展的趋势。
请参阅图2,图2是本发明实施例公开的另一种基于逻辑链路控制协议LLCP的服务发现方法的流程示意图。其中,图2所示的流程示意图为当NFCC接收到的LLC PDU为第二NFC设备发送的SNL PDU时的基于逻辑链路控制协议LLCP的服务发现方法的流程示意图,且图2中的NFCC为第一NFC设备的NFCC,图2中的DH为第一NFC设备中的DH。如图2所示,该基于逻辑链路控制协议LLCP的服务发现方法可以包括以下步骤:
S201、NFCC通过CORE_INIT_RSP向DH上报用于表示NFCC具有执行服务发现过程能力的能力信息。
本发明实施例中,NFCC上报能力信息的具体方式如上面实施例所述,这里不再赘述。本发明实施例仅以此为例进行描述,当然,还可以采用如上实施例所述的其他上报方式。
S202、NFCC接收上述DH通过CORE_SET_CONFIG_CMD配置的服务信息。
本发明实施例中,服务信息可以包括至少一个SN,也可以包括至少一个SN以及与每个SN对应的SAP,还可以包括一个或多个SN以及与该一个或多个SN的部分SN中每个SN分别对应的SAP,本发明实施例不做限定。当服务信息包括至少一个SN时,NFCC在接收到服务信息之后为服务信息中的每个SN分配对应的SAP。
本发明实施例中,上述DH可以在接收到上述能力信息后通过配置参数命令为NFCC配置服务信息,其中,配置参数命令可以为NCI协议中定义的CORE_SET_CONFIG_CMD,也可以为专门用于配置该服务信息的命令,如CORE_CONFIG_LLCP_SDP_CMD,本发明实施例不做限定。当配置参数命令为CORE_SET_CONFIG_CMD且服务信息包括至少一个SN以及每个SN对应的SAP时,该配置参数命令可以如表3所示:
表3:CORE_SET_CONFIG_CMD
Figure PCTCN2015076693-appb-000003
其中,表3为NCI协议中的表格11。本实施例中用于配置服务信息的参数可以为LLCP服务发现过程操作参数LLCP_SDP_OP,如表4所示:
表4:配置参数
Figure PCTCN2015076693-appb-000004
其中,表4为NCI协议中的表格134,NCI协议可以将该参数LLCP_SDP_OP作为NFC-DEP射频接口下NFCC执行服务发现过程所需的参数进行配置,当然也可以作为其他射频接口(如帧射频接口、LLCP高射频接口等)下NFCC执行服务发现过程所需的参数进行配置。当通过上述表3配置该参数LLCP_SDP_OP时,其对应的值(Val)字段包括的具体参数(即服务信息包括的内容及内容的长度)可以如表5所示:
表5:LLCP服务发现过程操作参数LLCP_SDP_OP
字段 长度 含义
Service List[n] 1字节 SN-SAP对的数量
SN y字节 第一NFC设备为某服务注册的服务名称
SAP 1字节 第一NFC设备为SN对应的服务绑定的服务访问点地址
S203、NFCC接收上述DH发送的开启命令,以开启NFCC执行服务发现过 程的能力。
本发明实施例中,NFCC向上述DH发送的开启命令可以是NCI协议定义的RF_INTF_EXT_START_CMD(如下表6所示),其中包括的Extension字段可为LLCP服务发现过程射频接口扩展标识LLCP SDP RF IF Ext,开启参数Start Parameter可为空。
S204、NFCC接收第二NFC设备发送的LLC PDU。
S205、NFCC通过上述LLC PDU包头中的类型标识判断接收到的LLC PDU是否为SNL PDU。
本发明实施例中,当步骤S205的判断结果为是时,NFCC执行步骤S206;当步骤S205的判断结果为否时,NFCC判断上述LLC PDU是否为CONNECT PDU或包括至少一个SNL PDU和/或至少一个CONNECT PDU的AGF PDU,若是,则NFCC执行对应的操作,若否,则NFCC判断上述LLC PDU对应的功能是否在当前已激活的射频接口(即NCI协议定义的RF Interface,具体请见NCI协议,这里不再赘述)下可作为射频接口功能扩展(即NCI协议定义的RF Interface Extension,具体请见NCI协议,这里不再赘述)在NFCC上处理,若能,则NFCC直接处理后应答,若否,则NFCC直接将上述LLC PDU转发至DH。
需要说明的是,本步骤也可以包括以下情形:如果通过LLC PDU的包头中的类型标识判断出该LLC PDU为AGF PDU,则NFCC可以通过解析该AGF PDU的信息字段中携带的至少一个LLC PDU来判断其中是否存在SNL PDU。
S206、当上述LLC PDU为SNL PDU时,NFCC判断该SNL PDU的信息字段中包含的参数是否为第一SDREQ。
本发明实施例中,当该SNL PDU的信息字段中的类型参数type取值为08h时,NFCC即可认定上述SNL PDU的信息字段中包含的参数为第一SDREQ。
本发明实施例中,当步骤S206的判断结果为是时,NFCC执行步骤S207;当步骤S206的判断结果为否时,NFCC将上述SNL PDU转发至DH,以使DH进行处理并应答。
S207、当上述SNL PDU的信息字段中包含的参数为第一SDREQ时,NFCC从上述服务信息中确定出与上述第一SDREQ包括的第一SN对应的第一SAP。
S208、NFCC生成包括上述第一SAP的第一服务发现响应(SDRES,Service Discovery Response),并将该第一SDRES通过SNL PDU返回至第二NFC设备。
本发明实施例中,在步骤S207中,若NFCC未在上述服务信息中查询出与第一SN对应的第一SAP,则NFCC不进行应答,或直接生成包含错误指示的应答信息并将该应答信息返回至第二NFC设备,或为第一SN分配对应的第一SAP后上报DH并向第二NFC设备应答包含该第一SAP的SDRES。
作为一种可选的实施方式,步骤S202以及步骤S203可以合并为一个步骤,即NFCC向DH上报用于表示NFCC具有执行服务发现过程能力的能力信息之后,NFCC接收DH发送的RF_INTF_EXT_START_CMD,以开启NFCC执行服务发现过程的能力,其中,该RF_INTF_EXT_START_CMD的开启参数Start Parameter可以包含上述服务信息,在此种情况下,RF_INTF_EXT_START_CMD可以如表6所示:
表6:RF_INTF_EXT_START_CMD
Figure PCTCN2015076693-appb-000005
其中,对RF_INTF_EXT_START_CMD中Start Parameter的扩展可以如表7所示:
表7:LLCP服务发现射频接口扩展对应的开启参数
字段 长度 含义
Service List[n] 1字节 SN-SAP对的数量
SN y字节 第一NFC设备为某服务注册的服务名称
SAP 1字节 第一NFC设备为SN对应的服务绑定的服务访问点地址
本发明实施例中,步骤S206为NFCC判断是否需要执行服务发现过程的步骤,步骤S207以及步骤S208为NFCC执行服务发现过程的步骤。
本发明实施例中的步骤203是以激活某个射频接口(如NFC-DEP射频接口、帧射频接口或LLCP高射频接口)之后,DH向NFCC发送开启命令为例进行说明的。此外,本发明实施例还可以在激活某个射频接口(如LLCP高射频接口)之前需要在NFCC上执行服务发现过程为例,此时,NFCC在执行服务发现过程之前的任意时刻需要确定自身具有执行服务发现过程的能力,具体不再赘述。
需要说明的是,本发明实施例中所说的NCI协议是指目前的NCI 2.0版本草案9,下面实施例中同样是指该协议版本,后续不再赘述。
本发明实施例减少了NFCC与DH之间的交互次数,即NFCC执行服务发现过程,从而无需与DH进行交互,减少了DH的资源开销。此外,虽然NFCC在执行服务发现过程中需要具有解析LLC PDU的能力,但NFCC只需先对LLC PDU的包头进行解析,然后再针对个别LLC PDU进行解析,如包含SN的SNL PDU,并不需要对LLCP规定的所有(目前有14种)LLC PDU的信息字段全都进行解析,因此,NFCC解析个别LLC PDU带来的NFCC的开销较小,不会影响RF通信,且本发明实施例还能够使NFCC分担DH的一部分功能,如服务发现过程,也符合点对点模式下DH与NFCC之间逻辑接口向上层发展的趋势。另外,本实施例中,双方在传送上层信息之前,即使DH处于休眠状态,NFCC一样可以完成服务发现过程,从而为后续交互上层信息做好准备。
请参阅图3,图3是本发明实施例公开的又一种基于逻辑链路控制协议LLCP的服务发现方法的流程示意图。其中,图3所示的流程示意图为当NFCC接收到的LLC PDU为第二NFC设备或DH发送的第一CONNECT PDU时的基于逻辑链路控制协议LLCP的服务发现方法的流程示意图,且图3中的NFCC为第一NFC设备的NFCC,图3中的DH为第一NFC设备中的DH。如图3所示,该基于逻辑链路控制协议LLCP的服务发现方法可以包括以下步骤:
S301、NFCC通过CORE_INIT_RSP向DH上报用于表示NFCC具有执行服务发现过程能力的能力信息。
本发明实施例中,NFCC上报能力信息的具体方式如上面实施例所述,这里不再赘述。本发明实施例仅以此为例进行描述,当然,还可以采用如上实施例所述的其他上报方式。
S302、NFCC接收上述DH通过CORE_SET_CONFIG_CMD配置的服务信息。
本发明实施例中,NFCC接收DH发送的服务信息的方式同前面的实施例所述,这里不再赘述。
S303、NFCC接收上述DH发送的开启命令,以开启NFCC执行服务发现过程的能力。
本发明实施例中,NFCC接收DH发送的开启命令的方式同前面的实施例所述,这里不再赘述。
S304、NFCC接收第二NFC设备或DH发送的LLC PDU。
S305、NFCC通过上述LLC PDU包头中的类型标识判断上述LLC PDU是否为第一CONNECT PDU。
本发明实施例,当步骤S305的判断结果为是时,NFCC执行步骤S306;当步骤S305的判断结果为否时,NFCC判断上述LLC PDU是否为第二设备发送的SNL PDU或第二设备发送AGF PDU,若是,则NFCC执行对应的操作,如当上述LLC PDU为第二设备发送的SNL PDU时,NFCC执行图2所示的步骤S206~S208对应的操作,若否,则NFCC判断上述LLC PDU对应的功能能否在当前已激活的射频接口(即NCI协议定义的RF Interface,具体请见NCI协议,这里不再赘述)下作为射频接口功能扩展在NFCC上进行处理,若能,则NFCC直接处理后应答,若不能,则当上述LLC PDU为第二NFC设备发送的PDU时,NFCC直接将上述LLC PDU转发至DH,当上述LLC PDU为DH发送的PDU时,NFCC直接将上述LLC PDU发送至第二NFC设备。
S306、当上述LLC PDU为第一CONNECT PDU时,NFCC判断该第一CONNECT PDU的包头中的DSAP字段的值是否等于预设值01h。
本发明实施例中,当步骤S306的判断结果为是时,NFCC执行步骤S307;当步骤S306的判断结果为否且上述第一CONNECT PDU为第二NFC设备发送的PDU时,NFCC判断上述第一CONNECT PDU对应的功能能够在当前已激活的射频接口(即NCI协议定义的RF Interface,具体请见NCI协议,这里不再赘述)下作为射频接口功能扩展在NFCC上进行处理,若能,则NFCC直接处理后应答,若否,则NFCC直接将上述LLC PDU转发至DH;当步骤S306的判断结果为否且上述第一CONNECT PDU为DH发送的PDU时,NFCC直接将上述第 一CONNECT PDU发送至第二NFC设备。
S307、当上述DSAP字段的值等于预设值01h时,NFCC判断是否能够从上述第一CONNECT PDU的信息字段中解析出第二SN。
本发明实施例中,当步骤S307的判断结果为是时,NFCC执行步骤S308;当步骤S307的判断结果为否且上述第一CONNECT PDU为第二NFC设备发送的PDU时,NFCC不对上述第一CONNECT PDU进行应答,或直接生成包含错误指示的应答信息并将该应答信息返回至第二NFC设备;当步骤S306的判断结果为否且上述第一CONNECT PDU为DH发送的PDU时,NFCC不对上述第一CONNECT PDU进行应答,或直接生成包含错误指示的应答信息并将该应答信息返回至DH。
S308、当解析出第二SN时,NFCC生成包括上述第二SN的第二SDREQ,并将该第二SDREQ通过SNL PDU发送至第二NFC设备。
S309、NFCC接收第二NFC设备响应上述第二SDREQ发送的包括第二SDRES的SNL PDU。
本发明实施例中,该第二SDRES中包括第二SAP,其中,第二SAP可以是第二NFC设备的NFCC为上述第二SN分配的SAP,也可以是第二NFC设备的NFCC从该NFCC存储的服务信息中查询出的与上述第二SN对应的SAP,本发明实施例不做限定。
本发明实施例中,步骤S306及步骤S307为NFCC判断是否需要执行服务发现过程的步骤,步骤S308以及步骤S309为NFCC执行服务发现过程的步骤。
作为一种可选的实施方式,当上述第一CONNECT PDU为DH发送的PDU时,NFCC在执行完毕步骤S309之后,NFCC还可以执行以下操作:
NFCC生成第二CONNECT PDU,并将该第二CONNECT PDU发送至第二NFC设备,其中,该第二CONNECT PDU中的DSAP为上述第二SDRES中的第二SAP,且当上述第一CONNECT PDU的包头中的源服务访问点(SSAP,Source Service Access Point)字段的值为无效值(如00h或01h等)时,该第二CONNECT PDU中的SSAP为NFCC从上述服务信息中查询出的与上述第二SN对应的第三SAP,当上述第一CONNECT PDU的包头中的SSAP字段的值为有效值时,该第二CONNECT PDU中的SSAP为上述第一CONNECT PDU的包头中的SSAP。
本发明实施例中,对于上述步骤S306-S307,NFCC在确定接收到的LLC  PDU是DH发送的CONNECT PDU之后,还可以判断该CONNECT PDU的包头中的DSAP是否为01h且SSAP是否为有效值(即非00h以及非01h的其它值),如果是,则NFCC可以直接将该CONNECT PDU发送给对端的第二NFC设备,也可以先判断该CONNECT PDU的信息字段中的SN与该CONNECT PDU的包头中的SSAP是否为NFCC中保存的服务信息中的一对,若是,则将该CONNECT PDU发送给对端的第二NFC设备,若否,则执行上述步骤S308-S309所述的服务发现过程以及上述重新生成CONNECT PDU的操作;如果该CONNECT PDU的包头中的DSAP为01h且SSAP为非有效值(如00h或01h),则NFCC可以直接将该CONNECT PDU发送给第二NFC设备,也可以执行上述步骤S308-S309所述的服务发现过程以及上述重新生成CONNECT PDU的操作,还可以在解析出该CONNECT PDU的信息字段中的SN后为其查找到对应的SAP或为其分配对应的SAP,然后执行上述重新生成CONNECT PDU的操作;如果该CONNECT PDU的包头中的DSAP为非00h以及非01h的其它值,则NFCC直接将该CONNECT PDU发送给对端的第二NFC设备。
作为另一种可选的实施方式,当上述第一CONNECT PDU为DH发送的PDU时,NFCC在执行完毕步骤S309之后,NFCC还可以执行以下操作:
NFCC将NFCC执行服务发现过程的结果(即上述第二SDRES中的第二SAP)以及用于重新生成CONNECT PDU的请求消息上报至DH,接收DH重新生成的CONNECT PDU并将该重新生成的CONNECT PDU发送至第二NFC设备,其中,该重新生成的CONNECT PDU中的DSAP为上述第二SDRES中的第二SAP。
作为一种可选的实施方式,当上述第一CONNECT PDU为第二NFC设备发送的PDU时,NFCC在执行完毕步骤S309之后,NFCC还可以执行以下操作:
NFCC生成连接完成协议数据单元(CC PDU,CONNECT Complete PDU),并将该CC PDU发送至第二NFC设备,其中,该CC PDU中的SSAP为上述服务信息中与上述第二SN对应的第四SAP,该CC PDU中的DSAP为上述第二SDRES中的第二SAP,且该CC PDU用于指示第一NFC设备与第二NFC设备间的数据链路连接建立成功;
NFCC将上述第一CONNECT PDU对应的指示信息以及用于指示数据链路连接建立成功的指示信息发送至DH,其中,上述第一CONNECT PDU对应的 指示信息可以包括但不限于上述第二SAP,或者上述第二SAP与上述第一CONNECT PDU的PDU类型,其中,上述第一CONNECT PDU的PDU类型用于表示第二NFC设备请求建立与第一NFC设备之间的数据链路连接。
本发明实施例中,对于上述步骤S306-S307,NFCC在确定接收到的LLC PDU是对端的第二NFC设备发送的CONNECT PDU之后,还可以判断该CONNECT PDU的包头中的DSAP是否为01h且SSAP是否为有效值(即非00h以及非01h的其它值),如果是,即该DSAP为01h且SSAP为有效值,则NFCC可以直接执行上述步骤S307-S309,也可以在解析出该CONNECT PDU的信息字段中的SN后为其查找到对应的SAP或为其分配对应的SAP,然后直接转发给DH;如果该DSAP为01h且SSAP为非有效值,则NFCC可以直接执行上述步骤S307-S309以及上述生成与应答CC PDU的操作;如果该DSAP为非00h以及非01h的其它值,且SSAP为有效值,则NFCC可以将该CONNECT PDU直接转发给DH;如果该DSAP为非00h以及非01h的其它值,且SSAP为非有效值,则NFCC可以在从NFCC保存的服务信息中为该DSAP查找到对应的SN之后执行上述步骤S308-S309以及上述生成与应答CC PDU的操作。
作为另一种可选的实施方式,当上述第一CONNECT PDU为第二NFC设备发送的PDU时,NFCC在执行完毕步骤S309之后,NFCC还可以执行以下操作:
NFCC将NFCC执行服务发现过程的结果以及上述第一CONNECT PDU对应的指示信息上报给DH,以等待DH生成CC PDU,其中,上述第一CONNECT PDU对应的指示信息可以包括但不限于上述第二SAP,或者上述第二SAP与上述第一CONNECT PDU的PDU类型,其中,上述第一CONNECT PDU的PDU类型用于表示第二NFC设备请求建立与第一NFC设备之间的数据链路连接。
当然,上述第一CONNECT PDU对应的指示信息还可以是第一CONNECT PDU,本发明对此不进行限定。
本发明实施例中,当上述LLC PDU为第二NFC设备发送的AGF PDU时,NFCC将该AGF PDU的信息字段中的每个LLC PDU解析出来,然后对解析出来的每个SNL PDU执行图2中的步骤S206~步骤S208对应的操作,对解析出来的每个CONNECT PDU执行图3中的步骤S306~步骤S309对应的操作。此外,NFCC也可以对DH发送的AGF PDU进行解析,若解析出该AGF PDU中包括CONNECT PDU,则NFCC也可以针对解析出的每个CONNECT PDU执行图3 中的步骤S306-S309对应的操作。
本发明实施例减少了NFCC与DH之间的交互次数,即NFCC执行服务发现过程,从而无需与DH进行交互,减少了DH的资源开销。此外,虽然在NFCC执行服务发现过程中需要NFCC具有解析LLC PDU的能力,但NFCC只需先对LLC PDU的包头进行解析,然后再针对个别LLC PDU进行解析,如包含SN的CONNECT PDU,并不是要对LLCP规定的所有(目前有14种)LLC PDU的信息字段全都进行解析,因此,NFCC解析个别LLC PDU带来的NFCC的开销较小,不会影响RF通信,且本发明实施例还能够使NFCC分担DH的一部分功能,如服务发现过程,也符合点对点模式下DH与NFCC之间逻辑接口向上层发展的趋势。另外,本实施例中,双方在传送上层信息之前,即使DH处于休眠状态,NFCC一样可以完成服务发现过程,从而为后续交互上层信息做好准备。
请参阅图4,图4是本发明实施例公开的又一种基于逻辑链路控制协议LLCP的服务发现方法的流程示意图。其中,图4所示的流程示意图为NFCC在激活某个射频接口(如LLCP高射频接口)之前执行基于逻辑链路控制协议LLCP的服务发现方法的流程示意图,且图4中的NFCC为第一NFC设备的NFCC,图4中的DH为第一NFC设备中的DH。如图4所示,该基于逻辑链路控制协议LLCP的服务发现方法可以包括以下步骤:
S401、NFCC向DH上报用于表示NFCC支持LLCP高射频接口的指示信息。
本发明实施例中,NFCC可以通过上述实施例中的表1向DH上报自身支持LLCP高射频接口的指示信息,示例地,通过表1中第n(n=1,2…)个支持的射频接口字段中占1个字节的射频接口的值来表示该指示信息,当该值为0x04时,表示支持LLCP高射频接口,如下表8所示:
表8:射频接口(RF Interfaces)
射频接口的值 意义
…… ……
0x04 LLCP高射频接口(LLCP High RF Interface)
…… ……
其中,上述表8是NCI协议的表格131,本发明实施例中的0x04以及对应的LLCP高射频接口是在NCI协议的表格131中新增的内容。
S402、NFCC接收上述DH通过CORE_SET_CONFIG_CMD配置的服务信息。
本发明实施例中,NFCC接收DH发送的服务信息的方式同前面的实施例所述,这里不再赘述。
S403、NFCC在RF发现过程中完成LLCP链路激活。
本发明实施例中,所述LLCP链路激活的具体过程请参考NFC论坛定义的LLCP协议,此处不再赘述。
S404、NFCC接收第二NFC设备发送的LLC PDU。
S405、NFCC确定上述LLC PDU的类型。
本发明实施例中,同上述实施例的方式相同,NFCC可以通过LLC PDU的包头中的类型标识PTYPE来判断该LLC PDU是哪种类型的PDU。当上述LLC PDU为SNL PDU时,NFCC执行步骤S406;当上述LLC PDU为CONNECT PDU时,NFCC执行步骤S413;当上述LLC PDU为包括至少一个SNL PDU和/或至少一个CONNECT PDU的AGF PDU时,NFCC首先将该AGF PDU的信息字段中的每个LLC PDU解析出来,当解析出的LLC PDU为SNL PDU时,NFCC执行步骤S406,当解析出的LLC PDU为CONNECT PDU时,NFCC执行步骤S413;此外,当上述LLC PDU为其他任意一种类型的PDU时,NFCC可以执行步骤S412(图4中未示出)。
S406、NFCC判断LLC PDU的信息字段中包含的参数是否为SDREQ。
本发明实施例中,当步骤S406的判断结果为是时,NFCC执行步骤S407;当步骤S406的判断结果为否时,NFCC执行步骤S412。
S407、NFCC从上述服务信息中查找与上述SDREQ包括的SN对应的SAP。
本发明实施例中,上述服务信息的获取方式同上述实施例,这里不再赘述。
S408、NFCC判断是否能够查找到与上述SDREQ包括的SN对应的SAP。
本发明实施例中,当步骤S408的判断结果为是时,NFCC执行步骤S409;当步骤S408的判断结果为否时,NFCC执行步骤S411。
需要说明的是,本发明实施例中,当本步骤判断结果为否时,NFCC也可以为该SN分配一个对应的SAP,然后执行步骤S409。
S409、NFCC生成包括上述SAP的SDRES,并将该SDRES通过SNL PDU返回至第二NFC设备,并等待第二NFC设备发送的其它LLC PDU。
S410、NFCC激活LLCP高射频接口并上报至上述DH。
S411、NFCC不进行应答,或直接生成包含错误指示的应答信息并将该应答信息返回至第二NFC设备。
S412、NFCC对LLC PDU进行处理,并激活LLCP高射频接口。
S413、NFCC判断LLC PDU的包头中的DSAP字段的值是否等于01h。
本发明实施例中,当步骤S413的判断结果为是时,NFCC执行步骤S414;当步骤S413的判断结果为否时,NFCC执行步骤S412。
需要说明的是,对于CONNECT PDU的判断过程,还可以采用上述实施例中所述的其他方式,这里不再赘述。
S414、NFCC判断是否能够从LLC PDU的信息字段中解析出SN。
本发明实施例中,当步骤S414的判断结果为是时,NFCC执行步骤S415;当步骤S414的判断结果为否时,NFCC执行步骤S411。
S415、NFCC从上述服务信息中查找上述SN和/或与上述SN对应的SAP。
需要说明的是,本步骤的目的是,NFCC为了检查第一NFC设备上是否有服务名称为上述SN的服务,或者更进一步地,检查第一NFC设备是否为服务名称为上述SN的服务分配了对应的SAP。
S416、NFCC判断是否能够查找到上述SN和/或与上述SN对应的SAP。
本发明实施例中,当步骤S416的判断结果为是时,NFCC执行步骤S417;当步骤S416的判断结果为否时(即NFCC没有查找到服务名称为上述SN的服务,或者,没有查找到服务名称为上述SN的服务对应的SAP),NFCC执行步骤S420。
S417、NFCC执行服务发现过程,即生成包括上述SN的SDREQ,将该SDREQ通过SNL PDU发送至第二NFC设备,并接收第二NFC设备响应于上述SDREQ而发送的包括SDRES的SNL PDU。
本发明实施例中,该SDRES包括第二NFC设备的NFCC从该NFCC中存储的服务信息中查询出的与步骤S416中的SN对应的SAP,或第二NFC设备的NFCC为步骤S416中的SN分配的SAP。
S418、NFCC激活LLCP高射频接口并上报至DH。
本发明实施例中,NFCC激活LLCP高射频接口的方式与NCI协议中定义的激活其他射频接口的方式相似,激活射频接口之后上报DH的方式也相似,这 里不再赘述。
S419、NFCC将执行服务发现过程的结果及所接收或解析出的CONNECT PDU发送至DH,或根据上述SDRES修改所接收或解析出的CONNECT PDU(即将该CONNECT PDU中的DSAP更新为上述所接收SDRES中的SAP)并发送至DH,以使DH生成CC PDU进行应答;或者生成CC PDU并将该CC PDU发送至第二NFC设备,然后将LLC PDU对应的指示信息(同上述实施例中的LLC PDU对应的指示信息,这里不再赘述)以及用于指示数据链路连接建立成功的指示信息发送至DH。
S420、NFCC生成包含拒绝原因的断开模式协议数据单元(DM PDU,Disconnected Mode Protocol Data Unit),并将该DM PDU发送至第二NFC设备。
需要说明的是,该DM PDU中的拒绝原因用来表示第一NFC设备不与第二NFC设备建立数据链路连接的具体原因。
实施本发明实施例能够使NFCC在激活NFCC支持的LLCP高射频接口之前执行服务发现过程,且在执行完服务发现过程之后激活LLCP高射频接口并上报至DH,因此,可以在激活射频接口之前减少DH与NFCC之间的交互,减少DH的资源开销,能使NFCC在一定程度上与对端NFC设备进行自由交互,即,能够使NFCC分担DH的一部分功能,如服务发现过程,也符合了点对点模式下DH与NFCC之间逻辑接口向上层发展的趋势。
请参阅图5,图5是本发明实施例公开的一种NFC控制器的结构示意图。其中,图5所示的NFC控制器为第一NFC设备中的NFC控制器,且该第一NFC设备还包括DH。如图5所示,该NFC控制器可以包括通信模块501、第一判断模块502、第二判断模块503以及执行模块504,其中:
通信模块501,用于接收LLC PDU。
本发明实施例中,通信模块501可以由用于与DH进行通信的第一通信子模块5011以及用于与第二NFC设备进行通信的第二通信子模块5012组成,此时,通信模块501的结构示意图可以如图10所示,图10是本发明实施例公开的一种NFC控制器中通信模块的结构示意图。且通信模块501接收LLC PDU的具体方式为:第一通信子模块5011接收DH发送的LLC PDU,第二通信子模块5012接收第二NFC设备发送的LLC PDU。
第一判断模块502,用于根据上述LLC PDU的包头中的类型标识判断上述LLC PDU是否为目标LLC PDU。
本发明实施例中,当第一判断模块502的判断结果为是时,第二判断模块503判断是否需要执行服务发现过程;当第一判断模块502的判断结果为否且上述LLC PDU为第二NFC设备发送的PDU时,NFC控制器可以通过通信模块501的第一通信子模块5011将上述LLC PDU发送至上述DH,或当上述LLC PDU对应的功能能够在当前已激活的射频接口(即NCI协议定义的RF Interface,具体请见NCI协议,这里不再赘述)下可作为射频接口功能扩展(即NCI协议定义的RF Interface Extension,具体请见NCI协议,这里不再赘述)在NFC控制器上处理时,NFC控制器直接对上述LLC PDU进行处理并应答;当第一判断模块502的判断结果为否且上述LLC PDU为上述DH发送的PDU时,NFC控制器可以通过通信模块501的第二通信子模块5012将上述LLC PDU发送至第二NFC设备。
本发明实施例中,目标LLC PDU可以包括但不限于上述DH或第二NFC设备发送的第一CONNECT PDU、第二NFC设备发送的SNL PDU或第二NFC设备发送的聚合帧协议数据单元(AGF PDU,Aggregated Frame PDU)等,其中,AGF PDU中可以包括CONNECT PDU和/或SNL PDU,本发明实施例不做限定。
第二判断模块503,用于当第一判断模块502的判断结果为是时,判断是否需要执行服务发现过程。
本发明实施例中,当第二判断模块503的判断结果为是时,NFC控制器的执行模块504执行服务发现过程;当第二判断模块503的判断结果为否且上述LLC PDU为第二NFC设备发送的LLC PDU时,NFC控制器可以通过通信模块501的第一通信子模块5011将上述LLC PDU发送至上述DH;当第二判断模块503的判断结果为否且上述LLC PDU为上述DH发送的LLC PDU时,NFC控制器通过通信模块501的第二通信子模块5012将上述LLC PDU发送至第二NFC设备。
执行模块504,用于当第二判断模块503的判断结果为是时,执行服务发现过程。
作为一种可选的实施方式,通信模块501的第一通信子模块5011还可以用于在执行模块504执行服务发现过程之前,接收上述DH发送的开启命令,其中,该开启命令用于命令NFC控制器开启执行服务发现过程的功能,且通信模块 501的第一通信子模块5011接收上述DH发送的开启命令的前提为上述DH确定NFC控制器具有执行服务发现过程的能力,上述DH确定NFC控制器具有执行服务发现过程的能力的具体方式包括但不限于以下两种:一、上述DH在确定需要由NFC控制器执行服务发现过程之前主动向NFC控制器发送用于查询NFC控制器是否具有执行服务发现过程的能力的查询请求,以使NFC控制器响应该查询请求并通过通信模块501的第一通信子模块5011向上述DH上报能力信息,该能力信息用于指示NFC控制器具有执行服务发现过程的能力;二、在NFC控制器初始化时,NFC控制器通过通信模块501的第一通信子模块5011向上述DH上报能力信息,该能力信息用于指示NFCC具有执行服务发现过程的能力。本发明实施例中,NFC控制器的通信模块501的第一通信子模块5011接收上述DH发送的开启命令的前提是帧射频接口、NFC-DEP射频接口或者LLCP高射频接口已经被激活。
作为另一种可选的实施方式,在图5所示的NFC控制器的结构的基础上,NFC控制器还可以包括确定模块505,且包括确定模块505的NFC控制器的结构如图6所示,图6是本发明实施例公开的另一种NFC控制器的结构示意图,其中:
确定模块505,用于确定NFC控制器具有执行服务发现过程的能力。
本发明实施例中,当确定模块505确定NFC控制器具有执行服务发现过程的能力时,在执行模块504执行服务发现过程之后,NFC控制器可以激活上述LLCP高射频接口并通过通信模块501的第一通信子模块5011上报至上述DH。
作为一种可选的实施方式,通信模块501的第一通信子模块5011还可以用于在接收LLC PDU之前,向上述DH上报能力信息,其中,该能力信息用于指示NFC控制器具有执行服务发现过程的能力。
本发明实施例中,通信模块501的第一通信子模块5011向上述DH上报能力信息的具体方式如上面实施例所示,这里不再赘述。
作为一种可选的实施方式,当通信模块501接收到的LLC PDU为第二NFC设备发送的SNL PDU时,第二判断模块503判断是否需要执行服务发现过程的具体方式可以为:
判断上述SNL PDU的信息字段中包含的参数是否为第一SDREQ,若是,则确定需要执行服务发现过程,若否,则不需要执行服务发现过程。
执行模块504执行服务发现过程的具体方式可以为:
从预先存储的服务信息中确定出与上述第一SDREQ包括的第一SN对应的第一SAP,其中,该服务信息包括至少一个SN以及每个SN对应的SAP;
生成包括上述第一SAP的第一SDRES,并通过通信模块501的第二通信子模块5012将上述第一SDRES发送至第二NFC设备。
本发明实施例中,该服务信息可以为通信模块501的第一通信子模块5011接收到的、上述DH在接收到能力信息后直接为NFC控制器配置的服务信息,其中,通信模块501的第一通信子模块5011接收DH发送的服务信息的方式如上面实施例所述,这里不再赘述,也可以是通信模块501的第一通信子模块5011接收到的、上述DH发送的开启命令中包括的服务信息。其中,该服务信息可以包括至少一个SN,也可以包括至少一个SN以及与每个SN对应的SAP,还可以包括一个或多个SN以及与该一个或多个SN的部分SN中每个SN分别对应的SAP,本发明实施例不做限定,且当该服务信息包括至少一个SN时,在通信模块501的第一通信子模块5011接收到服务信息之后,NFC控制器为服务信息中的每个SN分配对应的SAP。
作为一种可选的实施方式,当上述LLC PDU为上述第一CONNECT PDU时,第二判断模块503判断是否需要执行服务发现过程的具体方式为:
判断上述第一CONNECT PDU的包头中的DSAP字段的值是否等于预设值01h,当该DSAP字段的值等于预设值01h时,判断是否能够从上述第一CONNECT PDU的信息字段中解析出第二SN。
当第二判断模块503判断出能够从上述第一CONNECT PDU的信息字段中解析出第二SN时,执行模块504执行服务发现过程的具体方式为:
生成包括上述第二SN的第二SDREQ,并通过通信模块501的的第二通信子模块5012将该第二SDREQ发送至第二NFC设备,然后通过通信模块501的第二通信子模块5012接收第二NFC设备响应该第二SDREQ发送的第二SDRES,其中,该第二SDRES中包括第二SAP,且第二SAP可以是第二NFC设备的NFC控制器为上述第二SN分配的SAP,也可以是第二NFC设备的NFC控制器从存储的服务信息中查询出的与上述第二SN对应的SAP。
作为一种可选的实施方式,在图5所示的NFC控制器的结构的基础上,NFC控制器还可以包括第一生成模块506,且包括第一生成模块506的NFC控制器的结构如图7所示,图7是本发明实施例公开的又一种NFC控制器的结构示意图, 其中:
第一生成模块506,用于当上述第一CONNECT PDU由上述DH发送时且在执行模块504执行服务发现过程之后,生成第二CONNECT PDU,其中,第二CONNECT PDU中的SSAP为上述第一CONNECT PDU中的SSAP或图7所示的NFC控制器从预先存储的服务信息中查询出的与上述第二SN对应的第三SAP,第二CONNECT PDU中的DSAP为上述第二SAP,且该服务信息包括至少一个SN以及每个SN对应的SAP,该服务信息是通信模块501的第一通信子模块5011接收到的、上述DH配置的服务信息,且通信模块501的第一通信子模块5011接收服务信息的具体方式如上面实施例所述,这里不再赘述。
本发明实施例中,通信模块501的第二通信子模块5012,还可以用于将上述第二CONNECT PDU发送至第二NFC设备。
本发明实施例中,当上述LLC PDU为DH发送的CONNECT PDU时,第二判断模块503还可以用于判断该CONNECT PDU的包头中的DSAP是否为01h且SSAP是否为有效值(即非00h以及非01h的其它值),如果是,则NFC控制器的通信模块501的第二通信子模块5012可以直接将该CONNECT PDU发送给对端的第二NFC设备,或第二判断模块503先判断该CONNECT PDU的信息字段中的SN与包头中的SSAP是否为NFC控制器中保存的服务信息中的一对,若是,则NFC控制器的通信模块501的第二通信子模块5012将该CONNECT PDU发送给对端的第二NFC设备,若否,则由执行模块504执行服务发现过程且在执行模块504执行服务发现过程之后,由第一生成模块506重新生成CONNECT PDU;如果该CONNECT PDU的包头中的DSAP为01h且SSAP为非有效值(如00h或01h),则NFC控制器的通信模块501的第二通信子模块5012可以直接将该CONNECT PDU发送给第二NFC设备,也可以由执行模块504执行服务发现过程且在执行模块504执行服务发现过程之后,由第一生成模块506重新生成CONNECT PDU,还可以在解析出该CONNECT PDU的信息字段中的SN后为其查找到对应的SAP或为其分配对应的SAP,然后由第一生成模块506重新生成CONNECT PDU;如果该CONNECT PDU的包头中的DSAP为非00h以及非01h的其它值,则NFC控制器的通信模块501的第二通信子模块5012直接将该CONNECT PDU发送给对端的第二NFC设备。
作为一种可选的实施方式,在图5所示的NFC控制器的结构的基础上,NFC 控制器还可以包括第二生成模块507,且包括第二生成模块507的NFC控制器的结构如图8所示,图8是本发明实施例公开的又一种NFC控制器的结构示意图,其中:
第二生成模块507,用于当上述第一CONNECT PDU由第二NFC设备发送时且在执行模块504执行服务发现过程之后,生成CC PDU,其中,该CC PDU中的SSAP为预先储存的服务信息中与上述第二SN对应的第四SAP,该CC PDU中的DSAP为上述第二SAP,且CC PDU用于指示第一NFC设备与第二NFC设备间的数据链路连接建立成功,且该服务信息包括至少一个SN以及每个SN对应的SAP,该服务信息是通信模块501的第一通信子模块5011接收到的、上述DH配置的服务信息,且通信模块501的第一通信子模块5011接收服务信息的具体方式如上面实施例所述,这里不再赘述。
本发明实施例中,通信模块501的第二通信子模块5012,还可以用于将上述CC PDU发送至第二NFC设备,且通信模块501的第一通信子模块5011还可以用于将上述第一CONNECT PDU对应的指示信息以及用于指示上述数据链路连接建立成功的指示信息发送至上述DH,其中,上述第一CONNECT PDU对应的指示信息可以包括但不限于上述第二SAP以及上述第一CONNECT PDU的PDU类型,其中,上述第一CONNECT PDU的PDU类型用于表示第二NFC设备请求建立与第一NFC设备之间的数据链路连接。
本发明实施例中,当通信模块501接收到的LLC PDU是对端的第二NFC设备发送的CONNECT PDU之后,第二判断模块503还可以判断该CONNECT PDU的包头中的DSAP是否为01h且SSAP是否为有效值(即非00h以及非01h的其它值),如果是,即该DSAP为01h且SSAP为有效值,则NFC控制器的执行模块504执行服务发现过程,也可以在解析出该CONNECT PDU的信息字段中的SN后为其查找到对应的SAP或为其分配对应的SAP,然后由通信模块501的第一通信子模块5011直接转发给DH;如果该DSAP为01h且SSAP为非有效值,则由执行模块504执行上服务发现过程,并在服务发现过程执行完毕后,由第二生成模块507生成CC PDU并由通信模块501的第二通信子模块5012将该CC PDU发送至对端的第二NFC设备;如果该DSAP为非00h以及非01h的其它值,且SSAP为有效值,则NFC控制器的通信模块501的第一通信子模块5011可以将该CONNECT PDU直接转发给DH;如果该DSAP为非00h以及非01h的其它值, 且SSAP为非有效值,则NFC控制器可以在从NFCC保存的服务信息中为该DSAP查找到对应的SN之后,由执行模块504执行服务发现过程,然后由第二生成模块507生成CC PDU,最后由通信模块501的第二通信子模块5012将该CC PDU发送至对端的第二NFC设备。
本发明实施例减少了NFC控制器与DH之间的交互次数,即NFCC执行服务发现过程,从而无需与DH进行交互,减少了DH的资源开销。此外,虽然NFC控制器在执行服务发现过程中需要具有解析LLC PDU的能力,但NFC控制器只需先对LLC PDU的包头进行解析,然后再针对个别LLC PDU进行解析,并不需要对LLCP规定的所有(目前有14种)LLC PDU的信息字段全都进行解析,因此,NFC控制器解析个别LLC PDU带来的NFCC的开销较小,不会影响RF通信,且本发明实施例还能够使NFC控制器分担DH的一部分功能,如服务发现过程,也符合点对点模式下DH与NFC控制器之间逻辑接口向上层发展的趋势。另外,本实施例中,双方在传送上层信息之前,即使DH处于休眠状态,NFCC一样可以完成服务发现过程,从而为后续交互上层信息做好准备。
请参阅图9,图9是本发明实施例公开的又一种NFC控制器的结构示意图。其中,图9所示的NFC控制器为第一NFC设备中的NFC控制器,且该第一NFC设备还包括DH。如图9所示,该NFC控制器可以包括:至少一个处理器901,如CPU,通信装置902,且该通信装置902可以包括用于与DH进行通信的第一通信子装置9021,如DH与NFCC之间的接口,该接口在上层可以支持NCI协议,在底层可以使用通用异步收发传输器(UART,Universal Asynchronous Receiver/Transmitter)、I2C总线(Inter-Integrated Circuit)或半双工串行外设接口(SPI,Serial Peripheral Interface)等传输数据,以及用于与第二NFC设备进行通信的第二通信子装置9022,如NFC控制器中的收发电路等,该收发电路中NFC天线的工作频率可以是13.56MHz,NFC控制器通过该NFC天线可以向第二NFC设备发送数据,也可以从第二NFC设备接收数据,存储器903以及至少一个通信总线904,存储器903可以是高速RAM存储器,也可以是非不稳定的存储器(non-volatile memory),如至少一个磁盘存储器,可选的,存储器903还可以是至少一个位于远离前述处理器901的存储装置。其中:
通信总线904用于实现这些组件之间的连接通信。
通信装置902,用于接收LLC PDU。
具体的,通信装置902的第一通信子装置9021用于接收DH发送的LLC PDU,通信装置902的第二通信子装置9022用于接收第二NFC设备发送的LLC PDU。
存储器903中存储一组程序代码,且处理器901调用存储器903中存储的程序代码,用于执行以下操作:
根据上述LLC PDU的包头中的类型标识判断上述LLC PDU是否为目标LLC PDU,其中,该目标LLC PDU包括上述DH或第二NFC设备发送的第一CONNECT PDU、第二NFC设备发送的SNL PDU或第二NFC设备发送的AGF PDU,且AGF PDU中可以包括CONNECT PDU和/或SNL PDU,本发明实施例不做限定。
当上述LLC PDU为上述目标LLC PDU时,判断是否需要执行服务发现过程,若是,则执行服务发现过程。
在一个实施例中,当上述LLC PDU为第二NFC设备发送的SNL PDU时,处理器901判断是否需要执行服务发现过程的具体方式可以为:
判断上述SNL PDU的信息字段中包含的参数是否为第一SDREQ,当判断结果为是时,处理器901需要执行服务发现过程;
处理器901执行服务发现过程的具体方式可以为:
从预先存储的服务信息中确定出与上述第一SDREQ包括的第一SN对应的第一SAP,其中,该服务信息包括至少一个SN以及每个SN对应的SAP;
生成包括上述第一SAP的第一SDRES,并通过通信装置902的第二通信子装置9022将该第一SDRES发送至第二NFC设备。
在一个实施例中,当上述LLC PDU为上述第一CONNECT PDU时,处理器901判断是否需要执行服务发现过程的具体方式可以为:
判断上述第一CONNECT PDU的包头中的DSAP字段的值是否等于预设值01h,当该DSAP字段的值等于预设值01h时,判断是否能够从上述第一CONNECT PDU的信息字段中解析出第二SN,当解析出第二SN时,处理器901需要执行服务发现过程。
处理器901执行服务发现过程的具体方式为:
生成包括上述第二SN的第二SDREQ,并通过通信装置902的第二通信子装置9022将该第二SDREQ发送至第二NFC设备;
通过通信装置902的第二通信子装置9022接收第二NFC设备响应上述第二SDREQ发送的第二SDRES,其中,第二SDRES中包括第二SAP,且第二SAP可以是第二NFC设备的NFC控制器为上述第二SN分配的SAP,也可以是第二NFC设备的NFC控制器从存储的服务信息中查询出的与上述第二SN对应的SAP。
在一个实施例中,处理器901用于调用存储器903中存储的程序代码,还用于执行以下操作:
当上述第一CONNECT PDU由上述DH发送时且在执行服务发现过程之后,生成第二CONNECT PDU,其中,该第二CONNECT PDU中的SSAP为上述第一CONNECT PDU中的SSAP或NFC控制器从预先存储的服务信息中查询出的与上述第二SN对应的第三SAP,且该第二CONNECT PDU中的DSAP为上述第二SAP,该服务信息包括至少一个SN以及每个SN对应的SAP。
通信装置902的第二通信子装置9022,还可以用于将上述第二CONNECT PDU发送至第二NFC设备。
在一个实施例中,处理器901用于调用存储器903中存储的程序代码,还用于执行以下操作:
当上述第一CONNECT PDU由第二NFC设备发送时且在执行服务发现过程之后,生成CC PDU,其中,该CC PDU中的SSAP为预先储存的服务信息中与上述第二SN对应的第四SAP,该CC PDU中的DSAP为上述第二SAP,且该CC PDU用于指示第一NFC设备与第二NFC设备间的数据链路连接建立成功,该服务信息包括至少一个SN以及每个SN对应的SAP。
通信装置902的第二通信子装置9022,还可以用于将上述CC PDU发送至第二NFC设备,且通信装置902的第一通信子装置9021还可以用于将上述第一CONNECT PDU对应的指示信息以及用于指示上述数据链路连接建立成功的指示信息发送至上述DH,其中,该第一CONNECT PDU对应的指示信息可以包括但不限于第二SAP以及以及上述第一CONNECT PDU的PDU类型,其中,上述第一CONNECT PDU的PDU类型用于表示第二NFC设备请求建立与第一 NFC设备之间的数据链路连接。
在一个实施例中,通信装置902的第一通信子装置9021,还可以用于在处理器901执行服务发现过程之前,接收上述DH发送的开启命令,其中,该开启命令用于命令NFC控制器开启执行服务发现过程的功能。
在一个实施例中,处理器901用于调用存储器903中存储的程序代码,还用于执行以下操作:
确定NFC控制器具有执行服务发现过程的能力。
在一个实施例中,通信装置902的第一通信子装置9021,还可以用于向上述DH上报能力信息,其中,该能力信息用于指示NFC控制器具有执行服务发现过程的能力。
在一个实施例中,上述服务信息可以为通信装置902的第一通信子装置9021接收到的、上述DH在接收到能力信息后直接为NFC控制器配置的服务信息,其中,通信装置902的第一通信子装置9021接收DH发送的服务信息的方式如上面实施例所述,这里不再赘述,也可以是通信装置902的第一通信子装置9021接收到的、上述DH发送的开启命令中包括的服务信息。其中,上述服务信息可以包括至少一个SN,也可以包括至少一个SN以及与每个SN对应的SAP,还可以包括一个或多个SN以及与该一个或多个SN的部分SN中每个SN分别对应的SAP,本发明实施例不做限定,且当该服务信息包括至少一个SN时,在通信装置902的第一通信子装置9021接收到服务信息之后,NFC控制器的处理器901为服务信息中的每个SN分配对应的SAP。
本发明实施例减少了NFC控制器与DH之间的交互次数,即NFCC执行服务发现过程,从而无需与DH进行交互,减少了DH的资源开销。此外,虽然NFC控制器在执行服务发现过程中需要具有解析LLC PDU的能力,但NFC控制器只需先对LLC PDU的包头进行解析,然后再针对个别LLC PDU进行解析,并不需要对LLCP规定的所有(目前有14种)LLC PDU的信息字段全都进行解析,因此,NFC控制器解析个别LLC PDU带来的NFCC的开销较小,不会影响RF通信,且本发明实施例还能够使NFC控制器分担DH的一部分功能,如服务发现过程,也符合点对点模式下DH与NFC控制器之间逻辑接口向上层发展的趋势。另外,本实施例中,双方在传送上层信息之前,即使DH处于休眠状态,NFCC一样可以完成服务发现过程,从而为后续交互上层信息做好准备。
需要说明的是,上述实施例中提到的NFC设备(第一NFC设备以及第二NFC设备)是具有NFC功能的或通过NFC论坛(NFC Forum)测试认证的设备,它可以包括但不限于移动电话、移动电脑、平板电报、个人数字助理(PDA,Personal Digital Assistant)或可穿戴式设备等,本发明实施例不做限定。
需要说明的是,在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详细描述的部分,可以参见其他实施例的相关描述。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。
本发明实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。
本发明实施例NFC控制器中的模块以及子模块可以根据实际需要进行合并、划分和删减。
本发明实施例中所述模块以及子模块,可以通过通用集成电路,例如CPU(Central Processing Unit,中央处理器),或通过ASIC(Application Specific Integrated Circuit,专用集成电路)来实现。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
以上对本发明实施例公开的一种基于逻辑链路控制协议LLCP的服务发现方法及NFC控制器进行了详细介绍,本文中应用了具体实例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。

Claims (27)

  1. 一种基于逻辑链路控制协议LLCP的服务发现方法,所述方法应用于第一近场通信NFC设备的NFC控制器NFCC中,所述第一NFC设备还包括主机DH,其特征在于,所述方法包括:
    所述NFCC接收逻辑链路控制协议数据单元LLC PDU;
    所述NFCC根据所述LLC PDU的包头中的类型标识判断所述LLC PDU是否为目标LLC PDU,其中,所述目标LLC PDU包括所述DH或第二NFC设备发送的第一连接协议数据单元CONNECT PDU、所述第二NFC设备发送的服务名称发现协议数据单元SNL PDU或所述第二NFC设备发送的聚合帧协议数据单元AGF PDU;
    当所述LLC PDU为所述目标LLC PDU时,所述NFCC判断是否需要执行服务发现过程;
    若是,则所述NFCC执行所述服务发现过程。
  2. 根据权利要求1所述的方法,其特征在于,当所述LLC PDU为所述SNL PDU时,所述NFCC判断是否需要执行服务发现过程,包括:
    所述NFCC判断所述SNL PDU的信息字段中包含的参数是否为第一服务发现请求SDREQ;
    所述NFCC执行所述服务发现过程,包括:
    所述NFCC从预先存储的服务信息中确定出与所述第一SDREQ包括的第一服务名称SN对应的第一服务访问点SAP,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
    所述NFCC生成包括所述第一SAP的第一服务发现响应SDRES,并将所述第一SDRES发送至所述第二NFC设备。
  3. 根据权利要求1所述的方法,其特征在于,当所述LLC PDU为所述第一CONNECT PDU时,所述NFCC判断是否需要执行服务发现过程,包括:
    所述NFCC判断所述第一CONNECT PDU的包头中的目的服务访问点DSAP字段的值是否等于预设值;
    当所述DSAP字段的值等于所述预设值时,所述NFCC判断是否能够从所 述第一CONNECT PDU的信息字段中解析出第二SN;
    所述NFCC执行所述服务发现过程,包括:
    所述NFCC生成包括所述第二SN的第二SDREQ,并将所述第二SDREQ发送至所述第二NFC设备;
    所述NFCC接收所述第二NFC设备响应所述第二SDREQ发送的第二SDRES,所述第二SDRES中包括第二SAP。
  4. 根据权利要求3所述的方法,其特征在于,当所述第一CONNECT PDU由所述DH发送时,所述NFCC执行所述服务发现过程之后,所述方法还包括:
    所述NFCC生成第二CONNECT PDU,并将所述第二CONNECT PDU发送至所述第二NFC设备,所述第二CONNECT PDU中的源服务访问点SSAP为所述第一CONNECT PDU中的SSAP或所述NFCC从预先存储的服务信息中查询出的与所述第二SN对应的第三SAP,所述第二CONNECT PDU中的DSAP为所述第二SAP,所述服务信息包括至少一个SN以及每个所述SN对应的SAP。
  5. 根据权利要求3所述的方法,其特征在于,当所述第一CONNECT PDU由所述第二NFC设备发送时,所述NFCC执行所述服务发现过程之后,所述方法还包括:
    所述NFCC生成连接完成协议数据单元CC PDU,并将所述CC PDU发送至所述第二NFC设备,所述CC PDU中的SSAP为预先储存的服务信息中与所述第二SN对应的第四SAP,所述CC PDU中的DSAP为所述第二SAP,所述CC PDU用于指示所述第一NFC设备与所述第二NFC设备间的数据链路连接建立成功,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
    所述NFCC将所述第一CONNECT PDU对应的指示信息以及用于指示所述数据链路连接建立成功的指示信息发送至所述DH,所述第一CONNECT PDU对应的指示信息包括所述第二SAP。
  6. 根据权利要求1所述的方法,其特征在于,所述AGF PDU包括至少一个SNL PDU和/或至少一个CONNECT PDU。
  7. 根据权利要求1所述的方法,其特征在于,所述NFCC执行所述服务发现过程之前,所述方法还包括:
    所述NFCC接收所述DH发送的开启命令,所述开启命令用于命令所述NFCC开启执行所述服务发现过程的功能;或者,
    所述NFCC确定所述NFCC具有执行所述服务发现过程的能力。
  8. 根据权利要求2、4或5所述的方法,其特征在于,所述服务信息是由所述DH发送给所述NFCC的。
  9. 根据权利要求1所述的方法,其特征在于,所述NFCC接收逻辑链路控制协议数据单元LLC PDU之前,所述方法还包括:
    所述NFCC向所述DH上报能力信息,所述能力信息用于指示所述NFCC具有执行服务发现过程的能力。
  10. 一种NFC控制器,所述NFC控制器为第一NFC设备中的NFC控制器,所述第一NFC设备还包括DH,其特征在于,所述NFC控制器包括:
    通信模块,用于接收LLC PDU;
    第一判断模块,用于根据所述LLC PDU的包头中的类型标识判断所述LLC PDU是否为目标LLC PDU,其中,所述目标LLC PDU包括所述DH或第二NFC设备发送的第一CONNECT PDU、所述第二NFC设备发送的SNL PDU或所述第二NFC设备发送的AGF PDU;
    第二判断模块,用于当所述第一判断模块的判断结果为是时,判断是否需要执行服务发现过程;
    执行模块,用于当所述第二判断模块的判断结果为是时,执行服务发现过程。
  11. 根据权利要求10所述的NFC控制器,其特征在于,当所述LLC PDU为所述SNL PDU时,所述第二判断模块判断是否需要执行服务发现过程的具体方式为:
    判断所述SNL PDU的信息字段中包含的参数是否为第一服务发现请求 SDREQ;
    所述执行模块执行服务发现过程的具体方式为:
    从预先存储的服务信息中确定出与所述第一SDREQ包括的第一SN对应的第一SAP,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
    生成包括所述第一SAP的第一SDRES,并通过所述通信模块将所述第一SDRES发送至所述第二NFC设备。
  12. 根据权利要求10所述的NFC控制器,其特征在于,当所述LLC PDU为所述第一CONNECT PDU时,所述第二判断模块判断是否需要执行服务发现过程的具体方式为:
    判断所述第一CONNECT PDU的包头中的DSAP字段的值是否等于预设值;
    当所述DSAP字段的值等于所述预设值时,判断是否能够从所述第一CONNECT PDU的信息字段中解析出第二SN;
    所述执行模块执行服务发现过程的具体方式为:
    生成包括所述第二SN的第二SDREQ,并通过所述通信模块将所述第二SDREQ发送至所述第二NFC设备;
    通过所述通信模块接收所述第二NFC设备响应所述第二SDREQ发送的第二SDRES,所述第二SDRES中包括第二SAP。
  13. 根据权利要求12所述的NFC控制器,其特征在于,所述NFC控制器还包括第一生成模块,其中:
    所述第一生成模块,用于当所述第一CONNECT PDU由所述DH发送时且在所述执行模块执行服务发现过程之后,生成第二CONNECT PDU,所述第二CONNECT PDU中的SSAP为所述第一CONNECT PDU中的SSAP或所述NFC控制器从预先存储的服务信息中查询出的与所述第二SN对应的第三SAP,所述第二CONNECT PDU中的DSAP为所述第二SAP,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
    所述通信模块,还用于将所述第二CONNECT PDU发送至所述第二NFC设备。
  14. 根据权利要求12所述的NFC控制器,其特征在于,所述NFC控制器还包括第二生成模块,其中:
    所述第二生成模块,用于当所述第一CONNECT PDU由所述第二NFC设备发送时且在所述执行模块执行服务发现过程之后,生成CC PDU,所述CC PDU中的SSAP为预先储存的服务信息中与所述第二SN对应的第四SAP,所述CC PDU中的DSAP为所述第二SAP,所述CC PDU用于指示所述第一NFC设备与所述第二NFC设备间的数据链路连接建立成功,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
    所述通信模块,还用于将所述CC PDU发送至所述第二NFC设备,并将所述第一CONNECT PDU对应的指示信息以及用于指示所述数据链路连接建立成功的指示信息发送至所述DH,所述第一CONNECT PDU对应的指示信息包括所述第二SAP。
  15. 根据权利要求10所述的NFC控制器,其特征在于,所述AGF PDU包括至少一个SNL PDU和/或至少一个CONNECT PDU。
  16. 根据权利要求10所述的NFC控制器,其特征在于,所述通信模块,还用于在所述执行模块执行服务发现过程之前,接收所述DH发送的开启命令,所述开启命令用于命令所述NFC控制器开启执行所述服务发现过程的功能;或者,
    所述NFC控制器还包括确定模块,其中:
    所述确定模块,用于确定所述NFC控制器具有执行所述服务发现过程的能力。
  17. 根据权利要求11、13或14所述的NFC控制器,其特征在于,所述服务信息是由所述DH发送给所述NFC控制器的。
  18. 根据权利要求10所述的NFC控制器,其特征在于,所述通信模块,还用于向所述DH上报能力信息,所述能力信息用于指示所述NFC控制器具 有执行服务发现过程的能力。
  19. 一种NFC控制器,包括存储器、处理器以及通信装置,所述NFC控制器为第一NFC设备中的NFC控制器,所述第一NFC设备还包括DH,其特征在于,
    所述通信装置,用于接收LLC PDU;
    所述存储器中存储一组程序代码,且所述处理器用于调用所述存储器中存储的程序代码,用于执行以下操作:
    根据所述LLC PDU的包头中的类型标识判断所述LLC PDU是否为目标LLC PDU,其中,所述目标LLC PDU包括所述DH或第二NFC设备发送的第一CONNECT PDU、所述第二NFC设备发送的SNL PDU或所述第二NFC设备发送的AGF PDU;
    当所述LLC PDU为所述目标LLC PDU时,判断是否需要执行服务发现过程,若是,则执行服务发现过程。
  20. 根据权利要求19所述的NFC控制器,其特征在于,当所述LLC PDU为所述SNL PDU时,所述处理器判断是否需要执行服务发现过程的具体方式为:
    判断所述SNL PDU的信息字段中包含的参数是否为第一SDREQ;
    所述处理器执行服务发现过程的具体方式为:
    从预先存储的服务信息中确定出与所述第一SDREQ包括的第一SN对应的第一SAP,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
    生成包括所述第一SAP的第一SDRES,并通过所述通信装置将所述第一SDRES发送至所述第二NFC设备。
  21. 根据权利要求19所述的NFC控制器,其特征在于,当所述LLC PDU为所述第一CONNECT PDU时,所述处理器判断是否需要执行服务发现过程的具体方式为:
    判断所述第一CONNECT PDU的包头中的DSAP字段的值是否等于预设值;
    当所述DSAP字段的值等于所述预设值时,判断是否能够从所述第一CONNECT PDU的信息字段中解析出第二SN;
    所述处理器执行服务发现过程的具体方式为:
    生成包括所述第二SN的第二SDREQ,并通过所述通信装置将所述第二SDREQ发送至所述第二NFC设备;
    通过所述通信装置接收所述第二NFC设备响应所述第二SDREQ发送的第二SDRES,所述第二SDRES中包括第二SAP。
  22. 根据权利要求21所述的NFC控制器,其特征在于,所述处理器用于调用所述存储器中存储的程序代码,还用于执行以下操作:
    当所述第一CONNECT PDU由所述DH发送时且在执行服务发现过程之后,生成第二CONNECT PDU,所述第二CONNECT PDU中的SSAP为所述第一CONNECT PDU中的SSAP或所述NFC控制器从预先存储的服务信息中查询出的与所述第二SN对应的第三SAP,所述第二CONNECT PDU中的DSAP为所述第二SAP,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
    所述通信装置,还用于将所述第二CONNECT PDU发送至所述第二NFC设备。
  23. 根据权利要求21所述的NFC控制器,其特征在于,所述处理器用于调用所述存储器中存储的程序代码,还用于执行以下操作:
    当所述第一CONNECT PDU由所述第二NFC设备发送时且在执行服务发现过程之后,生成CC PDU,所述CC PDU中的SSAP为预先储存的服务信息中与所述第二SN对应的第四SAP,所述CC PDU中的DSAP为所述第二SAP,所述CC PDU用于指示所述第一NFC设备与所述第二NFC设备间的数据链路连接建立成功,所述服务信息包括至少一个SN以及每个所述SN对应的SAP;
    所述通信装置,还用于将所述CC PDU发送至所述第二NFC设备,并将所述第一CONNECT PDU对应的指示信息以及用于指示所述数据链路连接建立成功的指示信息发送至所述DH,所述第一CONNECT PDU对应的指示信息包括所述第二SAP。
  24. 根据权利要求19所述的NFC控制器,其特征在于,所述AGF PDU包括至少一个SNL PDU和/或至少一个CONNECT PDU。
  25. 根据权利要求19所述的NFC控制器,其特征在于,所述通信装置,还用于在所述处理器执行服务发现过程之前,接收所述DH发送的开启命令,所述开启命令用于命令所述NFC控制器开启执行所述服务发现过程的功能;或者,
    所述处理器用于调用所述存储器中存储的程序代码,还用于执行以下操作:
    确定所述NFC控制器具有执行所述服务发现过程的能力。
  26. 根据权利要求20、22或23所述的NFC控制器,其特征在于,所述服务信息是由所述DH发送给所述NFC控制器的。
  27. 根据权利要求19所述的NFC控制器,其特征在于,所述通信装置,还用于向所述DH上报能力信息,所述能力信息用于指示所述NFC控制器具有执行服务发现过程的能力。
PCT/CN2015/076693 2015-04-16 2015-04-16 一种基于逻辑链路控制协议llcp的服务发现方法及nfc控制器 WO2016165093A1 (zh)

Priority Applications (6)

Application Number Priority Date Filing Date Title
EP15888798.4A EP3276984B1 (en) 2015-04-16 2015-04-16 Service discovery method based on logical link control protocol (llcp) and nfc controller
KR1020177032783A KR101923093B1 (ko) 2015-04-16 2015-04-16 논리 링크 제어 프로토콜 기반 서비스 디스커버리 방법 및 nfc 제어기
JP2017554340A JP6511540B2 (ja) 2015-04-16 2015-04-16 論理リンク制御プロトコルllcpベースのサービス発見方法およびnfcコントローラ
PCT/CN2015/076693 WO2016165093A1 (zh) 2015-04-16 2015-04-16 一种基于逻辑链路控制协议llcp的服务发现方法及nfc控制器
CN201580039545.6A CN106664506B (zh) 2015-04-16 2015-04-16 一种基于逻辑链路控制协议llcp的服务发现方法及nfc控制器
US15/566,974 US10237902B2 (en) 2015-04-16 2015-04-16 Logical link control protocol LLCP based service discovery method and NFC controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/076693 WO2016165093A1 (zh) 2015-04-16 2015-04-16 一种基于逻辑链路控制协议llcp的服务发现方法及nfc控制器

Publications (1)

Publication Number Publication Date
WO2016165093A1 true WO2016165093A1 (zh) 2016-10-20

Family

ID=57125624

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/076693 WO2016165093A1 (zh) 2015-04-16 2015-04-16 一种基于逻辑链路控制协议llcp的服务发现方法及nfc控制器

Country Status (6)

Country Link
US (1) US10237902B2 (zh)
EP (1) EP3276984B1 (zh)
JP (1) JP6511540B2 (zh)
KR (1) KR101923093B1 (zh)
CN (1) CN106664506B (zh)
WO (1) WO2016165093A1 (zh)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130322296A1 (en) * 2011-02-19 2013-12-05 Samsung Electronics Co., Ltd. Method and system of providing internet protocol (ip) data communication in a nfc peer to peer communication environment
CN103828408A (zh) * 2011-09-23 2014-05-28 高通股份有限公司 用于改进nfcee发现过程的方法和装置

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8385823B2 (en) * 2007-10-03 2013-02-26 Samsung Electronics Co., Ltd Method and system for communication in near field communication network
US8462734B2 (en) * 2010-10-20 2013-06-11 Nokia Corporation Wireless docking with out-of-band initiation
JP5641323B2 (ja) * 2010-11-29 2014-12-17 ソニー株式会社 通信装置、通信方法、およびプログラム
US9370040B2 (en) * 2011-12-27 2016-06-14 Qualcomm Incorporated Methods and apparatus for improving NFC LLCP partitioning
JP2014086923A (ja) * 2012-10-24 2014-05-12 Sony Corp 集積回路、無線通信装置及びコンピュータプログラム
CN103503323B (zh) * 2013-03-05 2015-02-04 华为终端有限公司 近场通信射频通信方法、装置和终端设备
US10694378B2 (en) * 2013-03-29 2020-06-23 Sony Corporation Integrated circuit, communication method, computer program, and communication apparatus
KR102039522B1 (ko) * 2013-06-03 2019-11-26 휴렛-팩커드 디벨롭먼트 컴퍼니, 엘.피. 근거리 무선 통신(nfc)을 이용한 nfc 태그의 기록방법 및 장치
KR102300583B1 (ko) * 2015-06-26 2021-09-09 삼성전자주식회사 비콘을 이용한 서비스 제공 방법 및 그 전자 장치
KR102453705B1 (ko) * 2015-09-25 2022-10-11 삼성전자주식회사 호스트의 정당성 여부에 따라 선택적으로 결제 기능을 온(on)하는 결제 장치의 동작 방법

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130322296A1 (en) * 2011-02-19 2013-12-05 Samsung Electronics Co., Ltd. Method and system of providing internet protocol (ip) data communication in a nfc peer to peer communication environment
CN103828408A (zh) * 2011-09-23 2014-05-28 高通股份有限公司 用于改进nfcee发现过程的方法和装置

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
NFC FORUM: "NFC Controller Interface (NCI", TECHNICAL SPECIFICATION VERSION 1.1, 23 January 2014 (2014-01-23), XP055370484 *
See also references of EP3276984A4 *

Also Published As

Publication number Publication date
JP6511540B2 (ja) 2019-05-15
KR20170137838A (ko) 2017-12-13
EP3276984A1 (en) 2018-01-31
JP2018513643A (ja) 2018-05-24
US10237902B2 (en) 2019-03-19
EP3276984B1 (en) 2019-11-13
EP3276984A4 (en) 2018-03-07
US20180084592A1 (en) 2018-03-22
CN106664506A (zh) 2017-05-10
KR101923093B1 (ko) 2019-02-27
CN106664506B (zh) 2019-11-12

Similar Documents

Publication Publication Date Title
WO2018205150A1 (zh) 网络切片选择策略更新方法、及装置
US20210211965A1 (en) Data Transmission Method, Electronic Device, and Computer Readable Storage Medium
US20220201539A1 (en) Method for obtaining data radio bearer identifier and base station
EP3022952B1 (en) Billing of relayed device
JP2016522629A (ja) ワイヤレスシリアルバス(wsb)サービスのためのトランスポートモード
US20210029759A1 (en) Wireless communication method and network device
CN110545318B (zh) 一种依赖于gatt和指示进行适配的数据通信方法及系统
US9641395B2 (en) Method of processing device discovery
CN106605371B (zh) 一种调整近场通信nfc中数据包长度的方法、装置及系统
US20220312517A1 (en) D2d communication method, apparatus, and system
TWI705681B (zh) 增強型進程事務標識處理方法及使用者設備
JP2017532840A (ja) 近傍に基づいて管理される無線送受信機
CN109729516B (zh) 用户设备能力信息限制方法、装置、介质、终端及基站
WO2023116786A1 (zh) 物联网设备的注册方法、装置、通信设备、核心网设备、存储介质及系统
EP4037368A1 (en) Communication method and communication device
WO2020133491A1 (zh) 一种能力上报方法及终端设备
WO2016165093A1 (zh) 一种基于逻辑链路控制协议llcp的服务发现方法及nfc控制器
WO2022087795A1 (zh) 资源映射方法、装置、设备及存储介质
US9077700B2 (en) Authentication server, authentication method and computer program
WO2020057497A1 (zh) 通信方法和装置
WO2023165359A1 (zh) 一种Wi-Fi P2P连接的方法、装置以及系统
WO2022087796A1 (zh) Zigbee设备的属性订阅方法、装置及设备
US10003657B2 (en) Data transmission processing method and apparatus
WO2022222117A1 (zh) 业务标识到链路映射的方法和多链路设备
CN116546475A (zh) 蓝牙辅助连接方法及装置、存储介质、终端设备

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

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2017554340

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 15566974

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 20177032783

Country of ref document: KR

Kind code of ref document: A