Disclosure of Invention
In view of the above, the main objective of the present invention is to provide a WiFi data transmission method and a terminal, which can solve the problems of multiple operation steps, long waiting time and poor usability in the WiFi P2P connection establishment process.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the invention provides a wireless fidelity WiFi data transmission method, which comprises the following steps:
establishing a Near Field Communication (NFC) P2P connection between terminals, and carrying out WiFi out-of-band (OOB) data transmission by utilizing the established NFC P2P connection;
the terminal establishes WiFi P2P connection according to the received WiFi OOB data and carries out WiFi data transmission by utilizing the established WiFi P2P connection.
Preferably, the method further comprises:
before the WiFi OOB data transmission is carried out, the terminal encapsulates information for establishing WiFi connection into the WiFi OOB data; correspondingly, after receiving the WiFi OOB data, the terminal receiving the WiFi OOB data parses the WiFi OOB data to obtain the information for establishing the WiFi connection.
Preferably, the information for establishing the WiFi connection includes: the WiFi P2P connects the pairing code.
Preferably, the method further comprises: the terminals prompt the user to move the terminals closer to and/or away from each other through voice, and/or screen text, and/or image display.
Preferably, the method further comprises:
before the WiFi data transmission is carried out, the terminal encapsulates an operation instruction in the WiFi data; correspondingly, after the WiFi data is transmitted, the terminal receiving the WiFi data analyzes the WiFi data to obtain the operation instruction encapsulated in the WiFi data, and performs the operation corresponding to the operation instruction.
The invention provides a WiFi data transmission terminal, which comprises: the NFC communication module and the WiFi communication module; wherein,
the NFC communication module is used for establishing NFC P2P connection and carrying out WiFi OOB data transmission by utilizing the established NFC P2P connection; the WiFi communication module is also used for transmitting the received WiFi OOB data to the WiFi communication module;
the WiFi communication module is used for establishing WiFi P2P connection according to the received WiFi OOB data and carrying out WiFi data transmission by utilizing the established WiFi P2P connection.
Preferably, the NFC communication module further includes: the OOB data management module is used for encapsulating information for establishing WiFi connection into the WiFi OOB data;
correspondingly, the WiFi communication module is further configured to parse the WiFi OOB data received by the terminal, and obtain the information for establishing the WiFi connection encapsulated in the WiFi OOB data.
Preferably, the NFC communication module further includes: and the service response module is used for prompting the user to approach the terminals to each other and/or move away from each other through voice, screen text and/or image display.
Preferably, the WiFi communication module further comprises: and the WiFi data management module is used for encapsulating the operation instruction in the WiFi data and analyzing the WiFi data received by the WiFi communication module to obtain the operation instruction encapsulated in the WiFi data.
Preferably, the terminal further includes: an application management module;
the WiFi data management module is also used for sending the operation instruction obtained through analysis to the application management module;
correspondingly, the application management module is used for performing an operation corresponding to the operation instruction according to the received operation instruction.
According to the WiFi data transmission method and the terminal, the NFC P2P is used for connecting and transmitting the WiFi OOB data which are packaged with information for establishing WiFi connection, such as a WiFiP2P connection pairing code and the like; then, establishing WiFi connection according to the WiFi OOB data, and carrying out WiFi data transmission by utilizing the established WiFi connection; therefore, the operation of the WiFi P2P connection establishment process is simplified, the operation time of the WiFi P2P connection establishment is shortened, and the use is easier for users.
Detailed Description
NFC is a short-range wireless communication technology, and has an operating frequency of typically 13.56Mhz and a communication distance of typically 10 cm. The NFC technology is evolved on the basis of integration of non-contact Radio Frequency Identification (RFID) and interconnection technology, combines functions of a non-contact card reader, a non-contact card and P2P on a single NFC chip, and has the characteristics of bidirectional connection and bidirectional identification. Since connection between two NFC devices can be realized only by bringing them close to each other without operations such as network search and parameter configuration, the NFC technology is widely applied to devices such as entrance guards and ticket validators.
Based on the NFC technology, the basic idea of the invention is as follows: firstly, NFC P2P connection is established between terminals, and WiFi OOB data transmission is carried out by utilizing the established NFC P2P connection; then, the terminal establishes a WiFi P2P connection according to the received WiFi OOB data, and performs WiFi data transmission using the established WiFi P2P connection.
The following detailed description of implementations of the present invention is provided in connection with the accompanying drawings and the specific embodiments.
Fig. 1 is a schematic diagram of an implementation process of the WiFi data transmission method of the present invention, as shown in fig. 1, the process includes the following steps:
step 101: establishing an NFC P2P connection between the terminals;
here, the terminals establishing NFC P2P connection are two terminals that need to perform WiFi data transmission; the terminals are all terminals supporting NFC P2P application and WiFi P2P application;
when the terminals approach each other and reach the effective distance required for establishing the NFC P2P connection, the terminals may automatically establish the NFC P2P connection, and specifically how to establish the NFC P2P connection belongs to the prior art, and is not described herein again; wherein, the terminals can inform the user to approach the terminals needing to establish connection to each other through voice, and/or screen text, and/or image display, and the effective distance is usually within 10 centimeters.
Step 102: the terminals carry out WiFi OOB data transmission by utilizing the established NFC P2P connection;
the WiFi OOB data is encapsulated with information for establishing WiFi connection, such as a WiFi P2P connection pairing code and the like; specifically, the terminal serving as the sender may encapsulate, before the WiFi OOB data transmission operation, information for establishing WiFi connection, such as a WiFi connection pairing code, in the WiFi OOB data, and the terminal serving as the receiver may parse, after receiving the WiFi OOB data in which the information for establishing WiFi connection is encapsulated, the WiFi OOB data to obtain the information for establishing WiFi connection encapsulated in the WiFi OOB data; the format of the WiFi OOB data is the same as that of the WiFi OOB data in the prior art, and is not repeated here;
after the transfer of the WiFi OOB data is complete, the terminals may disconnect the NFC P2P connection, for example, by the terminals issuing a "drop" of an audible alert tone, and/or screen text, and/or image display to inform the user to move the terminals away from each other so that the distance between the terminals exceeds the effective distance required to maintain a NFC P2P connection, thereby disconnecting the NFC P2P connection.
Step 103: the terminal establishes WiFi P2P connection according to the received WiFi OOB data;
here, the terminal receiving the WiFi OOB data establishes a WiFi P2P connection using the information for establishing a WiFi connection acquired from the received WiFi OOB data; the information for establishing the WiFi connection at least comprises a WiFi connection pairing code.
Step 104: the terminal utilizes the WiFi P2P connection to carry out WiFi data transmission;
the terminal can encapsulate an operation instruction, such as an operation instruction of automatically importing a business card, in the WiFi data, wherein the operation instruction is used for instructing the terminal receiving the WiFi data to perform an operation corresponding to the operation instruction;
correspondingly, after WiFi data is transmitted, the terminal receiving the WiFi data can analyze the WiFi data to obtain an operation instruction encapsulated in the WiFi data, and then operation corresponding to the operation instruction is carried out according to the operation instruction.
Further, after the WiFi data transmission operation is finished, the WiFi p2P connection is disconnected between the terminals.
Fig. 2 is a schematic diagram of a composition structure of the WiFi data transmission terminal of the present invention, as shown in fig. 2, the system includes: an NFC communication module 11 and a WiFi communication module 12.
The NFC communication module 11 is configured to establish an NFC P2P connection, and perform WiFi OOB data transmission by using the established NFC P2P connection; the WiFi communication module is also used for transmitting the received WiFi OOB data to the WiFi communication module;
and the WiFi communication module 12 is used for establishing a WiFi P2P connection according to the received WiFi OOB data and carrying out WiFi data transmission by utilizing the established WiFi P2P connection.
Preferably, the NFC communication module 11 further includes: an OOB data management module 111 configured to encapsulate information for establishing the WiFi connection in WiFi OOB data; correspondingly, the WiFi communication module is further configured to analyze the WiFi OOB data received by the NFC communication module 11, and obtain the information for establishing the WiFi connection encapsulated in the WiFi OOB data.
Preferably, the NFC communication module 11 further includes: a service response module 112, configured to prompt a user to bring the terminals closer to and/or farther away from each other through voice, and/or screen text, and/or image display.
Preferably, the WiFi communication module 12 further comprises: the WiFi data management module 121 is configured to encapsulate an operation instruction, such as an operation instruction of automatically importing a business card, in the WiFi data, and analyze the WiFi data received by the WiFi communication module 12 to obtain the operation instruction encapsulated in the WiFi data.
Preferably, the terminal further includes: an application management module 13; the WiFi data management module 121 is further configured to send the operation instruction obtained through analysis to the application management module 13; correspondingly, the application management module 13 is configured to perform an operation corresponding to the operation instruction according to the received operation instruction.
Fig. 3 is a schematic diagram illustrating an implementation principle of two WiFi data transmission terminals shown in fig. 2 performing WiFi data transmission, as shown in fig. 3, in this embodiment, the two WiFi data transmission terminals include a terminal a and a terminal B, where the terminal a includes: an NFC communication module 21A and a WiFi communication module 22A; the NFC communication module 21A includes: the OOB data management module 211A and the WiFi communication module 22A include: a WiFi data management module 221A; the terminal B comprises: the NFC communication module 21B, WiFi includes a communication module 22B and an application management module 23B; the NFC communication module 21B includes: the OOB data management module 211B and the WiFi communication module 22B include: the WiFi data management module 221B. The process of the terminal a and the terminal B for WiFi data transmission is as follows:
step 200: establishing NFC P2P connection between the NFC module 21A of the terminal A and the NFC module 21B of the terminal B;
step 201: the OOB data management module 211A of the NFC communication module 21A encapsulates information for establishing the WiFi connection in the WiFi OOB data;
step 202: the NFC communication module 21A sends the WiFi OOB data to an NFC communication module 21B of a terminal B;
step 203: the NFC communication module 21B forwards the WiFi OOB data to the WiFi communication module 22B;
step 204: the WiFi data management module 221B of the WiFi communication module 22B parses the WiFi oob data, and obtains information for establishing WiFi connection;
step 205: the WiFi communication module 22B establishes a WiFi P2P connection with the WiFi communication module 22A using the information for establishing the WiFi connection;
step 206: the WiFi data management module 221A of the WiFi communication module 22A encapsulates the operation instruction in the WiFi data;
step 207: the WiFi communication module 221A sends the WiFi data to a WiFi communication module 221B of a terminal B;
step 208: the WiFi data management module 221B of the WiFi communication module 22B analyzes the WiFi data to obtain the operation instruction, and forwards the operation instruction to the application management module 23B;
step 209: the application management module 23B performs an operation corresponding to the operation instruction according to the received operation instruction.
Based on the operation process, the WiFi data transmission method and the terminal can solve the problems of multiple operation steps, long waiting time and poor usability in the WiFi P2P connection establishment process.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and it will be apparent to those skilled in the art that various modifications and variations can be made in the present invention. Various modifications, equivalent substitutions, improvements and the like can be made without departing from the spirit and principles of the invention, and are intended to be included within the scope of the invention.