CN108777865B - WIFI connection method and device - Google Patents

WIFI connection method and device Download PDF

Info

Publication number
CN108777865B
CN108777865B CN201810481273.0A CN201810481273A CN108777865B CN 108777865 B CN108777865 B CN 108777865B CN 201810481273 A CN201810481273 A CN 201810481273A CN 108777865 B CN108777865 B CN 108777865B
Authority
CN
China
Prior art keywords
wifi
target
data packet
network
access data
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
CN201810481273.0A
Other languages
Chinese (zh)
Other versions
CN108777865A (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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201810481273.0A priority Critical patent/CN108777865B/en
Publication of CN108777865A publication Critical patent/CN108777865A/en
Application granted granted Critical
Publication of CN108777865B publication Critical patent/CN108777865B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/08Access security
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers

Landscapes

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

Abstract

The invention provides a WIFI connection method and device, and relates to the technical field of WIFI connection. Wherein the method comprises the following steps: establishing a WIFI point-to-point service; packaging WIFI information to be shared into a data packet extension field of the WIFI point-to-point service according to a preset rule to obtain a WIFI access data packet; wherein, the WIFI information to be shared includes: a target WIFI network identifier and a target WIFI password of the target WIFI network; and broadcasting the WIFI access data packet in a network accessed by the broadcasting terminal through a WIFI protocol so that the terminal is connected to the target WIFI network according to the target WIFI network identifier and the target WIFI password in the WIFI access data packet after receiving the WIFI access data packet. In the embodiment of the invention, the terminal directly obtains the target WIFI password through the WIFI access data packet, thereby avoiding the complicated operation of inquiring and inputting the password by the terminal user; the broadcasting end does not need to establish a temporary link with the terminal in advance, so that the WIFI connection efficiency is improved, and network resources are saved.

Description

WIFI connection method and device
Technical Field
The invention relates to the technical field of WIFI connection, in particular to a WIFI connection method and device.
Background
At present, internet access by using a WIFI (Wireless-Fidelity) network is a main internet access mode of people, generally, the WIFI network can be used only by requiring passwords or authentication, and in many places where the WIFI network is provided, a user needs to inquire the WIFI passwords and input the passwords to connect to the WIFI network.
In order to reduce the tedious operation of a user in the process of connecting a WIFI network, at present, a temporary link connection between a WIFI network sharing end and a WIFI network connecting end is established, the WIFI network sharing end is connected through the temporary link, a WIFI network identifier to be shared and a corresponding WIFI password are sent to the WIFI network connecting end, then the temporary link connection is disconnected, and the WIFI network connecting end is accessed to the WIFI network through the received WIFI network identifier and the corresponding WIFI password.
The inventor finds that the prior art proposal has the following disadvantages in the process of studying the prior art: each WIFI network connection end needs to establish temporary link connection with the WIFI network sharing end firstly in the process of accessing the WIFI network for the first time, and the process of establishing the temporary link connection is complex and time-consuming, and occupies a large amount of resources.
Disclosure of Invention
The invention provides a WIFI connection method and device, and aims to provide rapid and intensive WIFI network connection service.
In a first aspect, an embodiment of the present invention provides a method for WIFI connection, which is applied to a broadcast end, and the method includes:
establishing a WIFI point-to-point service;
packaging WIFI information to be shared into a data packet extension field of the WIFI point-to-point service according to a preset rule to obtain a WIFI access data packet; wherein, the WIFI information to be shared includes: a target WIFI network identifier and a target WIFI password of the target WIFI network;
and broadcasting the WIFI access data packet in a network accessed by the broadcasting terminal through a WIFI protocol so that the terminal is connected to the target WIFI network according to the target WIFI network identifier and the target WIFI password in the WIFI access data packet after receiving the WIFI access data packet.
Preferably, the step of packaging the to-be-shared WIFI information into a data packet extension field of the WIFI point-to-point service according to a preset rule to obtain a WIFI access data packet includes:
setting a network access field in a data packet extension field of the WIFI point-to-point service;
and setting the target WIFI network identifier and the target WIFI password in the network access field to obtain a WIFI access data packet.
Preferably, the WIFI information to be shared further includes:
a target WIFI network type;
and checking the information by the target WIFI network.
In a second aspect, an embodiment of the present invention provides a method for WIFI connection, which is applied to a terminal, and the method includes:
acquiring a WIFI access data packet broadcasted by a broadcasting end in a network accessed by the broadcasting end; wherein, the WIFI access data packet includes: WIFI information to be shared; the WIFI information to be shared comprises: a target WIFI network identifier and a target WIFI password of the target WIFI network;
analyzing the WIFI access data packet to obtain a target WIFI network identifier and a target WIFI password;
determining a target WIFI network according to the target WIFI network identifier;
and connecting to the target WIFI network according to the target WIFI network identification and the target WIFI password.
Preferably, the step of determining the target WIFI network according to the target WIFI network identifier includes:
and matching the target WIFI network identifier with one or more WIFI network identifiers obtained by searching the terminal, and determining the WIFI network corresponding to the matched WIFI network identifier as the target WIFI network.
In a third aspect, an embodiment of the present invention provides a WIFI connection apparatus, which is applied to a broadcast end, and the apparatus includes:
the WIFI point-to-point service creating module is used for creating WIFI point-to-point services;
the WIFI access data packet packaging module is used for packaging WIFI information to be shared into a data packet extension field of the WIFI point-to-point service according to a preset rule to obtain a WIFI access data packet; wherein, the WIFI information to be shared includes: a target WIFI network identifier and a target WIFI password of the target WIFI network;
and the broadcasting module is used for broadcasting the WIFI access data packet in a network accessed by the broadcasting terminal through a WIFI protocol so that a terminal can be connected to the target WIFI network according to the target WIFI network identifier and the target WIFI password in the WIFI access data packet after receiving the WIFI access data packet.
Preferably, the WIFI access data package encapsulation module includes:
a network access field setting unit, configured to set a network access field in a data packet extension field of the WIFI point-to-point service;
and the WIFI access data packet packaging unit is used for setting the target WIFI network identifier and the target WIFI password in the network access field to obtain a WIFI access data packet.
Preferably, the WIFI information to be shared further includes:
a target WIFI network type;
and checking the information by the target WIFI network.
In a fourth aspect, an embodiment of the present invention provides a WIFI connection apparatus, which is applied to a terminal, and the apparatus includes:
the WIFI access data packet acquisition module is used for acquiring a WIFI access data packet broadcasted by a broadcasting end in a network accessed by the broadcasting end; wherein, the WIFI access data packet includes: WIFI information to be shared; the WIFI information to be shared comprises: a target WIFI network identifier and a target WIFI password of the target WIFI network;
the analysis module is used for analyzing the WIFI access data packet to obtain a target WIFI network identifier and a target WIFI password;
the target WIFI network determining module is used for determining a target WIFI network according to the target WIFI network identifier;
and the target WIFI network connection module is used for connecting to the target WIFI network according to the target WIFI network identifier and the target WIFI password.
Preferably, the target WIFI network determining module includes:
and the target WIFI network determining unit is used for matching the target WIFI network identifier with one or more WIFI network identifiers obtained by the terminal through searching, and determining the WIFI network corresponding to the matched WIFI network identifier as the target WIFI network.
In the embodiment of the invention, a broadcasting end creates a WIFI point-to-point server, a target WIFI network identifier and a target WIFI password of a target WIFI network to be shared are packaged into a data packet extension field of WIFI point-to-point service to obtain a WIIF access data packet, the WIFI access data packet is broadcasted in a network accessed by the broadcasting end through a WIFI protocol, and after a terminal obtains the broadcasted WIFI access data packet, the WIFI access data packet is analyzed to obtain the target WIFI network identifier and the target WIFI password, and the target WIFI network identifier and the target WIFI password are accessed to the target WIFI network. In the embodiment of the invention, the terminal directly acquires the target WIFI password of the target WIFI network through the data packet of the WIFI point-to-point service, so that the complicated operations of inquiring the password and manually inputting the password by a terminal user are avoided; in addition, in the process that the terminal is connected to the target WIFI network, the broadcasting end only needs to broadcast the WIFI information to be shared through the WIFI protocol, the broadcasting end does not need to establish temporary link connection with the terminal in advance, the WIFI connection efficiency is improved, and network resources are saved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
Fig. 1 shows a flowchart of a WIFI connection method in a first embodiment of the present invention;
fig. 2 shows a flowchart of a WIFI connection method in the second embodiment of the present invention;
fig. 3 shows a flowchart of a WIFI connection method in a third embodiment of the present invention;
fig. 4 is a block diagram illustrating a WIFI connection apparatus according to a fourth embodiment of the present invention;
fig. 5 is a block diagram illustrating a structure of another WIFI connection apparatus according to a fourth embodiment of the present invention;
fig. 6 is a block diagram illustrating a WIFI connection apparatus according to a fifth embodiment of the present invention;
fig. 7 is a block diagram illustrating a structure of another WIFI connection apparatus in a fifth embodiment of the present invention.
Detailed Description
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 some, not all, embodiments of the present invention. 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.
Example one
Referring to fig. 1, a flowchart of a WIFI connection method according to a first embodiment of the present invention is shown, where the method is applied to a broadcast end.
It can be understood that, in the embodiment of the present invention, the broadcast end may be a WIFI router, or may also be a terminal that is already connected to a WIFI network, or a terminal that stores a WIFI network identifier and a corresponding WIFI network password, and the like, which is not specifically limited in the embodiment of the present invention.
The WIFI connection method specifically comprises the following steps:
step 101, establishing a WIFI point-to-point service.
In the embodiment of the invention, WIFI point-to-point services are provided in the WIFI protocol, and are created through the WIFI point-to-point protocol. In the embodiment of the invention, the broadcasting end and the terminal can directly perform data interaction through the WIFI point-to-point service, and further create the data packet of the WIFI point-to-point service through the created point-to-point service, based on the WIFI point-to-point protocol, the broadcasting end can directly broadcast the data packet of the WIFI point-to-point service to the terminal, and the terminal directly acquires all information required for accessing the target WIFI network from the data packet of the WIFI point-to-point service.
In the embodiment of the present invention, a WIFI point-to-point protocol in the WIFI protocols may be used to support the WIFI point-to-point service, and the WIFI point-to-point service is created according to the WIFI point-to-point protocol in the WIFI protocols. In the embodiment of the present invention, this is not particularly limited.
102, packaging WIFI information to be shared into a data packet extension field of the WIFI point-to-point service according to a preset rule to obtain a WIFI access data packet; wherein, the WIFI information to be shared includes: a target WIFI network identifier and a target WIFI password of the target WIFI network.
In the embodiment of the present invention, a corresponding rule may be preset, where the preset rule may be a method for selecting an extension field from existing fields of a data packet of the WIFI peer-to-peer service, the preset rule may also be a method for adding an extension field to a data packet of the WIFI peer-to-peer service, and further, the preset rule may also be a standard for allocating a location where information such as a target WIFI network identifier, a target WIFI password, and a target WIFI network identifier is written in the extension field, and the preset rule may also be an encryption rule for the WIFI information to be shared, which is not specifically limited in the embodiment of the present invention.
In the embodiment of the present invention, the WIFI information to be shared may be WIFI information of any WIFI network that can be used by the user. The WIFI network may be, for example, a WIFI network provided in some public places, such as a WIFI network provided in a restaurant, a hotel, and a company, or a WIFI network provided in some private places, such as a home WIFI network. In the embodiment of the present invention, this is not particularly limited.
In the embodiment of the invention, the WIFI network to be shared can be used as a target WIFI network. This WIFI information to be shared may include: a target WIFI network identifier and a target WIFI password of the target WIFI network. The target WIFI network identifier corresponds to the target WIFI password, and the target WIFI network identifier can be connected to a target WIFI network corresponding to the target WIFI network identifier through the target WIFI password. Preferably, the to-be-shared WIFI information may further include: target WIFI network type, target WIFI network verification information and the like. In the embodiment of the present invention, this is not particularly limited.
In specific application, the target WIFI network identifier may be a unique identifier for distinguishing the WIFI network, such as a target WIFI network name, a Media Access Control (MAC) address of a target WIFI router, and the like; the target WIFI password may be a verified password required to connect to the target WIFI network; the target WIFI network type can be a 2G network, a 3G network, a 4G network, a 5G network type and the like; the target WIFI network verification information may be a verification field series, etc. In the embodiment of the present invention, this is not particularly limited.
In the embodiment of the invention, the target WIFI network type is simultaneously used as the WIFI information to be shared, the aim is to timely inform the terminal of which network type the received WIFI to be shared belongs to, when the terminal simultaneously receives a plurality of WIFI to be shared, the optimal WIFI to be shared can be selected from the plurality of WIFI to be shared according to the target WIFI network type to be used as the final target WIFI network, and the use experience of a terminal user is further improved.
In the embodiment of the invention, the network verification information is simultaneously used as the WIFI information to be shared, so that the target WIFI network can perform terminal verification through the WIFI network verification information, and the access security of the target WIFI network can be improved.
In the embodiment of the invention, the WIFI information to be shared is packaged into the data packet extension field of the WIFI point-to-point service according to a preset rule. The WIFI network to be shared is used as a target WIFI network, a target WIFI network identifier, a target WIFI password and the like of the target WIFI network are packaged by using a WIFI point-to-point service protocol and the like, and the WIFI information to be shared is packaged by using a data packet extension field of the WIFI point-to-point service, so that a WIFI access data packet is obtained. In the embodiment of the present invention, the process of encapsulating the to-be-shared WIFI information is not specifically limited.
Optionally, in order to avoid leakage of the target WIFI password of the target WIFI network, the target WIFI password may be encrypted in the process of encapsulating the to-be-shared WIFI information, which is not specifically limited in the embodiment of the present invention.
103, broadcasting the WIFI access data packet in a network accessed by the broadcasting terminal through a WIFI protocol so that the terminal can be connected to the target WIFI network according to the target WIFI network identifier and the target WIFI password in the WIFI access data packet after receiving the WIFI access data packet.
In the embodiment of the invention, the WIFI access data packet is broadcasted in the network accessed by the broadcasting terminal through a WIFI protocol.
In specific application, each network segment has a preset IP address as a broadcast address. For example, in a network of the TCP/IP protocol, the IP address with the host id segment of all 1 is a broadcast address, and for the segment 10.1.1.0(255.255.255.0), the broadcast address is 10.1.1.255, and when a packet or packet with the destination address of 10.1.1.255 is sent out, it will be distributed to all terminals on the segment.
In the embodiment of the present invention, the broadcast end may have access to a network, and the network that the broadcast end has access to may be a WIFI network or other networks. And taking the specific IP address in the network accessed by the broadcast terminal as the broadcast address or the multicast address of the broadcast terminal.
For example, in the network accessed by the broadcast terminal, the IP address with bytes of 0xFF:0xFF is used as a broadcast address, and the WIFI access data packet is broadcasted in the network accessed by the broadcast terminal through the broadcast address; in the network accessed by the broadcast terminal, the IP address with the first three bytes of 0x01:0x00:0x5E may be used as a multicast address, and the WIFI access packet may be multicast in the network accessed by the broadcast terminal through the multicast address. In the embodiment of the present invention, this is not particularly limited.
After the broadcasting end broadcasts the WIFI access data packet in the network accessed by the broadcasting end, the terminal which wants to access the target WIFI network receives the WIFI access data packet, and judges whether the WIFI access data packet is a broadcast message or a multicast message according to the destination address of the WIFI access data packet. Specifically, if the IP address in the received WIFI access data packet is: if the WIFI access data packet is a broadcast message, 0xFF and 0xFF are respectively calculated; if the IP address in the received WIFI access data packet is: 0x01:0x00:0x5E, the WIFI access packet is a multicast message.
After determining whether the WIFI access data packet is a broadcast message or a multicast message, a terminal which wants to access the WIFI network performs original analysis on the WIFI access data packet according to a corresponding decapsulation method to obtain an original broadcast data packet corresponding to the broadcast service, then performs corresponding analysis according to a specific encapsulation rule of the WIFI access data packet in the original broadcast data packet to obtain WIFI information to be shared in the WIFI access data packet, obtains a target WIFI network identifier and a target WIFI password of the target WIFI network, and connects the terminal which wants to access the WIFI network to the target WIFI network through the target WIFI network identifier and the target WIFI password obtained through analysis.
Optionally, in the process of packaging the to-be-shared WIFI information, if the target WIFI password is encrypted, in the analysis process, the target WIFI password is obtained through decryption according to a corresponding decryption method, so that leakage of the target WIFI password is avoided. In the embodiment of the present invention, this is not particularly limited.
In the embodiment of the invention, a broadcasting end encapsulates a target WIFI network identifier and a target WIFI password of a target WIFI network to be shared into a data packet extension field of WIFI point-to-point service to obtain a WIFI access data packet, broadcasts the WIFI access data packet in a network accessed by the broadcasting end through a WIFI protocol, and after the terminal obtains the broadcasted WIFI access data packet, the terminal analyzes the WIFI access data packet to obtain the target WIFI network identifier and the target WIFI password, and then accesses the target WIFI network. In the embodiment of the invention, the terminal directly acquires the target WIFI password of the target WIFI network through the WIFI access data packet, so that the complicated operations of inquiring the password and manually inputting the password by a terminal user are avoided; in addition, in the process that the terminal is connected to the target WIFI network, the broadcasting end only needs to package the WIFI information to be shared into the data packet extension field of the WIFI point-to-point service, and then broadcasts the WIFI information to be shared out, the broadcasting end does not need to establish temporary link connection with the terminal in advance, the WIFI connection efficiency is improved, and network resources are saved.
Example two
Referring to fig. 2, a flowchart of a WIFI connection method according to a second embodiment of the present invention is shown, where the method is applied to a broadcast end.
The WIFI connection method specifically comprises the following steps:
step 201, a WIFI point-to-point service is created.
Step 201 may refer to step 101 in the first embodiment of the present invention, and is not described herein again.
Step 202, setting a network access field in a data packet extension field of the WIFI point-to-point service.
In specific application, an extension field is reserved in a data packet of the WIFI point-to-point service. In the embodiment of the invention, a network access field is set in the data packet extension field, and the network access field is mainly used for setting the WIFI information to be shared. The network access field may be some idle parameter fields in the packet extension field of the WIFI point-to-point service, for example, the 11 th to 15 th bytes idle in the packet extension field of the WIFI point-to-point service are set as the network access field. The length of the network access field can be specifically set according to a target WIFI network identifier of a subsequent target WIFI network and the length of a field occupied by WIFI information to be shared by a target WIFI password, and the length of the network access field can be set to be fixed length. In the embodiment of the present invention, this is not particularly limited.
In the embodiment of the present invention, the content specifically included in the WIFI information to be shared may refer to the related description in the first embodiment, and details are not repeated here.
And 203, setting the target WIFI network identifier and the target WIFI password in the network access field to obtain a WIFI access data packet.
And setting a target WIFI network identifier and a target WIFI password in a network access field in a data packet extension field of the WIFI point-to-point service. For example, for the above example, bytes 11-15 that are idle in the data packet extension field of the WIFI point-to-point service are set as the network access field, bytes 1-2 in the network access field are set as the target WIFI network identifier, and bytes 3-4 in the network access field are set as the target WIFI password. If the target WIFI identifier of the target WIFI network is: hd, if the target WIFI password corresponding to the target WIFI network is ss, then in the idle 11 th-15 th bytes in the data packet extension field of the WIFI point-to-point service, the network access field may be: hdss. In the embodiment of the present invention, if the WIFI information to be shared further includes a target WIFI network type, target WIFI network verification information, and the like, the target WIFI network type, the target WIFI network verification information, and the like also need to be set in the network access field of the data packet extension field of the WIFI point-to-point service.
And setting the WIFI information to be shared by the target WIFI network identifier and the target WIFI password in a network access field of a data packet extension field of the WIFI point-to-point service, wherein the data packet of the WIFI point-to-point service with the network access field set at the moment is the WIFI access data packet.
Optionally, in order to avoid leakage of the target WIFI password of the target WIFI network, the target WIFI password may be encrypted in the process of setting the to-be-shared WIFI information in the network access field, which is not specifically limited in the embodiment of the present invention.
And 204, broadcasting the WIFI access data packet in a network accessed by the broadcasting terminal through a WIFI protocol so that the terminal can be connected to the target WIFI network according to the target WIFI network identifier and the target WIFI password in the WIFI access data packet after receiving the WIFI access data packet.
The above steps can refer to step 103 in the first embodiment, and are not described herein again.
In the embodiment of the invention, after the target WIFI network is determined, the target WIFI network can be connected to the target WIFI network according to the target WIFI network identifier and the target WIFI password obtained through analysis. For example, for the above example, if the determined target WIFI network identifier is hd, and the analyzed corresponding target WIFI password is ss, the terminal may access the target WIFI network with the target WIFI network identifier being hd.
In the embodiment of the invention, when the terminal receives the WIFI point-to-point data packets broadcasted by the plurality of broadcasting terminals or after the terminal searches a plurality of WIFI networks, the target WIFI network identifiers are matched, so that the corresponding relation between the WIFI network identifiers and the WIFI passwords is ensured, and the terminal is ensured to smoothly access the target WIFI network.
In the embodiment of the invention, a broadcasting end creates a WIFI point-to-point server, a target WIFI network identifier and a target WIFI password of a target WIFI network to be shared are packaged into a data packet extension field of WIFI point-to-point service to obtain a WIIF access data packet, the WIFI access data packet is broadcasted in a network accessed by the broadcasting end through a WIFI protocol, and after a terminal obtains the broadcasted WIFI access data packet, the WIFI access data packet is analyzed to obtain the target WIFI network identifier and the target WIFI password, and the target WIFI network identifier and the target WIFI password are accessed to the target WIFI network. In the embodiment of the invention, the terminal directly acquires the target WIFI password of the target WIFI network through the data packet of the WIFI point-to-point service, so that the complicated operations of inquiring the password and manually inputting the password by a terminal user are avoided; in addition, in the process that the terminal is connected to the target WIFI network, the broadcasting end only needs to broadcast the WIFI information to be shared through the WIFI protocol, the broadcasting end does not need to establish temporary link connection with the terminal in advance, the WIFI connection efficiency is improved, and network resources are saved.
EXAMPLE III
Referring to fig. 3, a flowchart of a WIFI connection method according to a third embodiment of the present invention is shown, where the method is applied to a terminal.
It can be understood that, in the embodiment of the present invention, the terminal may be a terminal that wants to access a WIFI network, and the like, which is not specifically limited in the embodiment of the present invention.
The WIFI connection method specifically comprises the following steps:
step 301, acquiring a WIFI access data packet broadcasted by a broadcasting end in a network accessed by the broadcasting end; wherein, the WIFI access data packet includes: WIFI information to be shared; the WIFI information to be shared comprises: a target WIFI network identifier and a target WIFI password of the target WIFI network.
In the embodiment of the present invention, the terminal may be a terminal supporting a WIFI protocol and a WIFI peer-to-peer protocol, and may generally search for one or more WIFI network identifiers that may provide a WIFI network service for the terminal, and support the WIFI protocol and the WIFI peer-to-peer protocol. In the embodiment of the present invention, this is not particularly limited.
In the embodiment of the present invention, the terminal may start the broadcast monitoring service, for example, the terminal may start the promiscuous mode to monitor all data streams passing through it, which is equivalent to starting the broadcast monitoring service. This is not particularly limited in the practice of the present invention.
In a specific application, when the terminal receives a WIFI search instruction of a user, in the process of searching for one or more WIFI network identifiers which may provide WIFI network services for the terminal, the terminal may be equivalent to having started a broadcast monitoring service. This is not particularly limited in the practice of the present invention.
In specific application, a terminal which wants to access a WIFI network can open a WIFI searching function on the terminal, and the terminal can search one or more WIFI network identifications which can provide WIFI network services for the terminal according to a WIFI searching instruction of a user. For example, the terminal searches for two WIFI network identifications, sushine and hd.
In the process of searching for one or more WIFI network identifiers which may provide WIFI network services for the terminal, the terminal starts a broadcast monitoring service, and therefore, when the terminal searches for the one or more WIFI network identifiers, the terminal may also receive a WIFI point-to-point data packet broadcast by the broadcast terminal in a network to which the broadcast terminal accesses through a WIFI protocol. Compared with the prior art, the terminal does not need to establish temporary link connection with the broadcasting end in advance, the WIFI connection efficiency is improved, and network resources are saved.
In this embodiment of the present invention, the WIFI access data packet may include: the to-be-shared WIFI information, optionally, the WIFI access data packet may further include: and (4) WIFI access data packet analysis rules. This WIFI information to be shared may include: a target WIFI network identifier, a target WIFI password and the like of the target WIFI network. The target WIFI network identifier is used for uniquely identifying a target WIFI network, the target WIFI password corresponds to the target WIFI network identifier, and the target WIFI network can be accessed through the target WIFI password.
The above-mentioned WIFI access data packet parsing rule may include: the analysis rule of the data packet of the WIFI point-to-point service, the analysis rule of the data packet extension field of the WIFI point-to-point service and the analysis rule of specific WIFI information to be shared in the WIFI access data packet are obtained. Through the analysis rule, the terminal can acquire the specific target WIFI network identifier, the specific target WIFI password and the like of the target WIFI network. And 302, analyzing the WIFI access data packet to obtain a target WIFI network identifier and a target WIFI password.
In the embodiment of the invention, the WIFI access data packet is analyzed, mainly the WIFI information to be shared is analyzed, and the target WIFI network identifier and the target WIFI password are obtained. Preferably, the WIFI access data packet may be analyzed according to the analysis rule to obtain the target WIFI network identifier and the target WIFI password.
In the embodiment of the invention, the terminal can judge whether the WIFI access data packet is a broadcast message or a multicast message according to the destination address of the received WIFI access data packet. And according to a decapsulation method corresponding to the broadcast message or the multicast message, performing original analysis on the WIFI access data packet to obtain a data packet of the WIFI point-to-point service with a network access field, and thus obtaining the WIFI access data packet.
And then analyzing the original WIFI access data packet according to a WIFI protocol and a WIFI point-to-point protocol to acquire a data packet extension field of WIFI point-to-point service, and then performing corresponding analysis according to a specific packaging rule of a network access field in the WIFI access data packet extension field to acquire WIFI information to be shared in the WIFI access data packet, and acquiring a target WIFI network identifier and a target WIFI password of the target WIFI network. This is not particularly limited in the embodiments of the present invention.
For the example in the second embodiment, the target WIFI network identifier of the target WIFI network obtained through analysis is: hd, target WIFI password ss.
In the embodiment of the present invention, the WIFI point-to-point data packet may also carry a specific encapsulation instruction, and a corresponding analysis module of the terminal that receives the WIFI point-to-point data packet is automatically called through the specific encapsulation instruction to analyze the WIFI point-to-point data packet.
Optionally, in the process of packaging or setting the to-be-shared WIFI information, if the target WIFI password is encrypted, in the analysis process, the target WIFI password is obtained through decryption according to a corresponding decryption method, so that leakage of the target WIFI password is avoided. In the embodiment of the present invention, this is not particularly limited.
Step 303, determining a target WIFI network according to the target WIFI network identifier.
In specific application, the target WIFI network identifier is matched with one or more WIFI network identifiers obtained by searching the terminal, and a WIFI network corresponding to the matched WIFI network identifier is determined as a target WIFI network. In the embodiment of the present invention, this is not particularly limited.
In this embodiment of the present invention, optionally, determining the target WIFI network according to the target WIFI network identifier may include the following sub-steps: and matching the target WIFI network identifier with one or more WIFI network identifiers obtained by searching the terminal, and determining the WIFI network corresponding to the matched WIFI network identifier as the target WIFI network.
In the embodiment of the invention, the terminal can start a WIFI search function, search for an available WIFI network and search for one or more WIFI network identifiers, for example, the terminal searches for two WIFI network identifiers, namely sunshine and hd. For the above example, the terminal matches the target WIFI network identifier hd obtained through analysis with the WIFI network identifiers sunshine and hd obtained through search, and determines the WIFI network corresponding to the matched WIFI network identifier hd as a target WIFI network, that is, the WIFI network broadcasted by the broadcasting end received by the terminal is used as the target WIFI network.
And 304, connecting to the target WIFI network according to the target WIFI network identification and the target WIFI password.
In the embodiment of the invention, after the target WIFI network is determined, the target WIFI network can be connected to the target WIFI network according to the target WIFI network identifier and the target WIFI password obtained through analysis. For example, for the above example, if the determined target WIFI network identifier is hd, and the analyzed corresponding target WIFI password is ss, the terminal may access the target WIFI network with the target WIFI network identifier being hd.
In the embodiment of the invention, when the terminal receives the WIFI access data packets broadcasted by the plurality of broadcasting terminals or after the terminal searches a plurality of WIFI networks, the target WIFI network identifiers are matched, so that the corresponding relation between the WIFI network identifiers and the WIFI passwords is ensured, and the terminal is ensured to smoothly access the target WIFI network.
In the embodiment of the invention, a broadcasting end encapsulates a target WIFI network identifier and a target WIFI password of a target WIFI network to be shared into a data packet extension field of WIFI point-to-point service to obtain a WIIF access data packet, the WIFI access data packet is broadcasted in a network accessed by the broadcasting end through a WIFI protocol, and after a terminal which wants to join the target WIFI network obtains the WIFI access data packet broadcasted by the broadcasting end through the network accessed by the broadcasting end, the WIFI access data packet can be analyzed according to an analysis rule carried by the WIFI access data packet to obtain the target WIFI network identifier and the target WIFI password, and then the target WIFI network identifier and the target WIFI password are accessed to the target WIFI network. According to the embodiment of the invention, the terminal directly acquires the target WIFI password of the target WIFI network through the WIFI access data packet, so that the complicated operations of inquiring the password and manually inputting the password by the terminal user are avoided; in addition, in the process that the terminal is connected to the target WIFI network, only the monitoring function needs to be started, and temporary link connection with the broadcasting end does not need to be established in advance, so that the WIFI connection efficiency is improved, and network resources are saved.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the embodiments of the application.
Example four
Referring to fig. 4, an embodiment of the present invention provides a WIFI connection apparatus 500, which is applied to a broadcast end, where the WIFI connection apparatus 500 specifically includes:
a WIFI point-to-point service creation module 501, configured to create a WIFI point-to-point service;
a WIFI access data packet encapsulation module 502, configured to encapsulate, according to a preset rule, WIFI information to be shared into a data packet extension field of the WIFI point-to-point service, so as to obtain a WIFI access data packet; wherein, the WIFI information to be shared includes: a target WIFI network identifier and a target WIFI password of the target WIFI network;
the broadcasting module 503 is configured to broadcast the WIFI access data packet in a network accessed by the broadcasting terminal through a WIFI protocol, so that a terminal receives the WIFI access data packet and then connects to the target WIFI network according to the target WIFI network identifier and the target WIFI password in the WIFI access data packet.
Alternatively, as shown in fig. 5, on the basis of the above-mentioned fig. 4,
optionally, the WIFI access data packet encapsulation module 502 may include:
a network access field setting unit 5021, configured to set a network access field in a data packet extension field of the WIFI point-to-point service;
and a WIFI access data packet encapsulation unit 5022, configured to set the target WIFI network identifier and the target WIFI password in the network access field, so as to obtain a WIFI access data packet.
Optionally, the to-be-shared WIFI information further includes:
a target WIFI network type;
and checking the information by the target WIFI network.
The WIFI connection device provided in the embodiment of the present invention can implement each process implemented by the device in the method embodiments of fig. 1 to fig. 2, and is not described herein again to avoid repetition.
In the embodiment of the invention, a broadcasting end creates a WIFI point-to-point server, a target WIFI network identifier and a target WIFI password of a target WIFI network to be shared are packaged into a data packet extension field of WIFI point-to-point service to obtain a WIIF access data packet, the WIFI access data packet is broadcasted in a network accessed by the broadcasting end through a WIFI protocol, and after a terminal obtains the broadcasted WIFI access data packet, the WIFI access data packet is analyzed to obtain the target WIFI network identifier and the target WIFI password, and the target WIFI network identifier and the target WIFI password are accessed to the target WIFI network. In the embodiment of the invention, the terminal directly acquires the target WIFI password of the target WIFI network through the data packet of the WIFI point-to-point service, so that the complicated operations of inquiring the password and manually inputting the password by a terminal user are avoided; in addition, in the process that the terminal is connected to the target WIFI network, the broadcasting end only needs to broadcast the WIFI information to be shared through the WIFI protocol, the broadcasting end does not need to establish temporary link connection with the terminal in advance, the WIFI connection efficiency is improved, and network resources are saved.
EXAMPLE five
Referring to fig. 6, an embodiment of the present invention provides a WIFI connection device 700, which is applied to a terminal, where the WIFI connection device 700 specifically includes:
a WIFI access data packet obtaining module 701, configured to obtain a WIFI access data packet broadcasted by a broadcast end in a network to which the broadcast end is accessed; wherein, the WIFI access data packet includes: WIFI information to be shared; the WIFI information to be shared comprises: a target WIFI network identifier and a target WIFI password of the target WIFI network;
an analyzing module 702, configured to analyze the WIFI access data packet to obtain a target WIFI network identifier and a target WIFI password;
a target WIFI network determining module 703, configured to determine a target WIFI network according to the target WIFI network identifier;
and a target WIFI network connection module 704, configured to connect to the target WIFI network according to the target WIFI network identifier and the target WIFI password.
Optionally, as shown in fig. 7, on the basis of fig. 6, the target WIFI network determining module 703 includes:
a target WIFI network determining unit 7031, configured to match the target WIFI network identifier with one or more WIFI network identifiers obtained by the terminal through the search, and determine a WIFI network corresponding to the matched WIFI network identifier as a target WIFI network.
The WIFI connection device provided in the embodiment of the present invention can implement each process implemented by the device in the method embodiment of fig. 3, and is not described herein again to avoid repetition.
In the embodiment of the invention, a broadcasting end encapsulates a target WIFI network identifier and a target WIFI password of a target WIFI network to be shared into a data packet extension field of WIFI point-to-point service to obtain a WIIF access data packet, the WIFI access data packet is broadcasted in a network accessed by the broadcasting end through a WIFI protocol, and after a terminal which wants to join the target WIFI network obtains the WIFI access data packet broadcasted by the broadcasting end through the network accessed by the broadcasting end, the WIFI access data packet can be analyzed according to an analysis rule carried by the WIFI access data packet to obtain the target WIFI network identifier and the target WIFI password, and then the target WIFI network identifier and the target WIFI password are accessed to the target WIFI network. According to the embodiment of the invention, the terminal directly acquires the target WIFI password of the target WIFI network through the WIFI access data packet, so that the complicated operations of inquiring the password and manually inputting the password by the terminal user are avoided; in addition, in the process that the terminal is connected to the target WIFI network, only the monitoring function needs to be started, and temporary link connection with the broadcasting end does not need to be established in advance, so that the WIFI connection efficiency is improved, and network resources are saved.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A WIFI connection method is applied to a broadcasting end, and is characterized by comprising the following steps:
establishing a WIFI point-to-point service;
packaging WIFI information to be shared into a data packet extension field of the WIFI point-to-point service according to a preset rule to obtain a WIFI access data packet; wherein, the WIFI information to be shared includes: a target WIFI network identifier and a target WIFI password of the target WIFI network; the WIFI access data packet further comprises: WIFI access data packet analysis rules;
and broadcasting the WIFI access data packet in a network accessed by the broadcasting terminal through a WIFI protocol, so that the terminal analyzes the WIFI access data packet according to the analysis rule to obtain the target WIFI network identifier and the target WIFI password after receiving the WIFI access data packet under the condition that the broadcasting monitoring service is started, and is connected to the target WIFI network according to the target WIFI network identifier and the target WIFI password in the WIFI access data packet, wherein the starting of the broadcasting monitoring service is triggered by the terminal through searching the WIFI network.
2. The method according to claim 1, wherein the step of encapsulating the WIFI information to be shared into a data packet extension field of the WIFI point-to-point service according to a preset rule to obtain a WIFI access data packet comprises:
setting a network access field in a data packet extension field of the WIFI point-to-point service;
and setting the target WIFI network identifier and the target WIFI password in the network access field to obtain a WIFI access data packet.
3. The method of claim 1, wherein the WIFI information to be shared further comprises:
a target WIFI network type;
and checking the information by the target WIFI network.
4. A WIFI connection method is applied to a terminal and is characterized by comprising the following steps:
starting a broadcast monitoring service by searching a WIFI network;
acquiring a WIFI access data packet broadcasted by a broadcasting end in a network accessed by the broadcasting end through the broadcasting monitoring service; wherein, the WIFI access data packet includes: WIFI information to be shared and a WIFI access data packet analysis rule; the WIFI information to be shared comprises: a target WIFI network identifier and a target WIFI password of the target WIFI network; the WIFI access data packet is obtained by packaging WIFI information to be shared into a data packet extension field of the WIFI point-to-point service according to a preset rule after the broadcasting end creates the WIFI point-to-point service;
analyzing the WIFI access data packet according to the analysis rule to obtain a target WIFI network identifier and a target WIFI password;
determining a target WIFI network according to the target WIFI network identifier;
and connecting to the target WIFI network according to the target WIFI network identification and the target WIFI password.
5. The method of claim 4, wherein the step of determining the target WIFI network according to the target WIFI network identification comprises:
and matching the target WIFI network identifier with one or more WIFI network identifiers obtained by searching the terminal, and determining the WIFI network corresponding to the matched WIFI network identifier as the target WIFI network.
6. A WIFI connecting device is applied to a broadcasting end and is characterized by comprising:
the WIFI point-to-point service creating module is used for creating WIFI point-to-point services;
the WIFI access data packet packaging module is used for packaging WIFI information to be shared into a data packet extension field of the WIFI point-to-point service according to a preset rule to obtain a WIFI access data packet; wherein, the WIFI information to be shared includes: a target WIFI network identifier and a target WIFI password of the target WIFI network; the WIFI access data packet further comprises: WIFI access data packet analysis rules;
and the broadcasting module is used for broadcasting the WIFI access data packet in a network accessed by the broadcasting terminal through a WIFI protocol, so that a terminal can analyze the WIFI access data packet according to the analysis rule to obtain the target WIFI network identifier and the target WIFI password after receiving the WIFI access data packet through a broadcasting monitoring service, and can be connected to the target WIFI network according to the target WIFI network identifier and the target WIFI password in the WIFI access data packet.
7. The apparatus of claim 6, wherein the WIFI access packet encapsulation module comprises:
a network access field setting unit, configured to set a network access field in a data packet extension field of the WIFI point-to-point service;
and the WIFI access data packet packaging unit is used for setting the target WIFI network identifier and the target WIFI password in the network access field to obtain a WIFI access data packet.
8. The apparatus of claim 6, wherein the WIFI information to be shared further comprises:
a target WIFI network type;
and checking the information by the target WIFI network.
9. A WIFI connection device is applied to a terminal, and is characterized by comprising:
the WIFI access data packet acquisition module is used for acquiring a WIFI access data packet broadcasted by a broadcasting end in a network accessed by the broadcasting end through a broadcasting monitoring service; wherein, the WIFI access data packet includes: WIFI information to be shared and a WIFI access data packet analysis rule; the WIFI information to be shared comprises: a target WIFI network identifier and a target WIFI password of the target WIFI network; the WIFI access data packet is obtained by packaging WIFI information to be shared into a data packet extension field of the WIFI point-to-point service according to a preset rule after the broadcasting end creates the WIFI point-to-point service;
the analysis module is used for analyzing the WIFI access data packet according to the analysis rule to obtain a target WIFI network identifier and a target WIFI password;
the target WIFI network determining module is used for determining a target WIFI network according to the target WIFI network identifier;
and the target WIFI network connection module is used for connecting to the target WIFI network according to the target WIFI network identifier and the target WIFI password.
10. The apparatus of claim 9, wherein the target WIFI network determination module comprises:
and the target WIFI network determining unit is used for matching the target WIFI network identifier with one or more WIFI network identifiers obtained by the terminal through searching, and determining the WIFI network corresponding to the matched WIFI network identifier as the target WIFI network.
CN201810481273.0A 2018-05-18 2018-05-18 WIFI connection method and device Active CN108777865B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810481273.0A CN108777865B (en) 2018-05-18 2018-05-18 WIFI connection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810481273.0A CN108777865B (en) 2018-05-18 2018-05-18 WIFI connection method and device

Publications (2)

Publication Number Publication Date
CN108777865A CN108777865A (en) 2018-11-09
CN108777865B true CN108777865B (en) 2020-07-31

Family

ID=64027199

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810481273.0A Active CN108777865B (en) 2018-05-18 2018-05-18 WIFI connection method and device

Country Status (1)

Country Link
CN (1) CN108777865B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110784941B (en) * 2019-10-31 2021-06-25 Oppo广东移动通信有限公司 Automatic connection method, device and system for CPE and terminal equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103634176A (en) * 2013-12-05 2014-03-12 青岛海尔软件有限公司 Haier Internet of Things household appliance configuration sharing method capable of improving user experience
CN104540126A (en) * 2014-05-16 2015-04-22 生迪光电科技股份有限公司 Method and system for multiple pieces of WI-FI equipment to automatically access specified access point (AP)
CN104837132A (en) * 2015-04-17 2015-08-12 北京奇艺世纪科技有限公司 Wi-Fi (Wireless-Fidelity) network sharing method and device
CN106550360A (en) * 2015-09-23 2017-03-29 中国电信股份有限公司 WiFi methods of attachment and system
CN107750058A (en) * 2017-10-30 2018-03-02 欧普照明股份有限公司 Method, control terminal and the system of equipment access network based on wifi Beacon frames

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103634176A (en) * 2013-12-05 2014-03-12 青岛海尔软件有限公司 Haier Internet of Things household appliance configuration sharing method capable of improving user experience
CN104540126A (en) * 2014-05-16 2015-04-22 生迪光电科技股份有限公司 Method and system for multiple pieces of WI-FI equipment to automatically access specified access point (AP)
CN104837132A (en) * 2015-04-17 2015-08-12 北京奇艺世纪科技有限公司 Wi-Fi (Wireless-Fidelity) network sharing method and device
CN106550360A (en) * 2015-09-23 2017-03-29 中国电信股份有限公司 WiFi methods of attachment and system
CN107750058A (en) * 2017-10-30 2018-03-02 欧普照明股份有限公司 Method, control terminal and the system of equipment access network based on wifi Beacon frames

Also Published As

Publication number Publication date
CN108777865A (en) 2018-11-09

Similar Documents

Publication Publication Date Title
CN111194067A (en) Network access method, device, related equipment and storage medium
CN111867007A (en) Automatic network distribution method and system for intelligent equipment and storage medium
CN111866996A (en) Intelligent device network distribution method, device and storage medium
CN111867002A (en) Intelligent equipment distribution network authentication method, system and storage medium
WO2022016669A1 (en) Bluetooth network configuration method, device, and storage medium
WO2004051948A1 (en) Internet connection system and server for routing connection to client device
CN108391238A (en) Wireless MESH network matches network method
MX2008014540A (en) Mechanism to convey discovery information in a wireless network.
JP2018509827A (en) Access point steering
CN110809308A (en) Method and device for automatically connecting IOT device and WIFI router
JP2020005256A (en) VXLAN mounting method, network device, and communication system
CN104980514A (en) Remote play control method and apparatus of wireless sound box
CN105873186A (en) Smart home equipment adding method and equipment
CN108834138B (en) Network distribution method and system based on voiceprint data
CN112383500B (en) Method and system for controlling access request related to screen projection equipment
WO2018049823A1 (en) Automatic network distribution method, apparatus and device, and repeater
CN103888488A (en) Method for sharing data based on WIFI
CN108207012B (en) Flow control method, device, terminal and system
CN106453370B (en) Method and device for registering IPC (inter-programmable logic controller) to NVR (network video recorder)
CN107733764B (en) Method, system and related equipment for establishing virtual extensible local area network tunnel
CN108093390B (en) Intelligent device discovery method based on characteristic information
CN107979619B (en) TWAMP session negotiation method, client and server
CN108777865B (en) WIFI connection method and device
CN105991786A (en) Wi-Fi access configuration method, Wi-Fi terminal and access equipment
KR102074760B1 (en) Image display apparatus for conducting auto wireless communication among devices and image displaying method thereof

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