Network switching method and device, electronic equipment and storage medium

By obtaining and reporting the attenuation score of the wireless network, weak network switching is achieved when roaming fails, solving the problem of network quality reduction in wireless roaming scenarios and ensuring the smoothness and stability of the network.

CN119233348APending Publication Date: 2024-12-31BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310791816.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-29
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

In wireless roaming scenarios, when the terminal device fails to roam online, it cannot switch weakly, resulting in a problem of degrading network quality and inability to access the Internet.

Method used

By obtaining the attenuation score of the wireless network currently connected to the terminal device, determining whether there is a second wireless network, and reporting the attenuation score when the roaming fails and the signal strength is less than the set threshold, weak network switching is achieved and network quality is ensured.

Benefits of technology

In the event of roaming failure, weak network switching can be performed to avoid network disconnection caused by poor network quality and ensure smooth and stable network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119233348A_ABST
    Figure CN119233348A_ABST
Patent Text Reader

Abstract

The invention provides a network switching method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining an attenuation score of a first wireless network currently accessed by terminal equipment, determining whether a second wireless network exists in an environment where the terminal equipment is currently located or not, enabling the second wireless network and the first wireless network to have the same service set identifier (SSID), and enabling the terminal equipment to access the second wireless network. If the second wireless network exists, monitoring a network roaming event that the terminal equipment roams from the first wireless network to the second wireless network, and if the monitored network roaming event is roaming failure and the signal strength of the first wireless network is smaller than a set threshold value, sending the roaming failure to the second wireless network within an effective duration corresponding to the network roaming event. And the attenuation score of the first wireless network is reported to the connection service of the terminal equipment, and the attenuation score is used for the connection service to perform weak network switching on the wireless network accessed by the terminal equipment, so that weak network switching can be performed under the condition of roaming failure, and the network quality is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of wireless communication technology, and in particular to a network switching method, device, electronic device and storage medium. Background Art

[0002] In a wireless roaming scenario, the terminal device will perform network roaming based on the quality of the WIFI network. If roaming fails, the terminal device will continue to connect to the original network. If the network quality is poor, the communication quality will be reduced. Summary of the invention

[0003] The present application aims to solve one of the technical problems in the related art at least to some extent.

[0004] To this end, the present application proposes a network switching method, device, electronic device and storage medium to achieve weak network switching in a wireless roaming network, in the event of roaming failure, to improve network quality, avoid network disconnection, and ensure network smoothness.

[0005] In one aspect, an embodiment of the present application provides a network switching method, including:

[0006] Obtaining an attenuation score of a first wireless network currently accessed by the terminal device;

[0007] Determine whether there is a second wireless network in the environment where the terminal device is currently located; wherein the second wireless network and the first wireless network have the same service set identifier SSID and different basic service set identifiers BSSID;

[0008] In response to the existence of the second wireless network, monitoring a network roaming event in which the terminal device roams from the first wireless network to the second wireless network;

[0009] In response to the monitored network roaming event being a roaming failure and the signal strength of the first wireless network being less than a set threshold, within the effective duration corresponding to the network roaming event, the attenuation score of the first wireless network is reported to the connection service of the terminal device; wherein the attenuation score is used by the connection service to perform a weak network switching on the wireless network to which the terminal device is connected.

[0010] Another aspect of the present application provides a network switching device, including:

[0011] An acquisition module, used to acquire an attenuation score of a first wireless network currently accessed by a terminal device;

[0012] A determination module, used to determine whether there is a second wireless network in the environment where the terminal device is currently located; wherein the second wireless network and the first wireless network have the same service set identifier SSID and different basic service set identifiers BSSID;

[0013] a monitoring module, configured to monitor, in response to the existence of the second wireless network, a network roaming event in which the terminal device roams from the first wireless network to a second wireless network;

[0014] A reporting module, used to respond to the monitored network roaming event being a roaming failure and the signal strength of the first wireless network being less than a set threshold, and to report the attenuation score of the first wireless network to the connection service of the terminal device within the effective duration corresponding to the network roaming event; wherein the attenuation score is used by the connection service to perform a weak network switching on the wireless network to which the terminal device is connected.

[0015] Another aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the above aspect is implemented.

[0016] Another aspect of the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method described in the aforementioned aspect is implemented.

[0017] Another aspect of the present application provides a computer program product on which a computer program is stored. When the program is executed by a processor, the method described in the above aspect is implemented.

[0018] The network switching method, device, electronic device and storage medium proposed in the present application obtain the attenuation score of the first wireless network currently accessed by the terminal device, determine whether there is a second wireless network in the current environment of the terminal device, wherein the service set identifier SSID of the second wireless network and the first wireless network are the same, and the basic service set identifier BSSID is different, in response to the existence of the second wireless network, monitor the network roaming event of the terminal device roaming from the first wireless network to the second wireless network, in response to the monitored network roaming event being a roaming failure, and the signal strength of the first wireless network is less than a set threshold, within the effective duration corresponding to the network roaming event, report the attenuation score of the first wireless network to the connection service of the terminal device, wherein the attenuation score is used for the connection service to perform weak network switching on the wireless network accessed by the terminal device, thereby realizing that in the event of roaming failure, weak network switching can be performed to ensure network quality.

[0019] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0021] Figure 1 A flowchart of a network switching method provided in an embodiment of the present application;

[0022] Figure 2 A flowchart of another network switching method provided in an embodiment of the present application;

[0023] Figure 3 A flowchart of another network switching method provided in an embodiment of the present application;

[0024] Figure 4 A flowchart of another network switching method provided in an embodiment of the present application;

[0025] Figure 5 A schematic diagram of the structure of a network switching device provided in an embodiment of the present application;

[0026] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0028] The network switching method, device, electronic device, and storage medium of the embodiments of the present application are described below with reference to the accompanying drawings.

[0029] In the related art, network quality detection is based on signal strength, for example, the received signal strength indication (RSSI), which switches to a network with good network quality when the network quality is poor. However, network roaming also relies on RSSI signals to perform network roaming, which makes weak network switching conflict with roaming scenarios. Therefore, in roaming scenarios, RSSI-based weak network switching is not performed, that is, in network roaming scenarios, weak network switching detection is not performed, so that in the case of network roaming failure, the quality of the access network is poor, resulting in a situation where the Internet cannot be accessed. In order to avoid this situation, the present application proposes a network switching method. In the case of network roaming failure, the attenuation score of the first wireless network currently accessed is reported, so that weak network switching can be performed to ensure network quality.

[0030] Figure 1 A flowchart of a network switching method provided in an embodiment of the present application.

[0031] The executor of the network switching method in the embodiment of the present application is a network switching device, which can be set in an electronic device. The electronic device can be a terminal device or a server. The terminal device is, for example, a smart phone, etc., which is not limited in this embodiment.

[0032] like Figure 1 As shown, the method may include the following steps:

[0033] Step 101: Obtain an attenuation score of a first wireless network to which a terminal device is currently connected.

[0034] In the embodiment of the present application, the attenuation score is determined based on the transmission failure rate of the foreground application running on the terminal device for data transmission, and can represent the data transmission quality of the network transmission layer. Among them, the higher the transmission failure rate, the higher the attenuation score. As an implementation method, the attenuation score is used to update the network score of the current first wireless network of the terminal device, and determine whether to switch the first wireless network currently connected to the terminal device to the second wireless network based on the updated network score, so as to switch the network in the case of poor network signal quality and ensure the smoothness of the network.

[0035] Step 102: Determine whether there is a second wireless network in the environment where the terminal device is currently located.

[0036] The second wireless network and the first wireless network have the same service set identifier (SSID) and different basic service set identifiers (BSSID). BSSID is unique identification information used to identify a wireless base station device, and is used in this application to identify different wireless networks, namely, the first wireless network and the second wireless network. The second wireless network can be one or more.

[0037] In an embodiment of the present application, it is determined whether there is a second wireless network in the environment where the terminal device is currently located. The second wireless network refers to a service set identifier SSID that is the same as the first wireless network, and a basic service set identifier BSSID that is different. That is to say, the first wireless network and the second wireless network belong to a roaming network area, that is, when the terminal device roams between the first wireless network and the second wireless network, it can roam between the first wireless network and the second wireless network without re-entering information.

[0038] Step 103: In response to the existence of the second wireless network, monitoring a network roaming event in which the terminal device switches from the first wireless network to the second wireless network.

[0039] In an embodiment of the present application, when a first wireless network and a second wireless network exist in the environment where the terminal device is currently located, the terminal device may roam, that is, roam from the first wireless network to the second wireless network, and report a roaming event, wherein the network roaming event includes roaming failure and roaming success. Roaming success means that the terminal device roams from the first wireless network to the second wireless network, and when there are multiple second wireless networks, it roams to one of the multiple second wireless networks. Roaming failure means that the terminal device has not roamed from the first wireless network to the second wireless network and is still connected to the first wireless network.

[0040] Step 104, in response to the monitored network roaming event being a roaming failure and the signal strength of the first wireless network being less than a set threshold, within the effective duration corresponding to the network roaming event, reporting the attenuation score of the first wireless network to the connection service of the terminal device.

[0041] As an implementation method, the signal strength of the first wireless network is Received Signal Strength Indication (RSSI), where RSSI is a received signal strength indication, which measures the distance between the signal point and the receiving point by the strength of the received signal, and is used to determine the connection quality, that is, to indicate the signal quality of the currently accessed first wireless network.

[0042] The attenuation score can represent the data transmission quality of the network transmission layer, and is used by the Connectivity Service (CS) to switch the wireless network accessed by the terminal device, such as switching to a weak network in a weak network situation to ensure network quality and avoid the situation where the page cannot be displayed due to poor network quality, that is, the inability to access the Internet. A weak network situation refers to poor network quality, such as an RSSI value less than a set threshold, and the set threshold is, for example, 75dB.

[0043] In the embodiment of the present application, in response to the monitored network roaming event being a roaming failure, that is, the current terminal device fails to roam from the first wireless network to the second wireless network, a roaming failure event (NO AP FOUND) will be reported, and the roaming failure event includes the cause of the roaming failure and the network interface (wlan interace) information. When the terminal device monitors that the network roaming event is a roaming failure, it obtains the current signal strength of the first wireless network. If the signal strength is less than the set threshold, for example, the set threshold is -75db, that is, the RSSI value is less than -75db, it is considered that the current network environment is weak, and the attenuation score of the first wireless network is reported to the connection service of the terminal device within the effective duration of the reported roaming failure. Among them, the connection service obtains the network score of the first wireless network, and the network score is determined based on the signal strength RSSI value and RSSI change rate of the first wireless network. Then, the network score of the first wireless network is subtracted from the corresponding attenuation score to obtain an updated network score, and the wireless network to be accessed by the terminal device is updated according to the updated network score. Among them, in one scenario, there are multiple second wireless networks, and the network scores of multiple second wireless networks are obtained, and at least one third wireless network with a higher network score than the updated network score of the first wireless network is selected from the network scores of the multiple second wireless networks, and the terminal device is switched from the first wireless network to any third wireless network to achieve weak network switching. In another scenario, the signal strength of the first wireless network is less than the set threshold, indicating that the first wireless network is a weak network, that is, the network quality is poor, and there is only one second wireless network, and the updated network score of the first wireless network is lower than the network score of the second wireless network, then the terminal device switches to the second wireless network to achieve weak network switching.

[0044] It should be noted that the terminal device will periodically perform roaming switching in the roaming scenario, so the reported roaming events have an effective duration, for example, the effective duration is 10 seconds. After the effective duration, the roaming event may change. Therefore, it is necessary to report the attenuation score of the first wireless network within the effective duration, so as to determine whether it is a weak network scenario in the event of roaming failure, and perform network switching in a weak network scenario to ensure network quality.

[0045] In the network switching method of the embodiment of the present application, an attenuation score of a first wireless network currently accessed by a terminal device is obtained, and it is determined whether a second wireless network exists in the environment currently located by the terminal device, wherein the second wireless network and the first wireless network have the same service set identifier SSID and different basic service set identifiers BSSIDs. In response to the existence of a second wireless network, a network roaming event of the terminal device roaming from the first wireless network to the second wireless network is monitored. In response to the monitored network roaming event being a roaming failure and the signal strength of the first wireless network being less than a set threshold, within the effective duration corresponding to the network roaming event, the attenuation score of the first wireless network is reported to the connection service of the terminal device, wherein the attenuation score is used for the connection service to perform a weak network switching on the wireless network accessed by the terminal device, thereby achieving a weak network switching in the event of a roaming failure, thereby ensuring network quality.

[0046] Based on the above embodiments, Figure 2 A flowchart of another network switching method provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the method comprises the following steps:

[0047] Step 201: Obtain an attenuation score of a first wireless network to which a terminal device is currently connected.

[0048] For details, please refer to the explanations in the aforementioned embodiments. The principles are the same and will not be repeated here.

[0049] Step 202: Detect the SSID and BSSID of the wireless network in the current environment.

[0050] Step 203: In response to detecting a target wireless network having the same SSID as the first wireless network but a different BSSID, it is determined that a second wireless network exists in the current environment.

[0051] In an embodiment of the present application, the SSID and BSSID of the wireless network in the current environment of the terminal device are detected, and the SSID and BSSID of the first wireless network are compared with other wireless networks respectively to determine whether there is a second wireless network with the same SSID and a different BSSID as the first wireless network.

[0052] Among them, the description of SSID and BSSID can refer to the explanation in the aforementioned embodiment, the principle is the same and will not be repeated here.

[0053] Step 204: In response to the existence of the second wireless network, monitor a network roaming event in which the terminal device roams from the first wireless network to the second wireless network.

[0054] Step 205, in response to the monitored network roaming event being a roaming failure and the signal strength of the first wireless network being less than a set threshold, within the effective duration corresponding to the network roaming event, reporting the attenuation score of the first wireless network to the connection service of the terminal device.

[0055] Among them, step 204 and step 205 can refer to the explanation in the above-mentioned embodiment, and the principles are the same, which will not be repeated here.

[0056] Step 206: In response to the monitored network roaming event being a roaming success, or the network roaming event being a roaming failure, and the signal strength of the first wireless network being greater than or equal to a set threshold, prohibiting reporting the attenuation score of the first wireless network to the connection service.

[0057] In one scenario of an embodiment of the present application, in response to a monitored network switching event being a successful switch, that is, the terminal device roams from a first wireless network to a second wireless network, the attenuation score of the first wireless network is not reported to the connection service, that is, it is prohibited to report the attenuation score of the first wireless network to the connection service.

[0058] In the second scenario of the embodiment of the present application, in response to the network roaming event being a roaming failure and the signal strength of the first wireless network being greater than or equal to a set threshold, it is prohibited to report the attenuation score of the first wireless network to the connection service. This is because although the roaming fails, the first wireless network is not a weak network environment and no network switching is required. The first wireless network can continue to be accessed, thereby avoiding unnecessary network switching and reducing power consumption losses caused by network switching.

[0059] In the network switching method of the embodiment of the present application, in response to the monitored network switching event being a successful roaming, or the network roaming event being a failed roaming, and the signal strength of the first wireless network being greater than or equal to a set threshold, it is prohibited to report the attenuation score of the first wireless network to the connection service. However, when the network roaming event is a successful roaming, and the signal strength of the first wireless network is less than the set threshold, the attenuation score of the first wireless network is reported to the connection service, thereby achieving weak network switching in a roaming scenario, ensuring connection to a wireless network with higher signal quality, and ensuring network quality.

[0060] Based on the above embodiments, the present application provides another network switching method. Figure 3 A flowchart of another network switching method provided in an embodiment of the present application is shown as follows: Figure 3 As shown, the method comprises the following steps:

[0061] Step 301: Obtain an attenuation score of a first wireless network to which a terminal device is currently connected.

[0062] Step 302: Detect the SSID and BSSID of the wireless network in the current environment.

[0063] Step 303: In response to detecting a target wireless network having the same SSID as the first wireless network but a different BSSID, it is determined that a second wireless network exists in the current environment.

[0064] Step 304: monitor a network roaming event in which the terminal device roams from the first wireless network to the second wireless network.

[0065] Step 305, in response to the monitored network roaming event being a roaming failure and the signal strength of the first wireless network being less than a set threshold, within the effective duration corresponding to the network roaming event, reporting the attenuation score of the first wireless network to the connection service of the terminal device.

[0066] Step 306: In response to the monitored network switching event being a roaming success, or the network roaming event being a roaming failure and the signal strength of the first wireless network being greater than or equal to a set threshold, prohibiting reporting of the attenuation score of the first wireless network to the connection service.

[0067] Among them, steps 301 to 306 can refer to the explanations in the aforementioned embodiments, and the principles are the same, so they will not be repeated here.

[0068] Step 307: In response to not detecting a target wireless network having the same SSID as the first wireless network and a different BSSID, determining that no second wireless network exists in the current environment.

[0069] Step 308: Report the attenuation score of the first wireless network to the connection service.

[0070] In an embodiment of the present application, in response to not detecting a target wireless network with the same SSID as the first wireless network and a different BSSID, it is determined that there is no second wireless network in the current environment, that is, the terminal device does not perform network roaming, then the attenuation score of the first wireless network is reported to the connection service, so that the connection service performs weak network switching of the terminal device according to the attenuation score to ensure network quality.

[0071] In the network switching method of the embodiment of the present application, in the scenario of network roaming, in the case of roaming failure, by reporting the attenuation score of the first network, the signal quality detection of the first wireless network accessed by the terminal device is realized, so as to perform weak network switching and ensure network quality. In response to not detecting a target wireless network with the same SSID as the first wireless network and a different BSSID, it is determined that there is no second wireless network in the current environment, that is, the terminal device does not perform network roaming, and then the attenuation score of the first wireless network is reported to the connection service, so that the connection service performs weak network switching of the terminal device according to the attenuation score to ensure network quality.

[0072] Based on the above embodiments, the present application provides another network switching method. Figure 4 A flowchart of another network switching method provided in an embodiment of the present application is shown as follows: Figure 4 As shown, the following steps are included before step 101:

[0073] Step 401, obtaining transmission control protocol connection information of a terminal device.

[0074] The transmission control protocol, for example, is Transmission Control Protocol (TCP), and the connection information is TCP parameter information.

[0075] Step 402: Determine the transmission failure rate of data transmission performed by the foreground application running on the terminal device according to the transmission control protocol connection information.

[0076] Among them, foreground applications include news applications, instant messaging applications, video live broadcast applications, etc., which are not listed here one by one.

[0077] An implementation method of an embodiment of the present application obtains parameter information of transmission control protocol connection information, wherein the parameter information includes the number of retransmitted data packets, the number of lost data packets, the number of unacknowledged data packets and the total number of transmitted data packets within a set time length, and determines the transmission failure rate based on the parameter information. Specifically, the transmission failure rate is determined by dividing the sum of the number of retransmitted data packets, the number of lost data packets, and the number of unacknowledged data packets within the set time length by the sum of the number of retransmitted data packets and the total number of transmitted data packets within the set time length.

[0078] Step 403: Determine the attenuation score of the first wireless network according to the transmission failure rate.

[0079] In the embodiment of the present application, the fading score of the first wireless network is determined according to the transmission failure rate, and the fading score can represent the data transmission quality of the network transmission layer. The transmission layer is the data transmission between the wireless access point and the wireless network. Through the transmission layer, it can directly reflect whether the foreground application running on the terminal is stuck.

[0080] In the network switching method of the embodiment of the present application, the attenuation score of the first wireless network can be determined according to the transmission failure rate, that is, the data packet transmission situation of the transmission layer is obtained, and then the actual network status of the foreground application running on the terminal device is perceived, so that in the event of network roaming failure, the network can be switched based on the attenuation score, thereby ensuring the network quality and improving the user experience of using the network. In the weak signal roaming scenario, the network switching sensitivity of the application using TCP connection is improved, and the network can be switched in time when roaming fails, thereby ensuring the network quality.

[0081] In order to implement the above embodiment, the embodiment of the present application also proposes a network switching device.

[0082] Figure 5 A schematic diagram of the structure of a network switching device provided in an embodiment of the present application.

[0083] like Figure 5 As shown, the device may include:

[0084] The acquisition module 51 is used to acquire the attenuation score of the first wireless network currently accessed by the terminal device.

[0085] The determination module 52 is used to determine whether there is a second wireless network in the current environment of the terminal device; wherein the second wireless network and the first wireless network have the same service set identifier SSID and different basic service set identifiers BSSID.

[0086] The monitoring module 53 is configured to monitor a network roaming event in which the terminal device roams from the first wireless network to a second wireless network in response to the existence of the second wireless network.

[0087] A reporting module 54 is used to respond to a monitored network roaming event being a roaming failure and the signal strength of the first wireless network being less than a set threshold, and to report the attenuation score of the first wireless network to the connection service of the terminal device within the effective duration corresponding to the network roaming event; wherein the attenuation score is used by the connection service to perform a weak network switching on the wireless network to which the terminal device is connected.

[0088] Further, in an implementation of the embodiment of the present application, the determination module 52 is specifically configured to:

[0089] Detecting the SSID and BSSID of a wireless network in a current environment; and in response to detecting a target wireless network having the same SSID as the first wireless network and a different BSSID, determining that the second wireless network exists in the current environment.

[0090] In an implementation of the embodiment of the present application, the determination module 52 is further configured to determine that the second wireless network does not exist in the current environment in response to not detecting a target wireless network having the same SSID as the first wireless network and a different BSSID.

[0091] The reporting module 54 is further configured to report the attenuation score of the first wireless network to a connection service in response to the absence of the second wireless network.

[0092] In one implementation of the embodiment of the present application, the device further includes:

[0093] The prohibition module is used to prohibit reporting the attenuation score of the first wireless network to the connection service in response to the monitored network roaming event being a roaming success, or the network roaming event being a roaming failure, and the signal strength of the first wireless network is greater than or equal to a set threshold.

[0094] In one implementation of the embodiment of the present application, the determination module 52 is further configured to:

[0095] Acquire transmission control protocol connection information of the terminal device;

[0096] Determining, according to the transmission control protocol connection information, a transmission failure rate of data transmission performed by a foreground application running on the terminal device;

[0097] An attenuation score of the first wireless network is determined according to the transmission failure rate.

[0098] In one implementation of the embodiment of the present application, the determination module 52 is further configured to:

[0099] Acquire parameter information of the transmission control protocol connection information; wherein the parameter information includes the number of retransmitted data packets, the number of lost data packets and the total number of transmitted data packets within a set time period;

[0100] The transmission failure rate is determined according to the parameter information.

[0101] It should be noted that the above explanation of the method embodiment is also applicable to the device of this embodiment, and will not be repeated here.

[0102] In the network switching device of the embodiment of the present application, an attenuation score of a first wireless network currently accessed by a terminal device is obtained, and it is determined whether a second wireless network exists in the environment currently located by the terminal device, wherein the second wireless network and the first wireless network have the same service set identifier SSID and different basic service set identifiers BSSIDs. In response to the existence of a second wireless network, a network roaming event of the terminal device roaming from the first wireless network to the second wireless network is monitored. In response to the monitored network roaming event being a roaming failure and the signal strength of the first wireless network being less than a set threshold, within the effective duration corresponding to the network roaming event, the attenuation score of the first wireless network is reported to the connection service of the terminal device, wherein the attenuation score is used for the connection service to perform a weak network switching on the wireless network accessed by the terminal device, thereby achieving a weak network switching in the event of a roaming failure to ensure network quality.

[0103] In order to implement the above embodiments, the present application also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the above method embodiments is implemented.

[0104] In order to implement the above embodiments, the present application also proposes a non-temporary computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method described in the above method embodiments is implemented.

[0105] In order to implement the above embodiments, the present application also proposes a computer program product on which a computer program is stored. When the computer program is executed by a processor, the method described in the above method embodiments is implemented.

[0106] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a message transceiver device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0107] Reference Figure 6 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0108] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0109] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0110] The power component 806 provides power to the various components of the electronic device 800. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.

[0111] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0112] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0113] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0114] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0115] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0116] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0117] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0118] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0119] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0120] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0121] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0122] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0123] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0124] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0125] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A network switching method, characterized in that: include: Obtaining an attenuation score of a first wireless network currently accessed by the terminal device; Determine whether there is a second wireless network in the environment where the terminal device is currently located; wherein the second wireless network and the first wireless network have the same service set identifier SSID and different basic service set identifiers BSSID; In response to the existence of the second wireless network, monitoring a network roaming event in which the terminal device roams from the first wireless network to the second wireless network; In response to the monitored network roaming event being a roaming failure and the signal strength of the first wireless network being less than a set threshold, within the effective duration corresponding to the network roaming event, the attenuation score of the first wireless network is reported to the connection service of the terminal device; wherein the attenuation score is used by the connection service to perform a weak network switching on the wireless network to which the terminal device is connected.

2. The method according to claim 1, characterized in that The determining whether a second wireless network exists in the environment where the terminal device is currently located includes: Detect the SSID and BSSID of the wireless network in the current environment; In response to detecting a target wireless network having the same SSID as the first wireless network and a different BSSID, it is determined that the second wireless network exists in the current environment.

3. The method according to claim 2, characterized in that The method further comprises: In response to not detecting a target wireless network having the same SSID as the first wireless network and a different BSSID, determining that the second wireless network does not exist in the current environment; Reporting the attenuation score of the first wireless network to a connection service.

4. The method according to claim 1, characterized in that The method further comprises: In response to the monitored network roaming event being a roaming success, or the network roaming event being a roaming failure, and the signal strength of the first wireless network is greater than or equal to the set threshold, prohibiting reporting the attenuation score of the first wireless network to the connection service.

5. The method according to claim 1, characterized in that Before obtaining the attenuation score of the first wireless network currently accessed by the terminal device, the method further includes: Acquire transmission control protocol connection information of the terminal device; Determining, according to the transmission control protocol connection information, a transmission failure rate of data transmission performed by a foreground application running on the terminal device; An attenuation score of the first wireless network is determined according to the transmission failure rate.

6. The method according to claim 5, characterized in that The determining, according to the transmission control protocol connection information, a transmission failure rate of data transmission performed by a foreground application running on the terminal device includes: Acquire parameter information of the transmission control protocol connection information; wherein the parameter information includes the number of retransmitted data packets, the number of lost data packets and the total number of transmitted data packets within a set time period; The transmission failure rate is determined according to the parameter information.

7. A network switching device, characterized in that: include: An acquisition module, used to acquire an attenuation score of a first wireless network currently accessed by a terminal device; A determination module, used to determine whether there is a second wireless network in the environment where the terminal device is currently located; wherein the second wireless network and the first wireless network have the same service set identifier SSID and different basic service set identifiers BSSID; a monitoring module, configured to monitor, in response to the existence of the second wireless network, a network roaming event in which the terminal device roams from the first wireless network to a second wireless network; A reporting module, used to respond to the monitored network roaming event being a roaming failure and the signal strength of the first wireless network being less than a set threshold, and to report the attenuation score of the first wireless network to the connection service of the terminal device within the effective duration corresponding to the network roaming event; wherein the attenuation score is used by the connection service to perform a weak network switching on the wireless network to which the terminal device is connected.

8. The device according to claim 7, characterized in that The determination module is specifically used for: Detect the SSID and BSSID of the wireless network in the current environment; In response to detecting a target wireless network having the same SSID as the first wireless network and a different BSSID, it is determined that the second wireless network exists in the current environment.

9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 6 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.