CN111065126B - Hot spot sharing method and device, storage medium and electronic equipment - Google Patents

Hot spot sharing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN111065126B
CN111065126B CN201911368023.7A CN201911368023A CN111065126B CN 111065126 B CN111065126 B CN 111065126B CN 201911368023 A CN201911368023 A CN 201911368023A CN 111065126 B CN111065126 B CN 111065126B
Authority
CN
China
Prior art keywords
network
network port
target
wifi
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.)
Active
Application number
CN201911368023.7A
Other languages
Chinese (zh)
Other versions
CN111065126A (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 hot spot sharing method, a hot spot sharing device, a storage medium and electronic equipment. The method comprises the following steps: when the wireless hotspot sharing method is connected with a first WiFi network based on a first network port and connected with a second WiFi network based on a second network port, detecting whether a wireless hotspot sharing instruction is received or not; when a wireless hotspot sharing instruction is received, acquiring a first parameter used for representing the network quality of a first network port and acquiring a second parameter used for representing the network quality of a second network port; 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 better than that of the target network port; when the network quality of the non-target network port meets a preset condition, sharing a target WiFi network based on the target network port, 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. The method and the device can improve flexibility of wireless hotspot sharing network port selection.

Description

Hot spot sharing method and device, storage medium and electronic equipment
Technical Field
The application belongs to the technical field of electronics, and particularly relates to a hot spot sharing method, a hot spot sharing device, a storage medium and electronic equipment.
Background
With the continuous development of electronic technology, the electronic equipment is from an initial supporting single WiFi mode to a current supporting double WiFi mode, so that the electronic equipment is enabled to be shared by wireless hot spots only supported on the basis of a data network, and can be enabled to be shared by wireless hot spots supported on the basis of a WiFi network.
In the related art, in the dual-WiFi mode, one WiFi network port is used as a main WiFi network port, and the other WiFi network port is used as a subsidiary WiFi network port. When the electronic equipment needs to start wireless hotspot sharing based on the WiFi network port, the electronic equipment 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, so that the flexibility of selecting the wireless hotspot sharing network port is lower in the related technology.
Disclosure of Invention
The embodiment of the application provides a hot spot sharing method, a hot spot sharing device, a storage medium and electronic equipment, which can improve the flexibility of wireless hot spot sharing network port selection.
The embodiment of the application provides a hot spot 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 network port is connected with a first WiFi network and the second network port is connected with a second WiFi network, detecting whether a wireless hotspot sharing instruction is received or not;
When a wireless hotspot sharing instruction is received, acquiring a first parameter used for representing the network quality of the first network port and acquiring a second parameter used for representing the network quality of the second network port;
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 better than that of the target network port;
and when the network quality of the non-target network port meets a preset condition, sharing a target WiFi network based on the target network port, 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.
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 wireless hotspot sharing instruction is connected with a first WiFi network based on the first network port and connected with a second WiFi network based on the second network port;
the acquisition module is used for acquiring a first parameter used for representing the network quality of the first network port and acquiring a second parameter used for representing the network quality of the second network port when receiving the wireless hotspot sharing instruction;
The determining module is used for 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 better than that of the target network port;
and the sharing module is used for sharing the target WiFi network based on the target network port when the network quality of the non-target network port meets the 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.
The embodiment of the application provides a storage medium, on which a computer program is stored, which when executed on a computer, causes the computer to execute the flow in the hot spot sharing method provided by the embodiment of the application.
The embodiment of the application also provides electronic equipment, which comprises a memory and a processor, wherein the processor is used for executing the flow in the hot spot sharing method provided by the embodiment of the application by calling the computer program stored in the memory.
In this embodiment of the present application, when the wireless hotspot sharing instruction is received, a first parameter for indicating the network quality of the first network port may be obtained, and a second parameter for indicating the network quality of the second network port may be obtained. And then, 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 better than that of the target network port, and finally, sharing a WiFi network corresponding to the non-target network port based on the target network port. Therefore, according to 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 hot spot sharing network port, and compared with the scheme of fixedly selecting one network port to serve as the wireless hot spot sharing network port, the scheme provided by the application is higher in flexibility.
Drawings
The technical solution of the present application and the advantageous effects thereof will be made apparent from the following detailed description of the specific embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of a first structure of an electronic device according to an embodiment of the present application.
Fig. 2 is a schematic flow chart of a hot spot sharing method according to an embodiment of the present application.
Fig. 3 is a second flowchart of a hot spot sharing method according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of a hotspot sharing apparatus according to an embodiment of the present application.
Fig. 5 is a schematic diagram of a second structure of an electronic device according to an embodiment of the present application.
Fig. 6 is a schematic diagram of a third structure of an electronic device according to an embodiment of the present application.
Detailed Description
Referring to the drawings, wherein like reference numerals refer to like elements throughout, the principles of the present application are illustrated as embodied in a suitable computing environment. The following description is based on the illustrated embodiments of the present application and should not be taken as limiting other embodiments not described in detail herein.
It is understood that the execution subject of the embodiments of the present application may be an electronic device such as a smart phone or tablet computer.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device 100 may be a smart phone, a tablet computer, a palm top computer (PDA, personal Digital Assistant), etc. 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 to establish a connection with the WiFi network.
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. The WiFi module 16 may include a first network port and a second network port, and the processor 15 may control the WiFi module 16 to connect to the first WiFi network based on the first network port and control the WiFi module 16 to connect to the second WiFi network based on the second network port.
The WiFi module 16 has a dual frequency dual transmission (Dual Band Dual Concurrent, DBDC) function, supports 2×2 antennas (a first antenna and a second antenna), and the 2 antennas are all matched with an amplifying circuit and a power amplifying chip, so that the antennas can be supported to transmit and receive signals simultaneously. The electronic device 100 may simultaneously connect two WiFi networks (a first WiFi network and a second WiFi network) through the WiFi module 16, and support data transceiving of the two WiFi paths (the first WiFi path and the 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, forms 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 the second network port through the WiFi module 16 to form a second WiFi path, and carrying out data transceiving through the second WiFi path. 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 through the WiFi module 16. The second WiFi path is a data path formed after the electronic device 100 establishes a connection with the 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 portal, 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 portal. Wherein the first frequency band may be 2.4G and the second frequency band may be 5G; or the first frequency band may be 5G and the second frequency band may be 2.4G.
In other embodiments, the electronic device 100 may connect two WiFi networks operating in the 2.4G frequency band simultaneously through the first antenna and the second antenna, or may connect two WiFi networks operating in the 5G frequency band simultaneously.
Referring to fig. 2, fig. 2 is a first flowchart of a hot spot sharing method provided in an embodiment of the present application, where the hot spot sharing method may be applied 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 flowchart may include:
in 101, when the first network port is connected to the first WiFi network and the second network port is connected to the second WiFi network, it is detected whether a wireless hotspot sharing instruction is received.
In the embodiment of the application, the electronic device may establish connection with the first WiFi network through the first antenna based on the first network port, and establish connection with the second WiFi network through the second antenna based on the second network port. 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 or not.
For example, when the 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 on a "setup" button in the electronic device to enter a setup 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 on the "on" button of the personal hotspot setting interface to turn on wireless hotspot sharing. When the user clicks the "on" button of the personal hot spot setting interface, the electronic device receives the wireless hot spot sharing instruction.
The wireless hotspot sharing is to convert GPRS, 3G, 4G or 5G signals received by the electronic equipment into WiFi signals and send the WiFi signals out, or to the electronic equipment capable of being connected with at least two WiFi networks, send the WiFi signals received by the electronic equipment based on a certain network port out from another network port.
It can be appreciated that when the electronic device is connected to the first WiFi network based on the first network port and connected to the second WiFi network based on the second network port, the electronic device may detect whether the wireless hotspot sharing instruction is received at intervals of a preset time. Upon receiving the wireless hotspot sharing instruction, the electronic device may enter flow 102. When the wireless sharing instruction is not received, the electronic device can continue to execute detection whether the wireless hotspot sharing instruction is received. The preset time may be set according to practical situations, for example, the preset time may be 2 seconds, 3 seconds, 5 seconds, or the like.
In 102, when a wireless hotspot sharing instruction is received, a first parameter indicative of network quality of a first portal is obtained, and a second parameter indicative of network quality of a second portal is obtained.
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, a first signal quality, or the like. 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 a wireless hotspot sharing instruction, the electronic device may obtain a first network signal strength indicative of network quality of a first portal and obtain a second network signal strength indicative of network quality of a 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 for representing the network quality of the first portal and obtain a second TCP retransmission rate for representing the network quality of the second portal. The smaller the first TCP retransmission rate is, the better the network quality of the first network port is; the smaller the second TCP retransmission rate, the better the network quality of the second portal.
It is understood 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. Namely, 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 portal and a non-target portal are determined from the first portal and the second portal according to the first parameter and the second parameter, wherein the network quality of the non-target portal is better than the network quality of the target portal.
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 intensity is greater than the second signal intensity, the network quality of the first network port is better than the network quality 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 smaller than the second signal strength, the network quality of the second network port is better than that of the first network port, and the first network port is a target network port and the second network port is a non-target network port.
For example, assuming that the first signal strength is-60 dBm and the second signal strength is-65 dBm, it may be determined that the first signal strength is greater than the second signal strength, then the first portal is a non-target portal and the second portal is a target portal.
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 smaller than the second TCP retransmission rate, the network quality of the first network port is better than the network quality 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, the network quality of the second network port is better than that of the first network port, and the first network port is a target network port, and the second network port is a non-target network port.
In 104, when the network quality of the non-target network port meets a preset condition, sharing the target WiFi network based on the target network port, 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.
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 network port meets the preset condition, the electronic equipment can share the target WiFi network based on the target network port.
For example, assume that the target portal is a first portal, the non-target portal is a second portal, 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 preset strength. If the second network signal strength is greater than the preset strength, the electronic device can determine that the network quality of the non-target network port meets the preset condition.
For another example, assume that the target portal is a first portal, the non-target portal is a second portal, 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 preset retransmission rate. If the second TCP retransmission rate is smaller than the preset retransmission rate, the electronic equipment can judge that the network quality of the non-target network port meets the preset condition.
The preset intensity and the preset retransmission rate may be set according to practical situations, and are not particularly limited herein.
It can be appreciated that sharing a target WiFi network with other electronic devices based on a target portal may require a higher network quality for the electronic device than for the electronic device alone. In order to avoid the problem that a user feels that a network is obviously blocked after the electronic device starts hot spot sharing, before the target network port and other electronic devices share the target WiFi network, 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 problem that the electronic device shares the target WiFi network with other electronic devices based on the target network port and the user cannot feel that the network is obviously blocked is solved. When the network quality of the non-target network port meets the preset condition, the electronic equipment can share the target WiFi network with other electronic equipment based on the target network port.
In this embodiment of the present application, when the wireless hotspot sharing instruction is received, a first parameter for indicating the network quality of the first network port may be obtained, and a second parameter for indicating the network quality of the second network port may be obtained. And then, 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 better than that of the target network port, and finally, sharing a WiFi network corresponding to the non-target network port based on the target network port. Therefore, according to 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 hot spot sharing network port, and compared with the scheme of fixedly selecting one network port to serve as the wireless hot spot sharing network port, the scheme provided by the application is higher in flexibility.
In some embodiments, the hotspot sharing method may further include:
when the first parameter is equal to the second parameter, acquiring the biological characteristic information input by the user;
when the biological characteristic information is matched with preset first biological characteristic information, sharing a second WiFi network based on the first network port;
And sharing the first WiFi network based on the second network port when the biological characteristic information is matched with the preset second biological characteristic information.
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. The first parameter can be determined to be equal to the second parameter, so that the network quality of the first network port and the network quality of the second network port can be determined to be not greatly different, and in this case, a user can select any one network port to share the WiFi network corresponding to the other network port.
For example, a 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 a first portal and the second biometric information may be associated with a 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, assume that the preset first biometric information is preset first fingerprint information, such as a fingerprint of a thumb of a left hand of the user, and the second biometric information is preset second fingerprint information, such as a fingerprint of a thumb of a right hand of the user. When the first parameter is equal to the second parameter, the electronic device may obtain biometric information entered by the user. Assuming that the biometric information is a fingerprint of a thumb of a left hand of the user, the electronic device may determine that the biometric information matches with preset first fingerprint information, and the preset first fingerprint information is associated with the first portal, then the electronic device may share the second WiFi network based on the first portal. 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 with preset second fingerprint information, and the preset second fingerprint information is associated with a second portal, then the electronic device may share a second WiFi network based on the second portal.
Referring to fig. 3, fig. 3 is a second flowchart of a hot spot sharing method according to an embodiment of the present application, where the flowchart may include:
in 201, when the electronic device is connected to the first WiFi network based on the first network port and connected to the second WiFi network based on the second network port, the electronic device determines 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 at intervals of a preset time.
In 202, the electronic device updates 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 intervals of a preset time, where the higher the score of the first network port, the better the network quality thereof.
In 203, the electronic device updates 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 at intervals of a preset time, where the higher the score of the second network port, the better the network quality thereof.
For example, when the electronic device is connected to the first WiFi network based on the first network port and connected to the second WiFi network based on the second network port, that is, when the electronic device is connected to the two WiFi networks based on the first network port and the second network port respectively, 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 within 3 seconds or 5 seconds, 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 3 seconds or 5 seconds every preset time, such as every 3 seconds or 5 seconds.
Then, the electronic device may update 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 intervals of a preset time, such as 3 seconds or 5 seconds, where the higher the score of the first network port, the better the network quality thereof. Meanwhile, the electronic device may update 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 at intervals of a preset time, such as 3 seconds or 5 seconds, where the higher the score of the second network port is, the better the network quality is.
It can be appreciated that the wireless router can forward and release the WiFi signal, thereby forming a WiFi network for the electronic device to connect to achieve the internet function of the electronic device. The number of electronic devices connected to one wireless router affects the signal quality of the WiFi network corresponding to the wireless router, wherein the greater the number of electronic devices connected to the wireless router, the poorer the signal quality of the WiFi network corresponding to the wireless router. 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 number of the electronic devices connected to the wireless router corresponding to the WiFi network connected to the electronic device can be used to represent the signal quality of the network port of 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 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, and continuously count from 0 seconds, and when the count 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 the 0 seconds to 3 seconds. The first signal quality can be determined by the number of the electronic devices corresponding to the 3 rd second through a first WiFi network connected with the electronic devices through a first network port; the second signal quality may be determined by a number of electronic devices corresponding to a second WiFi network to which the electronic devices are connected through a second portal at a 3 rd second.
Then, the electronic device may determine a fraction 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 of the first network port within the 0 second to 3 seconds, and determine a fraction 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 0 second to 3 seconds. The score of the first portal and the score of the second portal may be used as the score of the first portal and the score of the second portal within the 3 rd to 6 th seconds. For example, assuming that the score of the first portal is 80, the score of the first portal acquired by the electronic device at the 5 th second is 80.
When the timing 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 network 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 network port within 3 seconds to 6 seconds. The first signal quality can be determined by the number of the electronic devices corresponding to the 6 th second through a first WiFi network connected with the electronic devices through a first network port; the second signal quality may be determined by a number of electronic devices corresponding to a second 6 th second of a second WiFi network to which the electronic devices are connected through a second portal.
Then, the electronic device may determine 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 of the first network port within the 3 seconds to 6 seconds, and replace the score of the first network port determined last time with the score of the first network port determined this time. Meanwhile, the electronic device may determine the fraction 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 3 seconds to 6 seconds, and replace the fraction of the second network port determined last time with the fraction of the second network port determined this time. That is, the score of the first portal and the score of the second portal determined at this time may be the score of the first portal and the score of the second portal within the 6 th to 9 th seconds. If the score of the first portal is 70, the score of the first portal acquired by the electronic device at the 7 th second is 70.
And so on, the electronic device may determine the 9 th to 12 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. The electronic device may further 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 electronic device is connected to the first WiFi network based on the first portal and connected to the second WiFi network based on the second portal, the electronic device detects whether a wireless hotspot sharing instruction is received.
It can be appreciated that when the electronic device is connected to the first WiFi network based on the first network port and connected to the second WiFi network based on the second network port, the electronic device may detect whether the wireless hotspot sharing instruction is received at intervals of a preset time. Upon receiving the wireless hotspot sharing instruction, the electronic device may enter flow 205. When the wireless sharing instruction is not received, the electronic device can continue to execute detection whether the wireless hotspot sharing instruction is received. The preset time may be set according to practical situations, for example, the preset time may be 2 seconds, 3 seconds, 5 seconds, or the like.
It should be noted that, the execution sequence of the flow 201 and the flow 204 is not limited in this embodiment, and those skilled in the art may set the execution sequence of the flow 201 and the flow 204 according to the actual situation, for example, the flow 201 and the flow 204 may be executed simultaneously.
In 205, when a wireless hotspot sharing instruction is received, the electronic device obtains a score of the first portal and obtains a score of the second portal.
In 206, the electronic device determines a target portal and a non-target portal from the first portal and the second portal according to the score of the first portal and the score of the second portal, wherein the network quality of the non-target portal is better than the network quality of the target portal.
For example, assume that the electronic device updates the score of the first portal and the score of the second portal every 3 seconds, 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 61 seconds, the score of the first portal acquired by the electronic device is 80, and the score of the second portal is 85. It can be determined that the score of the second portal is greater than the score of the first portal, indicating that the network quality of the second portal is better than the network quality of the first portal. 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 the embodiment of the present application, 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 practical situations, 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, following the process 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 a two-dimensional code pattern, so that other electronic equipment analyzes the two-dimensional code pattern to obtain the access point information, and connection is established with the electronic equipment based on the access point information.
It may be appreciated that, after the electronic device shares the target WiFi network with other electronic devices based on the target portal, the target portal may be equivalent to an access point, which corresponds to an access point name and an access point password, so that 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 access point password may be set by a user in the electronic device. Thus, 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.
Then, the electronic device may convert the access point information into a two-dimensional code pattern. Then, other electronic devices can acquire the two-dimensional code pattern and analyze the two-dimensional code pattern to obtain access point information. Other electronic devices may then establish a connection with the electronic device based on the access point information. The electronic equipment can display the two-dimensional code graph, and then other electronic equipment can acquire the two-dimensional code graph by scanning the two-dimensional code graph displayed by the electronic equipment through the camera. Alternatively, the electronic device and other electronic devices may establish a bluetooth connection, and then the electronic device may transmit the two-dimensional code pattern to the other electronic devices through bluetooth.
In some embodiments, the hotspot sharing method may further include:
when the score of the first network port is equal to the score of the second network port, 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 network port;
when the biometric information is matched with preset second biometric information, the electronic equipment shares the first WiFi network based on the second network port.
For example, a 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 a first portal and the second biometric information may be associated with a 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, assume that the preset first biometric information is preset first fingerprint information, such as a fingerprint of a thumb of a left hand of the user, the second biometric information is preset second fingerprint information, such as a fingerprint of a thumb of a right hand of the user, the score of the first portal is 80, and the score of the second portal is also 80. Assuming that the biometric information input by the user and acquired by the electronic device is a fingerprint of the thumb of the left hand 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 portal, and then the electronic device may share the second WiFi network based on the first portal. Assuming that the biometric information input by the user and acquired by the electronic device is a fingerprint of the thumb of the 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 the second network port, and then the electronic device may share the second WiFi network based on the second network port.
In some embodiments, the process 202 may include:
the electronic equipment respectively determines the first TCP retransmission rate, the first round trip delay, the first DNS inquiry 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 inquiry delay is, the higher the corresponding score is, the better the first signal quality is, and the corresponding score is higher;
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 inquiry delay and the first signal quality according to weights corresponding to the first TCP retransmission rate, the first round trip delay, the first DNS inquiry delay and the first signal quality respectively;
the electronic equipment updates the score of the first network port according to the calculated first weighted sum at intervals of preset time.
For example, the electronic device may preset mapping relationships between the TCP retransmission rate, the round trip delay, the DNS query delay, and the signal quality, respectively, and the score. The smaller the TCP retransmission rate is, the higher the corresponding score is; the smaller the round trip delay, the higher the corresponding score; the smaller the DNS query latency, the higher its corresponding score; the better the signal quality, the higher its corresponding score. The signal quality of a network port can be determined by the number of electronic devices corresponding to the WiFi network corresponding to the network port, and the fewer the number of electronic devices is, the better the signal quality is, and then the preset mapping relationship between the signal quality and the score can be the preset mapping relationship between the number of electronic devices and the score.
For example, for a TCP retransmission rate, the electronic device may set a TCP retransmission rate interval to correspond to a fraction. For example, when the TCP retransmission rates are TC1 to TC2, the corresponding score S1; the TCP retransmission rates TC3 to TC4 correspond to the score S2, wherein the score S1 and the score S2 are greater than or equal to 0, less than or equal to 100, and so on. Similarly, for round trip delay, the electronic device may also set a round trip delay interval corresponding to a fraction; for DNS inquiry time delay, the electronic equipment can also set a DNS inquiry time delay interval to correspond to a fraction; for the number of electronic devices, the electronic devices may also set a score corresponding to a number interval of electronic devices. The corresponding relation between the number interval and the score of the electronic equipment is the corresponding relation between the signal quality and the score.
In this embodiment of the present 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 foregoing preset mapping relationship, the 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 a first weighted sum of scores corresponding to the first TCP retransmission rate, the first round trip delay, the first DNS query delay, and thus 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. Finally, the electronic device can update the score of the first portal according to the calculated first weighted sum at intervals of preset time.
For example, assuming that the preset time is 3 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 portal in the 3 rd to 6 th seconds. That is, the score of the first portal is 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 can update the score of the first network port according to the first weighted sum, namely, the first weighted sum is taken as the score of the first network port in the 6 th to 9 th seconds. That is, the score of the first portal is 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 the scores corresponding to the second TCP retransmission rate, the second round trip delay, the second DNS query delay, and the second signal quality according to the above-mentioned preset mapping relationship, respectively. The electronic device may then calculate a second weighted sum of the scores corresponding to the second TCP retransmission rate, the second round trip delay, the second DNS query delay, and the second signal quality, respectively, based on the 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 can update the score of the second portal according to the calculated second weighted sum at intervals of preset time.
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 the 3 rd to 6 th seconds. That is, the score of the second portal is 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 can update the score of the second network port according to the second weighted sum, namely, the second weighted sum is taken as the score of the second network port in the 6 th to 9 th seconds. That is, the score of the second portal is 49 in the 6 th to 9 th seconds.
It may be appreciated that the 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 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, which is not specifically limited herein.
It may be further understood that the electronic device may update the score of the first portal 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 at preset time intervals. For example, as UDP and IPV6 are more widely used, the electronic device may update the score of the first network port at preset 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 also be updated in the manner described above.
In some embodiments, the process 207 may include:
the electronic equipment acquires a currently running application program;
when a preset application program exists in the application programs, the electronic equipment judges 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, the electronic equipment executes sharing of the target WiFi network based on the target network port.
Before the electronic device obtains the currently running application program, when each application program is downloaded in the application mall, the electronic device obtains an application program label of each application program in the application mall and installation information corresponding to each application program, determines a security level corresponding to each application program according to the application program label and the installation information, and determines the application program with high security level as a preset application program. When the electronic device connects 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. The higher the security level of the WiFi network, the higher the security of the WiFi network.
The installation information may include, among other things, application name, installation details, download time, etc. The classification information in the installation information and the tag information is extracted, and the classification information is words with distinguishing marks, such as a map, a place, a game, a hand tour, entertainment, a video, shopping, payment, backup and the like. The security level of each application may be determined based on the plurality of classification information. For example, the security level of each application program is determined according to the target classification information manually set by the user, and if the target classification information is manually set by the user to be shopping, payment or the like, when the target classification information is detected to be included in the plurality of classification information of the application program, the application program is determined to be a preset application program with a high security level. For another example, the electronic device automatically determines a security level of each application according to the plurality of classification information of each application, and determines an application with a high security level as a preset application.
For example, when the network quality of the non-target portal meets a preset condition, the electronic device may acquire 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 programs, 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 sharing of the target WiFi network based on the target network port.
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, and the preset level is three, the electronic device may execute sharing the target WiFi network 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 the preset level, the method may further include:
if the security level of the target WiFi network is smaller 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 being greater than a preset level from connectable WiFi networks;
When the network quality of the third WiFi network is better than 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 a non-target network port;
the electronic device shares the third WiFi network based on the target portal.
For example, assuming that a preset application program exists in the currently running application program, the security level of the target WiFi network is two-level, and the preset level is three-level, the electronic device may acquire the connectable WiFi network. And the electronic equipment determines a third WiFi network with the security level being greater than a preset level from 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 better than 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 a 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 portal does not meet the preset condition, e.g., the score of the non-target portal is less than or equal to the preset score, the electronic device determines a fourth WiFi network with network quality superior to the network quality of the target WiFi network from connectable WiFi networks; the electronic equipment releases the target WiFi network; the electronic equipment establishes connection with a fourth WiFi network based on a non-target network port; the electronic device shares a 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 application. The hot spot sharing apparatus 300 may be applied to an electronic device, the electronic device may include a WiFi module, the WiFi module may include a first portal and a second portal, and the hot spot sharing apparatus 300 may include: the device comprises a detection module 31, an acquisition module 32, a determination module 33 and a sharing module 34.
The detection module 31 is configured to detect whether a wireless hotspot sharing instruction is received when the wireless hotspot sharing instruction is connected to the first WiFi network based on the first network port and the wireless hotspot sharing instruction is received when the wireless hotspot sharing instruction is connected to the second WiFi network based on the second network port.
The obtaining module 32 is configured to obtain a first parameter indicating a network quality of the first portal and obtain a second parameter indicating a network quality of the second portal when the wireless hotspot sharing instruction is received.
And the determining module 33 is 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 the network quality of the non-target portal is better than the network quality of the target portal.
And the sharing module 34 is configured to share a target WiFi network based on the target portal when the network quality of the 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 a first portal, the second parameter includes a score of a second portal, and the detection module 31 may be 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 intervals of preset time; updating the score of the first network port at intervals of preset time according to the first TCP retransmission rate, the first round trip delay, the first DNS inquiry delay and the first signal quality, 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 intervals of preset time according to the second TCP retransmission rate, the second round trip delay, the second DNS inquiry 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 also be configured to: 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 respectively, 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 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 updating the score of the first network port according to the calculated first weighted sum at intervals of preset time.
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 or not; and if the security level of the target WiFi network is greater than a preset level, executing sharing of the target WiFi network based on the target network port.
In some embodiments, the sharing module 34 may also be configured to: if the security level of the target WiFi network is smaller than or equal to a preset level, acquiring a connectable WiFi network; determining a third WiFi network with the security level being greater than a preset level from connectable WiFi networks; releasing the target WiFi network when the network quality of the third WiFi network is better than that of the target WiFi network; establishing connection with the third WiFi network based on the non-target network port; and sharing the third WiFi network based on the target network port.
In some embodiments, the sharing module 34 may also be 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 analyzes 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 also be configured to: when the first parameter is equal to the second parameter, acquiring the biological characteristic information input by the user; when the biological characteristic information is matched with preset first biological characteristic information, sharing the second WiFi network based on the first network port; and sharing the first WiFi network based on the second network port when the biological characteristic information is matched with preset second biological characteristic information.
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed on a computer, causes the computer to execute a flow in a hot spot sharing method as provided in the present embodiment.
The embodiment of the application also provides electronic equipment, which comprises a memory and a processor, wherein the processor is used for executing the flow in the hot spot sharing method provided by the embodiment by calling the 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 application.
The electronic device 100 may include a memory 17, a processor 15, and a WiFi module 16. It will be appreciated by those skilled in the art that the electronic device structure shown in fig. 5 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The memory 17 may be used to store applications and data. The memory 17 stores an application program including executable code. Applications may constitute various functional modules. The processor 15 executes various functional applications and data processing by running application programs 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 application programs stored in the memory 17 and calling data stored in the memory 17, thereby performing overall monitoring of the electronic device.
The WiFi module 16 includes a first portal, a second portal, a first antenna, and a second antenna. The electronic device 100 establishes a connection with a first WiFi through a first antenna based on a first portal; the electronic device 100 establishes a connection with a second WiFi through a second antenna based on a second portal.
In this embodiment, the processor 15 in the electronic device loads executable codes corresponding to the processes of one or more application programs into the memory 17 according to the following instructions, and the processor 15 executes the application programs stored in the memory 17, so as to implement the flow:
when the first network port is connected with a first WiFi network and the second network port is connected with a second WiFi network, detecting whether a wireless hotspot sharing instruction is received or not;
when a wireless hotspot sharing instruction is received, acquiring a first parameter used for representing the network quality of the first network port and acquiring a second parameter used for representing the network quality of the second network port;
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 better than that of the target network port;
and when the network quality of the non-target network port meets a preset condition, sharing a target WiFi network based on the target network port, 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.
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 including executable code. Applications may constitute various functional modules. The processor 15 executes various functional applications and data processing by running application programs 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 application programs stored in the memory 17 and calling data stored in the memory 17, thereby performing overall monitoring of the electronic device.
The WiFi module 16 includes a first portal, a second portal, a first antenna, and a second antenna. The electronic device 100 establishes a connection with a first WiFi through a first antenna based on a first portal; the electronic device 100 establishes a connection with a second WiFi through a second antenna based on a second portal.
The radio frequency circuit 11 may be configured to transmit and receive radio frequency signals to and from a network device or other electronic device by establishing wireless communication with the network device or other electronic device.
The display 13 may be used to display information entered by a user or provided to a user as well as various graphical user interfaces that may be composed of graphics, text, icons, video, and any combination thereof. The display 13 may include a display panel, which in some embodiments may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), or an Organic Light-Emitting Diode (OLED), or the like.
The camera module 18 includes a camera, and may be used to obtain an image, such as a two-dimensional code pattern.
The power supply 19 may be used to power the 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, so as to perform functions of managing charging, discharging, and power consumption management 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, etc., which will not be described herein.
In this embodiment, the processor 15 in the electronic device loads executable codes corresponding to the processes of one or more application programs into the memory 17 according to the following instructions, and the processor 15 executes the application programs stored in the memory 17, so as to implement the flow:
When the first network port is connected with a first WiFi network and the second network port is connected with a second WiFi network, detecting whether a wireless hotspot sharing instruction is received or not;
when a wireless hotspot sharing instruction is received, acquiring a first parameter used for representing the network quality of the first network port and acquiring a second parameter used for representing the network quality of the second network port;
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 better than that of the target network port;
and when the network quality of the non-target network port meets a preset condition, sharing a target WiFi network based on the target network port, 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.
In some embodiments, the first parameter includes a score of a first portal and the second parameter includes a score of a 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 intervals of preset time; updating the score of the first network port at intervals of preset time according to the first TCP retransmission rate, the first round trip delay, the first DNS inquiry delay and the first signal quality, 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 intervals of preset time according to the second TCP retransmission rate, the second round trip delay, the second DNS inquiry 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 the processor 15 executes the updating the score of the first portal at preset intervals according to the first TCP retransmission rate, the first round trip delay, the first DNS query delay, and the first signal quality, the updating may be performed: 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 respectively, 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 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 updating the score of the first network port according to the calculated first weighted sum at intervals of preset time.
In some embodiments, when the processor 15 executes the process that the network quality of the non-target portal meets the preset condition, the target WiFi network is shared based on the target portal, the process may be executed: 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 or not; and if the security level of the target WiFi network is greater than a preset level, executing sharing of the target WiFi network based on the target network port.
In some embodiments, after the processor 15 performs the determining 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 smaller than or equal to a preset level, acquiring a connectable WiFi network; determining a third WiFi network with the security level being greater than a preset level from connectable WiFi networks; releasing the target WiFi network when the network quality of the third WiFi network is better than that of the target WiFi network; establishing connection with the third WiFi network based on the non-target network port; and sharing the third WiFi network based on the target network port.
In some embodiments, after the processor 15 executes the sharing of the target WiFi network based on the target portal, the method 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 analyzes 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 also perform: when the first parameter is equal to the second parameter, acquiring the biological characteristic information input by the user; when the biological characteristic information is matched with preset first biological characteristic information, sharing the second WiFi network based on the first network port; and sharing the first WiFi network based on the second network port when the biological characteristic information is matched with preset second biological characteristic information.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and for those portions of an embodiment that are not described in detail, reference may be made to the foregoing detailed description of the hotspot sharing method, which is not repeated herein.
The hotspot sharing device provided in the embodiment of the present application belongs to the same concept as the hotspot sharing method in the foregoing embodiment, and any method provided in the hotspot sharing method embodiment may be run on the hotspot sharing device, and a detailed implementation process of the method is shown in the hotspot sharing method embodiment and will not be described herein.
It should be noted that, for the hot spot sharing method according to the embodiments of the present application, it will be understood by those skilled in the art that all or part of the flow of implementing the hot spot sharing method according to the embodiments of the present application may be implemented by controlling related hardware by using a computer program, where the computer program may be stored in a computer readable storage medium, such as a memory, and executed by at least one processor, and the execution may include the flow of the embodiment of the hot spot sharing method. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a random access Memory (RAM, random Access Memory), etc.
For the hotspot sharing device in the embodiment of the present application, each functional module may be integrated in one processing chip, or each module may exist separately and physically, or two or more modules may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated module, if implemented as a software functional module and sold or used as a stand-alone product, may also be stored on a computer readable storage medium such as read-only memory, magnetic or optical disk, etc.
The foregoing describes in detail a hot spot sharing method, apparatus, storage medium and electronic device provided in the embodiments of the present application, and specific examples are applied to illustrate principles and implementations of the present application, where the foregoing description of the embodiments is only for helping to understand the method and core ideas of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (9)

1. The hot spot sharing method is applied to electronic equipment and is characterized in that the electronic equipment comprises a WiFi module, the WiFi module comprises a first network port and a second network port, and the hot spot sharing 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, detecting whether a wireless hotspot sharing instruction is received or not;
when a wireless hotspot sharing instruction is received, acquiring a first parameter used for representing the network quality of the first network port and acquiring a second parameter used for representing the network quality of the second network port;
when the first parameter is not equal to the second parameter, 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 better than that of the target network port;
when the network quality of the non-target network port meets a preset condition, sharing a target WiFi network based on the target network port, 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;
when the first parameter is equal to the second parameter, acquiring the biological characteristic information input by the user;
When the biological characteristic information is matched with preset first biological characteristic information, sharing the second WiFi network based on the first network port;
and sharing the first WiFi network based on the second network port when the biological characteristic information is matched with preset second biological characteristic information.
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 intervals of preset time;
updating the score of the first network port at intervals of preset time according to the first TCP retransmission rate, the first round trip delay, the first DNS inquiry delay and the first signal quality, 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 intervals of preset time according to the second TCP retransmission rate, the second round trip delay, the second DNS inquiry 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 updating the score of the first portal at intervals of a preset time according to the first TCP retransmission rate, the first round trip delay, the first DNS query delay, and the first signal quality comprises:
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 respectively, 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 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 updating the score of the first network port according to the calculated first weighted sum at intervals of preset time.
4. The hotspot sharing method according to claim 1, wherein when the network quality of the non-target portal satisfies a preset condition, sharing the target WiFi network based on the target portal includes:
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 or not;
and if the security level of the target WiFi network is greater than a preset level, executing sharing of the target WiFi network based on the target network port.
5. The hotspot sharing method of claim 4, wherein after the determining whether the security level of the target WiFi network is greater than a preset level, further comprises:
if the security level of the target WiFi network is smaller than or equal to a preset level, acquiring a connectable WiFi network;
determining a third WiFi network with the security level being greater than a preset level from connectable WiFi networks;
releasing the target WiFi network when the network quality of the third WiFi network is better than that of the target WiFi network;
Establishing connection with the third WiFi network based on the non-target network port;
and sharing the third WiFi network based on the target network port.
6. The hotspot sharing method according to claim 1, wherein after the sharing of the target WiFi network based on the target portal, further comprises:
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 analyzes 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 utility model provides a hot spot sharing device, is applied to electronic equipment, 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 wireless hotspot sharing instruction is connected with a first WiFi network based on the first network port and connected with a second WiFi network based on the second network port;
the acquisition module is used for acquiring a first parameter used for representing the network quality of the first network port and acquiring a second parameter used for representing the network quality of the second network port when receiving the wireless hotspot sharing instruction;
The determining module is used for 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 when the first parameter is not equal to the second parameter, wherein the network quality of the non-target network port is better than that of the target network port;
the sharing module is used for sharing the target WiFi network based on the target network port when the network quality of the non-target network port meets the 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;
the sharing module is further configured to: when the first parameter is equal to the second parameter, acquiring the biological characteristic information input by the user; when the biological characteristic information is matched with preset first biological characteristic information, sharing the second WiFi network based on the first network port; and sharing the first WiFi network based on the second network port when the biological characteristic information is matched with preset second biological characteristic information.
8. A storage medium having stored therein a computer program which, when run on a computer, causes the computer to perform the hotspot sharing method of any of claims 1 to 6.
9. An electronic device comprising a processor and a memory, wherein the memory has stored therein a computer program, and wherein the processor is configured to perform the hotspot sharing method of any of claims 1-6 by invoking 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 CN111065126A (en) 2020-04-24
CN111065126B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8495244B2 (en) * 2005-06-29 2013-07-23 Jumpstart Wireless Corporation System and method for dynamic automatic communication path selection, distributed device synchronization and task delegation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN111065126A (en) 2020-04-24

Similar Documents

Publication Publication Date Title
CN109803325A (en) Data distribution method, device, mobile terminal and storage medium
CN108491707B (en) Unlocking control method, terminal equipment and medium product
CN107480496B (en) Unlocking control method and related product
CN107609375B (en) Unlocking control method and related product
CN108781410B (en) Scanning method and device
CN110049476B (en) Equipment pushing method, device, mobile terminal and storage medium
CN108513347B (en) Data transmission method and electronic equipment
CN108900231B (en) Dynamic antenna adjustment method and related product
CN110245601B (en) Eyeball tracking method and related product
CN107633235B (en) Unlocking control method and related product
CN107317918B (en) Parameter setting method and related product
CN106413070B (en) A kind of power regulating method, mobile terminal and computer readable storage medium
CN108668328B (en) Network switching method and mobile terminal
CN111065126B (en) Hot spot sharing method and device, storage medium and electronic equipment
WO2020147645A1 (en) Link aggregation realization method and related product
CN108718389B (en) Shooting mode selection method and mobile terminal
CN108549660B (en) Information pushing method and device
CN112312308A (en) Indoor positioning method and terminal equipment
CN113489630A (en) Network distribution method, device, storage medium and electronic terminal
CN104202301B (en) Numeric value transfer and device
CN113225787B (en) Wi-Fi scanning method, terminal equipment and storage medium
CN110956265A (en) Model training method and related device
CN108810261B (en) Antenna switching method in call and related product
CN108391011B (en) Face recognition method and mobile terminal
CN110632734B (en) Focusing method and related product

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