CN110446276B - Method and device for establishing WiFi P2P connection - Google Patents
Method and device for establishing WiFi P2P connection Download PDFInfo
- Publication number
- CN110446276B CN110446276B CN201810421012.XA CN201810421012A CN110446276B CN 110446276 B CN110446276 B CN 110446276B CN 201810421012 A CN201810421012 A CN 201810421012A CN 110446276 B CN110446276 B CN 110446276B
- Authority
- CN
- China
- Prior art keywords
- scene
- wifi
- connection
- temporary
- permanent
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention provides a method and a device for establishing WiFi P2P connection. The method comprises the following steps: receiving a WiFi P2P connection establishment request; judging whether the corresponding P2P scene is a temporary P2P scene or a permanent P2P scene according to the WiFi P2P connection establishment request; and establishing the WiFi P2P connection by adopting a corresponding WiFi P2P connection establishment flow according to the determined P2P scene. The method and the device can establish the WiFi P2P connection by adopting different processes according to different P2P scenes, and the establishment process of the WiFi P2P connection is more reasonable.
Description
Technical Field
The invention relates to the technical field of wireless communication, in particular to a method and a device for establishing WiFi P2P connection.
Background
P2P (Peer-to-Peer) is an end-to-end scenario technology in Wi-Fi technology, and two or more devices are connected by P2P technology to form a small-range network architecture, which can implement communication with each other.
As shown in fig. 1, the existing Wi-Fi P2P needs to go through three stages of scanning (scan), listening (listen), and searching (search) before establishing a connection. The scanning stage is to perform full channel scanning on channels 1 to 13, and the searching stage is to perform scanning on channels 1, 6 and 11.
P2P usage scenarios are generally divided into two categories: temporary P2P scenes and permanent P2P scenes.
Temporary P2P scene: after a P2P connection is established between two mobile phones, a temporary group is already established, if a third mobile phone device wants to join the connection, the Wi-Fi 1-13 full channels do not need to be scanned again, because the channel is already determined by the previous group establishment, and a confirmed proper channel is negotiated to establish the connection no matter whether full channel scanning exists or not.
Permanent P2P scene: for a printer scenario, when another device wants to join, the device must perform a full channel scan to find a suitable device to establish a connection with, since a permanent group is to be established.
At present, when a WiFi P2P connection is established, a full channel scan is performed no matter in a temporary P2P scene or a permanent P2P scene, and the temporary P2P scene does not require the full channel scan, so the existing WiFi P2P connection establishment process is not reasonable enough.
Disclosure of Invention
The method and the device for establishing the WiFi P2P connection can establish the WiFi P2P connection by adopting different processes according to different P2P scenes, and the establishing process of the WiFi P2P connection is more reasonable.
In a first aspect, the present invention provides a method for establishing a WiFi P2P connection, including:
receiving a WiFi P2P connection establishment request;
judging whether the corresponding P2P scene is a temporary P2P scene or a permanent P2P scene according to the WiFi P2P connection establishment request;
and establishing the WiFi P2P connection by adopting a corresponding WiFi P2P connection establishment process according to the judged P2P scene.
Optionally, the establishing, according to the determined P2P scene, a WiFi P2P connection by using a corresponding WiFi P2P connection establishment procedure includes: and when the determined P2P scene is a temporary P2P scene, sequentially carrying out channel monitoring and channel searching, and establishing WiFi P2P connection in the temporary P2P scene.
Optionally, the establishing the WiFi P2P connection by adopting the corresponding WiFi P2P connection establishment procedure according to the determined P2P scenario includes: and when the determined P2P scene is a permanent P2P scene, sequentially performing full channel scanning, channel monitoring and channel searching, and establishing WiFi P2P connection under the permanent P2P scene.
Optionally, the determining, according to the WiFi P2P connection establishment request, that the corresponding P2P scene is a temporary P2P scene or a permanent P2P scene includes: and judging that the corresponding P2P scene is a temporary P2P scene or a permanent P2P scene according to the attribute value of the Persistent P2P Group.
Optionally, the determining, according to the attribute value of the Persistent P2P Group, that the corresponding P2P scene is a temporary P2P scene or a permanent P2P scene includes: when the attribute value of the Persistent P2P Group is 1, judging that the corresponding P2P scene is a permanent P2P scene; when the attribute value of the Persistent P2P Group is 0, it is determined that the corresponding P2P scene is a temporary P2P scene.
In a second aspect, the present invention provides an apparatus for establishing a WiFi P2P connection, including:
a receiving unit, configured to receive a WiFi P2P connection establishment request;
a determining unit, configured to determine, according to the WiFi P2P connection establishment request, that a corresponding P2P scene is a temporary P2P scene or a permanent P2P scene;
and the establishing unit is used for establishing the WiFi P2P connection by adopting a corresponding WiFi P2P connection establishing process according to the P2P scene judged by the judging unit.
Optionally, the establishing unit is configured to, when the P2P scenario determined by the determining unit is a temporary P2P scenario, perform channel monitoring and channel searching in sequence, and establish a WiFi P2P connection in the temporary P2P scenario.
Optionally, the establishing unit is configured to, when the determining unit determines that the P2P scenario is a permanent P2P scenario, sequentially perform full channel scanning, channel monitoring, and channel searching, and establish a WiFi P2P connection in the permanent P2P scenario.
Optionally, the determining unit is configured to determine, according to an attribute value of a Persistent P2P Group, that the corresponding P2P scene is a temporary P2P scene or a permanent P2P scene.
Optionally, the determining unit is configured to determine that the corresponding P2P scene is a permanent P2P scene when the attribute value of the Persistent P2P Group is 1; when the attribute value of the Persistent P2P Group is 0, the corresponding P2P scene is determined to be a temporary P2P scene.
According to the method and the device for establishing the WiFi P2P connection, the corresponding P2P scene is judged to be a temporary P2P scene or a permanent P2P scene according to the WiFi P2P connection establishment request, when the judged P2P scene is the temporary P2P scene, channel monitoring and channel searching are sequentially carried out, and the WiFi P2P connection under the temporary P2P scene is established; and when the determined P2P scene is a permanent P2P scene, sequentially performing full channel scanning, channel monitoring and channel searching, and establishing WiFi P2P connection under the permanent P2P scene. Compared with the prior art, the WiFi P2P connection can be established by adopting different processes according to different P2P scenes, and the establishing process of the WiFi P2P connection is more reasonable.
Drawings
Fig. 1 is a schematic flow chart illustrating a WiFi P2P connection established in the prior art;
fig. 2 is a flowchart of a method for establishing a WiFi P2P connection according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a process of establishing a WiFi P2P connection in a temporary P2P scenario according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a process of establishing a WiFi P2P connection in a permanent P2P scenario according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus for establishing a WiFi P2P connection according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
An embodiment of the present invention provides a method for establishing a WiFi P2P connection, as shown in fig. 2, the method includes:
and S11, receiving a WiFi P2P connection establishment request.
And S12, judging that the corresponding P2P scene is a temporary P2P scene or a permanent P2P scene according to the WiFi P2P connection establishment request.
And S13, establishing the WiFi P2P connection by adopting a corresponding WiFi P2P connection establishment process according to the judged P2P scene.
Specifically, when the determined P2P scene is a temporary P2P scene, channel monitoring and channel searching are performed in sequence, and WiFi P2P connection under the temporary P2P scene is established;
and when the determined P2P scene is a permanent P2P scene, sequentially performing full channel scanning, channel monitoring and channel searching, and establishing WiFi P2P connection under the permanent P2P scene.
According to the method for establishing the WiFi P2P connection, the corresponding P2P scene is judged to be a temporary P2P scene or a permanent P2P scene according to the WiFi P2P connection establishment request, when the judged P2P scene is the temporary P2P scene, channel monitoring and channel searching are sequentially carried out, and the WiFi P2P connection under the temporary P2P scene is established; and when the determined P2P scene is a permanent P2P scene, sequentially performing full channel scanning, channel monitoring and channel searching, and establishing WiFi P2P connection under the permanent P2P scene. Compared with the prior art, the WiFi P2P connection can be established by adopting different processes according to different P2P scenes, and the establishing process of the WiFi P2P connection is more reasonable.
Specifically, the corresponding P2P scene may be determined to be a temporary P2P scene or a permanent P2P scene according to the attribute value of the Persistent P2P Group in the Wi-Fi air interface packet. The definition of Persistent P2P Group is shown in the following table.
Beacon frames, probe Request frames and Probe Response frames in the Wi-Fi air interface packet all judge the attribute value of the Persistent P2P Group field.
Optionally, when the attribute value of the Persistent P2P Group is 1, determining that the corresponding P2P scene is a permanent P2P scene; when the attribute value of the Persistent P2P Group is 0, it is determined that the corresponding P2P scene is a temporary P2P scene.
As shown in fig. 3, in the temporary P2P scenario, for the temporary P2P group, two devices may directly negotiate to establish connection, modify the scanning procedure in Discovery procedure, remove full channel scanning, perform channel monitoring and channel searching in sequence, and establish WiFi P2P connection in the temporary P2P scenario.
As shown in fig. 4, in a permanent P2P scenario, for a permanent P2P group, two devices need to find a suitable permanent device, and may keep full channel scanning, perform full channel scanning, channel monitoring, and channel searching in sequence, and establish a WiFi P2P connection in the permanent P2P scenario.
An embodiment of the present invention further provides a device for establishing a WiFi P2P connection, and as shown in fig. 5, the device includes:
a receiving unit 11, configured to receive a WiFi P2P connection establishment request;
a determining unit 12, configured to determine, according to the WiFi P2P connection establishment request, that a corresponding P2P scene is a temporary P2P scene or a permanent P2P scene;
and the establishing unit 13 is configured to establish a WiFi P2P connection by using a corresponding WiFi P2P connection establishment procedure according to the P2P scene determined by the determining unit.
Optionally, the establishing unit 13 is configured to, when the P2P scene determined by the determining unit 12 is a temporary P2P scene, perform channel monitoring and channel searching in sequence, and establish a WiFi P2P connection in the temporary P2P scene.
Optionally, the establishing unit 13 is configured to, when the determining unit 12 determines that the P2P scenario is a permanent P2P scenario, sequentially perform full channel scanning, channel monitoring, and channel searching, and establish a WiFi P2P connection in the permanent P2P scenario.
Optionally, the determining unit 12 is configured to determine, according to an attribute value of a Persistent P2P Group, that a corresponding P2P scene is a temporary P2P scene or a permanent P2P scene.
Optionally, the determining unit 12 is configured to determine, when the attribute value of the Persistent P2P Group is 1, that the corresponding P2P scene is a permanent P2P scene; when the attribute value of the Persistent P2P Group is 0, the corresponding P2P scene is determined to be a temporary P2P scene.
According to the device for establishing the WiFi P2P connection, the corresponding P2P scene is judged to be a temporary P2P scene or a permanent P2P scene according to the WiFi P2P connection establishment request, when the judged P2P scene is the temporary P2P scene, channel monitoring and channel searching are sequentially carried out, and the WiFi P2P connection under the temporary P2P scene is established; and when the determined P2P scene is a permanent P2P scene, sequentially performing full channel scanning, channel monitoring and channel searching, and establishing WiFi P2P connection under the permanent P2P scene. Compared with the prior art, the WiFi P2P connection can be established by adopting different processes according to different P2P scenes, and the establishing process of the WiFi P2P connection is more reasonable.
The apparatus of this embodiment may be configured to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (6)
1. A method for establishing a WiFi P2P connection, comprising:
receiving a WiFi P2P connection establishment request;
judging whether the corresponding P2P scene is a temporary P2P scene or a permanent P2P scene according to the WiFi P2P connection establishment request;
establishing WiFi P2P connection by adopting a corresponding WiFi P2P connection establishment process according to the judged P2P scene;
when the determined P2P scene is a temporary P2P scene, channel monitoring and channel searching are sequentially carried out, and WiFi P2P connection under the temporary P2P scene is established;
and when the determined P2P scene is a permanent P2P scene, sequentially performing full channel scanning, channel monitoring and channel searching, and establishing WiFi P2P connection under the permanent P2P scene.
2. The method of claim 1, wherein the determining that the corresponding P2P scenario is a temporary P2P scenario or a permanent P2P scenario according to the WiFi P2P connection establishment request comprises: and judging that the corresponding P2P scene is a temporary P2P scene or a permanent P2P scene according to the attribute value of the Persistent P2P Group.
3. The method of claim 2, wherein the determining, according to the attribute value of the Persistent P2P Group, that the corresponding P2P scene is a temporary P2P scene or a permanent P2P scene comprises: when the attribute value of the Persistent P2P Group is 1, judging that the corresponding P2P scene is a permanent P2P scene; when the attribute value of the Persistent P2P Group is 0, it is determined that the corresponding P2P scene is a temporary P2P scene.
4. An apparatus for establishing a WiFi P2P connection, comprising:
a receiving unit, configured to receive a WiFi P2P connection establishment request;
a determining unit, configured to determine, according to the WiFi P2P connection establishment request, that a corresponding P2P scene is a temporary P2P scene or a permanent P2P scene;
the establishing unit is used for establishing WiFi P2P connection by adopting a corresponding WiFi P2P connection establishing process according to the P2P scene judged by the judging unit;
the establishing unit is used for sequentially performing channel monitoring and channel searching when the P2P scene judged by the judging unit is a temporary P2P scene, and establishing WiFi P2P connection in the temporary P2P scene;
the establishing unit is used for sequentially carrying out full channel scanning, channel monitoring and channel searching when the P2P scene is judged to be the permanent P2P scene by the judging unit, and establishing WiFi P2P connection under the permanent P2P scene.
5. The apparatus according to claim 4, wherein the determining unit is configured to determine, according to the attribute value of the Persistent P2P Group, that the corresponding P2P scene is a temporary P2P scene or a permanent P2P scene.
6. The apparatus according to claim 4, wherein the determining unit is configured to determine that the corresponding P2P scene is a permanent P2P scene when the attribute value of the Persistent P2P Group is 1; when the attribute value of the Persistent P2P Group is 0, it is determined that the corresponding P2P scene is a temporary P2P scene.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810421012.XA CN110446276B (en) | 2018-05-04 | 2018-05-04 | Method and device for establishing WiFi P2P connection |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810421012.XA CN110446276B (en) | 2018-05-04 | 2018-05-04 | Method and device for establishing WiFi P2P connection |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110446276A CN110446276A (en) | 2019-11-12 |
CN110446276B true CN110446276B (en) | 2022-12-27 |
Family
ID=68427974
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810421012.XA Active CN110446276B (en) | 2018-05-04 | 2018-05-04 | Method and device for establishing WiFi P2P connection |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110446276B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112654074B (en) * | 2020-09-28 | 2022-08-09 | 华为技术有限公司 | Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101976518B1 (en) * | 2012-10-22 | 2019-05-10 | 삼성전자주식회사 | Wi-fi p2p communication terminal device and method thereof |
US9301127B2 (en) * | 2013-02-06 | 2016-03-29 | Blackberry Limited | Persistent network negotiation for peer to peer devices |
CN105472778B (en) * | 2015-12-24 | 2019-11-08 | 小米科技有限责任公司 | Establish the method and device being wirelessly connected |
-
2018
- 2018-05-04 CN CN201810421012.XA patent/CN110446276B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN110446276A (en) | 2019-11-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20220400421A1 (en) | Cell reselection method and apparatus, and communication device | |
JP6204380B2 (en) | Generating a search set of TV white space channels based on location information | |
US9923735B2 (en) | Systems, methods, and apparatuses for handling a legacy circuit switched communication | |
CN103648146B (en) | Terminal network selection method and terminal | |
IL271041B (en) | Wireless communication method, network device, and terminal device | |
CN104333914B (en) | A kind of Mesh link establishing method and equipment | |
US9319942B2 (en) | Systems, methods, and apparatuses for facilitating a circuit switched connection | |
WO2018040604A1 (en) | Mobile terminal testing method, apparatus, system, device, and storage medium | |
TW201218845A (en) | Methods and apparatus to discover network capabilities available via wireless networks | |
US20120327898A1 (en) | Method of controlling the connection of station and access points | |
WO2017101579A1 (en) | Call control apparatus and method | |
WO2017193658A1 (en) | Cell reselection method and device, and storage medium | |
CN111556553A (en) | Wireless screen projection method, terminal, electronic equipment and storage medium | |
WO2023193211A1 (en) | Rsrp threshold determination method and apparatus, and communication device and storage medium | |
CN112119673A (en) | Electronic device supporting multiple wireless communication protocols and method thereof | |
CN112291862A (en) | Method for establishing connection between terminal devices and terminal devices | |
CN103686837A (en) | Selected ip traffic offload method and system as well as policy and charging rule function equipment | |
CN110446276B (en) | Method and device for establishing WiFi P2P connection | |
EP3223558B1 (en) | Voice switching method and device | |
WO2016173338A1 (en) | Network access method and mobile communications terminal | |
EP3171639A1 (en) | Communication system and radio terminal | |
CN111866816A (en) | D2D terminal mode communication selection method under 5G hybrid networking | |
CN104602309B (en) | Wireless network switching and booting method and apparatus | |
CN107548121A (en) | It is determined that the method and device of access network | |
WO2019033267A1 (en) | Method and apparatus for device finding after network configuration |
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 |