CN106845974B - Method and device for realizing point-to-point communication of near field communication - Google Patents

Method and device for realizing point-to-point communication of near field communication Download PDF

Info

Publication number
CN106845974B
CN106845974B CN201510886423.2A CN201510886423A CN106845974B CN 106845974 B CN106845974 B CN 106845974B CN 201510886423 A CN201510886423 A CN 201510886423A CN 106845974 B CN106845974 B CN 106845974B
Authority
CN
China
Prior art keywords
instruction
ndef message
nfc
apdu
communication link
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510886423.2A
Other languages
Chinese (zh)
Other versions
CN106845974A (en
Inventor
沈琦
王钊
葛欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201510886423.2A priority Critical patent/CN106845974B/en
Publication of CN106845974A publication Critical patent/CN106845974A/en
Application granted granted Critical
Publication of CN106845974B publication Critical patent/CN106845974B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/32Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
    • G06Q20/327Short range or proximity payments by means of M-devices
    • G06Q20/3278RFID or NFC payments by means of M-devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72409User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
    • H04M1/72412User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories using two-way short-range wireless interfaces
    • 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

Abstract

The invention discloses a device for realizing a method for point-to-point (P2P) communication of Near Field Communication (NFC), which comprises the following steps: establishing a first connection communication link for communicating with an upper layer application; establishing a second connection communication link in communication with the NFC controller; receiving an NFC data interaction format (NDEF) message, an interaction instruction in an NFC read-write mode or an Application Protocol Data Unit (APDU) instruction sent by an upper layer application through a first connection communication link; distributing corresponding sending identification or response identification for the NDEF message, the interactive instruction or the APDU instruction; and packaging the NDEF message or the interactive command or the APDU command by combining with a corresponding sending identifier or a corresponding response identifier, and sending the packaged NDEF message or the interactive command or the APDU command to the NFC controller through a second connection communication link. By adopting the technical scheme of the invention, the off-line transaction of single-touch information bidirectional transmission can be realized.

Description

Method and device for realizing point-to-point communication of near field communication
Technical Field
The invention relates to Near Field Communication (NFC) transaction processing technology in the Field of communications, and in particular, to a method and apparatus for implementing Peer-to-Peer (P2P) Communication in Near Field Communication.
Background
As shown in fig. 1, the work flow of the conventional NFC P2P transaction system mainly includes: 1) an application program (APP) and an upper layer application of the device 1 send NFC Data Exchange Format (NDEF) messages to an NFC Controller (Controller); 2) the NFC Controller of the device 1 sends a connection establishing request message to the NFC Controller of the device 2; 3) the NFC Controller of the device 2 receives the connection establishing request message of the device 1 and then sends the connection establishing request message to the APP and the upper application of the device 2; 4) the upper layer application completes the transaction in a networked non-offline transaction mode or completes the information transmission process of the virtual line part through touch again.
In the transaction process, along with the continuous improvement of the requirements of service use scenes and the requirements of users, the technical problems of complexity and network limitation appear in the transaction scenes described above:
problem 1: a single touch using NFC P2P fails to complete the transaction. Due to the limitation of the rule of the mobile phone operating system, if data transmission is performed by using the NFC P2P method, single touch of two devices can only complete one-way data transmission from the device 1 to the device 2, and if the device 2 needs to return data to the device 1, the two devices need to touch again to complete a reverse data response. In the process, the time cost of the user is increased, and compared with single-time link establishment quick transmission of emerging radar link establishment and sound wave link establishment, the user experience in the transaction process is seriously reduced.
Problem 2: if a single-touch data transmission mode is used to improve the user experience, the reverse data response from the device 2 to the device 1 can only be completed in a networking mode due to the limitation of the rule of the mobile phone operating system. And many use scenes in the transaction process are carried out under the condition of no network or poor network conditions, and the use scenes of NFCP2P transaction are limited by the limitation of the network, so that the development of services is greatly restricted.
Disclosure of Invention
In view of the above, the present invention is directed to a method and an apparatus for implementing peer-to-peer communication in nfc, which can implement offline transaction of bidirectional transmission of single-touch information.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the invention provides a method for realizing point-to-point communication of near field communication, which comprises the following steps:
establishing a first connection communication link for communicating with an upper layer application;
establishing a second connection communication link in communication with the NFC controller;
receiving an NDEF message in an NFC P2P mode, an interactive instruction in an NFC read-write mode, or an Application Protocol Data Unit (APDU) instruction in the NFC read-write mode, which is sent by an upper layer application, through a first connection communication link;
distributing corresponding sending identification or response identification for the NDEF message, the interactive instruction or the APDU instruction;
and packaging the NDEF message, the interactive instruction or the APDU instruction by combining the corresponding sending identifier or the response identifier, and sending the packaged NDEF message, the interactive instruction or the APDU instruction to the NFC controller of the terminal through the second connection communication link.
In the foregoing solution, preferably, the method further includes:
and sending the encapsulated NDEF message, or the interactive instruction, or the APDU instruction to an NFC controller of an opposite terminal through an NFC controller of the terminal, so that the opposite terminal carries out decapsulation operation on the encapsulated NDEF message, or the interactive instruction, or the APDU instruction, and carries out response processing based on the decapsulated NDEF message, or the interactive instruction, or the APDU instruction.
In the foregoing solution, preferably, the decapsulating, by the opposite terminal, the encapsulated NDEF message, the interaction instruction, or the APDU instruction, and performing response processing based on the decapsulated NDEF message, the interaction instruction, or the APDU instruction includes:
receiving an encapsulated NDEF message, an interactive instruction or an APDU instruction sent by the NFC controller through a second connection communication link;
decapsulating the encapsulated NDEF message, or interactive instruction, or APDU instruction; and sending the unpacked NDEF message, the unpacked interactive instruction or the unpacked APDU instruction to an upper layer application through a first connection communication link, so that the upper layer application responds to the unpacked NDEF message, the unpacked interactive instruction or the unpacked APDU instruction.
In the foregoing solution, preferably, the receiving, by the first connection communication link, an NDEF message in the NFC P2P mode, an interaction instruction in the NFC read-write mode, and an APDU instruction sent by the upper layer application includes:
when a first preset condition is met, an upper application of the terminal sends an NDEF message in an NFC P2P mode; the terminal receives an NDEF message in an NFC P2P mode through a first connection communication link of the terminal;
or when a second preset condition is met, the upper application of the opposite terminal sends an interactive instruction or an APDU instruction in the NFC read-write mode; and the opposite terminal receives the interactive instruction or the APDU instruction in the NFC read-write mode through the first connection communication link of the opposite terminal.
In the foregoing solution, preferably, the NDEF message at least includes account information;
the interaction instruction at least comprises: the card searching command, the card selecting command or the parameter exchanging command.
The present invention also provides a device for implementing peer-to-peer communication of near field communication, the device comprising:
the communication module is used for establishing a first connection communication link for communicating with the upper layer application; establishing a second connection communication link in communication with the NFC controller;
the encapsulation module is used for receiving an NDEF message in an NFC P2P mode, an interaction instruction in an NFC read-write mode or an APDU instruction in the NFC read-write mode, which is sent by an upper layer application, through a first connection communication link; distributing corresponding sending identification or response identification for the NDEF message, the interactive instruction or the APDU instruction; and combining the corresponding sending identifier or the response identifier, encapsulating the NDEF message, the interactive instruction or the APDU instruction, and sending the encapsulated NDEF message, the interactive instruction or the APDU instruction to the NFC controller of the terminal through the second connection communication link.
In the foregoing solution, preferably, the apparatus further includes:
the NFC controller is used for receiving an encapsulated NDEF message, an interactive instruction or an APDU instruction sent by the NFC controller, wherein the encapsulated NDEF message, the interactive instruction or the APDU instruction is sent by a terminal of the opposite side; and carrying out decapsulation operation on the received encapsulated NDEF message, the interaction instruction or the APDU instruction.
In the foregoing solution, preferably, the decapsulating module is further configured to:
receiving an encapsulated NDEF message, an interactive instruction or an APDU instruction sent by the NFC controller through a second connection communication link; wherein, the encapsulated NDEF message, or interactive instruction, or APDU instruction is sent by the opposite terminal;
decapsulating the encapsulated NDEF message, or interactive instruction, or APDU instruction;
and sending the unpacked NDEF message, the unpacked interactive instruction or the unpacked APDU instruction to an upper layer application through a first connection communication link, so that the upper layer application responds to the unpacked NDEF message, the unpacked interactive instruction or the unpacked APDU instruction.
In the foregoing solution, preferably, the encapsulation module is further configured to:
when a first preset condition is met, receiving an NDEF message in an NFC P2P mode through a first connection communication link of a terminal where the NDEF message is located; wherein the NDEF message is sent by an upper layer application of the terminal;
or, when a second preset condition is met, receiving an interactive instruction or an APDU instruction in an NFC read-write mode through a first connection communication link of the terminal where the terminal is located; wherein, the interactive instruction or the APDU instruction is sent by an upper layer application of the terminal.
In the foregoing solution, preferably, the NDEF message at least includes account information; the interaction instruction at least comprises: the card searching command, the card selecting command or the parameter exchanging command.
The method and the device for realizing the point-to-point communication of the near field communication increase the corresponding sending identification or response identification for the NDEF message in the NFC P2P mode, the interactive instruction in the NFC read-write mode (also called NFC Reader mode) and the APDU instruction, and carry out secondary encapsulation or decapsulation by combining the sending identification or the response identification, thereby changing the original information intercommunication mode, simplifying the use flow of a user, avoiding the restriction of an operating system and network conditions, and realizing the offline transaction of single-touch information bidirectional transmission.
Drawings
Fig. 1 is a schematic diagram of a conventional NFC P2P transaction system;
fig. 2 is a flowchart of an implementation of a method for implementing peer-to-peer communication of near field communication according to the present invention;
fig. 3 is a schematic structural diagram of a peer-to-peer communication apparatus for implementing near field communication according to the present invention;
fig. 4 is a schematic flow chart of a system for implementing peer-to-peer communication of near field communication according to the present invention.
Detailed Description
So that the manner in which the features and aspects of the present invention can be understood in detail, a more particular description of the invention, briefly summarized above, may be had by reference to embodiments, some of which are illustrated in the appended drawings.
Example one
Fig. 2 is a flowchart of an implementation of a method for implementing peer-to-peer communication of near field communication according to the present invention, where the method is applied to a terminal having an NFC payment function, as shown in fig. 2, the method mainly includes the following steps:
step 201: establishing a first connection communication link for communicating with an upper layer application; a second connection communication link is established in communication with the NFC controller.
In this embodiment, the terminal includes an upper Application (APP), an NFC Controller (Controller), and an NFC-SWPSIM card; wherein, SWP is an abbreviation of Single Wire Protocol, wherein the name is "Single Wire Protocol".
Step 202: and receiving an NDEF message in an NFC P2P mode, an interactive instruction in an NFC read-write mode, or an APDU instruction in the NFC read-write mode, which is sent by an upper layer application, through a first connection communication link.
Preferably, the receiving, by the first connection communication link, an NDEF message in the NFC P2P mode, an interaction instruction in the NFC read-write mode, and an APDU instruction sent by the upper layer application includes:
when a first preset condition is met, an upper application of the terminal sends an NDEF message in an NFC P2P mode; the terminal receives an NDEF message in an NFC P2P mode through a first connection communication link of the terminal;
or when a second preset condition is met, the upper application of the opposite terminal sends an interactive instruction or an APDU instruction in the NFC read-write mode; and the opposite terminal receives the interactive instruction or the APDU instruction in the NFC read-write mode through the first connection communication link of the opposite terminal.
Here, the first preset condition may refer to that an upper application of the terminal triggers an e-commerce transaction operation;
the second preset condition may be that the upper application of the terminal receives an NDEF message containing account information sent by another terminal.
Step 203: and distributing corresponding sending identification or response identification for the NDEF message, the interactive instruction or the APDU instruction.
Preferably, the NDEF message includes at least account information.
Preferably, the interaction instruction comprises at least: the card searching command, the card selecting command or the parameter exchanging command.
Specifically, when an upper layer application issues an NDEF message, an interactive instruction, or an APDU instruction, a corresponding sending identifier is allocated to the NDEF message, the interactive instruction, or the APDU instruction;
when the upper layer application carries out response processing on the NDEF message, the interactive instruction or the APDU instruction, a corresponding response identifier is distributed for the response processing message which is sent by the upper layer application and is used for the NDEF message, the interactive instruction or the APDU instruction.
Step 204: and packaging the NDEF message, the interactive instruction or the APDU instruction by combining the corresponding sending identifier or the response identifier, and sending the packaged NDEF message, the interactive instruction or the APDU instruction to the NFC controller of the terminal through the second connection communication link.
In the foregoing scheme, the method may further include:
and sending the encapsulated NDEF message, or the interactive instruction, or the APDU instruction to an NFC controller of an opposite terminal through an NFC controller of the terminal, so that the opposite terminal carries out decapsulation operation on the encapsulated NDEF message, or the interactive instruction, or the APDU instruction, and carries out response processing based on the decapsulated NDEF message, or the interactive instruction, or the APDU instruction.
Specifically, the decapsulating operation performed by the opposite terminal on the encapsulated NDEF message, the encapsulated interactive instruction, or the encapsulated APDU instruction, and performing response processing based on the decapsulated NDEF message, the encapsulated interactive instruction, or the encapsulated APDU instruction includes:
receiving an encapsulated NDEF message, an interactive instruction or an APDU instruction sent by the NFC controller through a second connection communication link;
decapsulating the encapsulated NDEF message, or interactive instruction, or APDU instruction; and sending the unpacked NDEF message, the unpacked interactive instruction or the unpacked APDU instruction to an upper layer application through a first connection communication link, so that the upper layer application responds to the unpacked NDEF message, the unpacked interactive instruction or the unpacked APDU instruction.
In the method for implementing peer-to-peer communication of near field communication according to this embodiment, corresponding sending identifiers or response identifiers are added to NDEF messages in the NFC P2P mode, interactive instructions in the NFC read-write mode, and APDU instructions, and the sending identifiers or response identifiers are combined to perform secondary encapsulation or decapsulation, so that the original information intercommunication mode is changed, the user usage flow is simplified, the operating system and network condition restrictions are avoided, and offline transaction of single-touch information bidirectional transmission is implemented; in addition, the method can be completely compatible with the existing standard flow; the experience of the user is improved; more service use scenes are added, such as the conditions of poor network and no network; the transaction process adopts an off-line mode to ensure high security of the transaction.
Example two
Fig. 3 is a schematic structural diagram of a peer-to-peer communication apparatus for implementing near field communication according to the present invention; as shown in fig. 3, the apparatus mainly includes:
a communication module 31, configured to establish a first connection communication link for communicating with an upper layer application; establishing a second connection communication link in communication with the NFC controller;
the encapsulation module 32 is configured to receive, through the first connection communication link, an NDEF message in an NFC P2P mode, or an interaction instruction in an NFC read-write mode, or an APDU instruction in an NFC read-write mode, which is sent by an upper layer application; distributing corresponding sending identification or response identification for the NDEF message, the interactive instruction or the APDU instruction; and combining the corresponding sending identifier or the response identifier, encapsulating the NDEF message, the interactive instruction or the APDU instruction, and sending the encapsulated NDEF message, the interactive instruction or the APDU instruction to the NFC controller of the terminal through the second connection communication link.
Wherein the NDEF message at least includes account information;
the interaction instruction at least comprises: the card searching command, the card selecting command or the parameter exchanging command.
Preferably, the apparatus further comprises:
a decapsulation module 33, configured to receive an encapsulated NDEF message, an interaction instruction, or an APDU instruction sent by an NFC controller, where the encapsulated NDEF message, the interaction instruction, or the APDU instruction is sent by an opposite terminal; and carrying out decapsulation operation on the received encapsulated NDEF message, the interaction instruction or the APDU instruction.
Preferably, the decapsulation module 33 is further configured to:
receiving an encapsulated NDEF message, an interactive instruction or an APDU instruction sent by the NFC controller through a second connection communication link; wherein, the encapsulated NDEF message, or interactive instruction, or APDU instruction is sent by the opposite terminal;
decapsulating the encapsulated NDEF message, or interactive instruction, or APDU instruction;
and sending the unpacked NDEF message, the unpacked interactive instruction or the unpacked APDU instruction to an upper layer application through a first connection communication link, so that the upper layer application responds to the unpacked NDEF message, the unpacked interactive instruction or the unpacked APDU instruction.
Preferably, the encapsulation module 32 is further configured to:
when a first preset condition is met, receiving an NDEF message in an NFC P2P mode through a first connection communication link of a terminal where the NDEF message is located; wherein the NDEF message is sent by an upper layer application of the terminal;
or, when a second preset condition is met, receiving an interactive instruction or an APDU instruction in an NFC read-write mode through a first connection communication link of the terminal where the terminal is located; wherein, the interactive instruction or the APDU instruction is sent by an upper layer application of the terminal.
Here, the first preset condition may refer to that an upper application of the terminal triggers an e-commerce transaction operation;
the second preset condition may be that the upper application of the terminal receives an NDEF message containing account information sent by another terminal.
In a specific sub-embodiment, the communication module 31 may include:
a first communication sub-module 311, configured to establish a first connection communication link for communicating with an upper application;
and a second communication sub-module 312, configured to establish a second connection communication link for communicating with the NFC controller.
In a specific sub-embodiment, the encapsulation module 32 may include:
a first encapsulation submodule 321, configured to perform an encapsulation operation on the NDEF message;
a second encapsulation submodule 322, configured to perform encapsulation operation on the interactive instruction;
and a third encapsulating submodule 323, configured to perform an encapsulating operation on the APDU instruction.
In a specific sub-embodiment, the decapsulating module 33 may include:
a first decapsulation submodule 331, configured to decapsulate the encapsulated NDEF message;
the second decapsulation submodule 332 is configured to perform decapsulation operation on the encapsulated interactive instruction;
and the third decapsulation submodule 333 is configured to perform decapsulation operation on the encapsulated APDU instruction.
In particular, the device for realizing the point-to-point communication of the near field communication can be applied to a terminal with an NFC payment function.
In practical applications, the specific structures of the communication module 31, the encapsulation module 32, and the decapsulation module 33 may all correspond to a processor. The specific structure of the processor can be an electronic component or a collection of electronic components with processing functions, such as a CPU, an MCU, a DSP or a PLC. The processor includes executable codes, the executable codes are stored in a storage medium, the processor can be connected to the storage medium through a communication interface such as a bus, and when the corresponding functions of the specific modules are executed, the executable codes are read from the storage medium and executed. The portion of the storage medium used to store the executable code is preferably a non-transitory storage medium.
The communication module 31, the encapsulation module 32 and the decapsulation module 33 may be integrated to correspond to the same processor, or correspond to different processors respectively; when the integration corresponds to the same processor, the processor processes the functions corresponding to the communication module 31, the encapsulation module 32 and the decapsulation module 33 by time division.
The terminal of this embodiment provides hardware for implementing the method of the first embodiment, and can be used to implement the technical solution of the first embodiment, and similarly, the device for implementing peer-to-peer communication of nfc in this embodiment can change the original information intercommunication mode, simplify the user operation flow, avoid the restrictions of the operating system and network conditions, and implement offline transaction of single-touch information bidirectional transmission; in addition, the method can be completely compatible with the existing standard flow; the experience of the user is improved; more service use scenes are added, such as the conditions of poor network and no network; the transaction process adopts an off-line mode to ensure high security of the transaction.
EXAMPLE III
Fig. 4 is a schematic flow chart of a system for implementing peer-to-peer communication of near field communication according to the present invention, and as shown in fig. 4, both the device 1 and the device 2 are installed with a peer-to-peer communication apparatus for implementing near field communication according to the second embodiment.
Specifically, the process mainly includes:
step 401: an upper layer application in the device 1 sends an NDEF message containing account information to the parsing device;
step 402: the parsing apparatus allocates a sending identifier to the NDEF Message, encapsulates the sending identifier and the NDEF Message in a Request Message (Request Message), and sends the encapsulated Request Message to an NFC controller of the device 1;
step 403: the NFC controller of the device 1 sends the packaged request message to the NFC controller of the device 2;
step 404: the NFC controller of the equipment 2 sends the received packaged request message to an analysis device of the equipment 2;
step 405: the parsing device of the device 2 decapsulates the encapsulated request message, obtains an NDEF message, and sends the decapsulated NDEF message to an upper-layer application of the device 2;
step 406: the upper application of the device 2 sends an interactive instruction or an APDU instruction in the NFC read-write mode to an analysis device of the device 2;
here, the interactive instruction is a card searching instruction, a card selecting instruction, a parameter exchanging instruction, or the like.
Here, the APDU command includes account information of the device 2.
Step 407: the analysis device of the equipment 2 allocates a response identifier for the interactive instruction, encapsulates the response identifier into the interactive instruction, and sends the encapsulated interactive instruction to the NFC controller of the equipment 2;
step 408: the NFC controller of the device 2 sends the packaged interaction instruction to the NFC controller of the device 1;
step 409: the NFC controller of the equipment 1 sends the packaged interactive instruction to an analysis device of the equipment 1, the analysis device unpacks the packaged interactive instruction to obtain an interactive instruction, the unpacked interactive instruction is sent to an NFC-SWP SIM card through the NFC controller, and the NFC-SWP SIM card carries out corresponding processing according to the unpacked interactive instruction, such as operation of notifying and deducting;
step 410: after the NFC-SWP SIM card of the device 1 performs corresponding processing, an event notification is sent to the upper layer application of the device 1 to notify the upper layer application of the processing condition;
step 411: the upper application of the device 1 sends an interactive instruction to the analysis device of the device 1;
here, the interactive instructions include at least: the card searching command, the card selecting command or the parameter exchanging command.
Step 412: the analysis device allocates a secondary request identifier to the interactive instruction, packages the secondary request identifier into the interactive instruction, and sends the packaged interactive instruction to an NFC controller of the equipment 1;
step 413: the NFC controller of the equipment 1 sends the packaged interactive instruction to the NFC controller of the equipment 2;
step 414: the NFC controller of the equipment 2 sends the packaged interactive instruction to an analysis device of the equipment 2, the analysis device unpacks the packaged interactive instruction to obtain an interactive instruction, the unpacked interactive instruction is sent to an NFC-SWP SIM card through the NFC controller, and the NFC-SWP SIM card carries out corresponding processing according to the unpacked interactive instruction, such as deduction and other operations;
step 415: after the NFC-SWP SIM card of the device 2 performs corresponding processing, an event notification is sent to the upper layer application of the device 2 to notify the upper layer application of the processing situation.
Therefore, the NDEF message, the interactive instruction in the NFC read-write mode and the APDU instruction are secondarily encapsulated, the original intercommunication mode is changed, the analysis device is used as a transfer, and the limitation of an operating system on the two-way communication of the NFC P2P is avoided; meanwhile, not only can a request and a response be carried out, but also single touch of two devices and multiple transmission of information can be finished through the analysis device; specifically, the NDEF message issued by the upper layer application is encapsulated by the parsing device, and the sending identifier or the response identifier in the single touch process is added to distinguish the sending message and the response message in the single touch process of the NFC P2P; and unpacking the Request Message or the response instruction sent by the NFC control, and sending the unpacked standard NDEF Message or the sent interactive instruction and the APDU to an upper-layer application, so that the problem of bidirectional transmission of single-touch information of the NFC P2P is solved.
In the embodiments provided in the present invention, it should be understood that the disclosed method, apparatus and electronic device may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Alternatively, the integrated unit according to the embodiment of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (8)

1. A method for implementing peer-to-peer P2P communication for near field communication, NFC, the method comprising:
establishing a first connection communication link for communicating with an upper layer application;
establishing a second connection communication link in communication with the NFC controller;
receiving an NFC data interaction format NDEF message in an NFC P2P mode, an interaction instruction in an NFC read-write mode, or an application protocol data unit APDU instruction in the NFC read-write mode, which is sent by an upper layer application, through a first connection communication link;
distributing corresponding sending identification or response identification for the NDEF message, the interactive instruction or the APDU instruction;
the NDEF message, the interactive instruction or the APDU instruction is packaged by combining with the corresponding sending identification or the response identification, and the packaged NDEF message, the interactive instruction or the APDU instruction is sent to the NFC controller of the terminal through the second connection communication link;
the method further comprises the following steps:
and sending the encapsulated NDEF message, or the interactive instruction, or the APDU instruction to an NFC controller of an opposite terminal through an NFC controller of the terminal per se, so that the opposite terminal carries out decapsulation operation on the encapsulated NDEF message, or the interactive instruction, or the APDU instruction, and the opposite terminal carries out response processing based on the decapsulated NDEF message, or the interactive instruction, or the APDU instruction.
2. The method according to claim 1, wherein the decapsulating, by the opposite terminal, the encapsulated NDEF message, the interworking instruction, or the APDU instruction and performing response processing based on the decapsulated NDEF message, the interworking instruction, or the APDU instruction includes:
receiving an encapsulated NDEF message, an interactive instruction or an APDU instruction sent by the NFC controller through a second connection communication link;
decapsulating the encapsulated NDEF message, or interactive instruction, or APDU instruction; and sending the unpacked NDEF message, the unpacked interactive instruction or the unpacked APDU instruction to an upper layer application through a first connection communication link, so that the upper layer application responds to the unpacked NDEF message, the unpacked interactive instruction or the unpacked APDU instruction.
3. The method of claim 1, wherein receiving, by a first connection communication link, an NDEF message in NFC P2P mode, an interaction instruction in NFC read-write mode, and an APDU instruction sent by an upper layer application includes:
when a first preset condition is met, an upper-layer application of a terminal sends an NDEF message in an NFCP2P mode; the terminal receives an NDEF message in an NFC P2P mode through a first connection communication link of the terminal;
or when a second preset condition is met, the upper application of the opposite terminal sends an interactive instruction or an APDU instruction in the NFC read-write mode; and the opposite terminal receives the interactive instruction or the APDU instruction in the NFC read-write mode through the first connection communication link of the opposite terminal.
4. The method of claim 1, wherein the NDEF message includes at least account information;
the interaction instruction at least comprises: the card searching command, the card selecting command or the parameter exchanging command.
5. An apparatus for implementing peer-to-peer P2P communication for near field communication, NFC, the apparatus comprising:
the communication module is used for establishing a first connection communication link for communicating with the upper layer application; establishing a second connection communication link in communication with the NFC controller;
the encapsulation module is used for receiving an NDEF message in an NFC P2P mode, an interaction instruction in an NFC read-write mode or an APDU instruction in the NFC read-write mode, which is sent by an upper layer application, through a first connection communication link; distributing corresponding sending identification or response identification for the NDEF message, the interactive instruction or the APDU instruction; the NDEF message, the interactive instruction or the APDU instruction is packaged by combining with the corresponding sending identification or the corresponding response identification, and the packaged NDEF message, the interactive instruction or the APDU instruction is sent to the NFC controller of the terminal through the second connection communication link;
the device further comprises:
the NFC controller is used for receiving an encapsulated NDEF message, an interactive instruction or an APDU instruction sent by the NFC controller, wherein the encapsulated NDEF message, the interactive instruction or the APDU instruction is sent by a terminal of the opposite side; and carrying out decapsulation operation on the received encapsulated NDEF message, the interaction instruction or the APDU instruction.
6. The apparatus of claim 5, wherein the decapsulating module is further configured to:
receiving an encapsulated NDEF message, an interactive instruction or an APDU instruction sent by the NFC controller through a second connection communication link; wherein, the encapsulated NDEF message, or interactive instruction, or APDU instruction is sent by the opposite terminal;
decapsulating the encapsulated NDEF message, or interactive instruction, or APDU instruction;
and sending the unpacked NDEF message, the unpacked interactive instruction or the unpacked APDU instruction to an upper layer application through a first connection communication link, so that the upper layer application responds to the unpacked NDEF message, the unpacked interactive instruction or the unpacked APDU instruction.
7. The apparatus of claim 5, wherein the encapsulation module is further configured to:
when a first preset condition is met, receiving an NDEF message in an NFC P2P mode through a first connection communication link of a terminal where the NDEF message is located; wherein the NDEF message is sent by an upper layer application of the terminal;
or, when a second preset condition is met, receiving an interactive instruction or an APDU instruction in an NFC read-write mode through a first connection communication link of the terminal where the terminal is located; wherein, the interactive instruction or the APDU instruction is sent by an upper layer application of the terminal.
8. The apparatus of claim 5, wherein the NDEF message includes at least account information;
the interaction instruction at least comprises: the card searching command, the card selecting command or the parameter exchanging command.
CN201510886423.2A 2015-12-04 2015-12-04 Method and device for realizing point-to-point communication of near field communication Active CN106845974B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510886423.2A CN106845974B (en) 2015-12-04 2015-12-04 Method and device for realizing point-to-point communication of near field communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510886423.2A CN106845974B (en) 2015-12-04 2015-12-04 Method and device for realizing point-to-point communication of near field communication

Publications (2)

Publication Number Publication Date
CN106845974A CN106845974A (en) 2017-06-13
CN106845974B true CN106845974B (en) 2020-08-25

Family

ID=59152078

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510886423.2A Active CN106845974B (en) 2015-12-04 2015-12-04 Method and device for realizing point-to-point communication of near field communication

Country Status (1)

Country Link
CN (1) CN106845974B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113300174B (en) * 2021-07-28 2021-10-12 深圳市集鸿发电子有限公司 Plug connector and connector combination
CN114006638B (en) * 2021-11-03 2022-09-30 厦门市美亚柏科信息股份有限公司 NFC-based unidirectional data transmission method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559523A (en) * 2013-11-15 2014-02-05 武汉天喻信息产业股份有限公司 Contactless read-write equipment and method achieved on basis of SWP SE
CN104350513A (en) * 2013-07-26 2015-02-11 华为终端有限公司 Method and device for identifying label
CN104471600A (en) * 2014-04-01 2015-03-25 华为终端有限公司 Safety unit management method and terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104704769B (en) * 2012-10-15 2018-07-27 皇家飞利浦有限公司 Wireless communication system
US9544020B2 (en) * 2013-11-07 2017-01-10 Verizon Patent And Licensing Inc. NFC negotiated pairing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104350513A (en) * 2013-07-26 2015-02-11 华为终端有限公司 Method and device for identifying label
CN103559523A (en) * 2013-11-15 2014-02-05 武汉天喻信息产业股份有限公司 Contactless read-write equipment and method achieved on basis of SWP SE
CN104471600A (en) * 2014-04-01 2015-03-25 华为终端有限公司 Safety unit management method and terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
近场通信设备间的P2P通信设计与实现;何晨晖等;《计算机工程》;20150331;第41卷(第3期);第77-80页 *

Also Published As

Publication number Publication date
CN106845974A (en) 2017-06-13

Similar Documents

Publication Publication Date Title
US20180310157A1 (en) Near field communication method and mobile terminal
CN104253840B (en) For the device and its communication means for supporting to communicate between polytype safety barrier
US10708744B2 (en) NFC-based communication method and apparatus
CN113806116A (en) Protocol stack data transmission method based on Linux system, computer equipment and storage medium
CN104853309A (en) Method and system for managing multiple applications in near field communication
KR20140103153A (en) Method fo routing within a mobile terminal emulating a contactless payment card
CN102770850B (en) For the token communicated with main equipment, corresponding communication system and method
CN104216761A (en) Method for using shared device in device capable of operating two operation systems
CN105592019B (en) The method that two-way access is applied between dual execution environment
US8776251B2 (en) Data exchange between a secure element and a terminal
CN106845974B (en) Method and device for realizing point-to-point communication of near field communication
CA2935284C (en) Mobile communication device and cloud-based computer system
CN103987129A (en) Information push method, apparatus and system
JP5931224B2 (en) Data access method and apparatus
CN104951417A (en) Method for achieving USB combined device suitable for high-capacity USIM
CN106231538A (en) A kind of method and apparatus of OneM2M framework apparatus bound
WO2022228588A1 (en) Method, system and apparatus for binding user account, and device
CN101917780B (en) Function implementation method and device of wireless communication terminal network equipment
EP3048858A1 (en) Wireless customer premise equipment and accessing method therefor
CN115623057A (en) RDMA (remote direct memory Access) -based connection establishing method, device, equipment and storage medium
CN108307286B (en) Method and system for realizing communication between android devices based on NFC
CN102891888B (en) A kind of data access method and relevant device, system
KR101803972B1 (en) Apparatus having Universal Integrated Circuit card and File registration Method and Peer-to-Peer Transmission Method using the same
CN108235822A (en) The implementation method and device of virtual SIM card, storage medium, electronic equipment
CN112187698B (en) Communication method, service system, electronic equipment and host MCU (micro control Unit) of electronic equipment

Legal Events

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