CN118382118A - Network connection switching method and device, storage medium and electronic equipment - Google Patents

Network connection switching method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN118382118A
CN118382118A CN202410397588.2A CN202410397588A CN118382118A CN 118382118 A CN118382118 A CN 118382118A CN 202410397588 A CN202410397588 A CN 202410397588A CN 118382118 A CN118382118 A CN 118382118A
Authority
CN
China
Prior art keywords
hot spot
hotspot
connection
network
layer
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
CN202410397588.2A
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.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology 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 Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN202410397588.2A priority Critical patent/CN118382118A/en
Publication of CN118382118A publication Critical patent/CN118382118A/en
Pending legal-status Critical Current

Links

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The application discloses a network connection switching method, a device, a storage medium and electronic equipment, and relates to the technical field of communication, wherein the method comprises the following steps: acquiring hot spot information of at least two scanned hot spots; detecting according to the hot spot information to obtain a double-frequency hot spot belonging to the same router, wherein the double-frequency hot spot comprises a first hot spot and a second hot spot; if the connection between the local and the first hot spot is established and the hot spot switching condition is judged to be met, the connection between the local and the first hot spot is disconnected at a link layer, and the connection between the link layer and the second hot spot is established; and if the connection is established between the link layer and the second hot spot, completing the network connection with the second hot spot by detecting the network address reachability of the second hot spot. The application can improve the network switching efficiency, reduce the user perception in the switching process, realize the quick switching of the noninductive network and improve the user experience.

Description

Network connection switching method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of communications technologies, and in particular, to a network connection switching method, a device, a storage medium, and an electronic apparatus.
Background
At present, wifi network technology is more and more popular, and when wifi equipment is used, requirements on wifi network performance are also higher and higher, and switching network connection has great effect on improving user network performance.
In the existing network connection switching scheme, a user is usually helped to switch to a network with better network quality through judging the network quality score. However, in the existing switching scheme, when the network connection is switched, the network layer and the link layer are completely disconnected, connection is restarted, the switching efficiency is low, a user can perceive disconnection of the network, video playing is easy to be blocked, network disconnection prompt and other performances are easy to appear, and user experience is greatly affected.
Therefore, the existing network connection switching scheme has the problems of low switching efficiency and high user perception, and influences user experience.
Disclosure of Invention
The embodiment of the application provides a scheme which can effectively improve the network switching efficiency, reduce the user perception and improve the user experience.
The embodiment of the application provides the following technical scheme:
According to one embodiment of the present application, a network connection switching method includes: acquiring hot spot information of at least two scanned hot spots; detecting according to the hot spot information to obtain a double-frequency hot spot belonging to the same router, wherein the double-frequency hot spot comprises a first hot spot and a second hot spot; if the connection between the local and the first hot spot is established and the hot spot switching condition is judged to be met, the connection between the local and the first hot spot is disconnected at a link layer, and the connection between the link layer and the second hot spot is established; and if the connection is established between the link layer and the second hot spot, completing the network connection with the second hot spot by detecting the network address reachability of the second hot spot.
In some embodiments of the present application, the completing the network connection with the second hotspot by performing network address reachability detection on the second hotspot includes: issuing a disconnection command to a wireless network processing layer through a framework layer, wherein the wireless network processing layer responds to the disconnection command to disconnect the connection with the first hot spot; issuing a connection command to the wireless network processing layer through the framework layer, wherein the wireless network processing layer responds to the connection command and establishes connection with the second hot spot; detecting the network address reachability of the second hot spot through the frame layer to obtain a detection result; and if the detection result is that the network address is reachable, determining that the network connection with the second hot spot is established.
In some embodiments of the present application, after the network address reachability detection is performed on the second hotspot by the framework layer, the method further includes: if the detection result is that the network address is not reachable, carrying out a network address request through a preset network address allocation flow to obtain a hotspot address matched with the second hotspot; and establishing network layer connection with the second hot spot according to the hot spot address.
In some embodiments of the application, after the issuing of the disconnect command to the wireless network processing layer by the framework layer, the method further comprises: and setting a flag bit to the wireless network processing layer through the frame layer, wherein the flag bit is used for preventing the wireless network processing layer from executing corresponding user perception operation.
In some embodiments of the application, the hotspot information includes a hotspot identifier and a channel; the detecting according to the hotspot information, to obtain the dual-frequency hotspots belonging to the same router, includes: detecting the similarity of the hotspot identifiers of the scanned at least two hotspots to obtain a plurality of candidate hotspots with the similarity meeting a preset condition, wherein the plurality of candidate hotspots comprise the first hotspot; and selecting the hot spots which respectively belong to the preset double frequency bands with the channels of the first hot spot from the plurality of candidate hot spots to obtain the double frequency hot spots belonging to the same router.
In some embodiments of the application, the hotspot information comprises a user tag; the detecting according to the hotspot information, to obtain the dual-frequency hotspots belonging to the same router, includes: detecting user marks corresponding to the scanned at least two hot spots to obtain user marks belonging to the same double-frequency hot spot group; and taking the hotspots corresponding to the user marks belonging to the same double-frequency hotspot group as the double-frequency hotspots belonging to the same router.
In some embodiments of the present application, before the link layer disconnects from the first hotspot if the connection is locally established with the first hotspot and the hotspot switching condition is determined to be met, the method further includes: detecting whether connection information of the second hot spot is stored locally or not and whether the network quality of the second hot spot is higher than that of the first hot spot or not; and if yes, determining that the hot spot switching conditions are met.
According to an embodiment of the present application, a network connection switching apparatus includes: the acquisition module is used for acquiring the hot spot information of the scanned at least two hot spots; the detection module is used for detecting according to the hotspot information to obtain a double-frequency hotspot belonging to the same router, wherein the double-frequency hotspot comprises a first hotspot and a second hotspot; the connection module is used for disconnecting the connection with the first hot spot at a link layer and establishing connection with the second hot spot at the link layer if the connection with the first hot spot is established locally and the hot spot switching condition is judged to be met; and the detection module is used for completing network connection with the second hot spot by detecting the network address reachability of the second hot spot if the connection is established between the link layer and the second hot spot.
In some embodiments of the application, the detection module is configured to: issuing a disconnection command to a wireless network processing layer through a framework layer, wherein the wireless network processing layer responds to the disconnection command to disconnect the connection with the first hot spot; issuing a connection command to the wireless network processing layer through the framework layer, wherein the wireless network processing layer responds to the connection command and establishes connection with the second hot spot; detecting the network address reachability of the second hot spot through the frame layer to obtain a detection result; and if the detection result is that the network address is reachable, determining that the network connection with the second hot spot is established.
In some embodiments of the present application, after the network address reachability detection is performed on the second hotspot by the framework layer, the detection module is configured to: if the detection result is that the network address is not reachable, carrying out a network address request through a preset network address allocation flow to obtain a hotspot address matched with the second hotspot; and establishing network layer connection with the second hot spot according to the hot spot address.
In some embodiments of the present application, after the issuing of the disconnect command to the wireless network processing layer by the framework layer, the apparatus further comprises a setting module configured to: and setting a flag bit to the wireless network processing layer through the frame layer, wherein the flag bit is used for preventing the wireless network processing layer from executing corresponding user perception operation.
In some embodiments of the application, the hotspot information includes a hotspot identifier and a channel; the detection module is used for: detecting the similarity of the hotspot identifiers of the scanned at least two hotspots to obtain a plurality of candidate hotspots with the similarity meeting a preset condition, wherein the plurality of candidate hotspots comprise the first hotspot; and selecting the hot spots which respectively belong to the preset double frequency bands with the channels of the first hot spot from the plurality of candidate hot spots to obtain the double frequency hot spots belonging to the same router.
In some embodiments of the application, the hotspot information comprises a user tag; the detection module is used for: detecting user marks corresponding to the scanned at least two hot spots to obtain user marks belonging to the same double-frequency hot spot group; and taking the hotspots corresponding to the user marks belonging to the same double-frequency hotspot group as the double-frequency hotspots belonging to the same router.
In some embodiments of the present application, before the link layer disconnects from the first hotspot if the connection is locally established with the first hotspot and the hotspot switching condition is determined to be met, the apparatus further includes a determining module configured to: detecting whether connection information of the second hot spot is stored locally or not and whether the network quality of the second hot spot is higher than that of the first hot spot or not; and if yes, determining that the hot spot switching conditions are met.
According to another embodiment of the present application, a storage medium has a computer program stored thereon, which when executed by a processor of a computer, causes the computer to perform the method according to the embodiment of the present application.
According to another embodiment of the present application, an electronic device may include: a memory storing a computer program; and the processor reads the computer program stored in the memory to execute the method according to the embodiment of the application.
According to another embodiment of the application, a computer program product or computer program includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to cause the computer device to perform the methods provided in the various alternative implementations described in the embodiments of the present application.
In the embodiment of the application, the hot spot information of at least two scanned hot spots is obtained; detecting according to the hot spot information to obtain a double-frequency hot spot belonging to the same router, wherein the double-frequency hot spot comprises a first hot spot and a second hot spot; if the connection between the local and the first hot spot is established and the hot spot switching condition is judged to be met, the connection between the local and the first hot spot is disconnected at a link layer, and the connection between the link layer and the second hot spot is established; and if the connection is established between the link layer and the second hot spot, completing the network connection with the second hot spot by detecting the network address reachability of the second hot spot.
In this way, the dual-frequency hotspots belonging to the same router are detected through scanning, if connection is established between the local and the first hotspot in the dual-frequency hotspots and the connection is judged to be in accordance with the hotspot switching condition, the connection between the local and the first hotspot is disconnected only at the link layer, the connection between the network layer and the second hotspot is maintained, and then the connection between the link layer and the second hotspot is established, and after the connection, the network connection between the local and the second hotspot is completed through network address accessibility detection. When the network connection is switched, the network connection is disconnected and switched at the link layer by utilizing the reusability of the network address (ip address) of the double-frequency hot spot under the same router, and the network connection is completed through the network address accessibility detection, so that the overall process switching efficiency is effectively improved, the user perception degree in the switching process is low, the quick switching of the noninductive network is realized, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a flow chart of a network connection switching method according to an embodiment of the application.
Fig. 2 shows a flow chart of dual-frequency hot spot detection according to one embodiment of the application.
Fig. 3 shows a flow chart of reachability detection according to one embodiment of the present application.
Fig. 4 shows a block diagram of a network connection switching apparatus according to an embodiment of the present application.
Fig. 5 shows a block diagram of an electronic device according to an embodiment of the application.
Detailed Description
The present disclosure is further described in detail below with reference to the drawings and examples. It should be understood that the examples provided herein are merely illustrative of the present disclosure and are not intended to limit the present disclosure. In addition, the embodiments provided below are some of the embodiments for implementing the present disclosure, and not all of the embodiments for implementing the present disclosure, and the technical solutions described in the embodiments of the present disclosure may be implemented in any combination without conflict.
It should be noted that, in the embodiments of the present disclosure, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a method or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such method or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other related elements (e.g., a step in a method or a unit in an apparatus, e.g., a unit may be a part of a circuit, a part of a processor, a part of a program or software, etc.) in a method or apparatus comprising the element.
For example, the network connection switching method provided in the embodiment of the present disclosure includes a series of steps, but the network connection switching method provided in the embodiment of the present disclosure is not limited to the described steps, and similarly, the network connection switching apparatus provided in the embodiment of the present disclosure includes a series of units, but the apparatus provided in the embodiment of the present disclosure is not limited to including the explicitly described units, and may also include units that are required to be set when acquiring related information or performing processing based on the information.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure.
Fig. 1 schematically shows a flow chart of a network connection switching method according to an embodiment of the application. The main execution body of the network connection switching method can be any device with processing capability, such as a television, a computer, a mobile phone, a smart watch, a household appliance and the like.
As shown in fig. 1, the network connection switching method may include steps S110 to S140.
Step S110, acquiring hot spot information of at least two scanned hot spots; step S120, detecting according to the hot spot information to obtain a double-frequency hot spot belonging to the same router, wherein the double-frequency hot spot comprises a first hot spot and a second hot spot; step S130, if the connection is established with the first hot spot locally and the hot spot switching condition is judged to be met, the connection with the first hot spot is disconnected at a link layer, and the connection is established with the second hot spot at the link layer; step S140, if a connection is established between the link layer and the second hotspot, network connection with the second hotspot is completed by detecting the network address reachability of the second hotspot.
The hot spot can be scanned by executing the hot spot scanning function, hot spot information of at least two scanned hot spots can be further obtained, the hot spots can be usually hot spots of a wifi wireless network, and the hot spot information can be information such as a hot spot identifier (BSSID), a channel, a user mark and the like.
And detecting according to the hotspot information to obtain a double-frequency hotspot belonging to the same router, wherein the double-frequency hotspot comprises a first hotspot and a second hotspot, the first hotspot and the second hotspot of the double-frequency hotspot belonging to the same router are usually a 2.4G frequency band hotspot and a 5G frequency band hotspot respectively, and the double-frequency hotspots belonging to the same router can be generally multiplexed with a network address (ip address, namely an Internet protocol address).
If the local is connected with the first hot spot in the dual-frequency hot spots and the hot spot switching condition is judged to be met, and the non-inductive network switching scene is met at the moment, the connection with the first hot spot is disconnected only at the link layer (L2 layer), and the connection with the second hot spot is established at the link layer (L2 layer).
After the link layer (L2 layer) is connected with the second hotspot, network connection with the second hotspot is completed by detecting the network address reachability of the second hotspot by utilizing the network address (ip address) reusability of the double-frequency hotspot under the same router, and further, the network connection with the second hotspot is completed under the condition of not disconnecting the network layer.
In this way, based on steps S110 to S140, the dual-frequency hotspots belonging to the same router are detected through scanning, if the connection is locally established with the first hotspot in the dual-frequency hotspots and the hotspot switching condition is judged to be met, the connection with the first hotspot is firstly disconnected only at the link layer, the connection of the network layer is maintained, and secondly, the connection is established with the second hotspot at the link layer, and after the connection, the network connection with the second hotspot is completed through network address reachability detection. When the network connection is switched, the network connection is disconnected and switched at the link layer by utilizing the reusability of the network address (ip address) of the double-frequency hot spot under the same router, and the network connection is completed through the network address accessibility detection, so that the overall process switching efficiency is effectively improved, the user perception degree in the switching process is low, and the user experience is improved.
Further alternative embodiments of the steps performed when performing a network connection handover under the embodiment of fig. 1 are described below.
In one embodiment, referring to fig. 2, the hotspot information includes a hotspot identifier and a channel; the detecting according to the hotspot information to obtain the dual-frequency hotspots belonging to the same router may include:
Step S210, detecting the similarity of the hotspot identifiers of the scanned at least two hotspots to obtain a plurality of candidate hotspots with the similarity meeting a preset condition, wherein the plurality of candidate hotspots comprise the first hotspot; step S220, selecting a hotspot with a channel belonging to a predetermined dual-band from the plurality of candidate hotspots, to obtain the dual-band hotspot belonging to the same router.
The hotspot identifier (BSSID) and the channel of the hotspot can be obtained by scanning the hotspot, further, the similarity of the hotspot identifiers of the scanned at least two hotspots can be detected first to obtain a plurality of candidate hotspots with the similarity meeting the preset condition, specifically, whether the first 5 bytes of the hotspot identifier (BSSID) are identical to obtain the similarity between the hotspots can be judged, the similarity is 100% when the first 5 bytes of the hotspot identifier (BSSID) are identical, and the plurality of candidate hotspots with the similarity meeting the preset condition can be a plurality of candidate hotspots with the similarity of 100%. Wherein the plurality of candidate hotspots need to include the first hotspot to which the local connection has been made.
Further, a hotspot with a channel belonging to a predetermined dual-band may be selected from a plurality of candidate hotspots, where the predetermined dual-band may be specifically a 2.4G band and a 5G band, and a hotspot with a channel belonging to a 2.4G band and a 5G band respectively with the first hotspot is selected from the plurality of candidate hotspots, so as to obtain a dual-band hotspot "first hotspot and second hotspot" generated under the same router.
In one embodiment, the hotspot information comprises a user tag; the detecting according to the hotspot information to obtain the dual-frequency hotspots belonging to the same router may include:
Detecting user marks corresponding to the scanned at least two hot spots to obtain user marks belonging to the same double-frequency hot spot group; and taking the hotspots corresponding to the user marks belonging to the same double-frequency hotspot group as the double-frequency hotspots belonging to the same router.
The user can add a user mark for the double-frequency hot spot under the same router in advance, and the user mark can mark whether the two hot spots belong to the double-frequency hot spot group under the same router. After the device scans at least two hotspots, corresponding user marks can be obtained from the device, and hotspots corresponding to the user marks belonging to the same double-frequency hotspot group can be used as double-frequency hotspots belonging to the same router rapidly and accurately.
Compared with the detection mode through the hotspot identifier and the channel, in the embodiment, the double-frequency hotspot is detected through the user marking mode, so that double-frequency hotspot detection errors caused by the condition that information such as the hotspot identifier cannot be scanned or the scanned information such as the hotspot identifier is wrong can be avoided, and the double-frequency hotspot detection accuracy is further improved.
In one embodiment, before the link layer disconnects from the first hotspot if the connection is locally established with the first hotspot and the hotspot switching condition is determined to be met, the method further includes: detecting whether connection information of the second hot spot is stored locally or not and whether the network quality of the second hot spot is higher than that of the first hot spot or not; and if yes, determining that the hot spot switching conditions are met.
When the device determines that the connection information (such as a key and the like) of the second hotspot is locally stored and the network quality of the second hotspot is higher than that of the first hotspot, the device can be triggered to switch from the first hotspot to the second hotspot by determining that the current hotspot switching condition is met, and the second hotspot and the network quality after switching can be successfully switched.
In one embodiment, referring to fig. 3, the completing the network connection with the second hotspot by performing network address reachability detection on the second hotspot may include:
Step S310, issuing a disconnection command to a wireless network processing layer through a framework layer, wherein the wireless network processing layer responds to the disconnection command to disconnect the connection with the first hot spot; step S320, a connection command is issued to the wireless network processing layer through the framework layer, and the wireless network processing layer responds to the connection command to establish connection with the second hot spot; step S330, detecting the network address reachability of the second hotspot through the framework layer, to obtain a detection result; step S340, if the detected result is that the network address is reachable, determining that the network connection with the second hotspot is established.
After the network starts the switching, the system issues a disconnection command to a wireless network processing layer (wpa_support) through a frame layer (frame layer), so that the wireless network processing layer responds to the disconnection command to disconnect from the first hot spot, that is, disconnect from the first hot spot at a link layer in the device.
Further, after the link layer is disconnected from the first hotspot, the wireless network processing layer (wpa_suppuration) in the device may inform the frame layer (frame layer), and the frame layer (frame layer) may issue a connection command to the wireless network processing layer (wpa_suppuration again, so that the wireless network processing layer (wpa_suppuration) establishes a connection with the second hotspot in response to the connection command, that is, establishes a connection between the link layer and the second hotspot in the device.
The frame layer (frame layer) can inform the frame layer that the connection between the frame layer and the second hotspot is established in the device, and then the frame layer (frame layer) can detect the network address reachability of the second hotspot to obtain a detection result.
If the network address is reachable as a result of the detection, it is determined that the link layer and the network layer of the second hotspot are both connected, that is, the local and the second hotspot have network connection established.
Further, in an embodiment, after the network address reachability detection is performed on the second hotspot by the framework layer to obtain a detection result, the method further includes:
If the detection result is that the network address is not reachable, carrying out a network address request through a preset network address allocation flow to obtain a hotspot address matched with the second hotspot; and establishing network layer connection with the second hot spot according to the hot spot address.
If the network address is not reachable as the detection result, a network address request is performed through a predetermined network address allocation process, and a hotspot address matched with the second hotspot is obtained, where the predetermined network address allocation process may be specifically a DHCP process.
After obtaining the hotspot address (i.e. the ip address adapted to the second hotspot) matched with the second hotspot, network layer connection can be established according to the hotspot address and the second hotspot, so that network connection with the second hotspot is established.
Further, in an embodiment, after the issuing, by the framework layer, the disconnect command to the wireless network processing layer, the method further includes: and setting a flag bit to the wireless network processing layer through the frame layer, wherein the flag bit is used for preventing the wireless network processing layer from executing corresponding user perception operation.
Through a frame layer (frame layer), a flag bit can be added into the wireless network processing layer (wpa_supplicant), the wireless network processing layer is prevented from executing corresponding user perception operation through the flag bit, the user perception operation can be specifically an operation that the wireless network processing layer notifies the frame layer of a relevant state, further, the wireless network processing layer can be further prevented from notifying the frame layer of the relevant state through the flag bit, and further, the user perception of network switching is further reduced.
In order to facilitate better implementation of the network connection switching method provided by the embodiment of the application, the embodiment of the application also provides a network connection switching device based on the network connection switching method. The meaning of the nouns is the same as that in the network connection switching method, and specific implementation details can be referred to the description in the method embodiment. Fig. 4 shows a block diagram of a network connection switching apparatus according to an embodiment of the present application.
As shown in fig. 4, the network connection switching apparatus 400 may include: the acquiring module 410 may be configured to acquire hotspot information of the scanned at least two hotspots; the detection module 420 may be configured to detect according to the hotspot information to obtain a dual-frequency hotspot belonging to the same router, where the dual-frequency hotspot includes a first hotspot and a second hotspot; the connection module 430 may be configured to disconnect the connection with the first hotspot at the link layer and establish the connection with the second hotspot at the link layer if the connection with the first hotspot is locally established and the hotspot switching condition is determined to be met; the probing module 440 may be configured to complete a network connection with the second hotspot by performing network address reachability probing on the second hotspot if a connection is established with the second hotspot at the link layer.
In some embodiments of the application, the detection module is configured to: issuing a disconnection command to a wireless network processing layer through a framework layer, wherein the wireless network processing layer responds to the disconnection command to disconnect the connection with the first hot spot; issuing a connection command to the wireless network processing layer through the framework layer, wherein the wireless network processing layer responds to the connection command and establishes connection with the second hot spot; detecting the network address reachability of the second hot spot through the frame layer to obtain a detection result; and if the detection result is that the network address is reachable, determining that the network connection with the second hot spot is established.
In some embodiments of the present application, after the network address reachability detection is performed on the second hotspot by the framework layer, the detection module is configured to: if the detection result is that the network address is not reachable, carrying out a network address request through a preset network address allocation flow to obtain a hotspot address matched with the second hotspot; and establishing network layer connection with the second hot spot according to the hot spot address.
In some embodiments of the present application, after the issuing of the disconnect command to the wireless network processing layer by the framework layer, the apparatus further comprises a setting module configured to: and setting a flag bit to the wireless network processing layer through the frame layer, wherein the flag bit is used for preventing the wireless network processing layer from executing corresponding user perception operation.
In some embodiments of the application, the hotspot information includes a hotspot identifier and a channel; the detection module is used for: detecting the similarity of the hotspot identifiers of the scanned at least two hotspots to obtain a plurality of candidate hotspots with the similarity meeting a preset condition, wherein the plurality of candidate hotspots comprise the first hotspot; and selecting the hot spots which respectively belong to the preset double frequency bands with the channels of the first hot spot from the plurality of candidate hot spots to obtain the double frequency hot spots belonging to the same router.
In some embodiments of the application, the hotspot information comprises a user tag; the detection module is used for: detecting user marks corresponding to the scanned at least two hot spots to obtain user marks belonging to the same double-frequency hot spot group; and taking the hotspots corresponding to the user marks belonging to the same double-frequency hotspot group as the double-frequency hotspots belonging to the same router.
In some embodiments of the present application, before the link layer disconnects from the first hotspot if the connection is locally established with the first hotspot and the hotspot switching condition is determined to be met, the apparatus further includes a determining module configured to: detecting whether connection information of the second hot spot is stored locally or not and whether the network quality of the second hot spot is higher than that of the first hot spot or not; and if yes, determining that the hot spot switching conditions are met.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
In addition, the embodiment of the application further provides an electronic device, as shown in fig. 5, and fig. 5 shows a block diagram of the electronic device according to one embodiment of the application, specifically:
The electronic device may include one or more processing cores 'processors 501, one or more computer-readable storage media's memory 502, a power supply 503, and an input unit 504, among other components. It will be appreciated by those skilled in the art that the electronic device structure shown in fig. 5 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
Wherein:
The processor 501 is a control center of the electronic device, and connects various parts of the entire computer device using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 502, and calling data stored in the memory 502, thereby performing overall monitoring of the electronic device. Optionally, processor 501 may include one or more processing cores; preferably, the processor 501 may integrate an application processor and a modem processor, wherein the application processor primarily handles operating systems, user pages, applications, etc., and the modem processor primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 501.
The memory 502 may be used to store software programs and modules, and the processor 501 executes various functional applications and data processing by executing the software programs and modules stored in the memory 502. The memory 502 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the computer device, etc. In addition, memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 502 may also include a memory controller to provide access to the memory 502 by the processor 501.
The electronic device further comprises a power supply 503 for powering the various components, preferably the power supply 503 is logically connected to the processor 501 via a power management system, whereby the functions of managing charging, discharging, and power consumption are performed by the power management system. The power supply 503 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The electronic device may further comprise an input unit 504, which input unit 504 may be used for receiving input digital or character information and for generating keyboard, mouse, joystick, optical or trackball signal inputs in connection with user settings and function control.
Although not shown, the electronic device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 501 in the electronic device loads executable files corresponding to the processes of one or more computer programs into the memory 502 according to the following instructions, and the processor 501 executes the computer programs stored in the memory 502, so as to implement the functions in the foregoing embodiments of the present application, where the processor 501 may perform the following steps:
acquiring hot spot information of at least two scanned hot spots; detecting according to the hot spot information to obtain a double-frequency hot spot belonging to the same router, wherein the double-frequency hot spot comprises a first hot spot and a second hot spot; if the connection between the local and the first hot spot is established and the hot spot switching condition is judged to be met, the connection between the local and the first hot spot is disconnected at a link layer, and the connection between the link layer and the second hot spot is established; and if the connection is established between the link layer and the second hot spot, completing the network connection with the second hot spot by detecting the network address reachability of the second hot spot.
In some embodiments of the present application, the completing the network connection with the second hotspot by performing network address reachability detection on the second hotspot includes: issuing a disconnection command to a wireless network processing layer through a framework layer, wherein the wireless network processing layer responds to the disconnection command to disconnect the connection with the first hot spot; issuing a connection command to the wireless network processing layer through the framework layer, wherein the wireless network processing layer responds to the connection command and establishes connection with the second hot spot; detecting the network address reachability of the second hot spot through the frame layer to obtain a detection result; and if the detection result is that the network address is reachable, determining that the network connection with the second hot spot is established.
In some embodiments of the present application, after the network address reachability detection is performed on the second hotspot by the framework layer, a detection result is obtained, the method further includes: if the detection result is that the network address is not reachable, carrying out a network address request through a preset network address allocation flow to obtain a hotspot address matched with the second hotspot; and establishing network layer connection with the second hot spot according to the hot spot address.
In some embodiments of the present application, after the issuing of the disconnect command to the wireless network processing layer by the framework layer, the method further includes: and setting a flag bit to the wireless network processing layer through the frame layer, wherein the flag bit is used for preventing the wireless network processing layer from executing corresponding user perception operation.
In some embodiments of the application, the hotspot information includes a hotspot identifier and a channel; the detecting according to the hotspot information, to obtain the dual-frequency hotspots belonging to the same router, includes: detecting the similarity of the hotspot identifiers of the scanned at least two hotspots to obtain a plurality of candidate hotspots with the similarity meeting a preset condition, wherein the plurality of candidate hotspots comprise the first hotspot; and selecting the hot spots which respectively belong to the preset double frequency bands with the channels of the first hot spot from the plurality of candidate hot spots to obtain the double frequency hot spots belonging to the same router.
In some embodiments of the application, the hotspot information comprises a user tag; the detecting according to the hotspot information, to obtain the dual-frequency hotspots belonging to the same router, includes: detecting user marks corresponding to the scanned at least two hot spots to obtain user marks belonging to the same double-frequency hot spot group; and taking the hotspots corresponding to the user marks belonging to the same double-frequency hotspot group as the double-frequency hotspots belonging to the same router.
In some embodiments of the present application, before the link layer disconnects from the first hotspot if the connection is locally established with the first hotspot and the hotspot switching condition is determined to be met, the method further includes: detecting whether connection information of the second hot spot is stored locally or not and whether the network quality of the second hot spot is higher than that of the first hot spot or not; and if yes, determining that the hot spot switching conditions are met.
It will be appreciated by those of ordinary skill in the art that all or part of the steps of the various methods of the above embodiments may be performed by a computer program, or by computer program control related hardware, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present application also provides a storage medium in which a computer program is stored, the computer program being capable of being loaded by a processor to perform the steps of any of the methods provided by the embodiments of the present application.
Wherein the storage medium may be a computer-readable storage medium, the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The steps of any one of the methods provided in the embodiments of the present application may be executed by the computer program stored in the storage medium, so that the beneficial effects that can be achieved by the methods provided in the embodiments of the present application may be achieved, which are detailed in the previous embodiments and are not described herein.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains.
It will be understood that the application is not limited to the embodiments which have been described above and shown in the drawings, but that various modifications and changes can be made without departing from the scope thereof.

Claims (10)

1. A network connection switching method, comprising:
acquiring hot spot information of at least two scanned hot spots;
Detecting according to the hot spot information to obtain a double-frequency hot spot belonging to the same router, wherein the double-frequency hot spot comprises a first hot spot and a second hot spot;
If the connection between the local and the first hot spot is established and the hot spot switching condition is judged to be met, the connection between the local and the first hot spot is disconnected at a link layer, and the connection between the link layer and the second hot spot is established;
And if the connection is established between the link layer and the second hot spot, completing the network connection with the second hot spot by detecting the network address reachability of the second hot spot.
2. The method of claim 1, wherein the completing the network connection with the second hotspot by network address reachability detection of the second hotspot comprises:
Issuing a disconnection command to a wireless network processing layer through a framework layer, wherein the wireless network processing layer responds to the disconnection command to disconnect the connection with the first hot spot;
issuing a connection command to the wireless network processing layer through the framework layer, wherein the wireless network processing layer responds to the connection command and establishes connection with the second hot spot;
Detecting the network address reachability of the second hot spot through the frame layer to obtain a detection result;
And if the detection result is that the network address is reachable, determining that the network connection with the second hot spot is established.
3. The method of claim 2, wherein after the network address reachability detection of the second hotspot by the framework layer, the method further comprises:
if the detection result is that the network address is not reachable, carrying out a network address request through a preset network address allocation flow to obtain a hotspot address matched with the second hotspot;
And establishing network layer connection with the second hot spot according to the hot spot address.
4. The method of claim 2, wherein after said issuing a disconnect command to the wireless network processing layer through the framework layer, the method further comprises:
and setting a flag bit to the wireless network processing layer through the frame layer, wherein the flag bit is used for preventing the wireless network processing layer from executing corresponding user perception operation.
5. The method of claim 1, wherein the hotspot information comprises a hotspot identifier and a channel; the detecting according to the hotspot information, to obtain the dual-frequency hotspots belonging to the same router, includes:
Detecting the similarity of the hotspot identifiers of the scanned at least two hotspots to obtain a plurality of candidate hotspots with the similarity meeting a preset condition, wherein the plurality of candidate hotspots comprise the first hotspot;
and selecting the hot spots which respectively belong to the preset double frequency bands with the channels of the first hot spot from the plurality of candidate hot spots to obtain the double frequency hot spots belonging to the same router.
6. The method of claim 1, wherein the hotspot information comprises a user tag; the detecting according to the hotspot information, to obtain the dual-frequency hotspots belonging to the same router, includes:
detecting user marks corresponding to the scanned at least two hot spots to obtain user marks belonging to the same double-frequency hot spot group;
And taking the hotspots corresponding to the user marks belonging to the same double-frequency hotspot group as the double-frequency hotspots belonging to the same router.
7. The method according to any one of claims 1 to 6, wherein, before the link layer disconnects from the first hotspot if a connection is established locally with the first hotspot and it is determined that a hotspot switching condition is met, the method further comprises:
detecting whether connection information of the second hot spot is stored locally or not and whether the network quality of the second hot spot is higher than that of the first hot spot or not;
and if yes, determining that the hot spot switching conditions are met.
8. A network connection switching apparatus, comprising:
the acquisition module is used for acquiring the hot spot information of the scanned at least two hot spots;
The detection module is used for detecting according to the hotspot information to obtain a double-frequency hotspot belonging to the same router, wherein the double-frequency hotspot comprises a first hotspot and a second hotspot;
The connection module is used for disconnecting the connection with the first hot spot at a link layer and establishing connection with the second hot spot at the link layer if the connection with the first hot spot is established locally and the hot spot switching condition is judged to be met;
And the detection module is used for completing network connection with the second hot spot by detecting the network address reachability of the second hot spot if the connection is established between the link layer and the second hot spot.
9. A storage medium having stored thereon a computer program which, when executed by a processor of a computer, causes the computer to perform the method of any of claims 1 to 7.
10. An electronic device, comprising: a memory storing a computer program; a processor reading a computer program stored in a memory to perform the method of any one of claims 1 to 7.
CN202410397588.2A 2024-04-02 2024-04-02 Network connection switching method and device, storage medium and electronic equipment Pending CN118382118A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410397588.2A CN118382118A (en) 2024-04-02 2024-04-02 Network connection switching method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410397588.2A CN118382118A (en) 2024-04-02 2024-04-02 Network connection switching method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN118382118A true CN118382118A (en) 2024-07-23

Family

ID=91907525

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410397588.2A Pending CN118382118A (en) 2024-04-02 2024-04-02 Network connection switching method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN118382118A (en)

Similar Documents

Publication Publication Date Title
EP3337245B1 (en) Method and apparatus for handling abnormality of network communication function and storage medium
US8433321B2 (en) Method and apparatus for intelligently reporting neighbor information to facilitate automatic neighbor relations
WO2012048556A1 (en) Method and mobile communication terminal for accelerating cell search
CN113242580A (en) Cell residence method, terminal and storage medium
KR20090130981A (en) Apparatus and method for operating dual mode of mobile communication terminal
JP4296407B2 (en) Cellular network acquisition method
CN111417111A (en) Data processing method and network equipment
CN106488492A (en) The abnormal processing method and processing device of network communicating function
CN113746821B (en) Intelligent device control method and device, storage medium and electronic device
CN112533261A (en) Network switching method and device and electronic equipment
CN110677885A (en) Network switching method, device, storage medium and terminal
CN106851702A (en) The abnormal processing method and processing device of network communicating function
KR20200014986A (en) Electronic device and method for searching plmn in wireless communication system
CN111263434B (en) Network registration method, device, terminal and storage medium
US20240114563A1 (en) Network connection exception processing method, electronic device, and storage medium
KR20090117245A (en) Apparatus and method for cell selecting in a communication system
RU2758578C1 (en) Method and apparatus for controlling imaging apparatuses and electronic terminal using said method
CN107734496B (en) Network searching control method and device of mobile terminal and mobile terminal
CN113873606A (en) Method for terminal to autonomously return to network, terminal and storage medium
CN111065134B (en) Multi-card multi-4G mobile terminal and method for sharing 4G measuring capability thereof
CN111417104A (en) Data processing method, network equipment and terminal
CN114698000A (en) Network selection method, device, equipment and storage medium
CN118382118A (en) Network connection switching method and device, storage medium and electronic equipment
KR101676306B1 (en) Method and apparatus of cell searching in a wireless system
CN115134797B (en) Emergency service processing method, network side equipment and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination