CN108900385B - Network connection method and related product - Google Patents

Network connection method and related product Download PDF

Info

Publication number
CN108900385B
CN108900385B CN201810821203.5A CN201810821203A CN108900385B CN 108900385 B CN108900385 B CN 108900385B CN 201810821203 A CN201810821203 A CN 201810821203A CN 108900385 B CN108900385 B CN 108900385B
Authority
CN
China
Prior art keywords
network
nan
target
devices
request
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
CN201810821203.5A
Other languages
Chinese (zh)
Other versions
CN108900385A (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 CN201810821203.5A priority Critical patent/CN108900385B/en
Publication of CN108900385A publication Critical patent/CN108900385A/en
Application granted granted Critical
Publication of CN108900385B publication Critical patent/CN108900385B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0894Packet rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Abstract

The embodiment of the application discloses a network connection method and a related product, a Neighbor Awareness Network (NAN) between an electronic device and a plurality of NAN devices is established, the network download rate of each NAN device in the NAN devices is determined, a plurality of network download rates are obtained, a target NAN device with the maximum network download rate in the NAN devices is determined, a first network request is sent to the target NAN device, the first network request is used for requesting the target NAN device to send first network response data, the first network response data sent by the target NAN device is received, and therefore the electronic device selects the NAN device with the higher network download rate to request the network response data by comparing the network download rates of the NAN devices capable of surfing the Internet, and accordingly, the Internet surfing with the higher rate is achieved.

Description

Network connection method and related product
Technical Field
The present application relates to the field of communications technologies, and in particular, to a network connection method and a related product.
Background
With the widespread use of electronic devices (such as mobile phones, tablet computers, etc.), the electronic devices have more and more applications and more powerful functions, and the electronic devices are developed towards diversification and personalization, and become indispensable electronic products in the life of users.
In the prior art, an electronic device may perform data transmission and distance measurement between the electronic device and other electronic devices based on a Neighbor Awareness Network (NAN), but at present, the development of the NAN network is in a preliminary stage, and the function is single.
Disclosure of Invention
The embodiment of the application provides a network connection method and a related product, which can enable electronic equipment to realize internet surfing with a better speed.
In a first aspect, an embodiment of the present application provides a network connection method, where the method includes:
establishing a Neighbor Awareness Network (NAN) between an electronic device and a plurality of NAN devices;
determining a network download rate of each NAN device in the NAN devices to obtain a plurality of network download rates;
determining a target NAN device with the largest network downloading rate in the NAN devices;
sending a first network request to the target NAN device, the first network request requesting the target NAN device to send first network response data;
receiving first network response data sent by the target NAN device.
In a second aspect, an embodiment of the present application provides a network connection apparatus, including:
a connection unit for establishing a neighbor awareness network NAN between an electronic device and a plurality of NAN devices;
a determining unit, configured to determine a network download rate of each NAN device of the plurality of NAN devices, to obtain a plurality of network download rates;
the determining unit is further configured to determine a target NAN device with a maximum network download rate among the plurality of NAN devices;
a transmitting unit, configured to transmit a first network request to the target NAN device, where the first network request is used to request the target NAN device to transmit first network response data;
the connection unit is further configured to receive first network response data sent by the target NAN device.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory; and one or more programs stored in the memory and configured to be executed by the processor, the programs including instructions for some or all of the steps as described in the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium is used to store a computer program, where the computer program is used to make a computer execute some or all of the steps described in the first aspect of the present application.
In a fifth aspect, embodiments of the present application provide a computer program product, where the computer program product comprises a non-transitory computer-readable storage medium storing a computer program, the computer program being operable to cause a computer to perform some or all of the steps as described in the first aspect of embodiments of the present application. The computer program product may be a software installation package.
The embodiment of the application has the following beneficial effects:
it can be seen that, in the network connection method and the related product described in the embodiments of the present application, a neighbor awareness network NAN between an electronic device and a plurality of NAN devices is established, a network download rate of each NAN device in the plurality of NAN devices is determined, a plurality of network download rates are obtained, a target NAN device with a maximum network download rate in the plurality of NAN devices is determined, a first network request is sent to the target NAN device, the first network request is used to request the target NAN device to send first network response data, and the first network response data sent by the target NAN device is received, so that the electronic device selects a NAN device with a faster network download rate to request the network response data by comparing the network download rates of the plurality of NAN devices capable of surfing the internet, thereby implementing a better rate of surfing the internet.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1A is a schematic structural diagram of an example electronic device provided in an embodiment of the present application;
fig. 1B is a schematic flowchart of a network connection method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another network connection method provided in an embodiment of the present application;
fig. 3 is a schematic flowchart of another network connection method provided in an embodiment of the present application;
fig. 4 is another schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 5A is a schematic structural diagram of a network connection device according to an embodiment of the present application;
fig. 5B is a modified structure of the network connection device shown in fig. 5A according to the embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in multiple embodiments of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The electronic devices involved in the embodiments of the present application may include various handheld devices, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to a wireless modem with wireless communication functions, as well as various forms of User Equipment (UE), Mobile Stations (MS), terminal equipment (terminal device), and so on. For convenience of description, the above-mentioned devices are collectively referred to as electronic devices.
The following describes embodiments of the present application in detail.
Referring to fig. 1A, fig. 1A is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application, and the electronic device 100 may include a control circuit, which may include a storage and processing circuit 110. The storage and processing circuitry 110 may be a memory, such as a hard drive memory, a non-volatile memory (e.g., flash memory or other electronically programmable read-only memory used to form a solid state drive, etc.), a volatile memory (e.g., static or dynamic random access memory, etc.), etc., and the embodiments of the present application are not limited thereto. Processing circuitry in storage and processing circuitry 110 may be used to control the operation of electronic device 100. The processing circuit may be implemented based on one or more microprocessors, microcontrollers, digital master-slave headphone switch controllers, baseband processors, power management units, audio codec chips, application specific integrated circuits, display driver integrated circuits, and the like.
The storage and processing circuitry 110 may be used to run software in the electronic device 100, such as an internet browsing application, a Voice Over Internet Protocol (VOIP) telephone call application, an email application, a media playing application, operating system functions, and so forth. Such software may be used to perform control operations such as, for example, camera-based image capture, ambient light measurement based on an ambient light sensor, proximity sensor measurement based on a proximity sensor, information display functionality based on status indicators such as status indicator lights of light emitting diodes, touch event detection based on a touch sensor, functionality associated with displaying information on multiple (e.g., layered) displays, operations associated with performing wireless communication functions, operations associated with collecting and generating audio signals, control operations associated with collecting and processing button press event data, and other functions in the electronic device 100, and the like, without limitation of embodiments of the present application.
The electronic device 100 may also include input-output circuitry 150. The input-output circuit 150 may be used to enable the electronic device 100 to input and output data, i.e., to allow the electronic device 100 to receive data from an external device and also to allow the electronic device 100 to output data from the electronic device 100 to the external device. The input-output circuit 150 may further include a sensor 170. The sensors 170 may include ambient light sensors, proximity sensors based on light and capacitance, touch sensors (e.g., based on optical touch sensors and/or capacitive touch sensors, where the touch sensors may be part of a touch display screen or used independently as a touch sensor structure), acceleration sensors, gravity sensors, and other sensors, among others.
Input-output circuitry 150 may also include one or more displays, such as display 130. Display 130 may include one or a combination of liquid crystal displays, organic light emitting diode displays, electronic ink displays, plasma displays, displays using other display technologies. Display 130 may include an array of touch sensors (i.e., display 130 may be a touch display screen). The touch sensor may be a capacitive touch sensor formed by a transparent touch sensor electrode (e.g., an Indium Tin Oxide (ITO) electrode) array, or may be a touch sensor formed using other touch technologies, such as acoustic wave touch, pressure sensitive touch, resistive touch, optical touch, and the like, and the embodiments of the present application are not limited thereto.
The audio component 140 may be used to provide audio input and output functionality for the electronic device 100. The audio components 140 in the electronic device 100 may include a speaker, a microphone, a buzzer, a tone generator, and other components for generating and detecting sound.
The communication circuit 120 may be used to provide the electronic device 100 with the capability to communicate with external devices. The communication circuit 120 may include analog and digital input-output interface circuits, and wireless communication circuits based on radio frequency signals and/or optical signals. The wireless communication circuitry in communication circuitry 120 may include radio-frequency transceiver circuitry, power amplifier circuitry, low noise amplifiers, switches, filters, and antennas. For example, the wireless communication circuitry in communication circuitry 120 may include circuitry to support Near Field Communication (NFC) by transmitting and receiving near field coupled electromagnetic signals. For example, the communication circuit 120 may include a near field communication antenna and a near field communication transceiver. The communications circuitry 120 may also include a cellular telephone transceiver and antenna, a wireless local area network transceiver circuitry and antenna, and so forth.
The electronic device 100 may further include a battery, power management circuitry, and other input-output units 160. The input-output unit 160 may include buttons, joysticks, click wheels, scroll wheels, touch pads, keypads, keyboards, cameras, light emitting diodes and other status indicators, and the like.
A user may input commands through input-output circuitry 150 to control the operation of electronic device 100, and may use output data of input-output circuitry 150 to enable receipt of status information and other outputs from electronic device 100.
Referring to fig. 1B, fig. 1B is a schematic flowchart of a network connection method according to an embodiment of the present disclosure, where the network connection method described in the embodiment is applied to the electronic device shown in fig. 1A, and the network connection method includes:
101. a neighbor aware network NAN between an electronic device and a plurality of NAN devices is established.
The electronic device can establish a NAN network with the NAN devices, optionally, the electronic device can create a NAN group and set group identification information of the NAN group, the electronic device can send a Beacon (Beacon) to the NAN devices nearby, the NAN devices nearby can send a request for joining the NAN group to the electronic device after receiving the Beacon sent by the electronic device, and the electronic device can establish the NAN group according to the received request, so that the electronic device can perform message interaction, data transmission and the like with the NAN devices in the NAN group.
102. And determining the network download rate of each NAN device in the NAN devices to obtain a plurality of network download rates.
In an embodiment of the application, the network download rate of each NAN device of the plurality of NAN devices may be obtained by sending a network download rate query request to each NAN device of the plurality of NAN devices.
Optionally, in the step 102, determining a network download rate of each NAN device of the plurality of NAN devices to obtain a plurality of network download rates may include the following steps:
21. sending a network download rate query request to each NAN device of the plurality of NAN devices;
22. and receiving a network downloading rate sent by each NAN device in the NAN devices to obtain a plurality of network downloading rates, wherein the network downloading rates are downloading speeds of each NAN device in the NAN devices when downloading preset data to be downloaded.
In the embodiment of the application, the electronic device may sequentially send the network download rate query request to a plurality of NAN devices nearby; each NAN device can download preset data to be downloaded through the internet connected with the NAN device according to the network downloading rate query request, further obtain the network downloading rate of the data to be downloaded, and send the network downloading rate to the electronic device, wherein the preset data to be downloaded is a small section of data, so that the electronic device can complete a downloading task in a short time, and the network downloading rate of the NAN device can be quickly obtained; therefore, the electronic device can receive the network download rate sent by each NAN device in the NAN devices to obtain a plurality of network download rates.
103. And determining a target NAN device with the maximum network downloading rate in the NAN devices.
In this embodiment of the application, the multiple network download rates obtained in step 102 may be sequenced to obtain a maximum network download rate, and the target NAN device corresponding to the maximum network download rate is determined.
Optionally, in the step 103, determining a target NAN device with a maximum network download rate among the plurality of NAN devices may include the following steps:
31. acquiring the MAC address of each NAN device in the NAN devices to obtain a plurality of MAC addresses;
32. establishing a corresponding relation between the network download rate and the MAC address according to the network download rates and the MAC addresses;
33. sequencing the network downloading rates to obtain a maximum target network downloading rate;
34. and determining a target MAC address corresponding to the target network downloading rate according to the corresponding relation, and determining the target NAN equipment according to the target MAC address.
Wherein the electronic device may send a Media Access Control (MAC) address query request to each NAN device of the plurality of NAN devices; each NAN device can send the MAC address of the NAN device to the electronic device according to the MAC address query request; therefore, the electronic device can obtain a plurality of MAC addresses, further, the corresponding relation between the MAC address of each NAN device and the network downloading rate can be established, the corresponding relation between the network downloading rates and the MAC addresses is obtained, further, the network downloading rates are sequenced, the maximum target network downloading rate is obtained, and the target NAN device is determined according to the target MAC address corresponding to the target network downloading rate.
104. Sending a first network request to the target NAN device, the first network request requesting the target NAN device to send first network response data.
The NAN device may send a first network request to the target NAN device after determining a target NAN device with a maximum network download rate, so as to implement internet surfing through the target NAN device, and the target NAN device may forward the first network request to the internet, and send the first network response data to the electronic device after obtaining the first network response data of the internet through a data network or a WIFI manner.
For example, when a user needs to access a website, the electronic device may send a network access request for accessing the website to the target NAN device, and the target NAN device forwards the network access request for accessing the website to the internet, so as to obtain network response data of the website, and then sends the network response data of the website to the electronic device, so that the electronic device may obtain the network response data of the website, thereby implementing a web browsing function.
For another example, when a user uses a function in an application in the electronic device, the function needs to use a network, and therefore the electronic device may send a network request for the application to the target NAN device, and the target NAN device forwards the network request of the application to the internet, so as to obtain network response data of the application, and then sends the network response data of the application to the electronic device, so that the electronic device may obtain the network response data of the website, thereby implementing the function in the application.
105. Receiving first network response data sent by the target NAN device.
For example, under the condition that the electronic device cannot surf the internet, the electronic device may send a network rate query request to a plurality of NAN devices nearby, so as to obtain a network download rate of each NAN device in the NAN devices, determine a target NAN device with the highest network download rate in the NAN devices, send a first network request to the target NAN device, and receive first network response data corresponding to the first network request sent by the target NAN device, thereby implementing data communication with the internet.
Optionally, after sending the network connection request to the target NAN device, the method may further comprise:
51. if the target NAN device is executing a download task with download data larger than a first preset threshold value, receiving a response message of refusing the request sent by the target NAN device;
52. sending a second network request to an alternate NAN device of the plurality of NAN devices having a network download rate less than the target NAN device and greater than other NAN devices, the second network request requesting the target NAN device to send second network response data;
53. receiving the second network response data sent by the alternative NAN device.
If the target NAN device is executing a download task with download data larger than a first preset threshold value, which indicates that the target device is downloading a large download file, the electronic device is connected to the internet through the target NAN device, and may be difficult to acquire a fast network, and a download rate of the current download task of the target NAN device may also be affected.
Optionally, in this embodiment of the present application, the following steps may also be performed:
a1, establishing wireless network connection;
and A2, if the wireless network connection fails, or the wireless network connection succeeds but the network rate of the electronic device is less than a second preset threshold value, executing the operation of establishing the Neighbor Awareness Network (NAN) between the electronic device and the NAN devices.
The electronic device can establish wireless network connection first, if the electronic device can be connected with the internet, and the network rate of the electronic device is greater than or equal to a second preset threshold value, the electronic device can normally execute a downloading task through the wireless network, when the electronic device fails to be connected with the wireless network, or the network rate of the electronic device is smaller than the second preset threshold value, a neighbor awareness network NAN between the electronic device and the NAN devices is established, and the NAN device is accessed to the internet through a target NAN device with a higher network downloading rate in the NAN devices.
It can be seen that, in the network connection method described in this embodiment of the application, a neighbor awareness network NAN between an electronic device and a plurality of NAN devices is established, a network download rate of each NAN device in the NAN devices is determined, a plurality of network download rates are obtained, a target NAN device with the highest network download rate in the NAN devices is determined, a first network request is sent to the target NAN device, the first network request is used to request the target NAN device to send first network response data, and the first network response data sent by the target NAN device is received, so that the electronic device selects a NAN device with a faster network download rate to request the network response data by comparing the network download rates of the NAN devices capable of surfing the internet, and thus a better rate surfing the internet is achieved.
Referring to fig. 2, fig. 2 is a flowchart illustrating another network connection method according to an embodiment of the present disclosure, where the network connection method described in the embodiment is applied to the electronic device shown in fig. 1A, and the method includes the following steps:
201. a neighbor aware network NAN between an electronic device and a plurality of NAN devices is established.
202. And determining the network download rate of each NAN device in the NAN devices to obtain a plurality of network download rates.
203. And determining a target NAN device with the maximum network downloading rate in the NAN devices.
204. Sending a first network request to the target NAN device, the first network request requesting the target NAN device to send first network response data.
205. Receiving first network response data sent by the target NAN device.
206. And if the target NAN device is executing a download task with download data larger than a first preset threshold value, receiving a response message of refusing the request sent by the target NAN device.
207. And sending a second network request to an alternative NAN device of the NAN devices, wherein the network download rate of the alternative NAN device is less than that of the target NAN device and greater than that of other NAN devices, and the second network request is used for requesting the target NAN device to send second network response data.
208. Receiving the second network response data sent by the alternative NAN device.
The specific implementation process of the steps 201-208 can refer to the corresponding description in the method shown in fig. 1B, and is not described herein again.
It can be seen that the network connection method described in the embodiments of the present application, by establishing a neighbor aware network NAN between an electronic device and a plurality of NAN devices, determining a network download rate of each NAN device of the plurality of NAN devices, obtaining a plurality of network download rates, determining a target NAN device of the plurality of NAN devices having a largest network download rate, sending a first network request to the target NAN device, where the first network request is used to request the target NAN device to send first network response data, receiving the first network response data sent by the target NAN device, receiving a response message sent by the target NAN device to reject the request if the target NAN device is performing a download task in which the download data is greater than a first preset threshold, sending a second network request to an alternative NAN device of the plurality of NAN devices having a network download rate less than that of the target NAN device and greater than that of the other NAN devices, receiving second network response data sent by the alternative NAN device, therefore, the electronic equipment selects the NAN equipment with the higher network downloading rate to request the network response data by comparing the network downloading rates of the NAN equipment capable of surfing the internet, so that the internet surfing with the better rate is realized.
In accordance with the above, please refer to fig. 3, which is a schematic flow chart of another network connection method according to an embodiment of the present application, where the network connection method described in the embodiment is applied to the electronic device shown in fig. 1A, and the method includes the following steps:
301. and establishing wireless network connection.
302. If the wireless network connection fails, or the wireless network connection is successful but the network rate of the electronic device is smaller than a second preset threshold value, establishing a Neighbor Awareness Network (NAN) between the electronic device and the NAN devices.
303. Sending a network download rate query request to each NAN device of the plurality of NAN devices.
304. And receiving a network downloading rate sent by each NAN device in the NAN devices to obtain a plurality of network downloading rates, wherein the network downloading rates are downloading speeds of each NAN device in the NAN devices when downloading preset data to be downloaded.
305. And determining a target NAN device with the maximum network downloading rate in the NAN devices.
306. Sending a first network request to the target NAN device, the first network request requesting the target NAN device to send first network response data.
307. Receiving first network response data sent by the target NAN device.
The specific implementation process of steps 301-307 can refer to the corresponding description in the method shown in fig. 1B, and is not described herein again.
The network connection method described in the embodiment of the present application, when a wireless network connection fails or the wireless network connection is successful but the network rate of the electronic device is less than a second preset threshold value, establishes a neighbor aware network NAN between the electronic device and the plurality of NAN devices, sends a network download rate query request to each NAN device of the plurality of NAN devices, receives the network download rate sent by each NAN device of the plurality of NAN devices to obtain a plurality of network download rates, the network download rate being a download rate at which each NAN device of the plurality of NAN devices downloads preset data to be downloaded, determines a target NAN device of the plurality of NAN devices with a maximum network download rate, sends a first network request to the target NAN device, the first network request is used to request the target NAN device to send first network response data, receives the first network response data sent by the target NAN device, therefore, the electronic equipment selects the NAN equipment with the higher network downloading rate to request the network response data by comparing the network downloading rates of the NAN equipment capable of surfing the internet, so that the internet surfing with the better rate is realized.
The following is a device for implementing the network connection method, specifically as follows:
in accordance with the above, please refer to fig. 4, in which fig. 4 is an electronic device according to an embodiment of the present application, including: a processor and a memory; and one or more programs stored in the memory and configured to be executed by the processor, the programs including instructions for performing the steps of:
establishing a Neighbor Awareness Network (NAN) between an electronic device and a plurality of NAN devices;
determining a network download rate of each NAN device in the NAN devices to obtain a plurality of network download rates;
determining a target NAN device with the largest network downloading rate in the NAN devices;
sending a first network request to the target NAN device, the first network request requesting the target NAN device to send first network response data;
receiving first network response data sent by the target NAN device.
In one possible example, in the determining the network download rate of each NAN device of the plurality of NAN devices, resulting in a plurality of network download rates, the program comprises instructions for:
sending a network download rate query request to each NAN device of the plurality of NAN devices;
and receiving a network downloading rate sent by each NAN device in the NAN devices to obtain a plurality of network downloading rates, wherein the network downloading rates are downloading speeds of each NAN device in the NAN devices when downloading preset data to be downloaded.
In one possible example, in the determining a target NAN device of the plurality of NAN devices having a maximum network download rate, the program includes instructions to:
acquiring the MAC address of each NAN device in the NAN devices to obtain a plurality of MAC addresses;
establishing a corresponding relation between the network download rate and the MAC address according to the network download rates and the MAC addresses;
sequencing the network downloading rates to obtain a maximum target network downloading rate;
and determining a target MAC address corresponding to the target network downloading rate according to the corresponding relation, and determining the target NAN equipment according to the target MAC address.
In one possible example, after the sending the network connection request to the target NAN device, the program further comprises instructions to:
if the target NAN device is executing a download task with download data larger than a first preset threshold value, receiving a response message of refusing the request sent by the target NAN device;
sending a second network request to an alternative NAN device of the plurality of NAN devices, wherein the network download rate of the alternative NAN device is less than that of the target NAN device and greater than that of other NAN devices, and the second network request is used for requesting the target NAN device to send second network response data;
receiving the second network response data sent by the alternative NAN device.
In one possible example, the program further comprises instructions for performing the steps of:
establishing wireless network connection;
and if the wireless network connection fails, or the wireless network connection succeeds but the network rate of the electronic equipment is less than a second preset threshold value, executing the operation of establishing the neighbor awareness network NAN between the electronic equipment and the NAN equipment.
Referring to fig. 5A, fig. 5A is a schematic structural diagram of a network connection device according to the present embodiment. The network connection apparatus is applied to the electronic device shown in fig. 1A, and includes a connection unit 501, a determination unit 502, and a transmission unit 503, wherein,
the connection unit 501 is configured to establish a neighbor awareness network NAN between an electronic device and multiple NAN devices;
the determining unit 502 is configured to determine a network download rate of each NAN device of the plurality of NAN devices, to obtain a plurality of network download rates;
the determining unit 502 is further configured to determine a target NAN device with a maximum network download rate among the plurality of NAN devices;
the sending unit 503 is configured to send a first network request to the target NAN device, where the first network request is used to request the target NAN device to send first network response data;
the connection unit 501 is further configured to receive first network response data sent by the target NAN device.
Optionally, in the aspect of determining the network download rate of each NAN device of the plurality of NAN devices to obtain a plurality of network download rates, the determining unit 502 is specifically configured to:
sending a network download rate query request to each NAN device of the plurality of NAN devices;
and receiving a network downloading rate sent by each NAN device in the NAN devices to obtain a plurality of network downloading rates, wherein the network downloading rates are downloading speeds of each NAN device in the NAN devices when downloading preset data to be downloaded.
Optionally, in the aspect of determining the target NAN device with the largest network download rate among the NAN devices, the determining unit 502 is specifically configured to:
acquiring the MAC address of each NAN device in the NAN devices to obtain a plurality of MAC addresses;
establishing a corresponding relation between the network download rate and the MAC address according to the network download rates and the MAC addresses;
sequencing the network downloading rates to obtain a maximum target network downloading rate;
and determining a target MAC address corresponding to the target network downloading rate according to the corresponding relation, and determining the target NAN equipment according to the target MAC address.
Alternatively, as shown in fig. 5B, fig. 5B is a modified structure of the network connection device shown in fig. 5A, which may further include, compared with fig. 5A: a receiving unit 504, wherein, after the sending of the network connection request to the target NAN device,
the receiving unit 504 is configured to receive a response message of a rejection request sent by the target NAN device when the target NAN device is executing a download task whose download data is greater than a first preset threshold;
the sending unit 503 is further configured to send a second network request to an alternative NAN device of the plurality of NAN devices, where a network download rate of the alternative NAN device is less than that of the target NAN device and greater than that of other NAN devices, and the second network request is used to request the target NAN device to send second network response data;
the connection unit 501 is further configured to receive second network response data sent by the candidate NAN device.
Optionally, the connection unit 501 is further configured to establish a wireless network connection;
and when the wireless network connection fails or the wireless network connection succeeds but the network rate of the electronic device is smaller than a second preset threshold value, executing the operation of establishing the Neighbor Awareness Network (NAN) between the electronic device and the NAN devices.
It can be seen that, in the network connection apparatus described in this embodiment of the present application, a neighbor awareness network NAN between an electronic device and a plurality of NAN devices is established, a network download rate of each NAN device in the plurality of NAN devices is determined, a plurality of network download rates are obtained, a target NAN device with a maximum network download rate in the plurality of NAN devices is determined, and a first network request is sent to the target NAN device, where the first network request is used to request the target NAN device to send first network response data and receive the first network response data sent by the target NAN device.
It can be understood that the functions of each program module of the network connection device in this embodiment may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the relevant description of the foregoing method embodiment, which is not described herein again.
Embodiments of the present application also provide a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any one of the network connection methods as described in the above method embodiments.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any one of the network connection methods as recited in the above method embodiments.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may be implemented in the form of a software program module.
The integrated units, if implemented in the form of software program modules and sold or used as stand-alone products, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned memory comprises: various media capable of storing program codes, such as a usb disk, a read-only memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and the like.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash disk, ROM, RAM, magnetic or optical disk, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (9)

1. A network connection method is applied to an electronic device, and the method comprises the following steps:
creating a NAN group and sending beacons to a plurality of NAN devices nearby, so that the NAN devices send a request for joining the NAN group to the electronic device after receiving the beacons sent by the electronic device;
establishing a Neighbor Awareness Network (NAN) between the electronic device and the NAN devices according to the received request, wherein the NAN devices are all devices which can access the Internet and are in a preset distance range of the electronic device;
determining a network download rate of each NAN device in the NAN devices to obtain a plurality of network download rates;
determining a target NAN device with the largest network downloading rate in the NAN devices;
sending a first network request to the target NAN device, the first network request requesting the target NAN device to send first network response data;
receiving the first network response data sent by the target NAN device;
if the target NAN device is executing a download task with download data larger than a first preset threshold value, receiving a response message of refusing the request sent by the target NAN device;
sending a second network request to an alternative NAN device of the NAN devices, wherein the network download rate of the alternative NAN device is less than that of the target NAN device and greater than that of other NAN devices, and the second network request is used for requesting the alternative NAN device to send second network response data;
receiving the second network response data sent by the alternative NAN device.
2. The method of claim 1, wherein determining the network download rate of each of the plurality of NAN devices resulting in a plurality of network download rates comprises:
sending a network download rate query request to each NAN device of the plurality of NAN devices;
and receiving a network downloading rate sent by each NAN device in the NAN devices to obtain a plurality of network downloading rates, wherein the network downloading rates are downloading speeds of each NAN device in the NAN devices when downloading preset data to be downloaded.
3. The method of claim 1 or 2, wherein the determining the target NAN device of the plurality of NAN devices having the largest network download rate comprises:
acquiring the MAC address of each NAN device in the NAN devices to obtain a plurality of MAC addresses;
establishing a corresponding relation between the network download rate and the MAC address according to the network download rates and the MAC addresses;
sequencing the network downloading rates to obtain a maximum target network downloading rate;
and determining a target MAC address corresponding to the target network downloading rate according to the corresponding relation, and determining the target NAN equipment according to the target MAC address.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
establishing wireless network connection;
and if the wireless network connection fails, or the wireless network connection succeeds but the network rate of the electronic equipment is less than a second preset threshold value, executing the operation of establishing the neighbor awareness network NAN between the electronic equipment and the NAN equipment.
5. A network connection device, the network connection device comprising:
the connection unit is used for creating a NAN group and sending beacons to a plurality of NAN devices nearby, so that the NAN devices send a request for joining the NAN group to the electronic device after receiving the beacons sent by the electronic device; establishing a Neighbor Awareness Network (NAN) between the electronic device and the NAN devices according to the received request, wherein the NAN devices are all devices which can access the Internet and are in a preset distance range of the electronic device;
a determining unit, configured to determine a network download rate of each NAN device of the plurality of NAN devices, to obtain a plurality of network download rates;
the determining unit is further configured to determine a target NAN device with a maximum network download rate among the plurality of NAN devices;
a transmitting unit, configured to transmit a first network request to the target NAN device, where the first network request is used to request the target NAN device to transmit first network response data;
the connection unit is further configured to receive the first network response data sent by the target NAN device;
a receiving unit, configured to receive a response message of a rejection request sent by the target NAN device when the target NAN device is executing a download task whose download data is greater than a first preset threshold;
the sending unit is further configured to send a second network request to an alternative NAN device of the plurality of NAN devices, where a network download rate of the alternative NAN device is less than that of the target NAN device and greater than that of other NAN devices, and the second network request is used to request the alternative NAN device to send second network response data;
the connection unit is further configured to receive second network response data sent by the candidate NAN device.
6. The apparatus of claim 5, wherein in the determining the network download rate of each of the plurality of NAN devices to obtain a plurality of network download rates, the determining unit is specifically configured to:
sending a network download rate query request to each NAN device of the plurality of NAN devices;
and receiving a network downloading rate sent by each NAN device in the NAN devices to obtain a plurality of network downloading rates, wherein the network downloading rates are downloading speeds of each NAN device in the NAN devices when downloading preset data to be downloaded.
7. The network connection apparatus according to claim 5 or 6, wherein, in the determining the target NAN device with the largest network download rate among the plurality of NAN devices, the determining unit is specifically configured to:
acquiring the MAC address of each NAN device in the NAN devices to obtain a plurality of MAC addresses;
establishing a corresponding relation between the network download rate and the MAC address according to the network download rates and the MAC addresses;
sequencing the network downloading rates to obtain a maximum target network downloading rate;
and determining a target MAC address corresponding to the target network downloading rate according to the corresponding relation, and determining the target NAN equipment according to the target MAC address.
8. An electronic device, comprising: a processor and a memory; and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for the method of any of claims 1-4.
9. A computer-readable storage medium for storing a computer program, wherein,
the computer program causes a computer to perform the method of any one of claims 1-4.
CN201810821203.5A 2018-07-24 2018-07-24 Network connection method and related product Active CN108900385B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810821203.5A CN108900385B (en) 2018-07-24 2018-07-24 Network connection method and related product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810821203.5A CN108900385B (en) 2018-07-24 2018-07-24 Network connection method and related product

Publications (2)

Publication Number Publication Date
CN108900385A CN108900385A (en) 2018-11-27
CN108900385B true CN108900385B (en) 2021-02-26

Family

ID=64351636

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810821203.5A Active CN108900385B (en) 2018-07-24 2018-07-24 Network connection method and related product

Country Status (1)

Country Link
CN (1) CN108900385B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112788700A (en) * 2021-02-25 2021-05-11 芜湖美的厨卫电器制造有限公司 Communication method, terminal and readable storage medium
CN116886687A (en) * 2022-01-10 2023-10-13 荣耀终端有限公司 Method, device and storage medium for displaying network acceleration effect

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105430633A (en) * 2014-08-22 2016-03-23 电信科学技术研究院 Method and equipment for determining relay node

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10057342B2 (en) * 2014-09-05 2018-08-21 Qualcomm Incorporated Infrastructure access via neighbor awareness networking data path
US20180041947A1 (en) * 2015-02-27 2018-02-08 Huawei Technologies Co., Ltd. Access Point Discovery Method and Apparatus
CN105933224B (en) * 2016-04-15 2020-04-17 国网河北省电力公司 Opportunistic routing method for improving reliability of communication network
CN106713138A (en) * 2016-12-30 2017-05-24 北京奇虎科技有限公司 Cross-domain transmission method and apparatus of streaming data

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105430633A (en) * 2014-08-22 2016-03-23 电信科学技术研究院 Method and equipment for determining relay node

Also Published As

Publication number Publication date
CN108900385A (en) 2018-11-27

Similar Documents

Publication Publication Date Title
CN108683444B (en) Data transmission method and related product
CN108834132B (en) Data transmission method and equipment and related medium product
CN109120683B (en) Data transmission method and related product
CN108900231B (en) Dynamic antenna adjustment method and related product
CN109067984B (en) Data transmission method, electronic device and computer readable storage medium
US20220159777A1 (en) Method for network control and related products
CN109240551B (en) Method for controlling electronic device by using gestures and related product
CN110475020B (en) Equipment control method and related product
CN107317918B (en) Parameter setting method and related product
US11570348B2 (en) Electromagnetic interference control method and related product
CN108769401B (en) Signal detection method and related product
CN108900385B (en) Network connection method and related product
CN108966290B (en) Network connection method and related product
CN106293407B (en) Picture display method and terminal equipment
CN109117370B (en) Game testing method and related product
CN108566311B (en) Carrier aggregation configuration method and related equipment
CN110908728B (en) Authority configuration method and related product
CN110891262A (en) Bluetooth pairing method, system and terminal equipment
CN112367425B (en) Volume adjusting method and device and terminal
CN106294528B (en) Method and device for realizing information transmission
CN108600957B (en) Antenna control method and related product
CN113170305B (en) Application downloading and installing method and related product
CN110569099B (en) Message display method and related product
CN111405649B (en) Information transmission method and device and mobile terminal
CN110875810B (en) Carrier aggregation configuration method and related products

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