CN107370621B - Hotspot sharing method, readable storage medium and hotspot sharing device - Google Patents

Hotspot sharing method, readable storage medium and hotspot sharing device Download PDF

Info

Publication number
CN107370621B
CN107370621B CN201710549432.1A CN201710549432A CN107370621B CN 107370621 B CN107370621 B CN 107370621B CN 201710549432 A CN201710549432 A CN 201710549432A CN 107370621 B CN107370621 B CN 107370621B
Authority
CN
China
Prior art keywords
hotspot
configuration file
network equipment
information
configuration
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
CN201710549432.1A
Other languages
Chinese (zh)
Other versions
CN107370621A (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.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology 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 Guangzhou Shiyuan Electronics Thecnology Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201710549432.1A priority Critical patent/CN107370621B/en
Publication of CN107370621A publication Critical patent/CN107370621A/en
Application granted granted Critical
Publication of CN107370621B publication Critical patent/CN107370621B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]

Landscapes

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

Abstract

The invention provides a hot spot sharing method, a readable storage medium and a hot spot sharing device, wherein the method comprises the following steps: acquiring AP information of a device to be connected, and respectively generating a hotspot connection configuration file, a hotspot service configuration file, a host configuration protocol and a domain name service configuration file according to the AP information; loading a hotspot service configuration file, and configuring a preset port according to configuration information in the hotspot service configuration file so that the preset port starts a hotspot function and generates a network equipment node; loading a host configuration protocol and a domain name service configuration file to start a host configuration service and setting a network equipment node as bridging network equipment; the method and the device have the advantages that the WiFi hotspot bridging function between a single device and another device under a WiFi module is realized through the expansion of software functions on the basis of the existing hardware.

Description

Hotspot sharing method, readable storage medium and hotspot sharing device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a hot spot sharing method, a readable storage medium, and a hot spot sharing apparatus.
Background
With the development of the times, the living standard of people is continuously improved, the intelligent device is more and more widely used, in the network function of the intelligent device, the WiFi connection function and the hotspot sharing function play a crucial role, the WiFi connection function is used for connecting the intelligent device with an external WiFi network, so that the intelligent device can forward data through the external WiFi network, and the hotspot function is used for sharing other devices with the network.
In the existing hotspot sharing method, a single terminal device realizes hotspot network sharing with another terminal device through a network of the single terminal device.
In the existing hotspot sharing method, when a single terminal device shares a WiFi hotspot with another terminal device under a WiFi module, two sets of hotspot devices are required to be adopted on hardware, so that the cost is higher, the size of the device is increased, and the data processing steps of the system are increased by adopting the two sets of hotspot devices, so that the hotspot sharing efficiency is reduced.
Disclosure of Invention
Based on this, an object of the embodiments of the present invention is to provide a method, a readable storage medium, and a device for sharing a hotspot in a WiFi mode through software.
A hotspot sharing method, the method comprising:
acquiring AP information of a device to be connected, and respectively generating a hotspot connection configuration file, a hotspot service configuration file, a host configuration protocol and a domain name service configuration file according to the AP information;
loading the hotspot service configuration file, and configuring a preset port according to configuration information in the hotspot service configuration file so that the preset port starts a WiFi hotspot function and generates a network equipment node;
loading the host configuration protocol and the domain name service configuration file to start a host configuration service and setting the network equipment node as bridging network equipment;
and loading the hotspot connection configuration file, and configuring the bridge network equipment according to configuration information in the hotspot connection configuration file so as to connect the bridge network equipment with the equipment to be connected.
In the hotspot sharing method, the AP information of the device to be connected is acquired to respectively generate the hotspot connection configuration file, the hotspot service configuration file, the host configuration protocol and the domain name service configuration file, the hotspot service configuration file is used for configuring the preset port to enable the preset port to start a WiFi connection function and generate the network device node, the host configuration protocol and the domain name service configuration file are used for starting the host configuration service to start information configuration of a network IP address, and set the network device node as the bridge network device, the hotspot connection configuration file is used for providing address information of the device to be connected for the bridge network device to connect the bridge network device with the device to be connected, so as to achieve a bridge function between two WiFi hotspots, according to the method, the WiFi hotspot bridging function between the single terminal device and another terminal under the WiFi module is realized by expanding the software function on the basis of the existing hardware, the process is simple, other devices are not required to be additionally added, and the cost is saved.
Further, the method further comprises:
inquiring and executing a locally stored support instruction to start a function of supporting network forwarding;
inquiring and executing a forwarding instruction stored locally so as to start a route forwarding function of the bridging network equipment;
and inquiring and executing a locally stored rule adding instruction so as to start a rule adding function of the bridging network equipment.
Further, the step of loading the hotspot service configuration file and configuring a preset port according to configuration information in the hotspot service configuration file includes:
extracting a network configuration item in the hotspot service configuration file, and acquiring a port address of the preset port, wherein the network configuration item is wds _ sta ═ 1, and the preset port is an equipment node wlan 0;
and starting hot spot service for the port address according to the network configuration item information.
Further, the step of setting the network device node as a bridging network device includes:
extracting a preset command stored locally;
and sending the preset command to the network equipment node, and executing the preset command on the network equipment node so as to set the network equipment node as the bridging network equipment.
Further, the step of loading the hotspot connection configuration file and configuring the bridge network device according to the configuration information in the hotspot connection configuration file includes:
extracting SSID configuration information and password configuration information to be connected in the hotspot connection configuration file;
and sending the SSID configuration information to be connected and the password configuration information to the bridging network equipment.
A readable storage medium, having stored thereon a computer program which, when executed by a processor, carries out the steps of the method according to any one of the preceding claims.
A hotspot sharing device, comprising:
the acquisition module is used for acquiring AP information of the equipment to be connected and respectively generating a hotspot connection configuration file, a hotspot service configuration file, a host configuration protocol and a domain name service configuration file according to the AP information;
the first loading module is used for loading the hotspot service configuration file and configuring a preset port according to configuration information in the hotspot service configuration file so that the preset port starts a WiFi hotspot function and generates a network equipment node;
the second loading module is used for loading the host configuration protocol and the domain name service configuration file so as to start the host configuration service and set the network equipment node as bridging network equipment;
and the third loading module is used for loading the hotspot connection configuration file and configuring the bridge network equipment according to the configuration information in the hotspot connection configuration file so as to connect the bridge network equipment with the equipment to be connected.
In the hotspot sharing device, through the design of the acquisition module, the AP information may be acquired to obtain the hotspot connection configuration file, the hotspot service configuration file, the host configuration protocol and the domain name service configuration file, through the design of the first loading module, the hotspot function of the preset port may be enabled to generate the network device node, through the design of the second loading module, the host configuration service may be enabled and the network device node may be set as the bridge network device, through the design of the third loading module, the IP address configuration may be performed on the bridge network device to connect the bridge network device with the device to be connected, so as to achieve the bridging function between two WiFi hotspots, in the above method, through the extension of the software function on the basis of the existing hardware, the WiFi hotspot bridging function between a single terminal device and another terminal under the WiFi module is achieved, and the process is simple, and other devices are not required to be additionally added, so that the cost is saved.
Further, the hotspot sharing device further comprises:
the first execution module is used for inquiring and executing the locally stored support instruction so as to start the function of supporting network forwarding;
the second execution module is used for inquiring and executing the forwarding instruction stored locally so as to start the route forwarding function of the bridging network equipment;
and the third execution module is used for inquiring and executing the locally stored rule adding instruction so as to start the rule adding function of the bridging network equipment.
Further, the first load module comprises:
a first extraction module, configured to extract a network configuration item in the hotspot service configuration file, and acquire a port address of the preset port, where the network configuration item is wds _ sta ═ 1, and the preset port is an equipment node wlan 0;
and the starting module is used for starting the hotspot service on the port address according to the extraction result of the first extraction module.
Further, the second load module comprises:
the second extraction module is used for extracting the locally stored preset command;
and the first sending module is used for sending the preset command to the network equipment node according to the extraction result of the second extraction module and executing the preset command on the network equipment node so as to set the network equipment node as the bridging network equipment.
Drawings
Fig. 1 is a flowchart of a hot spot sharing method according to a first embodiment of the present invention;
fig. 2 is a flowchart of a hotspot sharing method according to a second embodiment of the invention;
fig. 3 is a schematic structural diagram of a hot spot sharing device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a hot spot sharing device according to a fourth embodiment of the present invention;
description of the symbols of the main elements
Figure GDA0002579485390000041
Figure GDA0002579485390000051
Detailed Description
In order to facilitate a better understanding of the invention, the invention will be further explained below with reference to the accompanying drawings of embodiments. Embodiments of the present invention are shown in the drawings, but the present invention is not limited to the preferred embodiments described above. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Referring to fig. 1, a flowchart of a hot spot sharing method according to a first embodiment of the present invention includes steps S10 to S40.
Step S10, obtaining AP information of a device to be connected, and respectively generating a hotspot connection configuration file, a hotspot service configuration file, a host configuration protocol and a domain name service configuration file according to the AP information;
the AP information comprises hotspot name information, hotspot connection security information and a hotspot connection password, the hotspot connection configuration file comprises the hotspot name information, security configuration corresponding to the hotspot connection security information, the hotspot connection password and connection priority configuration, the hotspot service configuration file comprises the hotspot name information, the security configuration, network equipment node configuration, working channel configuration, an enabled wireless distribution system, drive type configuration, maximum hotspot connection number configuration and wireless protocol type configuration items, and the hotspot service configuration file, host configuration protocol and domain name service configuration file comprises the network equipment node configuration, an allocated network address field range and used domain name host address configuration;
step S20, loading the hotspot service configuration file, and configuring a preset port according to configuration information in the hotspot service configuration file, so that the preset port starts a WiFi hotspot function and generates a network equipment node;
the preset port is a WiFi device node wlan0, and when the WiFi connection function is turned on, the WiFi device node wlan0 automatically generates a WiFi hotspot connection signal, generates a network device node wds0, and loads the hotspot service profile with a command of hostapd hostapd.conf;
step S30, loading the host configuration protocol and domain name service configuration file to start host configuration service, and setting the network device node as bridging network device;
the bridge network device is used for interconnecting and sharing the WiFi hotspot with another WiFi hotspot, and the command for loading the host configuration protocol and the domain name service configuration file is iwphy 0interface add wds0type wds;
step 40, loading the hotspot connection configuration file, and configuring the bridge network device according to configuration information in the hotspot connection configuration file so as to connect the bridge network device with the device to be connected;
the method comprises the steps that after a hotspot connection configuration file is obtained, the address of equipment to be connected is obtained, so that the equipment to be connected is connected and WiFi network sharing is realized, and commands adopted by loading the hotspot connection configuration file are wpa _ supplicant-iwds0-Dnl80211-cwpa _ supplicant.conf-Iwpa _ supplicant _ overlap.co nf-eentropy.bin-g @ android: wpa _ wds 0.
In this embodiment, the AP information of the device to be connected is obtained, so that the hotspot connection configuration file, the hotspot service configuration file, the host configuration protocol and the domain name service configuration file are respectively generated, the hotspot service configuration file is used to configure the preset port, so that the preset port starts a WiFi connection function and generates the network device node, the host configuration protocol and the domain name service configuration file are used to start the host configuration service, so as to start information configuration of a network IP address, and set the network device node as the bridge network device, the hotspot connection configuration file is used to provide the address information of the device to be connected for the bridge network device, so that the bridge network device is connected with the device to be connected, and a bridge function between two WiFi hotspots is achieved, according to the method, the WiFi hotspot bridging function between the single terminal device and another terminal under the WiFi module is realized by expanding the software function on the basis of the existing hardware, the process is simple, other devices are not required to be additionally added, and the cost is saved.
Referring to fig. 2, a flowchart of a hotspot sharing method according to a second embodiment of the present invention is shown, wherein the method includes steps S11 to S71.
Step S11, obtaining AP information of a device to be connected, and respectively generating a hotspot connection configuration file, a hotspot service configuration file, a host configuration protocol and a domain name service configuration file according to the AP information;
the AP information comprises hotspot name information, hotspot connection security information and a hotspot connection password, the hotspot connection configuration file comprises the hotspot name information, security configuration corresponding to the hotspot connection security information, the hotspot connection password and connection priority configuration, the hotspot service configuration file comprises the hotspot name information, the security configuration, network equipment node configuration, working channel configuration, an enabled wireless distribution system, drive type configuration, maximum hotspot connection number configuration and wireless protocol type configuration items, and the hotspot service configuration file, host configuration protocol and domain name service configuration file comprises the network equipment node configuration, an allocated network address field range and used domain name host address configuration;
in this embodiment, the procedure for generating the hotspot service configuration file by acquiring the AP information of the device to be connected is as follows:
interface=wlan0
driver=nl80211
ctrl_interface=/data/misc/WiFi/hostapd
SSID-WiFi hotspot SSID name
hw_mode=a
wds_sta=1
wme_enabled=1
max_num_sta=8
channel=36
ieee80211n=1
ieee80211ac=1
wpa_group_rekey=86400
wpa=2
wpa_pairwise=CCMP
wpa_passphrase=12345678
In this embodiment, the procedure for generating the hotspot connection configuration file by acquiring the AP information of the device to be connected is as follows:
Figure GDA0002579485390000071
Figure GDA0002579485390000081
in this embodiment, the procedure for generating the host configuration protocol and the domain name service configuration file by obtaining the AP information of the device to be connected is as follows:
interface=wlan0
keep-in-foreground
dhcp-authoritative
localise-queries
no-resolv
no-poll
no-hosts
except-interface=lo
cache-size=500
dhcp-range=192.168.43.100,192.168.43.200,255.255.255.0,12h
dhcp-option=6,114.114.114.114,119.29.29.29,180.76.76.76,223.5.5.5,223.6.6.6, 8.8.8.8,8.8.4.4,192.168.43.1
dhcp-option-force=43,ANDROID_METERED
dhcp-leasefile=/data/misc/WiFi/dnsmasq.leases
pid-file=/data/misc/WiFi/dnsmasq.pid
step S21, extracting the network configuration item in the hotspot service configuration file, acquiring the port address of the preset port, and starting hotspot service to the port address according to the network configuration item information;
the network configuration item is wds _ sta ═ 1, the preset port is a WiFi device node wlan0, so that the preset port starts a WiFi connection function and generates the network device node, and at this time, the WiFi device node wlan0 automatically connects to an external WiFi network;
in this embodiment, the command for starting the hotspot service is hostapd hostapd.conf;
step S31, loading the host configuration protocol and the domain name service configuration file to start the host configuration service and extract the preset command stored locally;
wherein the preset command is iwphy 0interface add wds0type wds;
step S41, sending the preset command to the network device node, and executing the preset command on the network device node, so as to set the network device node as the bridge network device;
step S51, extracting SSID configuration information and password configuration information to be connected in the hotspot connection configuration file;
step S61, sending the SSID configuration information and the password configuration information to be connected to the bridge network device;
step S71, respectively inquiring and executing the locally stored support instruction, forwarding instruction and rule adding instruction to open the network sharing rule;
the support instruction is echo '1' >/proc/sys/net/ipv4/ip _ FORWARD and is used for starting a support network forwarding function, the forwarding instruction is iptables-P FORWARD ACCEPT and is used for starting a route forwarding function of the bridging network device, and the rule adding instruction is iptables-t nat-A POSTROUTING-o wds0-i wlan0-j MASQUERED and is used for starting a rule adding function of the bridging network device.
In this embodiment, the AP information of the device to be connected is obtained, so that the hotspot connection configuration file, the hotspot service configuration file, the host configuration protocol and the domain name service configuration file are respectively generated, the hotspot service configuration file is used to configure the preset port, so that the preset port starts a WiFi connection function and generates the network device node, the host configuration protocol and the domain name service configuration file are used to start the host configuration service, so as to start information configuration of a network IP address, and set the network device node as the bridge network device, the hotspot connection configuration file is used to provide the address information of the device to be connected for the bridge network device, so that the bridge network device is connected with the device to be connected, and a bridge function between two WiFi hotspots is achieved, according to the method, the WiFi hotspot bridging function between the single terminal device and another terminal under the WiFi module is realized by expanding the software function on the basis of the existing hardware, the process is simple, other devices are not required to be additionally added, and the cost is saved.
It will be understood by those skilled in the art that all or part of the steps in the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, where the program may be stored in a computer readable storage medium, and when executed, the program includes the following steps:
acquiring AP information of a device to be connected, and respectively generating a hotspot connection configuration file, a hotspot service configuration file, a host configuration protocol and a domain name service configuration file according to the AP information;
loading the hotspot service configuration file, and configuring a preset port according to configuration information in the hotspot service configuration file so that the preset port starts a WiFi hotspot function and generates a network equipment node;
loading the host configuration protocol and the domain name service configuration file to start a host configuration service and setting the network equipment node as bridging network equipment;
and loading the hotspot connection configuration file, and configuring the bridge network equipment according to configuration information in the hotspot connection configuration file so as to connect the bridge network equipment with the equipment to be connected. The readable storage medium comprises: ROM/RAM, magnetic disk, optical disk, etc.
Referring to fig. 3, a schematic structural diagram of a hot spot sharing device 100 according to a third embodiment of the present invention is shown, where the hot spot sharing device 100 includes:
the device comprises an acquisition module 10, a storage module and a processing module, wherein the acquisition module is used for acquiring AP information of a device to be connected, and respectively generating a hotspot connection configuration file, a hotspot service configuration file, a host configuration protocol and a domain name service configuration file according to the AP information, the device to be connected is a device which is selected by a user and needs to be connected, and the device to be connected can be a mobile phone, a computer, a tablet, a set-top box and the like;
a first loading module 20, configured to load the hotspot service configuration file, and configure a preset port according to configuration information in the hotspot service configuration file, so that the preset port starts a WiFi hotspot function and generates a network device node, where the preset port is a WiFi device node wlan0, and when the WiFi connection function is started, the WiFi device node wlan0 automatically generates a WiFi hotspot connection signal and generates a network device node wds0, and a command adopted to load the hotspot service configuration file is hostapdhostapd.
The second loading module 30 is configured to load the host configuration protocol and the domain name service configuration file to start a host configuration service, and set the network device node as a bridge network device, where the bridge network device is configured to interconnect and share a WiFi hotspot with another WiFi hotspot, and a command used to load the host configuration protocol and the domain name service configuration file is iwphy phy0interface add wds0type wds;
a third loading module 40, configured to load the hotspot connection configuration file, and configure the bridge network device according to configuration information in the hotspot connection configuration file, so that the bridge network device is connected to the device to be connected;
the method comprises the steps that after a hotspot connection configuration file is obtained, the address of equipment to be connected is obtained, so that the equipment to be connected is connected and WiFi network sharing is realized, and commands adopted by loading the hotspot connection configuration file are wpa _ supplicant-iwds0-Dnl80211-cwpa _ supplicant.conf-Iwpa _ supplicant _ overlap.co nf-eentropy.bin-g @ android: wpa _ wds 0.
The first load module 20 includes:
a first extracting module 21, configured to extract a network configuration item in the hotspot service configuration file, and acquire a port address of the preset port, where the network configuration item is wds _ sta ═ 1, and the preset port is an equipment node wlan 0;
a starting module 22, configured to start a hot spot service for the port address according to the extraction result of the first extraction module 21, where an instruction adopted by the hot spot service is hostapd.
The second load module 30 includes:
the second extracting module 31 is configured to extract the preset command stored locally, where the preset command is iwphy 0interface add wds0type wds;
a first sending module 32, configured to send the preset command to the network device node according to the extraction result of the second extraction module 31, and execute the preset command on the network device node, so as to set the network device node as the bridge network device.
The third load module 40 includes:
a third extracting module 41, configured to extract SSID configuration information and password configuration information to be connected in the hotspot connection configuration file;
a second sending module 42, configured to send the SSID configuration information and the password configuration information to be connected to the bridge network device according to the extraction result of the third extraction module 41.
In this embodiment, through the design of the obtaining module 10, the AP information may be obtained to obtain the hotspot connection configuration file, the hotspot service configuration file, the host configuration protocol, and the domain name service configuration file, through the design of the first loading module 20, the hotspot function of the preset port may be enabled to generate the network device node, through the design of the second loading module 30, the host configuration service may be enabled and the network device node may be set as the bridge network device, through the design of the third loading module 40, the IP address configuration may be performed on the bridge network device, so that the bridge network device is connected with the device to be connected, thereby achieving the bridging function between two WiFi hotspots, in the above method, through the extension of the software function on the basis of the existing hardware, the WiFi hotspot bridging function between a single terminal device and another terminal under the WiFi module is further achieved, and the process is simple, and other devices are not required to be additionally added, so that the cost is saved.
Referring to fig. 4, a schematic structural diagram of a hot spot sharing device 100a according to a fourth embodiment of the present invention is shown, where the fourth embodiment is substantially the same as the third embodiment, and the difference is that the hot spot sharing device 100a in this embodiment further includes:
the first execution module 11 is configured to query and execute a locally stored support instruction, where the support instruction is:
echo '1' >/proc/sys/net/ipv4/ip _ forward, wherein the support instruction is used for starting a support network forwarding function;
a second execution module 12, configured to query and execute a locally stored forwarding instruction, where the forwarding instruction is an iptables-P FORWARD ACCEPT, and the forwarding instruction is used to start a route forwarding function of the bridged network device;
and the third execution module 13 is configured to query and execute a locally stored rule adding instruction, where the rule adding instruction is iptables-t nat-a post outputting-o wds0-i wlan0-j MASQUERADE, and the rule adding instruction is used to turn on a rule adding function of the bridging network device.
In this embodiment, the first execution module 11 is designed to enable a system kernel to support a network forwarding function, and the second execution module 12 and the third execution module 13 are designed to enable a user to issue forwarding rules by himself, so that the requirements of the user on different forwarding rules are met, and the user experience is improved.
The above-described embodiments describe the technical principles of the present invention, and these descriptions are only for the purpose of explaining the principles of the present invention and are not to be construed as limiting the scope of the present invention in any way. Based on the explanations herein, those skilled in the art will be able to conceive of other embodiments of the present invention without inventive effort, which would fall within the scope of the present invention.

Claims (6)

1. A hotspot sharing method, the method comprising:
acquiring AP information of a device to be connected, and respectively generating a hotspot connection configuration file, a hotspot service configuration file, a host configuration protocol and a domain name service configuration file according to the AP information;
loading the hotspot service configuration file, and configuring a preset port according to configuration information in the hotspot service configuration file so that the preset port starts a WiFi hotspot function and generates a network equipment node;
the step of loading the hotspot service configuration file and configuring a preset port according to configuration information in the hotspot service configuration file comprises the following steps:
extracting a network configuration item in the hotspot service configuration file, and acquiring a port address of the preset port, wherein the network configuration item is wds _ sta ═ 1, and the preset port is an equipment node wlan 0;
starting hot spot service for the port address according to the network configuration item information;
loading the host configuration protocol and the domain name service configuration file to start a host configuration service and setting the network equipment node as bridging network equipment;
the step of setting the network device node as a bridging network device comprises:
extracting a preset command stored locally;
sending the preset command to the network equipment node, and executing the preset command on the network equipment node so as to set the network equipment node as the bridging network equipment;
and loading the hotspot connection configuration file, and configuring the bridge network equipment according to configuration information in the hotspot connection configuration file so as to connect the bridge network equipment with the equipment to be connected.
2. The hotspot sharing method of claim 1, further comprising:
inquiring and executing a locally stored support instruction to start a function of supporting network forwarding;
inquiring and executing a forwarding instruction stored locally so as to start a route forwarding function of the bridging network equipment;
and inquiring and executing a locally stored rule adding instruction so as to start a rule adding function of the bridging network equipment.
3. The hotspot sharing method according to claim 1, wherein the step of loading the hotspot connection configuration file and configuring the bridging network device according to the configuration information in the hotspot connection configuration file comprises:
extracting SSID configuration information and password configuration information to be connected in the hotspot connection configuration file;
and sending the SSID configuration information to be connected and the password configuration information to the bridging network equipment.
4. A readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 3.
5. A hotspot sharing device, comprising:
the acquisition module is used for acquiring AP information of the equipment to be connected and respectively generating a hotspot connection configuration file, a hotspot service configuration file, a host configuration protocol and a domain name service configuration file according to the AP information;
the first loading module is used for loading the hotspot service configuration file and configuring a preset port according to configuration information in the hotspot service configuration file so that the preset port starts a WiFi hotspot function and generates a network equipment node;
the first load module includes:
a first extraction module, configured to extract a network configuration item in the hotspot service configuration file, and acquire a port address of the preset port, where the network configuration item is wds _ sta ═ 1, and the preset port is an equipment node wlan 0;
the starting module is used for starting hotspot service on the port address according to the extraction result of the first extraction module;
the second loading module is used for loading the host configuration protocol and the domain name service configuration file so as to start the host configuration service and set the network equipment node as bridging network equipment;
the second load module comprises:
the second extraction module is used for extracting the locally stored preset command;
the first sending module is used for sending the preset command to the network equipment node according to the extraction result of the second extraction module and executing the preset command on the network equipment node so as to set the network equipment node as the bridging network equipment;
and the third loading module is used for loading the hotspot connection configuration file and configuring the bridge network equipment according to the configuration information in the hotspot connection configuration file so as to connect the bridge network equipment with the equipment to be connected.
6. The hotspot sharing device of claim 5, further comprising:
the first execution module is used for inquiring and executing the locally stored support instruction so as to start the function of supporting network forwarding;
the second execution module is used for inquiring and executing the forwarding instruction stored locally so as to start the route forwarding function of the bridging network equipment;
and the third execution module is used for inquiring and executing the locally stored rule adding instruction so as to start the rule adding function of the bridging network equipment.
CN201710549432.1A 2017-07-07 2017-07-07 Hotspot sharing method, readable storage medium and hotspot sharing device Active CN107370621B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710549432.1A CN107370621B (en) 2017-07-07 2017-07-07 Hotspot sharing method, readable storage medium and hotspot sharing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710549432.1A CN107370621B (en) 2017-07-07 2017-07-07 Hotspot sharing method, readable storage medium and hotspot sharing device

Publications (2)

Publication Number Publication Date
CN107370621A CN107370621A (en) 2017-11-21
CN107370621B true CN107370621B (en) 2020-12-22

Family

ID=60306002

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710549432.1A Active CN107370621B (en) 2017-07-07 2017-07-07 Hotspot sharing method, readable storage medium and hotspot sharing device

Country Status (1)

Country Link
CN (1) CN107370621B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113473493B (en) * 2020-03-31 2023-06-30 华为技术有限公司 Communication method and device
CN113423116B (en) * 2021-08-25 2021-12-24 广州朗国电子科技股份有限公司 Configuration method of 5G hot spot default mode based on Android system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516528A (en) * 2015-11-27 2016-04-20 深圳市朗科科技股份有限公司 Wireless internet access method and wireless internet access device
CN106658367A (en) * 2016-11-30 2017-05-10 努比亚技术有限公司 Network connection device and method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286909B (en) * 2008-06-10 2010-10-13 华中科技大学 Method of automatically constructing wireless distributed system
CN101605330B (en) * 2009-07-03 2012-11-28 中兴通讯股份有限公司 Method and device for building wireless distribution system connection
US9288754B2 (en) * 2012-09-07 2016-03-15 Qualcomm Incorporated Apparatus and methods of power save for wireless access points and multi-hop relays

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516528A (en) * 2015-11-27 2016-04-20 深圳市朗科科技股份有限公司 Wireless internet access method and wireless internet access device
CN106658367A (en) * 2016-11-30 2017-05-10 努比亚技术有限公司 Network connection device and method

Also Published As

Publication number Publication date
CN107370621A (en) 2017-11-21

Similar Documents

Publication Publication Date Title
US9699642B2 (en) Electronic subscriber identity module selection
US9769732B2 (en) Wireless network connection establishment method and terminal device
EP3165009B1 (en) Apparatus and method for controlling wireless data traffic
US10785645B2 (en) Techniques for dynamically supporting different authentication algorithms
US20150350879A1 (en) Electronic subscriber identity module application identifier handling
US20160242033A1 (en) Communication service using method and electronic device supporting the same
EP2814273A1 (en) Method of connecting an appliance to a WIFI network
CN109041140B (en) Method for rapidly switching wireless network, intelligent hardware and terminal equipment
CN104080194A (en) Method for wirelessly configuring WIFI access parameters of zero-input terminal equipment through mobile phone
CN104159321A (en) Wi-Fi configuration method and system
EP3076718B1 (en) Wireless access method and relevant device and system
CN103974376A (en) Network connection assisting system and method
CN104936258A (en) Network access method, terminal and system
EP2938156A1 (en) Method and device for establishing convenient wireless connection
US20150133052A1 (en) Device selection
CN107370621B (en) Hotspot sharing method, readable storage medium and hotspot sharing device
CN103906170A (en) Method for setting hardware Wi-Fi access point information
CN104918296A (en) Network connection assistance system and method
US10708775B2 (en) Method for establishing network connection by using WPS, and mobile Wi-Fi device
CN104519482A (en) Equipment parameter configuration method and device
CN103078931A (en) Embedded monitoring equipment and method for realizing network sharing of embedded monitoring equipment
US9479987B2 (en) Wireless communication device with internal local access point
US20160036634A1 (en) Zero touch configuration support for unniversal serial bus modem on a network device
US20150249955A1 (en) Dialling method and device
WO2013182087A2 (en) Information pushing method and mobile terminal

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200319

Address after: 510530 Guangdong city of Guangzhou province YUNPU Whampoa district four Road No. 6

Applicant after: GUANGZHOU SHIYUAN ELECTRONICS Co.,Ltd.

Address before: 510530 Guangdong city of Guangzhou province YUNPU Whampoa district four Road No. 6

Applicant before: GUANGZHOU SHIYUAN ELECTRONICS Co.,Ltd.

Applicant before: SHENZHEN KAISHI ELECTRONIC TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant