CN113438710A - Network connection method and electronic device - Google Patents

Network connection method and electronic device Download PDF

Info

Publication number
CN113438710A
CN113438710A CN202110757394.5A CN202110757394A CN113438710A CN 113438710 A CN113438710 A CN 113438710A CN 202110757394 A CN202110757394 A CN 202110757394A CN 113438710 A CN113438710 A CN 113438710A
Authority
CN
China
Prior art keywords
network
state information
beacon frame
equipment
network state
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.)
Pending
Application number
CN202110757394.5A
Other languages
Chinese (zh)
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.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN202110757394.5A priority Critical patent/CN113438710A/en
Publication of CN113438710A publication Critical patent/CN113438710A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • H04W48/10Access restriction or access information delivery, e.g. discovery data delivery using broadcasted information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/20Selecting an access point

Landscapes

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

Abstract

The embodiment of the application provides a network connection method and electronic equipment, wherein the method comprises the following steps: acquiring network state information and a communication identifier of first equipment, wherein the communication identifier is used for representing information required by a network connected to the first equipment; adding the communication identifier and the network state information of the first device into a beacon frame of the first device, so that the beacon frame comprises the communication identifier and the network state information of the first device; broadcasting the beacon frame.

Description

Network connection method and electronic device
Technical Field
The present disclosure relates to the field of network connection technologies, and in particular, to a network connection method and an electronic device.
Background
With the development of various network access technologies and the development of multi-network convergence technologies, more and more devices can be automatically accessed to the 2/3/4/5G network or the wifi/bluetooth network on the home, company or even open site, and the devices may share the network access function through wifi.
Currently, an STA device (Wireless station, network device supporting 802.11 Wireless network protocol, such as a terminal, etc.) may search for one or more AP devices (Wireless Access Point, Wireless device providing wifi network Access, such as a Wireless router, etc.). However, some STA devices without a keyboard, a camera, a screen, or a manual input function cannot automatically connect to the network of AP devices. If multiple AP devices can be successfully connected, the STA device cannot decide on its own which AP device's network to connect to.
Disclosure of Invention
The application provides a network connection method and electronic equipment, which enable STA equipment to be automatically connected to a network of AP equipment and automatically decide which AP equipment network to connect to.
In a first aspect, the present application provides a network connection method, applied to a first device, the method including:
acquiring network state information and a communication identifier of the first device, wherein the communication identifier is used for representing information required by a network connected to the first device;
adding the communication identifier and the network state information of the first device into a beacon frame of the first device, so that the beacon frame comprises the communication identifier and the network state information of the first device;
broadcasting the beacon frame.
In one possible implementation manner, after the adding the communication identifier and the network state information of the first device to the beacon frame of the first device, the method further includes:
judging whether the sending times of the beacon frame is greater than or equal to a preset threshold value or not;
if the sending times of the beacon frame is larger than or equal to a preset threshold value, checking whether the network state information of the first equipment changes, and if the network state information of the first equipment changes, updating the network state information in the beacon frame.
In one possible implementation manner, the network state information includes one or more of a network connection state, a network type, a network uplink speed and a network downlink speed of the first device, a network load degree in a preset first time period, and a network disconnection number in a preset second time period.
In a second aspect, the present application provides a network connection method, applied to a second device, the method including:
acquiring one or more scanned beacon frames, wherein the beacon frames comprise communication identifiers and network state information of first equipment, and the communication identifiers are used for representing information required by a network connected to the first equipment;
selecting a target first device based on the network state information of each first device;
and connecting to the network of the target first equipment according to the communication identification of the target first equipment.
In one possible implementation manner, the selecting, by the second device, a target first device based on the network state information of each first device includes:
analyzing the scanned beacon frame;
if the beacon frame contains the communication identifier and the network state information of the first equipment through analysis, judging whether the network state information of the first equipment meets the network connection requirement;
if the network state information of the first equipment meets the network connection requirement, selecting target first equipment, wherein the network state information of the target first equipment meets the network connection requirement;
and if the beacon frame does not contain the communication identifier and the network state information of the first equipment or the network state information of the first equipment does not meet the network connection requirement, analyzing the next scanned beacon frame.
In one possible implementation manner, the selecting a target first device based on the network state information of each first device includes:
comparing network status information of a plurality of the first devices;
and selecting the target first equipment according to the comparison result, wherein the network state information of the target first equipment is optimal.
In one possible implementation manner, after connecting to the network of the target first device, the method further includes:
checking whether the network state information of the target first device meets the network connection requirement of the second device;
if the network state information of the target first device does not meet the network connection requirement, scanning the beacon frame again, selecting the first device meeting the network connection requirement according to the network state information in the scanned beacon frame again, and connecting to the network of the first device meeting the network connection requirement.
In a third aspect, the present application provides a network connection method, which is applied to a third device, where the third device establishes a connection with a first device, and the third device includes a beacon frame, and the method includes:
receiving a communication identifier and network state information sent by the first device, wherein the communication identifier is used for representing information required by a network connected to the first device;
adding the communication identifier and the network state information of the first device to a beacon frame of the third device, so that the beacon frame comprises the communication identifier and the network state information of the first device;
broadcasting the beacon frame.
In one possible implementation manner, the broadcasting the beacon frame includes:
and responding to the hotspot operation of starting the third equipment by the user, and broadcasting the beacon frame.
In a fourth aspect, the present application provides an electronic device comprising:
one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions which, when executed by the apparatus, cause the apparatus to perform the method of the first, second or third aspect.
In a fifth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when run on a computer, causes the computer to perform the method of the first, second or third aspect.
In a sixth aspect, the present application provides a computer program for performing the method of the first aspect when the computer program is executed by a computer.
In a possible design, the program in the sixth aspect may be stored in whole or in part on a storage medium packaged with the processor, or in part or in whole on a memory not packaged with the processor.
Drawings
Fig. 1 is a schematic diagram illustrating a method applied to a first device according to an embodiment of the network connection method of the present application;
fig. 2 is a schematic structural diagram of a first device and a second device in an embodiment of the network connection method of the present application;
fig. 3 is a schematic diagram illustrating a format of a beacon frame in an embodiment of the network connection method of the present application;
fig. 4 is a flowchart illustrating an application of an embodiment of the network connection method to a first device according to the present application;
FIG. 5 is a schematic diagram of another embodiment of a network connection method according to the present application;
FIG. 6 is a schematic flow chart diagram illustrating another embodiment of a network connection method according to the present application;
fig. 7 is a schematic diagram illustrating a method applied to a second device according to an embodiment of the network connection method of the present application;
fig. 8 is a flowchart illustrating an application of an embodiment of the network connection method to a second device according to the present application;
FIG. 9 is a schematic diagram of an embodiment of a network connection device 100A;
FIG. 10 is a schematic diagram of an embodiment of a network connection device 100B;
FIG. 11 is a schematic diagram of an embodiment of a network connection device 100C;
fig. 12 is a schematic structural diagram of an embodiment of an electronic device according to the present application.
Detailed Description
The terminology used in the description of the embodiments section of the present application is for the purpose of describing particular embodiments of the present application only and is not intended to be limiting of the present application.
Currently, an STA device (Wireless station, network device supporting 802.11 Wireless network protocol) may search for one or more AP devices (Wireless Access Point, Wireless devices providing wifi network Access, such as a router, etc.). However, some STA devices without a keyboard, a camera, a screen, or a manual input function cannot automatically connect to the network of AP devices. If multiple AP devices can be successfully connected, the STA device cannot decide on its own which AP device's network to connect to.
In the related art, the name and password of the AP device are filled in a Beacon frame (one of management frames in wifi protocol, which contains necessary information of wifi network) of the AP device, the Beacon frame is periodically transmitted to surrounding STA devices that wish to connect to the AP device by broadcasting, and the STA devices connect to the network of the AP device by parsing the name and password of the AP device contained in the received Beacon frame. However, in the related art, when the STA device receives beacon frames transmitted by a plurality of AP devices, and the AP devices can be successfully connected, the STA device cannot decide by itself which AP device the network is most suitable for connecting to.
Therefore, the present application provides a network connection method and an electronic device, which enable an STA device to automatically connect to a network of AP devices and to automatically decide which AP device to connect to.
For example, in one embodiment, a first device (e.g., an AP device) may add network state information and a communication identification of the first device to a beacon frame, and then broadcast the beacon frame into the surrounding environment. The second device (e.g., STA device) may include some STA device without a keyboard, camera, screen, or manual input. If the second device (such as the STA device) scans the beacon frame broadcast by one or more first devices, the network of the first device with the optimal network state information (or the network state information meeting the network connection requirement) is selected and connected according to the network state information in the scanned beacon frame and the communication identification.
Fig. 1 is a schematic method diagram of an embodiment of a network connection method according to the present application. The method provided in this embodiment may be applied to a first device (e.g., an AP device), and as shown in fig. 1 and fig. 2, the network connection method may include:
s101, obtaining network state information and a communication identifier of the first device, wherein the communication identifier is used for representing information required by a network connected to the first device.
Specifically, the communication identifier of the first device may include a name of the first device (e.g., SSID, service set identifier, wifi name, etc.) and authentication information (e.g., PSK/PWD, predefined key or password, wifi password, etc.), and the name of the first device and the authentication information may be used to connect to a wifi network provided by the first device.
The network status information may be used to indicate a network status of the first device. The network status information may include, but is not limited to, one or more of a network connection status, a network type, a network uplink speed and a network downlink speed of the first device, a network load level in a preset first time period, and a network disconnection number in a preset second time period.
For example, the network connection status may include "connect", "disconnect", etc. status; the network types can comprise network types such as '5G', 'Ethernet', 'ADSL' and the like; the uplink speed is used for indicating the data transmission rate when the mobile terminal (such as a mobile phone, a computer and the like) sends information to the first equipment, and the downlink speed is used for indicating the data transmission rate when the first equipment sends information to the mobile terminal; the network load level may include a network load rate of the network of the first device over a first period of time (e.g., 15 minutes) in the past; the number of network disconnections may include a number of network disconnections of the first device over a second period of time (e.g., 24 hours) in the past.
S102, adding the communication identifier and the network state information of the first device into a beacon frame of the first device, so that the beacon frame comprises the communication identifier and the network state information of the first device.
Specifically, the Beacon frame (wifi Beacon frame) may include a custom field, such as a Vendor Specific field, and the Vendor Specific field may be used to fill the communication identifier and the network status information of the first device. That is, in step S102, the communication identification of the first device and the network status information may be added to the Vendor Specific field in the beacon frame. The definition of the Vendor Specific field in the beacon frame can refer to IEEE Std 802.11TMSections 9.3.1.1Format of Control frames and 9.3.3.3Beacon frame Format, 2016 (Vision of IEEE Std 802.11-2012). For example, the format of the beacon Frame is as shown in fig. 3, where the Vendor Specific field is located in the Frame Body field of the beacon Frame, and the communication identifier and the network status information of the first device are filled in the Frame Body field. For example, the parameter description of the Frame Body field is shown in table 1 below:
Beacon frame body
Figure BDA0003148302420000061
TABLE 1
As can be seen from Table 1, the Vendor Specific field is located in the last part of the Frame Body field in the beacon Frame.
It should be noted that the communication identifier or the network status information of the first device in the Vendor Specific field in the beacon frame may be encrypted by a pre-negotiated method (e.g., an encryption method negotiated with a second device of the network that desires to connect to the first device) to avoid information leakage. Those skilled in the art will appreciate that the Encryption method may include, but is not limited to, aes (advanced Encryption standard) or RSA, and the like.
S103, broadcasting the beacon frame.
The first device may periodically transmit the beacon frame to the surrounding environment by means of broadcasting, such as periodically broadcasting the beacon frame in a periodic manner. The broadcast range of the first device is limited by the transmit power of the first device. Therefore, the second device may obtain, through scanning, a beacon frame broadcasted by one or more first devices in the surrounding environment, and by analyzing the communication identifier and the network status information of the first devices included in the scanned beacon frame, select a target first device whose network status information is optimal or whose network status information meets the network connection requirement, and connect to the network of the target first device according to the communication identifier of the target first device, thereby implementing a network of AP devices to which the STA device can automatically connect, and automatically decide which AP device to connect to.
In one possible implementation manner, as shown in fig. 4, after the step S102 of adding the communication identifier of the first device and the network status information to the beacon frame of the first device, the method further includes:
s201, judging whether the sending times of the beacon frame is greater than or equal to a preset threshold value;
s202, if the sending times of the beacon frame is larger than or equal to a preset threshold value, checking whether the network state information of the first equipment changes, and if the network state information of the first equipment changes, updating the network state information in the beacon frame.
The preset threshold is preferably 1. That is, if the number of times of sending the beacon frame (broadcast times) is less than 1, step S102 is executed, if the number of times of sending the beacon frame is greater than or equal to 1, whether the network state information of the first device changes is checked, and if the network state information of the first device changes, the changed network state information is updated to the beacon frame, so that the updated beacon frame is broadcast next time, so that the second device can obtain the changed network state information through the scanned updated beacon frame, thereby improving the network connection success rate. If the network state information of the first device is not changed, the beacon frame does not need to be updated, so that the beacon frame is still broadcast next time.
The first device may periodically check whether the network status information of the first device has changed, e.g., before each broadcast. Further, in step S202, whether the currently detected network state information is consistent with the last detected network state information is compared, and whether the network state information of the first device is changed is determined according to the comparison result, if the currently detected network state information is consistent with the last detected network state information, it is determined that the network state information of the first device is not changed, if the currently detected network state information is not consistent with the last detected network state information, it is determined that the network state information of the first device is changed, the currently detected network state information is updated into the beacon frame, and if the network state information existing in the Vendor Specific field in the beacon frame is deleted, the currently detected network state information is written into the Vendor Specific field in the beacon frame.
It is to be understood that some or all of the steps or operations in the above-described embodiments are merely examples, and other operations or variations of various operations may be performed by the embodiments of the present application. Further, the various steps may be performed in a different order presented in the above-described embodiments, and it is possible that not all of the operations in the above-described embodiments are performed.
As shown in fig. 5 and fig. 6, another embodiment of the present application provides a network connection method, where the method is applied to a third device, such as a terminal of a mobile phone, a computer, or some device with a function of sending a beacon frame. For example, as shown in fig. 6, the third device establishes a connection (e.g., wifi connection, etc.) with the first device, the third device includes a beacon frame, the first device (e.g., AP device) may send the network status information and the communication identifier of the first device to the third device through the network, and the third device receives the communication identifier and the network status information of the first device sent by the first device, adds the communication identifier and the network status information of the first device to the beacon frame of the third device, and then broadcasts the beacon frame to the surrounding environment. If the second device (such as a STA device) scans a beacon frame broadcast by one or more third devices, a network of the first device with the best network status information (or the network status information meets the network connection requirement) is selected and connected according to the network status information and the communication identifier of the first device in the scanned beacon frame, so that the communication identifier and the network status of the first device are broadcast to the surrounding environment by the third device.
Specifically, as shown in fig. 5, the method may include:
s301, receiving a communication identifier and network state information sent by the first device, wherein the communication identifier is used for representing information required by a network connected to the first device.
Preferably, the third device establishes communication with the first device first, for example, receives the communication identifier and the network status information sent by the first device through wifi communication.
S302, add the communication identifier and the network status information of the first device to the beacon frame of the third device to obtain a beacon frame, so that the beacon frame includes the communication identifier and the network status information of the first device.
Specifically, the format or principle of the beacon frame of the third device may refer to the format or principle of the beacon frame of the first device in step S102 in the embodiment of the method in fig. 1 described above. Unlike the method embodiment of fig. 1 described above, the communication identifier and the network status information of the first device are added to the Vendor Specific field of the beacon frame of the first device in step S102, and the communication identifier and the network status information of the first device are added to the Vendor Specific field of the beacon frame of the third device in step S302.
And S303, broadcasting the beacon frame.
That is, the beacon frame is broadcast to the surrounding environment by the third device, and the first device does not need to broadcast the beacon frame to the surrounding environment, so that the communication identifier and the network state of the first device are directly broadcast to the surrounding environment by the third device, and the compatibility is improved.
Therefore, if the second device scans the beacon frames broadcast by one or more third devices (and/or one or more first devices) in the surrounding environment, the second device can resolve the communication identifiers and the network status information of different first devices from each scanned beacon frame, then select a target first device with optimal network status information or network status information meeting the network connection requirement, and connect to the network of the target first device according to the communication identifier of the target first device, thereby realizing the network of the AP device to which the STA device can automatically connect, and deciding the network connected to which AP device.
In one possible implementation manner, step S303 may include:
and responding to the hotspot operation of starting the third equipment by the user, and broadcasting the beacon frame.
That is to say, the third device has a hotspot function (e.g., a wifi hotspot, etc.), for example, the user may start the hotspot function of the third device, and after the hotspot function is started, the third device broadcasts the beacon frame to the surrounding environment.
It is to be understood that some or all of the steps or operations in the above-described embodiments are merely examples, and other operations or variations of various operations may be performed by the embodiments of the present application. Further, the various steps may be performed in a different order presented in the above-described embodiments, and it is possible that not all of the operations in the above-described embodiments are performed.
As shown in fig. 7, an embodiment of the present application provides a network connection method, which is applied to a second device, such as an STA device. As shown in fig. 7, the method may include:
s401, one or more scanned beacon frames are obtained, wherein the beacon frames comprise communication identification and network state information of first equipment, and the communication identification is used for representing information required by a network connected to the first equipment.
Referring to the method embodiments shown in fig. 1 or fig. 5, in step S401, the second device may scan for beacon frames broadcast by one or more first devices and/or beacon frames broadcast by one or more third devices in the surrounding environment.
S402, selecting target first equipment based on the network state information of each first equipment.
For example, the selection condition of the target first device may include whether the network state information of the first device meets the network connection requirement of the second device, or whether the network state information of the first device is optimal, or the like.
In one possible implementation manner, as shown in fig. 8, the second device may include a network connection requirement, and step S502 may include:
s501, analyzing the scanned beacon frame;
s502, if the beacon frame is analyzed to contain the communication identifier and the network state information of the first equipment, judging whether the network state information of the first equipment meets the network connection requirement;
s503, if the network state information of the first equipment meets the network connection requirement, selecting target first equipment, wherein the network state information of the target first equipment meets the network connection requirement;
s504, if it is analyzed that the beacon frame does not include the communication identifier and the network status information of the first device, or the network status information of the first device does not satisfy the network connection requirement, analyzing a next scanned beacon frame.
That is, after scanning the beacon frame, the second device parses the scanned beacon frame (for example, parses a Vendor Specific field in the beacon frame), determines whether the beacon frame includes the network status information and the communication identifier of the first device according to a parsing result, and parses a next scanned beacon frame if the beacon frame does not include the communication identifier and the network status information of the first device. If the beacon frame contains the communication identifier and the network state information of the first device, whether the network state information of the first device meets the network connection requirement is judged, if yes, the first device is selected as a target first device, and if not, the next scanned beacon frame is analyzed.
It is understood that the network connection requirement of the second device may be preset according to the network type of the second device or the user requirement, for example, the network connection requirement of the second device may include, but is not limited to, one or more of a network connection status of "connected", a network type of "5G", an uplink speed or a downlink speed not lower than a preset speed value, a network load degree in the past 15 minutes not higher than a preset load value, a network disconnection number in the past 24 hours not higher than a preset number, and the like.
In one possible implementation manner, step S402 may include:
s601, comparing the network state information of a plurality of first devices;
s602, selecting a target first device according to the comparison result, wherein the network state information of the target first device is optimal.
That is, if the second device scans multiple beacon frames, each beacon frame is analyzed to obtain network status information and communication identifiers of multiple first devices, then the network status information of the multiple first devices is compared, and according to a comparison result, the first device with the optimal network status information is selected as the target first device.
For example, the network status information may be optimally expressed as that the network connection status is "connected", the network type is "5G", the uplink speed or the downlink speed is the largest, the network load degree in the past 15 minutes is the lowest, or the network disconnection times in the past 24 hours is not higher than the preset times and the lowest, etc.
It should be noted that, in the process of parsing the beacon frame, if the information in the Vendor Specific field in the beacon frame is encrypted, the second device may decrypt the encrypted information according to a pre-agreed decryption method to parse the communication identifier and the network status information of the first device, which are included in the beacon frame.
S403, connecting to the network of the target first device according to the communication identifier of the target first device.
Therefore, for some second devices (such as STA devices) without keyboard, camera, screen or manual input function, it connects to the network of the target first device according to the SSID and PSK/PWD of the communication identifier of the target first device in the parsed beacon frame, and the network status information of the target first device can meet the network connection requirement of the second device or the network status information of the target first device is optimal.
In one possible implementation manner, after connecting to the network of the target first device in step S403, the method may further include:
s701, checking whether the network state information of the target first equipment meets the network connection requirement of the second equipment;
s702, if the network state information of the target first equipment does not meet the network connection requirement, scanning the beacon frame again, and selecting the first equipment meeting the network connection requirement according to the network state information in the scanned beacon frame again, and connecting to the network of the first equipment meeting the network connection requirement.
That is, after the second device connects to the network of the target first device, if the network status information of the target first device changes, the network communication quality of the second device may be affected. Therefore, in order to reduce the influence on the network communication quality of the second device, after the second device is connected to the target first device, the second device may check (e.g., at intervals) whether the network status information of the target first device meets the network connection requirement of the second device, and if it is checked that the network status information of the target first device still meets the network connection requirement of the second device, the network connection with the target first device is maintained. And if the network state information of the target first equipment does not meet the network connection requirement of the second equipment, scanning one or more beacon frames in the surrounding environment again, analyzing the scanned beacon frames again, and reselecting and connecting to the network of the first equipment meeting the network connection requirement according to the analysis result.
It is understood that if the network state information of other first devices in the surrounding environment cannot satisfy the network connection requirement of the second device, the second device may still maintain the network connection with the target first device. Alternatively, if the network status information of a certain first device in the surrounding environment is better than the network status information of the target first device, the second device may switch the network connected to the first device whose network status information is better.
It is to be understood that some or all of the steps or operations in the above-described embodiments are merely examples, and other operations or variations of various operations may be performed by the embodiments of the present application. Further, the various steps may be performed in a different order presented in the above-described embodiments, and it is possible that not all of the operations in the above-described embodiments are performed.
As shown in fig. 9, an embodiment of the present application provides a network connection apparatus 100A, where the apparatus 100A may include:
an obtaining module 10A, configured to obtain network status information of the first device and a communication identifier, where the communication identifier is used to represent information required by a network connected to the first device;
a first adding module 20A, configured to add the communication identifier and the network status information of the first device to a beacon frame of the first device, so that the beacon frame includes the communication identifier and the network status information of the first device;
a first broadcasting module 30A, configured to broadcast the beacon frame.
The network connection apparatus 100A shown in fig. 9 may be configured to execute the network connection method provided in the embodiment of the method shown in fig. 1, and specific principles or functions may refer to the embodiment of the method shown in fig. 1, which is not described herein again.
As shown in fig. 10, another embodiment of the present application provides a network connection apparatus 100B, where the apparatus 100B may include:
a receiving module 10B, configured to receive a communication identifier and network status information sent by the first device, where the communication identifier is used to indicate information required by a network connected to the first device;
a second adding module 20B, configured to add the communication identifier and the network status information of the first device to a beacon frame of the third device, so that the beacon frame includes the communication identifier and the network status information of the first device;
a second broadcasting module 30B, configured to broadcast the beacon frame.
The network connection apparatus 100B shown in fig. 10 may be configured to execute the network connection method provided in the embodiment of the method shown in fig. 5, and specific principles or functions may refer to the method embodiment shown in fig. 1, which is not described herein again.
As shown in fig. 11, another embodiment of the present application further provides a network connection device 100C, where the device 100C may include:
a scanning module 10C, configured to obtain one or more scanned beacon frames, where the beacon frames include a communication identifier of a first device and network status information, and the communication identifier is used to indicate information required by a network connected to the first device;
a selecting module 20C, configured to select a target first device based on the network state information of each first device;
and a connection module 30C, configured to connect to the network of the target first device according to the communication identifier of the target first device.
The network connection apparatus 100C shown in fig. 11 may be configured to execute the network connection method provided in the embodiment of the method shown in fig. 7, and specific principles or functions may refer to the embodiment of the method shown in fig. 7, which is not described herein again.
It should be understood that the division of the modules of the network connection device 100A shown in fig. 9, the network connection device 100B shown in fig. 10, and the network connection device 100C shown in fig. 11 is merely a logical division, and all or part of the actual implementation may be integrated into one physical entity or may be physically separated. And these modules can be realized in the form of software called by processing element; or may be implemented entirely in hardware; and part of the modules can be realized in the form of calling by the processing element in software, and part of the modules can be realized in the form of hardware. For example, the first adding module may be a separately established processing element, or may be implemented by being integrated into a certain chip of the electronic device. Other modules are implemented similarly. In addition, all or part of the modules can be integrated together or can be independently realized. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors (DSPs), one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, these modules may be integrated together and implemented in the form of a System-On-a-Chip (SOC).
Fig. 12 is a schematic structural diagram of an embodiment of an electronic device of the present application, and as shown in fig. 12, the electronic device may include:
one or more processors; a memory; and one or more computer programs;
the electronic device may be implemented as an AP device, a base station, or the like, or a chip module, or the like, provided in the AP device or the base station.
Wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions which, when executed by the apparatus, cause the apparatus to perform the steps of:
acquiring network state information and a communication identifier of the first device, wherein the communication identifier is used for representing information required by a network connected to the first device;
adding the communication identifier and the network state information of the first device into a beacon frame of the first device, so that the beacon frame comprises the communication identifier and the network state information of the first device;
broadcasting the beacon frame.
In one possible implementation manner, when the instruction is executed by the device, the device further performs, after the adding the communication identifier and the network status information of the first device to the beacon frame of the first device is executed, the step of:
judging whether the sending times of the beacon frame is greater than or equal to a preset threshold value or not;
if the sending times of the beacon frame is larger than or equal to a preset threshold value, checking whether the network state information of the first equipment changes, and if the network state information of the first equipment changes, updating the network state information in the beacon frame.
In one possible implementation manner, the network state information includes one or more of a network connection state, a network type, a network uplink speed and a network downlink speed of the first device, a network load degree in a preset first time period, and a network disconnection number in a preset second time period.
The electronic device may be configured to execute the functions/steps in the method provided in the embodiment shown in fig. 1 of the present application, and specific functions or steps may refer to the embodiment of the method shown in fig. 1, which is not described herein again.
Alternatively, the electronic device may be implemented as an STA device, such as a STA device without a screen, a keyboard, a camera, or a manual input function, or a chip module disposed in the STA device.
Wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions which, when executed by the apparatus, cause the apparatus to perform the steps of:
acquiring one or more scanned beacon frames, wherein the beacon frames comprise communication identifiers and network state information of first equipment, and the communication identifiers are used for representing information required by a network connected to the first equipment;
selecting a target first device based on the network state information of each first device;
and connecting to the network of the target first equipment according to the communication identification of the target first equipment.
In one possible implementation manner, when the instruction is executed by the device, the device is enabled to execute that the second device includes a network connection requirement, and the selecting a target first device based on the network state information of each first device includes:
analyzing the scanned beacon frame;
if the beacon frame contains the communication identifier and the network state information of the first equipment through analysis, judging whether the network state information of the first equipment meets the network connection requirement;
if the network state information of the first equipment meets the network connection requirement, selecting target first equipment, wherein the network state information of the target first equipment meets the network connection requirement;
and if the beacon frame does not contain the communication identifier and the network state information of the first equipment or the network state information of the first equipment does not meet the network connection requirement, analyzing the next scanned beacon frame.
In one possible implementation manner, when the instruction is executed by the device, the device is enabled to execute the selecting of the target first device based on the network state information of each first device, including:
comparing network status information of a plurality of the first devices;
and selecting the target first equipment according to the comparison result, wherein the network state information of the target first equipment is optimal.
In one possible implementation manner, when the instructions are executed by the device, the device further performs, after executing the network connected to the target first device, the steps of:
checking whether the network state information of the target first device meets the network connection requirement of the second device;
if the network state information of the target first device does not meet the network connection requirement, scanning the beacon frame again, selecting the first device meeting the network connection requirement according to the network state information in the scanned beacon frame again, and connecting to the network of the first device meeting the network connection requirement.
The electronic device may be configured to execute the functions/steps in the method provided in the embodiment shown in fig. 7 of the present application, and specific functions or steps may refer to the embodiment of the method shown in fig. 7, which is not described herein again.
Alternatively, the electronic device may be implemented as a terminal, such as a mobile phone, a computer, a smart watch, a bracelet, or the like, or a chip module set in the terminal.
Wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions which, when executed by the apparatus, cause the apparatus to perform the steps of:
receiving a communication identifier and network state information sent by the first device, wherein the communication identifier is used for representing information required by a network connected to the first device;
adding the communication identifier and the network state information of the first device to a beacon frame of the third device, so that the beacon frame comprises the communication identifier and the network state information of the first device;
broadcasting the beacon frame.
In one possible implementation manner, when the instruction is executed by the apparatus, the apparatus is caused to perform the broadcasting the beacon frame, and the method includes:
and responding to the hotspot operation of starting the third equipment by the user, and broadcasting the beacon frame.
The electronic device may be configured to execute the functions/steps in the method provided in the embodiment shown in fig. 5 of the present application, and specific functions or steps may refer to the embodiment of the method shown in fig. 5, which is not described herein again.
As shown in fig. 12, the electronic device 900 includes a processor 910 and a memory 920. Wherein, the processor 910 and the memory 920 can communicate with each other through the internal connection path to transmit control and/or data signals, the memory 920 is used for storing computer programs, and the processor 910 is used for calling and running the computer programs from the memory 920.
The memory 920 may be a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a Random Access Memory (RAM), or other types of dynamic storage devices that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disc storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, etc.
The processor 910 and the memory 920 may be combined into a processing device, and more generally, independent components, and the processor 910 is configured to execute the program codes stored in the memory 920 to realize the functions. In particular implementations, the memory 920 may be integrated with the processor 910 or may be separate from the processor 910.
It should be understood that the electronic device 900 shown in fig. 12 is capable of implementing the processes of the methods provided by the embodiments shown in fig. 1, 5 or 7 of the present application. The operations and/or functions of the respective modules in the electronic device 900 are respectively for implementing the corresponding flows in the above-described method embodiments. In particular, reference may be made to the description of the embodiments of the method shown in fig. 1, fig. 5 or fig. 7 of the present application, and a detailed description is appropriately omitted herein to avoid redundancy.
It should be understood that the processor 910 in the electronic device 900 shown in fig. 12 may be a system on chip SOC, and the processor 910 may include a Central Processing Unit (CPU), and may further include other types of processors, such as: an image Processing Unit (hereinafter, referred to as GPU), and the like.
In summary, various parts of the processors or processing units within the processor 910 may cooperate to implement the foregoing method flows, and corresponding software programs for the various parts of the processors or processing units may be stored in the memory 920.
The application also provides an electronic device, which includes a storage medium and a central processing unit, where the storage medium may be a non-volatile storage medium, and a computer executable program is stored in the storage medium, and the central processing unit is connected to the non-volatile storage medium and executes the computer executable program to implement the method provided by the embodiment shown in fig. 1, fig. 5, or fig. 7 of the present application.
In the above embodiments, the processors may include, for example, a CPU, a DSP, a microcontroller, or a digital Signal processor, and may further include a GPU, an embedded Neural Network Processor (NPU), and an Image Signal Processing (ISP), and the processors may further include necessary hardware accelerators or logic Processing hardware circuits, such as an ASIC, or one or more integrated circuits for controlling the execution of the program according to the technical solution of the present application. Further, the processor may have the functionality to operate one or more software programs, which may be stored in the storage medium.
Embodiments of the present application further provide a computer-readable storage medium, in which a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute the method provided by the embodiments shown in fig. 1, fig. 5, or fig. 7 of the present application.
Embodiments of the present application also provide a computer program product, which includes a computer program, when the computer program runs on a computer, causes the computer to execute the method provided by the embodiments shown in fig. 1, fig. 5 or fig. 7 of the present application.
In the embodiments of the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, and means that there may be three relationships, for example, a and/or B, and may mean that a exists alone, a and B exist simultaneously, and B exists alone. Wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c may represent: a, b, c, a and b, a and c, b and c or a and b and c, wherein a, b and c can be single or multiple.
Those of ordinary skill in the art will appreciate that the various elements and algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or combinations of electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, any function, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including 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 according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present application, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present disclosure, and all the changes or substitutions should be covered by the protection scope of the present application. The protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. A network connection method is applied to a first device, and is characterized by comprising the following steps:
acquiring network state information and a communication identifier of the first device, wherein the communication identifier is used for representing information required by a network connected to the first device;
adding the communication identifier and the network state information of the first device into a beacon frame of the first device, so that the beacon frame comprises the communication identifier and the network state information of the first device;
broadcasting the beacon frame.
2. The method of claim 1, wherein after the adding the communication identity and the network state information of the first device to the beacon frame of the first device, the method further comprises:
judging whether the sending times of the beacon frame is greater than or equal to a preset threshold value or not;
if the sending times of the beacon frame is larger than or equal to a preset threshold value, checking whether the network state information of the first equipment changes, and if the network state information of the first equipment changes, updating the network state information in the beacon frame.
3. The method according to claim 1 or 2, wherein the network status information comprises one or more of a network connection status, a network type, a network uplink speed and a network downlink speed of the first device, a network load degree in a preset first time period, and a network disconnection number in a preset second time period.
4. A network connection method applied to a second device, the method comprising:
acquiring one or more scanned beacon frames, wherein the beacon frames comprise communication identifiers and network state information of first equipment, and the communication identifiers are used for representing information required by a network connected to the first equipment;
selecting a target first device based on the network state information of each first device;
and connecting to the network of the target first equipment according to the communication identification of the target first equipment.
5. The method of claim 4, wherein the second device includes a network connection requirement, and wherein selecting the target first device based on the network status information of each of the first devices comprises:
analyzing the scanned beacon frame;
if the beacon frame contains the communication identifier and the network state information of the first equipment through analysis, judging whether the network state information of the first equipment meets the network connection requirement;
if the network state information of the first equipment meets the network connection requirement, selecting target first equipment, wherein the network state information of the target first equipment meets the network connection requirement;
and if the beacon frame does not contain the communication identifier and the network state information of the first equipment or the network state information of the first equipment does not meet the network connection requirement, analyzing the next scanned beacon frame.
6. The method of claim 4, wherein the selecting the target first device based on the network status information of each of the first devices comprises:
comparing network status information of a plurality of the first devices;
and selecting the target first equipment according to the comparison result, wherein the network state information of the target first equipment is optimal.
7. The method of any of claims 4 to 6, wherein after connecting to the network of target first devices, the method further comprises:
checking whether the network state information of the target first device meets the network connection requirement of the second device;
if the network state information of the target first device does not meet the network connection requirement, scanning the beacon frame again, selecting the first device meeting the network connection requirement according to the network state information in the scanned beacon frame again, and connecting to the network of the first device meeting the network connection requirement.
8. A network connection method is applied to a third device, the third device establishes connection with a first device, and the third device contains a beacon frame, and the method is characterized by comprising the following steps:
receiving a communication identifier and network state information sent by the first device, wherein the communication identifier is used for representing information required by a network connected to the first device;
adding the communication identifier and the network state information of the first device to a beacon frame of the third device, so that the beacon frame comprises the communication identifier and the network state information of the first device;
broadcasting the beacon frame.
9. The method of claim 10, wherein said broadcasting the beacon frame comprises:
and responding to the hotspot operation of starting the third equipment by the user, and broadcasting the beacon frame.
10. An electronic device, comprising:
one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions which, when executed by the apparatus, cause the apparatus to perform the method of any of claims 1 to 3, 4 to 7, or 8 to 9.
11. A computer-readable storage medium, in which a computer program is stored which, when run on a computer, causes the computer to carry out the method according to any one of claims 1 to 3, 4 to 7 or 8 to 9.
CN202110757394.5A 2021-07-05 2021-07-05 Network connection method and electronic device Pending CN113438710A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110757394.5A CN113438710A (en) 2021-07-05 2021-07-05 Network connection method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110757394.5A CN113438710A (en) 2021-07-05 2021-07-05 Network connection method and electronic device

Publications (1)

Publication Number Publication Date
CN113438710A true CN113438710A (en) 2021-09-24

Family

ID=77758969

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110757394.5A Pending CN113438710A (en) 2021-07-05 2021-07-05 Network connection method and electronic device

Country Status (1)

Country Link
CN (1) CN113438710A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105430647A (en) * 2015-11-04 2016-03-23 广东欧珀移动通信有限公司 Wireless sound box networking method and mobile terminal
CN106341863A (en) * 2015-07-08 2017-01-18 华为终端(东莞)有限公司 Capability notification method, access point connection method, access point and workstation
WO2017185460A1 (en) * 2016-04-29 2017-11-02 宇龙计算机通信科技(深圳)有限公司 Network access method, terminal and access point
US20180152873A1 (en) * 2016-09-30 2018-05-31 International Business Machines Corporation Access point selection
CN110225516A (en) * 2018-03-01 2019-09-10 鸿合科技股份有限公司 A kind of connection method and system of wireless network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106341863A (en) * 2015-07-08 2017-01-18 华为终端(东莞)有限公司 Capability notification method, access point connection method, access point and workstation
CN105430647A (en) * 2015-11-04 2016-03-23 广东欧珀移动通信有限公司 Wireless sound box networking method and mobile terminal
WO2017185460A1 (en) * 2016-04-29 2017-11-02 宇龙计算机通信科技(深圳)有限公司 Network access method, terminal and access point
US20180152873A1 (en) * 2016-09-30 2018-05-31 International Business Machines Corporation Access point selection
CN110225516A (en) * 2018-03-01 2019-09-10 鸿合科技股份有限公司 A kind of connection method and system of wireless network

Similar Documents

Publication Publication Date Title
US8874710B2 (en) Access network discovery
CN112203336B (en) Wireless access control method, device and system
CN109756951B (en) Method and user equipment for network selection
CN103650548B (en) Method and apparatus for providing the flexibility in peer discovery distance and renewal frequency
EP3761679B1 (en) Location method and related device
US10716043B2 (en) Access point handover method and device
US20230345244A1 (en) Method and device for obtaining, managing, and verifying user consent for external provision of user data analysis information
CN102448064A (en) Access through non-3GPP access networks
EP3739909B1 (en) Method and apparatus for network self-organization
WO2019090763A1 (en) Method for selecting cell, terminal device, and network device
CN104770049A (en) Method and apparatus for network-controlled proximity device to device discovery and communication
CN113508569B (en) Method and node for processing system information
US8929315B2 (en) Method and system for coexistence between wireless communication networks
CN113228743B (en) User equipment and method for access control thereof through access classification
US11122494B2 (en) Access method, and terminal
CN114902703A (en) D2D communication method, device and system
CN114697958A (en) Network access method and system of wireless access point, AP and storage medium
CN113438710A (en) Network connection method and electronic device
KR20180124841A (en) D2D-based communication method and terminal
CN111181667A (en) Processing method for cell selection based on NR-U
US20230254677A1 (en) Method for notifying of disaster situation by ran node, and device supporting same
KR20230049706A (en) Network Transition Methods, Devices and Appliances
WO2021155588A1 (en) Method and apparatus for restricting access of devices
WO2014181028A1 (en) Method and apparatus for access control
CN108990039B (en) Data transmission method and related device

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210924