CN111065126A - Hotspot sharing method and device, storage medium and electronic equipment - Google Patents

Hotspot sharing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN111065126A
CN111065126A CN201911368023.7A CN201911368023A CN111065126A CN 111065126 A CN111065126 A CN 111065126A CN 201911368023 A CN201911368023 A CN 201911368023A CN 111065126 A CN111065126 A CN 111065126A
Authority
CN
China
Prior art keywords
network
target
wifi
wifi network
port
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.)
Granted
Application number
CN201911368023.7A
Other languages
Chinese (zh)
Other versions
CN111065126B (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201911368023.7A priority Critical patent/CN111065126B/en
Publication of CN111065126A publication Critical patent/CN111065126A/en
Application granted granted Critical
Publication of CN111065126B publication Critical patent/CN111065126B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/08Testing, supervising or monitoring using real traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/02Terminal devices
    • H04W88/04Terminal devices adapted for relaying to or from another terminal or user
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

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

Abstract

The application discloses a hotspot sharing method and device, a storage medium and electronic equipment. The method comprises the following steps: when the first network port is connected with a first WiFi network and the second network port is connected with a second WiFi network, whether a wireless hotspot sharing instruction is received or not is detected; when a wireless hotspot sharing instruction is received, acquiring a first parameter used for expressing the network quality of a first internet access, and acquiring a second parameter used for expressing the network quality of a second internet access; determining a target network port and a non-target network port from the first network port and the second network port according to the first parameter and the second parameter, wherein the network quality of the non-target network port is superior to that of the target network port; and when the network quality of the non-target network interface meets a preset condition, sharing a target WiFi network based on the target network interface, wherein the target WiFi network is a WiFi network corresponding to the non-target network interface in the first WiFi network and the second WiFi network. The method and the device can improve the flexibility of selecting the wireless hotspot sharing network port.

Description

Hotspot sharing method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a hotspot sharing method and apparatus, a storage medium, and an electronic device.
Background
With the continuous development of electronic technology, electronic devices support a single WiFi mode from the first to the current dual WiFi mode, so that the electronic devices only support to turn on wireless hotspot sharing based on a data network, and then turn on wireless hotspot sharing based on a WiFi network.
In the related art, in the dual WiFi mode, one WiFi port is used as a main WiFi port, and the other WiFi port is used as a sub WiFi port. When the electronic device needs to start wireless hotspot sharing based on the WiFi network port, the electronic device fixedly selects the auxiliary WiFi network port as the wireless hotspot sharing network port, and shares the WiFi network corresponding to the main WiFi network port based on the auxiliary WiFi network port.
Disclosure of Invention
The embodiment of the application provides a hotspot sharing method and device, a storage medium and electronic equipment, which can improve the flexibility of selecting a wireless hotspot sharing network port.
The embodiment of the application provides a hotspot sharing method, which is applied to electronic equipment, wherein the electronic equipment comprises a WiFi module, the WiFi module comprises a first network port and a second network port, and the method comprises the following steps:
when the first internet access is connected with a first WiFi network and the second internet access is connected with a second WiFi network, whether a wireless hotspot sharing instruction is received or not is detected;
when a wireless hotspot sharing instruction is received, acquiring a first parameter used for expressing the network quality of the first internet access, and acquiring a second parameter used for expressing the network quality of the second internet access;
determining a target internet access and a non-target internet access from the first internet access and the second internet access according to the first parameter and the second parameter, wherein the network quality of the non-target internet access is better than that of the target internet access;
and when the network quality of the non-target network interface meets a preset condition, sharing a target WiFi network based on the target network interface, wherein the target WiFi network is a WiFi network corresponding to the non-target network interface in the first WiFi network and the second WiFi network.
The embodiment of the application provides a hot spot sharing device, is applied to electronic equipment, electronic equipment includes the wiFi module, the wiFi module includes first net gape and second net gape, includes:
the detection module is used for detecting whether a wireless hotspot sharing instruction is received or not when the first internet access is connected with a first WiFi network and the second internet access is connected with a second WiFi network;
the acquisition module is used for acquiring a first parameter used for representing the network quality of the first internet access and acquiring a second parameter used for representing the network quality of the second internet access when a wireless hotspot sharing instruction is received;
a determining module, configured to determine a target portal and a non-target portal from the first portal and the second portal according to the first parameter and the second parameter, where a network quality of the non-target portal is better than a network quality of the target portal;
the sharing module is used for sharing a target WiFi network based on the target network port when the network quality of the non-target network port meets a preset condition, wherein the target WiFi network is a WiFi network corresponding to the non-target network port in the first WiFi network and the second WiFi network.
An embodiment of the present application provides a storage medium, on which a computer program is stored, and when the computer program is executed on a computer, the computer is caused to execute a flow in a hotspot sharing method provided by the embodiment of the present application.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the processor is configured to execute the procedure in the hotspot sharing method provided by the embodiment of the present application by calling the computer program stored in the memory.
In the embodiment of the application, when the wireless hotspot sharing instruction is received, a first parameter used for representing the network quality of the first internet access can be obtained, and a second parameter used for representing the network quality of the second internet access can be obtained. And then, according to the first parameter and the second parameter, a target network port and a non-target network port can be determined from the first network port and the second network port, wherein the network quality of the non-target network port is superior to that of the target network port, and finally, the WiFi network corresponding to the non-target network port can be shared based on the target network port. Therefore, in the embodiment of the application, the network port with poor network quality can be selected from the first network port and the second network port according to the first parameter and the second parameter to serve as the wireless hotspot sharing network port, and compared with a scheme of fixedly selecting one network port to serve as the wireless hotspot sharing network port, the scheme provided by the application has higher flexibility.
Drawings
The technical solutions and advantages of the present application will become apparent from the following detailed description of specific embodiments of the present application when taken in conjunction with the accompanying drawings.
Fig. 1 is a first structural schematic diagram of an electronic device according to an embodiment of the present application.
Fig. 2 is a schematic flowchart of a first hot spot sharing method according to an embodiment of the present disclosure.
Fig. 3 is a schematic flowchart of a second hot spot sharing method according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of a hot spot sharing device according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of a second electronic device according to an embodiment of the present application.
Fig. 6 is a third schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present application are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the application and should not be taken as limiting the application with respect to other embodiments that are not detailed herein.
It is understood that the execution subject of the embodiment of the present application may be an electronic device such as a smart phone or a tablet computer.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device 100 may be a smart phone, a tablet computer, a Personal Digital Assistant (PDA), or the like having a wireless communication function. The electronic device 100 includes a housing 12, a circuit board 14, a processor 15, and a WiFi module 16. The circuit board 14 is disposed in the housing 12, the circuit board 14 is provided with a processor 15 and a WiFi module 16, the WiFi module 16 is electrically connected to the processor 15, and the processor 15 is used for controlling the WiFi module 16 and the WiFi network to establish a connection relationship.
The WiFi module 16 may support simultaneous transceiving of signals in two WIreless Fidelity (WiFi) frequency bands, and the signals in the two WiFi frequency bands do not interfere with each other. Wherein, the WiFi module 16 may include a first port and a second port, and the processor 15 may control the WiFi module 16 to connect to the first WiFi network based on the first port and control the WiFi module 16 to connect to the second WiFi network based on the second port.
The WiFi module 16 has a Dual Band Dual Current (DBDC) function, and supports 2 × 2 antennas (a first antenna and a second antenna), and 2 groups of antennas are all configured with an amplifying circuit and a power amplifier chip, and can support the antennas to transmit and receive signals simultaneously. The electronic device 100 may connect to two WiFi networks (a first WiFi network and a second WiFi network) through the WiFi module 16 at the same time, and support data transceiving of the two WiFi paths (a first WiFi path and a second WiFi path). For example, the electronic device 100 establishes a connection relationship with a first WiFi network through a first antenna based on a first network port through the WiFi module 16 to form a first WiFi path, and performs data transceiving through the first WiFi path; and establishing a connection relationship with a second WiFi network through a second antenna based on a second portal through the WiFi module 16 to form a second WiFi access, and performing data transceiving through the second WiFi access. It should be noted that the first WiFi path is a data path formed after the electronic device 100 establishes a connection with the first WiFi via the WiFi module 16. The second WiFi path is a data path formed after the electronic device 100 establishes a connection with a second WiFi network through the WiFi module 16.
In some embodiments, the electronic device 100 may establish a connection with a first WiFi network operating in a first frequency band through a first antenna based on a first port, and may also establish a connection with a second WiFi network operating in a second frequency band through a second antenna based on a second port. The first frequency band can be 2.4G, and the second frequency band can be 5G; alternatively, the first frequency band may be 5G and the second frequency band may be 2.4G.
In other embodiments, the electronic device 100 may simultaneously connect two WiFi networks operating in the 2.4G frequency band or two WiFi networks operating in the 5G frequency band through the first antenna and the second antenna.
Referring to fig. 2, fig. 2 is a first flowchart illustrating a hotspot sharing method according to an embodiment of the present disclosure, where the hotspot sharing method is applicable to an electronic device, the electronic device may include a WiFi module, the WiFi module may include a first network port and a second network port, the electronic device may be the electronic device 100, and the process includes:
in 101, when the first WiFi network is connected to the first portal and the second WiFi network is connected to the second portal, whether a wireless hotspot sharing command is received is detected.
In this embodiment, the electronic device may establish a connection with a first WiFi network through a first antenna based on a first portal, and establish a connection with a second WiFi network through a second antenna based on a second portal. When the first network port is connected with the first WiFi network through the first antenna and the second network port is connected with the second WiFi network through the second antenna, the electronic equipment can detect whether a wireless hotspot sharing instruction is received.
For example, when a user operates the electronic device to start wireless hotspot sharing, the electronic device receives a wireless hotspot sharing instruction. For example, a user may click a "settings" button in the electronic device to enter a settings interface. The user may then click on the "personal hotspot" button of the settings interface to enter the personal hotspot settings interface. Finally, the user may click the "open" button of the personal hotspot setup interface to open wireless hotspot sharing. When the user clicks an 'open' button of the personal hotspot setting interface, the electronic equipment receives a wireless hotspot sharing instruction.
The wireless hotspot sharing is to convert a GPRS, 3G, 4G or 5G signal received by the electronic device into a WiFi signal and send the WiFi signal, or to an electronic device connectable to at least two WiFi networks, send the WiFi signal received by the electronic device from another network port based on a certain network port.
It can be understood that, when the first WiFi network is connected based on the first portal and the second WiFi network is connected based on the second portal, the electronic device may detect whether the wireless hotspot sharing instruction is received at preset time intervals. Upon receiving the wireless hotspot sharing command, the electronic device may proceed to process 102. When the wireless sharing command is not received, the electronic device may continue to detect whether the wireless hotspot sharing command is received. The preset time can be set according to actual conditions, for example, the preset time can be 2 seconds, 3 seconds, 5 seconds, or the like.
In 102, when a wireless hotspot sharing instruction is received, a first parameter used for representing the network quality of a first internet access is acquired, and a second parameter used for representing the network quality of a second internet access is acquired.
The first parameter may be a first network signal strength, a first network packet loss rate, a first network transmission rate, a first TCP retransmission rate, a first round trip delay, a first DNS query delay, or a first signal quality. The second parameter may be a second network signal strength, a second network packet loss rate, a second network transmission rate, a second TCP retransmission rate, a second round trip delay, a second DNS query delay, or a second signal quality, etc.
For example, upon receiving the wireless hotspot sharing instruction, the electronic device may obtain a first network signal strength indicating the network quality of the first portal and obtain a second network signal strength indicating the network quality of the second portal. The stronger the first network signal strength is, the better the network quality of the first network port is; the stronger the second network signal strength, the better the network quality of the second network port.
For another example, when receiving the wireless hotspot sharing instruction, the electronic device may obtain a first TCP retransmission rate representing the network quality of the first portal and obtain a second TCP retransmission rate representing the network quality of the second portal. The smaller the retransmission rate of the first TCP is, the better the network quality of the first network port is; the smaller the retransmission rate of the second TCP is, the better the network quality of the second network port is.
It will be appreciated that the network quality of the first portal is substantially equivalent to the network quality of the first WiFi and the network quality of the second portal is substantially equivalent to the network quality of the second WiFi. The better the network quality of the first WiFi is, the better the network quality of the first network port is; the better the network quality of the second WiFi, the better the network quality of the second portal.
In 103, a target port and a non-target port are determined from the first port and the second port according to the first parameter and the second parameter, wherein the network quality of the non-target port is better than that of the target port.
For example, assume that the first parameter is a first signal strength and the second parameter is a second signal strength. If the first signal strength is greater than the second signal strength, the network quality of the first network port is superior to that of the second network port, and then the first network port is a non-target network port and the second network port is a target network port. If the first signal strength is less than the second signal strength, it indicates that the network quality of the second port is better than that of the first port, and then the first port is a target port and the second port is a non-target port.
For example, assuming that the first signal strength is-60 dBm and the second signal strength is-65 dBm, it can be determined that the first signal strength is greater than the second signal strength, the first network port is a non-target network port and the second network port is a target network port.
For another example, assume that the first parameter is a first TCP retransmission rate and the second parameter is a second TCP retransmission rate. If the first TCP retransmission rate is less than the second TCP retransmission rate, it indicates that the network quality of the first network port is better than that of the second network port, and the first network port is a non-target network port and the second network port is a target network port. If the first TCP retransmission rate is greater than the second TCP retransmission rate, it indicates that the network quality of the second network port is superior to that of the first network port, and then the first network port is a target network port and the second network port is a non-target network port.
At 104, when the network quality of the non-target portal meets a preset condition, sharing the target WiFi network based on the target portal, where the target WiFi network is a WiFi network corresponding to the non-target portal in the first WiFi network and the second WiFi network.
For example, after determining the target portal and the non-target portal, the electronic device may determine whether the network quality of the non-target portal meets a preset condition. When the network quality of the non-target portal meets a preset condition, the electronic device may share the target WiFi network based on the target portal.
For example, assume that the target port is a first port, the non-target port is a second port, and the second parameter is a second network signal strength. The electronic device may determine whether the second network signal strength is greater than a predetermined strength. If the second network signal strength is greater than the preset strength, the electronic device may determine that the network quality of the non-target network port meets the preset condition.
For another example, assume that the target port is a first port, the non-target port is a second port, and the second parameter is a second TCP retransmission rate. The electronic device may determine whether the second TCP retransmission rate is less than a predetermined retransmission rate. If the second TCP retransmission rate is less than the predetermined retransmission rate, the electronic device may determine that the network quality of the non-target network port satisfies the predetermined condition.
The preset strength and the preset retransmission rate may be set according to an actual situation, and are not specifically limited herein.
It can be appreciated that an electronic device sharing a target WiFi network with other electronic devices based on a target portal may have higher requirements for network quality than if the electronic device were to use the target WiFi network alone. In order to avoid the problem that a user feels that the network is obviously displayed and blocked after the electronic device starts hot spot sharing, before the target WiFi network is shared by the target network port and other electronic devices based on the target network port, the electronic device can judge whether the network quality of the non-target network port meets a preset condition, namely whether the network quality of the non-target network is good enough, so that the electronic device can share the target WiFi network with the other electronic devices based on the target network port, and the user cannot feel that the network is obviously displayed and blocked. When the network quality of the non-target portal meets the preset condition, the electronic device may share the target WiFi network with other electronic devices based on the target portal.
In the embodiment of the application, when the wireless hotspot sharing instruction is received, a first parameter used for representing the network quality of the first internet access can be obtained, and a second parameter used for representing the network quality of the second internet access can be obtained. And then, according to the first parameter and the second parameter, a target network port and a non-target network port can be determined from the first network port and the second network port, wherein the network quality of the non-target network port is superior to that of the target network port, and finally, the WiFi network corresponding to the non-target network port can be shared based on the target network port. Therefore, in the embodiment of the application, the network port with poor network quality can be selected from the first network port and the second network port according to the first parameter and the second parameter to serve as the wireless hotspot sharing network port, and compared with a scheme of fixedly selecting one network port to serve as the wireless hotspot sharing network port, the scheme provided by the application has higher flexibility.
In some embodiments, the hotspot sharing method may further include:
when the first parameter is equal to the second parameter, acquiring biological characteristic information input by a user;
when the biological characteristic information is matched with preset first biological characteristic information, sharing a second WiFi network based on a first internet access;
and when the biological characteristic information is matched with preset second biological characteristic information, sharing the first WiFi network based on the second network port.
For example, assume that the first parameter is a first network signal strength, the second parameter is a second network signal strength, the first network signal strength is-60 dBm, and the second network signal strength is-60 dBm. It may be determined that the first parameter is equal to the second parameter, and then it may be determined that the network quality of the first port is not much different from the network quality of the second port.
For example, the user may enter first biometric information and second biometric information in the electronic device in advance, wherein the first biometric information may be associated with the first portal and the second biometric information may be associated with the second portal. The first biological characteristic information is preset first biological characteristic information, and the second biological characteristic information is preset second biological characteristic information. Wherein the first biometric information and the second biometric information may be: fingerprint information, voiceprint information, face feature information, iris information, or the like.
For example, it is assumed that the first biometric information is preset first fingerprint information, such as a fingerprint of a left thumb of the user, and the second biometric information is preset second fingerprint information, such as a fingerprint of a right thumb of the user. When the first parameter is equal to the second parameter, the electronic device may acquire the biometric information input by the user. Assuming that the biometric information is a fingerprint of the thumb of the left hand of the user, the electronic device may determine that the biometric information matches the preset first fingerprint information, and the preset first fingerprint information is associated with the first port, so that the electronic device may share the second WiFi network based on the first port. Assuming that the biometric information is a fingerprint of a thumb of a right hand of the user, the electronic device may determine that the biometric information matches a predetermined second fingerprint information associated with the second portal, and the electronic device may share the second WiFi network based on the second portal.
Referring to fig. 3, fig. 3 is a schematic flowchart illustrating a second process of a hotspot sharing method according to an embodiment of the present application, where the process may include:
in 201, when the first network port is connected to the first WiFi network and the second network port is connected to the second WiFi network, the electronic device determines, at intervals of a preset time, a first TCP retransmission rate, a first round-trip delay, a first DNS query delay, and a first signal quality of the first network port, and a second TCP retransmission rate, a second round-trip delay, a second DNS query delay, and a second signal quality of the second network port.
In 202, the electronic device updates the score of the first network port at preset time intervals according to the first TCP retransmission rate, the first round trip delay, the first DNS query delay, and the first signal quality, wherein the higher the score of the first network port is, the better the network quality is.
In 203, the electronic device updates the score of the second network port at preset intervals according to the second TCP retransmission rate, the second round trip delay, the second DNS query delay, and the second signal quality, wherein the higher the score of the second network port is, the better the network quality is.
For example, when the first network port is connected to a first WiFi network and the second network port is connected to a second WiFi network, that is, the electronic device is connected to two WiFi networks simultaneously based on the first network port and the second network port, the electronic device may determine, at preset time intervals, for example, at 3 seconds or 5 seconds, a first TCP retransmission rate, a first round trip delay, a first DNS query delay, and a first signal quality of the first network port in the 3 seconds or 5 seconds, and a second TCP retransmission rate, a second round trip delay, a second DNS query delay, and a second signal quality of the second network port in the 3 seconds or 5 seconds.
Then, the electronic device may update the score of the first port according to the first TCP retransmission rate, the first round trip delay, the first DNS query delay, and the first signal quality every preset time, for example, 3 seconds or 5 seconds, where the higher the score of the first port is, the better the network quality is. Meanwhile, the electronic device may also update the score of the second network port at preset time intervals, such as 3 seconds or 5 seconds, according to the second TCP retransmission rate, the second round-trip delay, the second DNS query delay, and the second signal quality, where the higher the score of the second network port is, the better the network quality is.
It can be understood that the wireless router can forward and release the WiFi signal, so as to form a WiFi network for the electronic device to connect to, thereby implementing the internet access function of the electronic device. The number of the electronic devices connected to one wireless router may affect the signal quality of the WiFi network corresponding to the wireless router, wherein the greater the number of the electronic devices connected to the wireless router, the worse the signal quality of the WiFi network corresponding to the wireless router is. The electronic device establishes connection with the WiFi network based on the network port, so the signal quality of the WiFi network to which the electronic device is connected is actually the signal quality of the network port of the electronic device. Therefore, the signal quality of the network port of the electronic device can be represented by the number of the electronic devices connected to the wireless router corresponding to the WiFi network connected to the electronic device, that is, the number of the electronic devices corresponding to the WiFi network connected to the electronic device.
For example, assuming that the preset time is 3 seconds, when the first network port is connected to the first WiFi network and the second network port is connected to the second WiFi network, the electronic device may continuously determine the first TCP retransmission rate, the first round trip delay, the first DNS query delay, and the first signal quality of the first network port, and the second TCP retransmission rate, the second round trip delay, the second DNS query delay, and the second signal quality of the second network port, and continuously time from 0 second, and when the time reaches 3 seconds, the electronic device may determine the first TCP retransmission rate, the first round trip delay, the first DNS query delay, and the first signal quality of the first network port, and the second TCP retransmission rate, the second round trip delay, the second DNS query delay, and the second signal quality of the second network port within 0 seconds to 3 seconds. The first signal quality can be determined by the number of electronic devices corresponding to the 3 rd second WiFi network connected with the electronic devices through the first internet access; the second signal quality may be determined by the number of electronic devices corresponding to the 3 rd second WiFi network to which the electronic devices are connected through the second network port.
Then, the electronic device may determine a score of the first port according to the first TCP retransmission rate, the first round trip delay, the first DNS query delay, and the first signal quality of the first port within the 0 second to 3 seconds, and determine a score of the second port according to the second TCP retransmission rate, the second round trip delay, the second DNS query delay, and the second signal quality of the second port within the 0 second to 3 seconds. The fraction of the first port and the fraction of the second port may be taken as the fraction of the first port and the fraction of the second port in the 3 rd to 6 th seconds. If the score of the first internet access is 80, the score of the first internet access acquired by the electronic device in the 5 th second is 80.
When the time reaches 6 seconds, the electronic device may determine a first TCP retransmission rate, a first round trip delay, a first DNS query delay, and a first signal quality for the first port, and a second TCP retransmission rate, a second round trip delay, a second DNS query delay, and a second signal quality for the second port within 3 seconds to 6 seconds. The first signal quality can be determined by the number of electronic devices corresponding to the 6 th second of a first WiFi network connected with the electronic devices through a first network port; the second signal quality may be determined by the number of electronic devices corresponding to the 6 th second WiFi network to which the electronic devices are connected through the second network port.
Then, the electronic device may determine a score of the first port according to the first TCP retransmission rate, the first round trip delay, the first DNS query delay, and the first signal quality of the first port within the 3 seconds to 6 seconds, and replace the last determined score of the first port with the determined score of the first port. Meanwhile, the electronic device may determine the score of the second network port according to the second TCP retransmission rate, the second round trip delay, the second DNS query delay, and the second signal quality of the second network port within the 3 seconds to 6 seconds, and replace the last determined score of the second network port with the determined score of the second network port. That is, the score of the first port and the score of the second port determined this time may be taken as the score of the first port and the score of the second port in the 6 th to 9 th seconds. If the score of the first internet access is 70, the score of the first internet access acquired by the electronic device in the 7 th second is 70.
By analogy, the electronic device may determine the 9 th second to 12 th second, the score of the first portal, and the score of the second portal in the manner described above, instead of the score of the first portal and the score of the second portal at the previous time. The electronic device may also determine the 12 th to 15 th seconds, the score of the first portal and the score of the second portal in the above manner to replace the score of the first portal and the score of the second portal last time, and so on, so as to update the score of the first portal and the score of the second portal in real time.
In 204, when the first WiFi network is connected based on the first portal and the second WiFi network is connected based on the second portal, the electronic device detects whether a wireless hotspot sharing command is received.
It can be understood that, when the first WiFi network is connected based on the first portal and the second WiFi network is connected based on the second portal, the electronic device may detect whether the wireless hotspot sharing instruction is received at preset time intervals. Upon receiving the wireless hotspot sharing command, the electronic device may proceed to process 205. When the wireless sharing command is not received, the electronic device may continue to detect whether the wireless hotspot sharing command is received. The preset time can be set according to actual conditions, for example, the preset time can be 2 seconds, 3 seconds, 5 seconds, or the like.
It should be noted that, in the embodiment of the present application, the execution order of the process 201 and the process 204 is not limited, and a person skilled in the art may set the execution order of the process 201 and the process 204 according to an actual situation, for example, the process 201 and the process 204 may be executed simultaneously.
In 205, when the wireless hotspot sharing instruction is received, the electronic device obtains a score of the first portal and obtains a score of the second portal.
At 206, the electronic device determines a target port and a non-target port from the first port and the second port according to the score of the first port and the score of the second port, wherein the network quality of the non-target port is better than the network quality of the target port.
For example, it is assumed that the electronic device updates the score of the first portal and the score of the second portal every 3 seconds, and the score of the first portal is 80 and the score of the second portal is 85 in 60 th to 63 th seconds. Assuming that the electronic device receives the wireless hotspot sharing instruction at the 61 st second, the score of the first internet access acquired by the electronic device is 80, and the score of the second internet access acquired by the electronic device is 85. It can be determined that the score of the second port is greater than the score of the first port, indicating that the network quality of the second port is better than the network quality of the first port. Then, the electronic device may determine the first portal as a target portal and the second portal as a non-target portal.
In 207, when the network quality of the non-target portal meets a preset condition, the electronic device shares a target WiFi network based on the target portal, where the target WiFi network is a WiFi network corresponding to the non-target portal in the first WiFi network and the second WiFi network.
In this embodiment, when the score of the non-target portal is greater than the preset score, the electronic device may determine that the network quality of the non-target portal meets the preset condition. The preset score may be set according to actual conditions, for example, the preset score may be 80. Assuming that the score of the non-target portal is 85, the electronic device may determine that the score of the non-target portal is greater than a preset score, so that the electronic device may determine that the network quality of the non-target portal satisfies a preset condition. Then, the electronic device may share the target WiFi network based on the target portal.
In some embodiments, after flow 207, it may further include:
the electronic equipment acquires access point information of a target network port;
the electronic equipment converts the access point information into the two-dimensional code graph, so that other electronic equipment analyzes the two-dimensional code graph to obtain the access point information, and connection is established with the electronic equipment based on the access point information.
It is understood that, after the electronic device shares the target WiFi network with other electronic devices based on the target portal, the target portal may correspond to an access point, which corresponds to an access point name and an access point password, so that the other electronic devices may establish a connection with the electronic device according to the access point name and the access point password to share the target WiFi network with the electronic device. Wherein the access point name and the access point password are settable by a user in the electronic device. Therefore, after the electronic device shares the target WiFi network with other electronic devices based on the target portal, the electronic device may obtain access point information of the target portal, where the access point information may include an access point name and an access point password.
The electronic device may then convert the access point information into a two-dimensional code pattern. Then, other electronic devices may obtain the two-dimensional code pattern and analyze the two-dimensional code pattern to obtain access point information. Subsequently, the other electronic device may establish a connection with the electronic device based on the access point information. The electronic equipment can display the two-dimension code graph, and other electronic equipment can scan the two-dimension code graph displayed by the electronic equipment through the camera to acquire the two-dimension code graph. Or the electronic device and other electronic devices can establish a bluetooth connection, and then the electronic device can transmit the two-dimensional code graph to other electronic devices through bluetooth.
In some embodiments, the hotspot sharing method may further include:
when the score of the first internet access is equal to the score of the second internet access, the electronic equipment acquires the biological characteristic information input by the user;
when the biological characteristic information is matched with preset first biological characteristic information, the electronic equipment shares a second WiFi network based on the first internet access;
and when the biological characteristic information is matched with the preset second biological characteristic information, the electronic equipment shares the first WiFi network based on the second internet access.
For example, the user may enter first biometric information and second biometric information in the electronic device in advance, wherein the first biometric information may be associated with the first portal and the second biometric information may be associated with the second portal. The first biological characteristic information is preset first biological characteristic information, and the second biological characteristic information is preset second biological characteristic information. Wherein the first biometric information and the second biometric information may be: fingerprint information, voiceprint information, face feature information, iris information, or the like.
For example, it is assumed that the first biometric information is preset first fingerprint information, such as a fingerprint of a left thumb of the user, the second biometric information is preset second fingerprint information, such as a fingerprint of a right thumb of the user, a score of the first portal is 80, and a score of the second portal is 80. Assuming that the biometric information input by the user and acquired by the electronic device is a fingerprint of the left thumb of the user, the electronic device may determine that the biometric information matches preset first fingerprint information, and the preset first fingerprint information is associated with the first internet access, so that the electronic device may share the second WiFi network based on the first internet access. Assuming that the biometric information input by the user and acquired by the electronic device is a fingerprint of a thumb of a right hand of the user, the electronic device may determine that the biometric information matches preset second fingerprint information, and the preset second fingerprint information is associated with a second portal, so that the electronic device may share a second WiFi network based on the second portal.
In some embodiments, the process 202 may include:
the electronic equipment respectively determines a first TCP retransmission rate, a first round-trip delay, a first DNS query delay and a score corresponding to first signal quality, wherein the smaller the first TCP retransmission rate is, the higher the corresponding score is, the smaller the first round-trip delay is, the higher the corresponding score is, the smaller the first DNS query delay is, the higher the corresponding score is, the better the first signal quality is, and the higher the corresponding score is;
the electronic equipment calculates a first weighted sum of scores corresponding to the first TCP retransmission rate, the first round-trip delay, the first DNS query delay and the first signal quality according to weights corresponding to the first TCP retransmission rate, the first round-trip delay, the first DNS query delay and the first signal quality respectively;
and the electronic equipment updates the score of the first internet access according to the calculated first weighted sum at preset time intervals.
For example, the electronic device may preset a preset mapping relationship between the TCP retransmission rate, the round trip delay, the DNS query delay, and the signal quality and the score. The smaller the TCP retransmission rate is, the higher the corresponding score is; the smaller the round-trip delay is, the higher the corresponding fraction is; the smaller the DNS query time delay is, the higher the corresponding score is; the better the signal quality, the higher its corresponding score. The signal quality of a certain network port can be determined by the number of the electronic devices corresponding to the WiFi network corresponding to the network port, and the smaller the number of the electronic devices, the better the signal quality, and then the preset mapping relationship between the signal quality and the score may be the preset mapping relationship between the number of the electronic devices and the score.
For example, for TCP retransmission rates, the electronic device can set a TCP retransmission rate interval to correspond to a fraction. For example, when the TCP retransmission rate is TC1 to TC2, the corresponding score is S1; the TCP retransmission rates from TC3 to TC4 correspond to a fraction S2, wherein the fraction S1 and the fraction S2 are greater than or equal to 0, less than or equal to 100, and so on. Similarly, for the round-trip delay, the electronic device may also set a fraction corresponding to a round-trip delay interval; for the DNS query time delay, the electronic equipment can also set a point corresponding to a DNS query time delay interval; for the number of the electronic devices, the electronic devices may also set a score corresponding to a number interval of the electronic devices. The corresponding relation between the quantity interval of the electronic equipment and the score is the corresponding relation between the signal quality and the score.
In this embodiment of the application, after determining the first TCP retransmission rate, the first round trip delay, the first DNS query delay, and the first signal quality, the electronic device may determine, according to the preset mapping relationship, scores corresponding to the first TCP retransmission rate, the first round trip delay, the first DNS query delay, and the first signal quality, respectively. Then, the electronic device may calculate, according to the respective weights corresponding to the first TCP retransmission rate, the first round-trip delay, the first DNS query delay, and the first signal quality, a first weighted sum of scores corresponding to the first TCP retransmission rate, the first round-trip delay, the first DNS query delay, and the first signal quality, respectively. Finally, the electronic device may update the score of the first port according to the calculated first weighted sum at preset time intervals.
For example, assuming that the preset time is 3 seconds, within the 0 th to 3 rd seconds, the score corresponding to the first TCP retransmission rate is 60, the score corresponding to the first round trip delay is 70, the score corresponding to the first DNS query delay is 60, the score corresponding to the first signal quality is 70, the weight corresponding to the first TCP retransmission rate is 20%, the weight corresponding to the first round trip delay is 20%, the weight corresponding to the first DNS query delay is 30%, and the weight corresponding to the first signal quality is 30%, then the first weighted sum is 65, and the electronic device may use the first weighted sum as the score of the first network port within the 3 rd to 6 th seconds. That is, the fraction of the first mesh port was 65 in the 3 rd to 6 th seconds.
In the 3 rd to 6 th seconds, the score corresponding to the first TCP retransmission rate is 65, the score corresponding to the first round trip delay is 60, the score corresponding to the first DNS query delay is 60, the score corresponding to the first signal quality is 60, the weight corresponding to the first TCP retransmission rate is 20%, the weight corresponding to the first round trip delay is 20%, the weight corresponding to the first DNS query delay is 30%, and the weight corresponding to the first signal quality is 30%, then, the first weighted sum is 61, and the electronic device may update the score of the first portal according to the first weighted sum, that is, the first weighted sum is the score of the first portal in the 6 th to 9 th seconds. That is, the fraction of the first mesh opening was 61 in the 6 th to 9 th seconds.
In some embodiments, after determining the second TCP retransmission rate, the second round trip delay, the second DNS query delay, and the second signal quality, the electronic device may determine, according to the preset mapping relationship, scores corresponding to the second TCP retransmission rate, the second round trip delay, the second DNS query delay, and the second signal quality, respectively. Then, the electronic device may calculate a second weighted sum of scores corresponding to the second TCP retransmission rate, the second round trip delay, the second DNS query delay, and the second signal quality, respectively, according to weights corresponding to the second TCP retransmission rate, the second round trip delay, the second DNS query delay, and the second signal quality, respectively. Finally, the electronic device may update the score of the second port according to the calculated second weighted sum at preset time intervals.
For example, assuming that the preset time is 3 seconds, the score corresponding to the second TCP retransmission rate is 50, the score corresponding to the second round trip delay is 55, the score corresponding to the second DNS query delay is 60, the score corresponding to the second signal quality is 50, the weight corresponding to the second TCP retransmission rate is 20%, the weight corresponding to the second round trip delay is 20%, the weight corresponding to the second DNS query delay is 30%, and the weight corresponding to the second signal quality is 30%, then the second weighted sum is 65, and the electronic device may use the second weighted sum as the score of the second network port in 3 seconds to 6 seconds. That is, the fraction of the second mesh port was 54 in the 3 rd to 6 th seconds.
In the 3 rd to 6 th seconds, the score corresponding to the second TCP retransmission rate is 45, the score corresponding to the second round-trip delay is 50, the score corresponding to the second DNS query delay is 50, the score corresponding to the second signal quality is 50, the weight corresponding to the second TCP retransmission rate is 20%, the weight corresponding to the second round-trip delay is 20%, the weight corresponding to the second DNS query delay is 30%, and the weight corresponding to the second signal quality is 30%, then the second weighted sum is 61, and the electronic device may update the score of the second network port according to the second weighted sum, that is, the second weighted sum is the score of the second network port in the 6 th to 9 th seconds. That is, the score of the second mesh port was 49 in the 6 th to 9 th seconds.
It can be understood that the respective weights corresponding to the first TCP retransmission rate, the first round trip delay, the first DNS query delay, and the first signal quality, and the respective weights corresponding to the second TCP retransmission rate, the second round trip delay, the second DNS query delay, and the second signal quality may be set according to actual requirements, and are not limited specifically here.
It is further understood that the electronic device may further update the score of the first port at preset time intervals according to the first TCP retransmission rate, the first round trip delay, the first DNS query delay, the first signal quality, and other network parameters. For example, as UDP and IPV6 become more widely used, the electronic device may update the score of the first port at predetermined intervals according to the first TCP retransmission rate, the first round trip delay, the first DNS query delay, the first signal quality, and network parameters corresponding to UDP and IPV 6. Similarly, the score of the second portal may be updated as described above.
In some embodiments, the process 207 may include:
the electronic equipment acquires a currently running application program;
when the preset application program exists in the application program, the electronic equipment judges whether the security level of the target WiFi network is greater than the preset level;
and if the security level of the target WiFi network is greater than the preset level, the electronic equipment executes target WiFi network sharing based on the target internet access.
Before the electronic equipment acquires the currently running application programs, when each application program is downloaded in an application mall, the electronic equipment acquires application program labels of the application programs in the application mall and installation information corresponding to the application programs, determines the safety level corresponding to each application program according to the application program labels and the installation information, and determines the application program with the high safety level as a preset application program. When the electronic device is connected to each WiFi network for the first time, the electronic device can determine the security level of the WiFi network by itself or set the security level of the WiFi network by a user. Wherein, the higher the security level of the WiFi network is, the higher the security of the WiFi network is.
The installation information may include application name, installation details, download time, and the like. And extracting the installation information and the classification information in the label information, wherein the classification information is words with distinguishing identifications, such as maps, places, games, hand games, entertainment, videos, shopping, payment, backup and the like. The security level of each application can be determined jointly from a plurality of classification information. For example, the security level of each application is determined according to the target classification information manually set by the user, and if the user manually sets the target classification information to be shopping, payment, or the like, when it is detected that the target classification information is included in the plurality of classification information of the application, the application is determined to be a preset application with a high security level. For another example, the electronic device automatically determines the security level of each application according to the plurality of classification information of each application, and determines the application with the high security level as the preset application.
For example, when the network quality of the non-target portal meets a preset condition, the electronic device may obtain the currently running application program. The currently running applications may include foreground running applications and background running applications. When a preset application program exists in the currently running application program, the electronic equipment judges whether the security level of the target WiFi network is greater than the preset level; and if the security level of the target WiFi network is greater than the preset level, the electronic equipment executes target WiFi network sharing based on the target internet access.
For example, assuming that a preset application program exists in the currently running application program, the security level of the target WiFi network is four levels, and the preset level is three levels, the electronic device may execute target WiFi network sharing based on the target portal.
In some embodiments, after the electronic device determines whether the security level of the target WiFi network is greater than a preset level, the method may further include:
if the security level of the target WiFi network is less than or equal to the preset level, the electronic equipment acquires the connectable WiFi network;
the electronic equipment determines a third WiFi network with the security level higher than a preset level from the connectable WiFi networks;
when the network quality of the third WiFi network is superior to that of the target WiFi network, the electronic equipment releases the target WiFi network;
the electronic equipment establishes connection with a third WiFi network based on the non-target network port;
the electronic device shares the third WiFi network based on the target portal.
For example, assuming that a preset application exists in the currently running application, the security level of the target WiFi network is two levels, and the preset level is three levels, the electronic device may acquire a connectable WiFi network. The electronic equipment determines a third WiFi network with a security level higher than a preset level from the connectable WiFi networks. For example, assuming that there is a WiFi network with a security level of four among connectable WiFi networks, the WiFi network may be a third WiFi network. The electronic device may detect whether the network quality of the third WiFi network is better than the network quality of the target WiFi network. When the network quality of the third WiFi network is superior to that of the target WiFi network, the electronic equipment releases the target WiFi network; the electronic equipment establishes connection with a third WiFi network based on the non-target network port; the electronic device shares the third WiFi network based on the target portal.
In some embodiments, when the network quality of the non-target port does not satisfy a preset condition, for example, the score of the non-target port is less than or equal to a preset score, the electronic device determines a fourth WiFi network with a network quality better than that of the target WiFi network from the connectable WiFi networks; the electronic equipment releases the target WiFi network; the electronic equipment establishes connection with a fourth WiFi network based on the non-target network port; the electronic device shares the fourth WiFi network based on the target portal.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a hot spot sharing device according to an embodiment of the present disclosure. The hotspot sharing device 300 can be applied to an electronic device, the electronic device can include a WiFi module, the WiFi module can include a first portal and a second portal, the hotspot sharing device 300 can include: a detection module 31, an acquisition module 32, a determination module 33 and a sharing module 34.
The detecting module 31 is configured to detect whether a wireless hotspot sharing instruction is received when the first portal is connected to the first WiFi network and the second portal is connected to the second WiFi network.
The obtaining module 32 is configured to, when a wireless hotspot sharing instruction is received, obtain a first parameter used for representing the network quality of the first portal, and obtain a second parameter used for representing the network quality of the second portal.
A determining module 33, configured to determine a target portal and a non-target portal from the first portal and the second portal according to the first parameter and the second parameter, where a network quality of the non-target portal is better than a network quality of the target portal.
The sharing module 34 is configured to share a target WiFi network based on a target portal when a network quality of a non-target portal meets a preset condition, where the target WiFi network is a WiFi network corresponding to the non-target portal in the first WiFi network and the second WiFi network.
In some embodiments, the first parameter includes a score of the first portal, the second parameter includes a score of the second portal, and the detecting module 31 is further configured to: when the first network port is connected with the first WiFi network and the second network port is connected with the second WiFi network, determining a first TCP retransmission rate, a first round-trip delay, a first DNS query delay and first signal quality of the first network port and a second TCP retransmission rate, a second round-trip delay, a second DNS query delay and second signal quality of the second network port at preset time intervals; updating the score of the first network port according to the first TCP retransmission rate, the first round-trip delay, the first DNS query delay and the first signal quality at preset intervals, wherein the higher the score of the first network port is, the better the network quality is; and updating the score of the second network port at preset intervals according to the second TCP retransmission rate, the second round-trip delay, the second DNS query delay and the second signal quality, wherein the higher the score of the second network port is, the better the network quality is.
In some embodiments, the detection module 31 may further be configured to: respectively determining the first TCP retransmission rate, the first round-trip delay, the first DNS query delay and the corresponding score of the first signal quality, wherein the smaller the first TCP retransmission rate is, the higher the corresponding score is, the smaller the first round-trip delay is, the higher the corresponding score is, the smaller the first DNS query delay is, the higher the corresponding score is, the better the first signal quality is, and the higher the corresponding score is; calculating a first weighted sum of scores respectively corresponding to the first TCP retransmission rate, the first round-trip delay, the first DNS query delay and the first signal quality according to weights respectively corresponding to the first TCP retransmission rate, the first round-trip delay, the first DNS query delay and the first signal quality; and updating the score of the first internet access according to the calculated first weighted sum at preset time intervals.
In some embodiments, the sharing module 34 may be configured to: acquiring a currently running application program; when a preset application program exists in the application programs, judging whether the security level of the target WiFi network is greater than a preset level; and if the security level of the target WiFi network is greater than the preset level, executing target WiFi network sharing based on the target internet access.
In some embodiments, the sharing module 34 may be further configured to: if the security level of the target WiFi network is less than or equal to a preset level, a connectable WiFi network is obtained; determining a third WiFi network with the security level higher than a preset level from the connectable WiFi networks; releasing the target WiFi network when the network quality of the third WiFi network is better than the network quality of the target WiFi network; establishing a connection with the third WiFi network based on the non-target portal; sharing the third WiFi network based on the target portal.
In some embodiments, the sharing module 34 may be further configured to: acquiring access point information of the target network port; and converting the access point information into a two-dimensional code graph so that other electronic equipment can analyze the two-dimensional code graph to obtain access point information, and establishing connection with the electronic equipment based on the access point information.
In some embodiments, the sharing module 34 may be further configured to: when the first parameter is equal to the second parameter, acquiring biological characteristic information input by a user; when the biological characteristic information is matched with preset first biological characteristic information, sharing the second WiFi network based on the first internet access; and when the biological characteristic information is matched with preset second biological characteristic information, sharing the first WiFi network based on the second network port.
The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed on a computer, the computer is caused to execute the flow in the hotspot sharing method provided in this embodiment.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the processor is configured to execute the procedure in the hotspot sharing method provided in this embodiment by calling a computer program stored in the memory.
For example, the electronic device may be a mobile terminal such as a tablet computer or a smart phone. Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
The electronic device 100 may include components such as a memory 17, a processor 15, and a WiFi module 16. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 5 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The memory 17 may be used to store applications and data. The memory 17 stores an application program containing executable code. The application programs may constitute various functional modules. The processor 15 executes various functional applications and data processing by running an application program stored in the memory 17.
The processor 15 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing an application program stored in the memory 17 and calling data stored in the memory 17, thereby integrally monitoring the electronic device.
The WiFi module 16 includes a first port, a second port, a first antenna and a second antenna. The electronic device 100 establishes a connection with the first WiFi through the first antenna based on the first portal; the electronic device 100 establishes a connection with the second WiFi through the second antenna based on the second portal.
In this embodiment, the processor 15 in the electronic device loads the executable code corresponding to the processes of one or more application programs into the memory 17 according to the following instructions, and the processor 15 runs the application programs stored in the memory 17, so as to implement the following processes:
when the first internet access is connected with a first WiFi network and the second internet access is connected with a second WiFi network, whether a wireless hotspot sharing instruction is received or not is detected;
when a wireless hotspot sharing instruction is received, acquiring a first parameter used for expressing the network quality of the first internet access, and acquiring a second parameter used for expressing the network quality of the second internet access;
determining a target internet access and a non-target internet access from the first internet access and the second internet access according to the first parameter and the second parameter, wherein the network quality of the non-target internet access is better than that of the target internet access;
and when the network quality of the non-target network interface meets a preset condition, sharing a target WiFi network based on the target network interface, wherein the target WiFi network is a WiFi network corresponding to the non-target network interface in the first WiFi network and the second WiFi network.
Referring to fig. 6, the electronic device 100 may include a memory 17, a processor 15, a WiFi module 16, a radio frequency circuit 11, a display 13, a camera module 18, or a power supply 19.
The memory 17 may be used to store applications and data. The memory 17 stores an application program containing executable code. The application programs may constitute various functional modules. The processor 15 executes various functional applications and data processing by running an application program stored in the memory 17.
The processor 15 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing an application program stored in the memory 17 and calling data stored in the memory 17, thereby integrally monitoring the electronic device.
The WiFi module 16 includes a first port, a second port, a first antenna and a second antenna. The electronic device 100 establishes a connection with the first WiFi through the first antenna based on the first portal; the electronic device 100 establishes a connection with the second WiFi through the second antenna based on the second portal.
The rf circuit 11 may be used to transmit and receive rf signals to establish wireless communication with a network device or other electronic devices through wireless communication, and to transmit and receive signals with the network device or other electronic devices.
The display 13 may be used to display information entered by or provided to the user as well as various graphical user interfaces, which may be made up of graphics, text, icons, video, and any combination thereof. The Display 13 may include a Display panel, and in some embodiments, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The camera module 18 includes a camera and can be used to obtain an image, such as a two-dimensional code pattern.
The power supply 19 may be used to power various components of the electronic device 100. In some embodiments, the power supply 19 may be logically connected to the processor 15 through a power management system, such that functions of managing charging, discharging, and power consumption are performed through the power management system.
Although not shown in fig. 6, the electronic device 100 may further include a microphone, a speaker, a bluetooth module, and the like, which are not described in detail herein.
In this embodiment, the processor 15 in the electronic device loads the executable code corresponding to the processes of one or more application programs into the memory 17 according to the following instructions, and the processor 15 runs the application programs stored in the memory 17, so as to implement the following processes:
when the first internet access is connected with a first WiFi network and the second internet access is connected with a second WiFi network, whether a wireless hotspot sharing instruction is received or not is detected;
when a wireless hotspot sharing instruction is received, acquiring a first parameter used for expressing the network quality of the first internet access, and acquiring a second parameter used for expressing the network quality of the second internet access;
determining a target internet access and a non-target internet access from the first internet access and the second internet access according to the first parameter and the second parameter, wherein the network quality of the non-target internet access is better than that of the target internet access;
and when the network quality of the non-target network interface meets a preset condition, sharing a target WiFi network based on the target network interface, wherein the target WiFi network is a WiFi network corresponding to the non-target network interface in the first WiFi network and the second WiFi network.
In some embodiments, the first parameter comprises a score of the first portal, the second parameter comprises a score of the second portal, and the processor 15 may further perform: when the first network port is connected with the first WiFi network and the second network port is connected with the second WiFi network, determining a first TCP retransmission rate, a first round-trip delay, a first DNS query delay and first signal quality of the first network port and a second TCP retransmission rate, a second round-trip delay, a second DNS query delay and second signal quality of the second network port at preset time intervals; updating the score of the first network port according to the first TCP retransmission rate, the first round-trip delay, the first DNS query delay and the first signal quality at preset intervals, wherein the higher the score of the first network port is, the better the network quality is; and updating the score of the second network port at preset intervals according to the second TCP retransmission rate, the second round-trip delay, the second DNS query delay and the second signal quality, wherein the higher the score of the second network port is, the better the network quality is.
In some embodiments, when processor 15 executes the updating of the score of the first port according to the first TCP retransmission rate, the first round trip delay, the first DNS query delay, and the first signal quality at preset time intervals, it may execute: respectively determining the first TCP retransmission rate, the first round-trip delay, the first DNS query delay and the corresponding score of the first signal quality, wherein the smaller the first TCP retransmission rate is, the higher the corresponding score is, the smaller the first round-trip delay is, the higher the corresponding score is, the smaller the first DNS query delay is, the higher the corresponding score is, the better the first signal quality is, and the higher the corresponding score is; calculating a first weighted sum of scores respectively corresponding to the first TCP retransmission rate, the first round-trip delay, the first DNS query delay and the first signal quality according to weights respectively corresponding to the first TCP retransmission rate, the first round-trip delay, the first DNS query delay and the first signal quality; and updating the score of the first internet access according to the calculated first weighted sum at preset time intervals.
In some embodiments, the processor 15 may perform, when the network quality of the non-target portal meets a preset condition and the target WiFi network is shared based on the target portal, the following steps: acquiring a currently running application program; when a preset application program exists in the application programs, judging whether the security level of the target WiFi network is greater than a preset level; and if the security level of the target WiFi network is greater than the preset level, executing target WiFi network sharing based on the target internet access.
In some embodiments, after the processor 15 performs the determining whether the security level of the target WiFi network is greater than the preset level, the following may be further performed: if the security level of the target WiFi network is less than or equal to a preset level, a connectable WiFi network is obtained; determining a third WiFi network with the security level higher than a preset level from the connectable WiFi networks; releasing the target WiFi network when the network quality of the third WiFi network is better than the network quality of the target WiFi network; establishing a connection with the third WiFi network based on the non-target portal; sharing the third WiFi network based on the target portal.
In some embodiments, after the processor 15 executes the sharing of the target WiFi network based on the target portal, it may further execute: acquiring access point information of the target network port; and converting the access point information into a two-dimensional code graph so that other electronic equipment can analyze the two-dimensional code graph to obtain access point information, and establishing connection with the electronic equipment based on the access point information.
In some embodiments, the processor 15 may further perform: when the first parameter is equal to the second parameter, acquiring biological characteristic information input by a user; when the biological characteristic information is matched with preset first biological characteristic information, sharing the second WiFi network based on the first internet access; and when the biological characteristic information is matched with preset second biological characteristic information, sharing the first WiFi network based on the second network port.
In the above embodiments, the descriptions of the embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description of the hotspot sharing method, and are not described herein again.
The hot spot sharing device provided in the embodiment of the present application and the hot spot sharing method in the above embodiments belong to the same concept, and any method provided in the embodiment of the hot spot sharing method may be operated on the hot spot sharing device, and a specific implementation process thereof is described in detail in the embodiment of the hot spot sharing method, and is not described herein again.
It should be noted that, for the hotspot sharing method described in the embodiment of the present application, it can be understood by those skilled in the art that all or part of the process of implementing the hotspot sharing method described in the embodiment of the present application can be completed by controlling the related hardware through a computer program, where the computer program can be stored in a computer-readable storage medium, such as a memory, and executed by at least one processor, and in the execution process, the process of the embodiment of the hotspot sharing method can be included. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
For the hot spot sharing device in the embodiment of the present application, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.
The hotspot sharing method, device, storage medium and electronic device provided by the embodiments of the present application are described in detail above, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A hotspot sharing method is applied to electronic equipment, wherein the electronic equipment comprises a WiFi module, the WiFi module comprises a first network port and a second network port, and the method comprises the following steps:
when the first internet access is connected with a first WiFi network and the second internet access is connected with a second WiFi network, whether a wireless hotspot sharing instruction is received or not is detected;
when a wireless hotspot sharing instruction is received, acquiring a first parameter used for expressing the network quality of the first internet access, and acquiring a second parameter used for expressing the network quality of the second internet access;
determining a target internet access and a non-target internet access from the first internet access and the second internet access according to the first parameter and the second parameter, wherein the network quality of the non-target internet access is better than that of the target internet access;
and when the network quality of the non-target network interface meets a preset condition, sharing a target WiFi network based on the target network interface, wherein the target WiFi network is a WiFi network corresponding to the non-target network interface in the first WiFi network and the second WiFi network.
2. The hotspot sharing method of claim 1 wherein the first parameter comprises a score of a first portal and the second parameter comprises a score of a second portal, the method further comprising:
when the first network port is connected with the first WiFi network and the second network port is connected with the second WiFi network, determining a first TCP retransmission rate, a first round-trip delay, a first DNS query delay and first signal quality of the first network port and a second TCP retransmission rate, a second round-trip delay, a second DNS query delay and second signal quality of the second network port at preset time intervals;
updating the score of the first network port according to the first TCP retransmission rate, the first round-trip delay, the first DNS query delay and the first signal quality at preset intervals, wherein the higher the score of the first network port is, the better the network quality is;
and updating the score of the second network port at preset intervals according to the second TCP retransmission rate, the second round-trip delay, the second DNS query delay and the second signal quality, wherein the higher the score of the second network port is, the better the network quality is.
3. The hotspot sharing method of claim 2, wherein the updating the score of the first portal according to the first TCP retransmission rate, the first round trip delay, the first DNS query delay, and the first signal quality at preset time intervals comprises:
respectively determining the first TCP retransmission rate, the first round-trip delay, the first DNS query delay and the corresponding score of the first signal quality, wherein the smaller the first TCP retransmission rate is, the higher the corresponding score is, the smaller the first round-trip delay is, the higher the corresponding score is, the smaller the first DNS query delay is, the higher the corresponding score is, the better the first signal quality is, and the higher the corresponding score is;
calculating a first weighted sum of scores respectively corresponding to the first TCP retransmission rate, the first round-trip delay, the first DNS query delay and the first signal quality according to weights respectively corresponding to the first TCP retransmission rate, the first round-trip delay, the first DNS query delay and the first signal quality;
and updating the score of the first internet access according to the calculated first weighted sum at preset time intervals.
4. The hotspot sharing method of claim 1, wherein the sharing a target WiFi network based on a target portal when the network quality of a non-target portal meets a preset condition comprises:
acquiring a currently running application program;
when a preset application program exists in the application programs, judging whether the security level of the target WiFi network is greater than a preset level;
and if the security level of the target WiFi network is greater than the preset level, executing target WiFi network sharing based on the target internet access.
5. The hotspot sharing method of claim 4, wherein after determining whether the security level of the target WiFi network is greater than a preset level, the method further comprises:
if the security level of the target WiFi network is less than or equal to a preset level, a connectable WiFi network is obtained;
determining a third WiFi network with the security level higher than a preset level from the connectable WiFi networks;
releasing the target WiFi network when the network quality of the third WiFi network is better than the network quality of the target WiFi network;
establishing a connection with the third WiFi network based on the non-target portal;
sharing the third WiFi network based on the target portal.
6. The hotspot sharing method of claim 1, wherein after sharing a target WiFi network based on the target portal, further comprising:
acquiring access point information of the target network port;
and converting the access point information into a two-dimensional code graph so that other electronic equipment can analyze the two-dimensional code graph to obtain access point information, and establishing connection with the electronic equipment based on the access point information.
7. The hotspot sharing method of claim 1, further comprising:
when the first parameter is equal to the second parameter, acquiring biological characteristic information input by a user;
when the biological characteristic information is matched with preset first biological characteristic information, sharing the second WiFi network based on the first internet access;
and when the biological characteristic information is matched with preset second biological characteristic information, sharing the first WiFi network based on the second network port.
8. The utility model provides a hot spot sharing device, is applied to electronic equipment, and its characterized in that, electronic equipment includes the wiFi module, the wiFi module includes first net gape and second net gape, includes:
the detection module is used for detecting whether a wireless hotspot sharing instruction is received or not when the first internet access is connected with a first WiFi network and the second internet access is connected with a second WiFi network;
the acquisition module is used for acquiring a first parameter used for representing the network quality of the first internet access and acquiring a second parameter used for representing the network quality of the second internet access when a wireless hotspot sharing instruction is received;
a determining module, configured to determine a target portal and a non-target portal from the first portal and the second portal according to the first parameter and the second parameter, where a network quality of the non-target portal is better than a network quality of the target portal;
the sharing module is used for sharing a target WiFi network based on the target network port when the network quality of the non-target network port meets a preset condition, wherein the target WiFi network is a WiFi network corresponding to the non-target network port in the first WiFi network and the second WiFi network.
9. A storage medium having stored therein a computer program which, when run on a computer, causes the computer to execute the hotspot sharing method of any one of claims 1 to 7.
10. An electronic device, comprising a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the hotspot sharing method according to any one of claims 1 to 7 by calling the computer program stored in the memory.
CN201911368023.7A 2019-12-26 2019-12-26 Hot spot sharing method and device, storage medium and electronic equipment Active CN111065126B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911368023.7A CN111065126B (en) 2019-12-26 2019-12-26 Hot spot sharing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911368023.7A CN111065126B (en) 2019-12-26 2019-12-26 Hot spot sharing method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111065126A true CN111065126A (en) 2020-04-24
CN111065126B CN111065126B (en) 2023-06-20

Family

ID=70303938

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911368023.7A Active CN111065126B (en) 2019-12-26 2019-12-26 Hot spot sharing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111065126B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112040520A (en) * 2020-08-20 2020-12-04 Oppo(重庆)智能科技有限公司 Network switching method, device, terminal equipment and computer storage medium
CN114143787A (en) * 2021-12-07 2022-03-04 北京字节跳动网络技术有限公司 Security detection method, device, terminal device, storage medium and program product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100124196A1 (en) * 2005-06-29 2010-05-20 Jumpstart Wireless Corporation System and method for dynamic automatic communication path selection, distributed device synchronization and task delegation
CN105592424A (en) * 2014-10-24 2016-05-18 东莞宇龙通信科技有限公司 Network sharing method, network sharing device, and terminal
CN107580359A (en) * 2017-09-29 2018-01-12 努比亚技术有限公司 Hotspot sharing method, mobile terminal and computer-readable recording medium
CN108307433A (en) * 2017-09-29 2018-07-20 努比亚技术有限公司 Hotspot sharing method, mobile terminal and computer readable storage medium
CN108462994A (en) * 2018-03-09 2018-08-28 广东欧珀移动通信有限公司 The channel selecting method and Related product of personal hot spot

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100124196A1 (en) * 2005-06-29 2010-05-20 Jumpstart Wireless Corporation System and method for dynamic automatic communication path selection, distributed device synchronization and task delegation
CN105592424A (en) * 2014-10-24 2016-05-18 东莞宇龙通信科技有限公司 Network sharing method, network sharing device, and terminal
CN107580359A (en) * 2017-09-29 2018-01-12 努比亚技术有限公司 Hotspot sharing method, mobile terminal and computer-readable recording medium
CN108307433A (en) * 2017-09-29 2018-07-20 努比亚技术有限公司 Hotspot sharing method, mobile terminal and computer readable storage medium
CN108462994A (en) * 2018-03-09 2018-08-28 广东欧珀移动通信有限公司 The channel selecting method and Related product of personal hot spot

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112040520A (en) * 2020-08-20 2020-12-04 Oppo(重庆)智能科技有限公司 Network switching method, device, terminal equipment and computer storage medium
CN112040520B (en) * 2020-08-20 2023-02-17 Oppo(重庆)智能科技有限公司 Network switching method, device, terminal equipment and computer storage medium
CN114143787A (en) * 2021-12-07 2022-03-04 北京字节跳动网络技术有限公司 Security detection method, device, terminal device, storage medium and program product

Also Published As

Publication number Publication date
CN111065126B (en) 2023-06-20

Similar Documents

Publication Publication Date Title
CN109905907B (en) Network searching method and mobile terminal
CN109819489B (en) Terminal calling method and terminal
CN111601287B (en) Network switching method, electronic equipment and storage medium
CN106413070B (en) A kind of power regulating method, mobile terminal and computer readable storage medium
CN107317918B (en) Parameter setting method and related product
CN107948919B (en) Shared information processing method and mobile terminal
CN108881719B (en) Method for switching shooting mode and terminal equipment
CN108718389B (en) Shooting mode selection method and mobile terminal
CN108549660B (en) Information pushing method and device
CN113489630A (en) Network distribution method, device, storage medium and electronic terminal
CN111065126B (en) Hot spot sharing method and device, storage medium and electronic equipment
CN110381200B (en) Screen-off control method and mobile terminal
CN104202301B (en) Numeric value transfer and device
CN110052024B (en) Game vibration adjusting method, adjusting device, mobile terminal and storage medium
CN113407423A (en) Signal intensity display method and signal intensity display device
CN111427644B (en) Target behavior identification method and electronic equipment
CN109286414B (en) Antenna determination method and terminal
CN110062412B (en) Wireless pairing method, system, storage medium and mobile terminal
CN109450508B (en) Antenna determination method and device and mobile terminal
CN109743469B (en) VOLTE-based communication method and mobile terminal
CN115118636B (en) Method and device for determining network jitter state, electronic equipment and storage medium
CN107889164B (en) Wireless local area network distribution processing method and related product
CN112867171B (en) WIFI connection method and device, storage medium and mobile terminal
CN111163221B (en) Group address book updating method and device, storage medium and terminal equipment
CN113613310A (en) WIFI connection method and device, storage medium 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
GR01 Patent grant
GR01 Patent grant