Network connection method, device, storage medium and electronic device

By obtaining the current location information on the smartphone and matching it with the location network database, the appropriate network connection signal type is determined, and the cost consumption and network lag problems during switching between the wireless data network and the mobile data network are solved, and the user's normal network experience is achieved.

CN113709665BActive Publication Date: 2025-04-25GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111003381.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-30
Publication Date
2025-04-25
Estimated Expiration
2041-08-30

AI Technical Summary

Technical Problem

The automatic switching method of existing smartphones between wireless data networks and mobile data networks has problems of unnecessary consumption of user fees and network lag.

Method used

By obtaining the current location information of the electronic device, matching it with the location network database, and determining the appropriate network connection signal type based on the matching result, thereby performing network connection or switching.

Benefits of technology

It effectively avoids the cost consumption caused by users due to connecting to mobile data networks, and realizes continuous communication needs in different network signal environments, ensuring the normal network experience of users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113709665B_ABST
    Figure CN113709665B_ABST
Patent Text Reader

Abstract

The present application discloses a network connection method, device, storage medium and electronic device, the method comprising obtaining the current location information of the electronic device, matching the current location information with a location network database to obtain a matching result, the location network database comprising multiple location information and network identification information corresponding to each of the multiple location information; and connecting the electronic device to the network according to the matching result. The present application facilitates the user to match the current location information of the electronic device with a location network database comprising multiple location information and corresponding network identification information during the use of the electronic device, determine the current network identification type of the electronic device and connect to the network, which can not only avoid the user's cost consumption caused by connecting to a mobile data network, but also realize the continuous communication needs of the electronic device in different network signal environments, thereby ensuring the user's normal network experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Existing smartphones usually have two ways of automatically switching between wireless data networks (WIFI) and mobile data networks. One is based on the full network aggregation acceleration technology (Link Turbo), which uses wireless data networks and mobile data networks concurrently on electronic devices, giving users an ultimate communication experience with aggregated high network speed, stable and low latency; the other is based on the intelligent switching solution between wireless data networks and mobile data networks (RF / WIFI intelligent switching), which automatically switches to the mobile data network when the electronic device has a poor connection to the wireless data network, ensuring uninterrupted data connection.

[0003] However, during the network switching process of the above two methods, the former will still use the mobile data network to consume traffic when the quality of the wireless data network is good, thereby resulting in consumption of user fees; the latter will not be able to automatically switch to the mobile data network when the quality of the wireless data network is poor but sustainable communication is possible, thereby causing lag. Both methods affect the user's network experience. Summary of the invention

[0004] Embodiments of the present application provide a network connection method, device, storage medium, and electronic device, which can determine the type of network connection signal connected according to the location information of the electronic device to avoid affecting the user's network experience.

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

[0006] Obtaining current location information of the electronic device;

[0007] Matching the current location information with a location network database to obtain a matching result, wherein the location network database includes a plurality of location information and network identification information corresponding to each of the plurality of location information; and

[0008] The electronic device is connected to the network according to the matching result.

[0009] In a second aspect, an embodiment of the present application provides a network connection device, including:

[0010] A first acquisition module, used to acquire current location information of the electronic device;

[0011] A first processing module is used to match the current location information with a location network database to obtain a matching result, wherein the location network database includes a plurality of location information and network identification information corresponding to each of the plurality of location information;

[0012] The connection module is used to connect the electronic device to the network according to the matching result.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory;

[0014] The processor is connected to the memory;

[0015] A memory for storing executable program codes;

[0016] The processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the network connection method provided by the first aspect of the embodiment of the present application or any one of the implementations of the first aspect.

[0017] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, they can implement the network connection method provided by the first aspect of the embodiment of the present application or any one of the implementation methods of the first aspect.

[0018] In an embodiment of the present application, by acquiring the current location information of the electronic device, matching the current location information with the location network database, obtaining a matching result, and connecting the electronic device to the network according to the matching result. The present application facilitates the user to match the current location information of the electronic device with the location network database including multiple location information and corresponding network identification information during the use of the electronic device, determine the current network identification type according to the matching result, and connect or switch the network, which can not only avoid the cost consumption caused by the user connecting to the mobile data network, but also realize the continuous communication needs of the electronic device in different network signal environments, thereby ensuring the normal network experience of the user. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A schematic diagram of the architecture of a network connection system provided in an embodiment of the present application;

[0021] Figure 2 A schematic diagram showing a path of an electronic device provided in an embodiment of the present application;

[0022] Figure 3 A schematic diagram of a marking effect of position information provided in an embodiment of the present application;

[0023] Figure 4 A flowchart of a network connection method provided in an embodiment of the present application;

[0024] Figure 5 A schematic diagram of a construction process of a location network database provided in an embodiment of the present application;

[0025] Figure 6 A schematic diagram of the structure of a location network database provided in an embodiment of the present application;

[0026] Figure 7 A schematic diagram of the structure of another location network database provided in an embodiment of the present application;

[0027] Figure 8 A flowchart of another network connection method provided in an embodiment of the present application;

[0028] Fig. 9 A flowchart of another network connection method provided in an embodiment of the present application;

[0029] Fig.10 A diagram showing the network connection effect of an electronic device provided in an embodiment of the present application

[0030] Fig.11 A schematic diagram of the structure of a network connection device provided in an embodiment of the present application;

[0031] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0033] The terms "first", "second", "third", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0034] See also Figure 1 , Figure 1 A schematic diagram of the architecture of a network connection system provided in an embodiment of the present application is shown.

[0035] like Figure 1 As shown, the network connection system may include at least an electronic device 101, a backend server 102, and a network access site 103, wherein:

[0036] The electronic device 101 may include an electronic device 101 of the same device type with an Android system or multiple electronic devices 101 of different device types, and an application for obtaining current location information is installed on the electronic device 101. Possibly, the electronic device 101 can obtain the current location information in real time through the positioning software that comes with the system. For example, the current location information of the electronic device can be obtained by the positioning software using the global navigation satellite system at preset time intervals. The current location information can be, but is not limited to, expressed as "xx street, xx district, xx city, xx province" and the like. Possibly, the electronic device 101 can also obtain the current location information in real time through a downloaded third-party application. For example, the user can first download and install a third-party application with positioning and navigation functions (which can be, but is not limited to, Baidu Maps, Tencent Maps, etc.) in the application store of the electronic device, and obtain the current location information of the electronic device through the third-party application. Similarly, the current location information can be, but is not limited to, expressed as "xx street, xx district, xx city, xx province" and the like.

[0037] It is understandable that the application for obtaining location information installed on the electronic device 101 can also record all path information of the user in the process of using the electronic device, and integrate all the path information to obtain the user's frequently used location information. Figure 2 The schematic diagram of a path display of an electronic device provided by the present application is shown as follows: Figure 2As shown, the path display diagram may include three paths, which can be represented as path one including position A to position B to position C to position D, path two including position A to position C to position E to position F to position G, and path three including position B to position E to position H to position I to position G, wherein the combination of path one and path two can obtain the commonly used location information of the electronic device including position A and position C, the combination of path two and path three can obtain the commonly used location information of the electronic device including position E and position G, the combination of path one and path three can obtain the commonly used location information of the electronic device including position B, and then the commonly used location information of the electronic device including position A, position B, position C, position E and position G can be obtained by integration. It is easy to understand that the method for determining the commonly used location information of the electronic device here can be to determine the historical access times of different location information, and take the location information with a historical access time greater than or equal to twice as the commonly used location information, and the present application is not limited to this method.

[0038] After the electronic device 101 obtains the current location information according to the application for obtaining location information, it can match the current location information with the location network database, determine the network identification information according to the matching result between the current location information and the location network database, and make a network connection with the network corresponding to the network identification information in the network access site 103. The location network database may include multiple location information and network identification information corresponding to each of the multiple location information. Here, the location network database can be obtained by the electronic device 101 from the background server 102, and the background server 102 can obtain multiple location information and network identification information corresponding to each of the multiple location information within a preset range, write the multiple location information and all the acquired partial network identification information corresponding to each of the multiple location information into the location network database according to the network quality of the network identification information corresponding to each of the multiple location information, and the electronic device 101 can send a request to download the location network database to the background server 102, so that the background server 102 sends the location network database to the electronic device 101 in response to the download request. It can be understood that in this embodiment, the preset range can be a range including multiple location information commonly used by the user of the electronic device 101.

[0039] Here, the network identification information in the location network database includes the media access control address (MAC address) of the network that can establish a connection with the corresponding location information, wherein the type of the network may include a first network and a second network, for example but not limited to the first network being a wireless local area network and the second network being a cellular network, that is, it can be understood that the network identification information includes the MAC address of the wireless local area network that can establish a connection with the corresponding location information and the MAC address of the cellular network. After the electronic device 101 matches the location network database according to the current location information to obtain a matching result, a fast network connection can be made according to the MAC address of the wireless local area network or the MAC address of the cellular network provided in the matching result.

[0040] It should be noted that the network quality corresponding to the MAC address of the wireless local area network that can establish a connection with the corresponding location information included in the network identification information and the network quality corresponding to the MAC address of the cellular network both meet the preset conditions, for example but not limited to the network quality corresponding to the MAC address of the wireless local area network needs to meet the first preset condition, the network quality corresponding to the MAC address of the cellular network needs to meet the second preset condition, and the first preset condition and the second preset condition may be the same preset condition.

[0041] It is understandable that the present application can be but is not limited to the location network database being obtained by the electronic device 101 from the background server 102. For example, the location network database can also be generated by the electronic device 102 based on multiple location information frequently used by the user and the network identification information corresponding to the multiple location information frequently used by the user, so that the electronic device 101 can directly match the generated location network database with the current location information.

[0042] In addition, the electronic device 101 in the embodiment of the present application may be, but is not limited to, an electronic device with an Android system, and may also be an electronic device with other operating systems.

[0043] The electronic device 101 involved in the embodiment of the present application can be a smart phone, tablet computer, desktop, laptop, notebook computer, ultra-mobile personal computer (Ultra-mobile Personal Computer, UMPC), handheld computer, netbook, personal digital assistant (Personal Digital Assistant, PDA), virtual reality device, etc. installed with an Android system.

[0044] The backend server 102 may be used to obtain multiple location information and network identification information corresponding to each of the multiple location information within a preset range, and generate a location network database based on the multiple location information and the network identification information corresponding to each of the multiple location information, so that after the electronic device 101 obtains the current location information, the location network database is sent to the electronic device 101 according to the request for downloading the location network database sent by the electronic device 101. In the process of generating the location network database, the backend server 102 may first determine multiple location information within the preset range, which may be referred to herein. Figure 3 FIG. 1 is a schematic diagram showing a marking effect of a position information provided by an embodiment of the present application. Figure 3 As shown, the backend server 102 may first divide the preset range into 2*2 grids, which may be represented by region A, region B, region C, and region D, and mark the landmark location information included in each region, for example, region A may be marked with location A1, location A2, and location A3, region B may be marked with location B1, location B2, location B3, and location B4, region C may be marked with location C1, location C2, and location C3, and region D may be marked with location D1, location D2, and location D3. It is understandable that the landmark location here may be understood as a representative building, such as but not limited to large buildings such as schools, hospitals, hotels, and commercial office buildings, and may also be but not limited to small buildings such as xx noodle shops and xx non-staple food stores. It should be noted that the network identification information covered by each area divided by the preset range is different. For example, the network identification information corresponding to the above-mentioned area A may include MAC address A of the wireless local area network and MAC address A of the cellular network, the network identification information corresponding to area B may include MAC address B of the wireless local area network and MAC address B of the cellular network, and the network identification information corresponding to area C may include MAC address C of the wireless local area network and MAC address C of the cellular network, and the number of MAC addresses of the same network type corresponding to different areas may be one or more.

[0045] After determining multiple location information within a preset range, the backend server 102 may obtain network identification information corresponding to each of the multiple location information, correspond all or part of the network identification information whose network quality meets the preset conditions to the corresponding location information, and generate a location database in combination with the multiple location information and all or part of the network identification information whose network quality meets the preset conditions for the multiple location information. Among them, the backend server 102 may obtain the network identification information corresponding to each of the multiple location information by sending a request to obtain network identification information to other electronic devices in the location information, so as to determine the network identification information corresponding to the location information according to the network identification information connected to other electronic devices. Specifically, taking the location information as the area A mentioned above as an example, when the backend server 102 receives the MAC address Aa of the wireless local area network sent by an electronic device in area A, the MAC address Aa of the wireless local area network may be used as the network identification information corresponding to area A. It can be understood that the network identification information obtained by the backend server 102 may also include the signal strength and signal network speed corresponding to the MAC address of the wireless local area network that can establish a connection with the corresponding location information, and the signal strength and signal network speed corresponding to the MAC address of the cellular network.

[0046] The background server 102 involved in the embodiment of the present application is specifically but not limited to a hardware server, a virtual server, a cloud server, etc., and can also be a terminal, specifically but not limited to a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (Ultra-mobile Personal Computer, UMPC), a handheld computer, a netbook, a personal digital assistant (Personal Digital Assistant, PDA), a routing device, etc.

[0047] The network access site 103 may be a site for providing the electronic device 103 with the network identification information corresponding to it. For example, the site may be a routing device corresponding to one or more MAC addresses of a wireless local area network that can establish a connection with the corresponding location information, and may be a base station corresponding to one or more MAC addresses of a cellular network that can establish a connection with the corresponding location information. The type of base station corresponding to the site may include, but is not limited to, at least one of a 5G base station, a 4G base station, and a 3G base station.

[0048] It should be noted that the network access site 103 includes sites corresponding to all network identification information that can establish a connection with the location information, so that the electronic device 101 can establish a network connection through the determined network identification information provided by the network access site 103 after determining the network identification information according to the matching result.

[0049] It should also be noted that the network connection system architecture of the present application is not limited to the above-mentioned electronic device 101 as the execution subject of the network connection, for example, the backend server 102 can also be used as the execution subject of the network connection. Specifically, the backend server 102 can obtain the current location information from the electronic device 101, and match the current location information with the generated location network database to determine the network identification information connected to the electronic device 101, and send the network identification information to the electronic device 101, so that the electronic device 101 can connect to the network according to the network identification information.

[0050] The present application is further explained below with the execution subject of the network connection being an electronic device.

[0051] See also Figure 4 , Figure 4 A schematic diagram of a flow chart of a network connection method provided in an embodiment of the present application is shown.

[0052] like Figure 4 As shown, the network connection method includes the following steps:

[0053] Step 401: Obtain current location information of the electronic device.

[0054] Specifically, the electronic device can obtain the current location information in real time according to the application for obtaining location information. Possibly, the electronic device can obtain the location information in real time through the positioning software that comes with the system. For example, the positioning software can use the global navigation satellite system to obtain the current location information of the electronic device at preset time intervals. The current location information can be, but is not limited to, expressed as "xx street, xx district, xx city, xx province" and the like. Possibly, the electronic device can also obtain the location information in real time through a downloaded third-party application. For example, the user can first download and install a third-party application with positioning and navigation functions in the application store of the electronic device (which can be, but is not limited to, Baidu Maps, Tencent Maps, etc.), and obtain the current location information of the electronic device through the third-party application. Similarly, the current location information can be, but is not limited to, expressed as "xx street, xx district, xx city, xx province" and the like.

[0055] It is understandable that electronic devices are not limited to obtaining current location information through applications using positioning and navigation functions as mentioned above. For example, they can also use network location positioning technology (NLP) to obtain current location information through cloud servers and Bluetooth communications, which will not be elaborated here.

[0056] Step 402: Match the current location information with the location network database to obtain a matching result.

[0057] Specifically, after obtaining the current location information, the electronic device can match it with the location network database, which includes multiple location information and network identification information corresponding to each of the multiple location information. Among them, the location network database can be automatically generated by the electronic device, and can also be downloaded and obtained by the electronic device from the background server. Possibly, if the location network database is automatically generated by the electronic device, the electronic device can generate the location network database based on the user's frequently used location information and the network identification information of the network connection established at each frequently used location information. It should be noted that the electronic device can also obtain other types of network identification information of the network connection established by other electronic devices at the same location information from the background server based on the location information, so as to generate a more complete location network database.

[0058] Possibly, if the location network database is downloaded and obtained by the electronic device from the background server, the background server may obtain multiple location information including the location information commonly used by the electronic device within a preset range based on the location information commonly used by the electronic device, and generate the location network database based on the multiple location information and the network identification information of the network connection established in the multiple location information. It should be noted that the background server may obtain the network identification information of the network connection established in the same location information from different electronic devices based on the location information, so as to generate a more complete location network database.

[0059] Here, the step of the electronic device determining the location network database may be, but is not limited to, set before obtaining the current location information of the electronic device, set after obtaining the current location information of the electronic device, or performed synchronously with obtaining the current location information of the electronic device.

[0060] Step 403: Connect the electronic device to the network according to the matching result.

[0061] Specifically, after obtaining the matching result between the current location information and the location network database, the electronic device can determine the network identification information applicable to the current location according to the matching result, and establish a network connection with the network identification information.

[0062] Of course, the embodiments involved in the present application may not be limited to connecting electronic devices to a network. For example, it may also be possible to perform network switching on electronic devices to ensure smooth network communication requirements of electronic devices.

[0063] In an embodiment of the present application, the current location information of the electronic device can be matched with a location network database including multiple location information and their corresponding network identification information, the network identification information suitable for the current location of the electronic device can be determined and a network connection can be established, so as to realize the continuous communication needs of the electronic device in different network signal environments, thereby ensuring the user's normal network experience.

[0064] The network identification information included in the location network database mentioned in the above step 402 may include first network identification information and second network identification information, wherein the network types of the first network identification information and the second network identification information are different, for example but not limited to the network type corresponding to the first network identification information is a wireless local area network, and the network type corresponding to the second network identification information is a cellular network. It is understandable that the first network identification information may include one or more first network identifiers, which may correspond to MAC addresses of different wireless local area networks, and the network quality of each first network identifier in the location network database satisfies a first preset condition. Here, the first preset condition may be but is not limited to the network strength of the wireless local area network being greater than or equal to the first preset network strength threshold or the network speed of the wireless local area network being greater than or equal to the first preset network speed threshold.

[0065] Similarly, the second network identifier may include one or more second network identifiers, which may correspond to MAC addresses of different cellular networks, and the network quality of each second network identifier in the location network database satisfies the second preset condition. Here, the second preset condition may be, but is not limited to, the network strength of the cellular network is greater than or equal to the second preset network strength threshold or the network speed of the cellular network is greater than or equal to the second preset network speed threshold.

[0066] It should be noted that the above-mentioned first preset threshold value may also be equal to the second preset threshold value, for example, the first preset network strength threshold value is equal to the second preset network strength threshold value, and the first preset network speed threshold value is equal to the second preset network speed threshold value.

[0067] As an embodiment of the present application, please refer to Figure 5 A schematic diagram of a construction process of a location network database provided in an embodiment of the present application is shown.

[0068] like Figure 5 As shown, the construction process of the location network database specifically includes the following steps:

[0069] Step 501: Acquire first network identification information and second network identification information corresponding to location information.

[0070] Specifically, in the process of building a location network database, the electronic device can first record all path information of the user during the use of the electronic device according to the application used to obtain location information, and integrate all the path information to obtain the user's frequently used location information. The location information frequently used by the user here can refer to the above-mentioned method of determining the historical number of visits to different location information, and use the location information with a historical number of visits greater than or equal to two as the frequently used location information. Of course, the present application is not limited to this method.

[0071] After the electronic device determines multiple commonly used location information, it can respectively obtain the first network identification information and the second network identification information corresponding to each commonly used location information. Here, taking the first network identification information including one or more wireless local area network identifications as an example, the electronic device can obtain one or more wireless local area network identifications to which the electronic device has established a connection in each commonly used location information, and preferably, the electronic device can also obtain other wireless local area network identifications to which other electronic devices have established a connection in the same location information from the background server.

[0072] Similarly, taking the example of the second network identification information including one or more cellular network identifications, the electronic device can obtain one or more cellular network identifications to which the electronic device has established connections at each commonly used location information, and preferably, the electronic device can also obtain from the background server other cellular network identifications to which other electronic devices have established connections at the same location information.

[0073] It is understandable that the electronic device can also send multiple commonly used location information to the background server, and the background server will statistically obtain the first network identification information and the second network identification information corresponding to each commonly used location information, and send the first network identification information and the second network identification information corresponding to each commonly used location information back to the electronic device.

[0074] Step 502: If the network quality of the network corresponding to the first network identification information meets the third preset condition, the first network identification information and the corresponding location information corresponding to the network whose network quality meets the third preset condition are written into the location network database.

[0075] Specifically, if the electronic device detects that the network quality of all networks corresponding to the first network identifier corresponding to the location information meets the third preset condition, the first network identifiers corresponding to all networks and the location information can be written into the location network database. Here, taking the first network identifier information including one or more wireless local area network identifiers as an example, the location network database may include location information and all corresponding wireless local area network identifiers whose network quality meets the third preset condition, wherein the third preset condition can be understood as the network strength of the wireless local area network being greater than or equal to the third preset network strength threshold or the network speed of the wireless local area network being greater than or equal to the third preset network speed threshold.

[0076] It can be understood that the above-mentioned location network database can be used as a "white list" for electronic devices to connect to wireless networks. That is, when the current location of the electronic device successfully matches the location in the above-mentioned location network database, it indicates that the network quality of all wireless local area networks that can be connected to the current location of the electronic device is high. The electronic device can then connect to the network according to any wireless local area network identifier corresponding to the current location in the above-mentioned location network database to ensure normal communication of the connected network.

[0077] See here Figure 6 A schematic diagram of the structure of a location network database is shown.

[0078] like Figure 6 As shown, the location network database may include three location information of location A, location B and location C, as well as wireless local area network a1 and wireless local area network a2 corresponding to location A, wireless local area network b corresponding to location B, and wireless local area network c1 and wireless local area network c2 corresponding to location C. Among them, all wireless local area network identifiers corresponding to location A include wireless local area network a1 and wireless local area network a2, and the network qualities corresponding to wireless local area network a1 and wireless local area network a2 respectively meet the third preset condition. All wireless local area network identifiers corresponding to location B include wireless local area network b, and the network quality corresponding to wireless local area network b meets the third preset condition. All wireless local area network identifiers corresponding to location C include wireless local area network c1 and wireless local area network c2, and the network qualities corresponding to wireless local area network c1 and wireless local area network c2 respectively meet the third preset condition.

[0079] When the current location of the electronic device fails to match the location in the above-mentioned location network database, it indicates that there is a wireless local area network with poor network quality among all wireless local area networks that can be connected to the current location of the electronic device. To prevent the electronic device from accessing a wireless local area network with poor network quality, the electronic device can be connected to a cellular network.

[0080] Step 503: If the first network identification information corresponds to a network whose network quality does not meet the third preset condition, determine all or part of the second network identification information according to a preset rule.

[0081] Specifically, if the electronic device detects that there is a network whose network quality does not meet the third preset condition in the network corresponding to the first network identifier corresponding to the location information, it can determine all or part of the second network identification information according to the preset rules. Among them, taking the example that the first network identification information includes one or more wireless local area network identifiers and the second network identification information includes one or more cellular network identifiers, the third preset condition here can be understood as the network strength of the wireless local area network is greater than or equal to the third preset network strength threshold or the network speed of the wireless local area network is greater than or equal to the third preset network speed threshold, that is, when there is a wireless local area network whose network strength is less than the third preset network strength threshold or whose network speed is less than the third preset network speed threshold in one or more wireless local area networks corresponding to the location information, all cellular networks corresponding to the location information are determined, and all or part of the cellular networks in all cellular networks are determined according to the preset rules.

[0082] It can be understood that the preset rules in this embodiment may be:

[0083] Sort the second network identification information from high to low according to the network quality of the corresponding network;

[0084] The part of the second network identification information that is ranked first is used as all or part of the second network identification information.

[0085] Specifically, still taking the example that the second network identification information includes one or more cellular network identifications, after determining that there is a wireless local area network whose network strength is less than the third preset network strength threshold or whose network speed is less than the third preset network speed threshold in the one or more wireless local area networks corresponding to the location information, the one or more cellular networks corresponding to the location information obtained can be sorted from high to low according to network quality, wherein the network quality can be but is not limited to network strength or network speed, for example, the one or more cellular networks corresponding to the location information obtained can be sorted from high to low according to network strength. Furthermore, some of the cellular networks with high network quality rankings are used as one or more cellular networks corresponding to the location information in the location network database. It can be understood that the ranking here can be but is not limited to the first two rankings (if only one cellular network corresponding to the location information is obtained, then the cellular network can be directly used as the cellular network corresponding to the location information in the location network database).

[0086] Step 504: write the first network identification information, all or part of the second network identification information, and the corresponding location information corresponding to the network whose network quality does not meet the third preset condition into the location network database.

[0087] Specifically, after the electronic device determines all or part of the second network identification information corresponding to the location information, it can write the location information, the first network identification information corresponding to the network whose network quality corresponding to the location information does not meet the third preset condition, and all or part of the second network identification information corresponding to the location information into the location network database.

[0088] It can be understood that the location network database here can be used as a "blacklist" for electronic devices to connect to wireless networks, that is, when the current location of the electronic device successfully matches the location in the location network database, it indicates that there is a wireless local area network with poor network quality in the wireless local area network that can be connected to the current location of the electronic device, and the electronic device can connect to the network based on all or part of the cellular network identifiers corresponding to the current location in the location network database to ensure normal communication of the connected network. When the current location of the electronic device fails to match the location in the location network database, it indicates that the network quality of all wireless local area networks that can be connected to the current location of the electronic device is high, and the electronic device can connect to the wireless local area network corresponding to the current location.

[0089] It should be noted that the intelligent switching between the wireless local area network and the cellular network mentioned in the prior art will automatically connect to the wireless local area network when the network quality of the detected wireless local area network is poor but can still maintain communication at a low rate, and cannot switch to the cellular network. This method can easily affect the user's normal network experience. In step 503 and step 504, the location written into the location network database includes a wireless local area network with poor network quality, so that when the current location of the electronic device successfully matches the location in the location network database, all or part of the cellular network corresponding to the location is selected for connection to ensure the communication quality of the electronic device.

[0090] See here Figure 7 A schematic diagram of the structure of another location network database is shown.

[0091] like Figure 7As shown, the location network database may include three location information of location D, location E and location F, as well as wireless local area network d corresponding to location D, wireless local area network e corresponding to location E, wireless local area network f1 and wireless local area network f2 corresponding to location F, and cellular networks d1 and cellular network d2 corresponding to location D, cellular network e corresponding to location E, and cellular network f1 and cellular network f2 corresponding to location F. Among them, the network quality of wireless local area network d corresponding to location D does not meet the third preset condition, and the network quality of cellular network d1 and cellular network d2 in the cellular network corresponding to location D is ranked higher. The network quality of wireless local area network e corresponding to location E does not meet the third preset condition, and location E corresponds to a cellular network e. The network quality of wireless local area network f1 and wireless local area network f2 corresponding to location F does not meet the third preset condition, and the network quality of cellular network f1 and cellular network f2 in the cellular network corresponding to location F is ranked higher.

[0092] It can also be understood that step 504 can also directly write the location information and all or part of the second network identification information corresponding to the location information into the location network database, and this embodiment is not limited thereto.

[0093] In an embodiment of the present application, location information and corresponding network identification information that meets different needs can be written into a location network database, so that electronic devices can quickly determine reasonable network identification information based on the matching results between the current location and the location network database to ensure network communication quality and network connection efficiency.

[0094] It should also be noted that the electronic device can write the location information and the network identification information corresponding to the location information into the location network database in real time. For example, when the electronic device adds one or more commonly used location information, it can obtain the first network identification information and the second network identification information corresponding to the newly added one or more commonly used location information, determine the network identification information corresponding to the newly added commonly used location based on the judgment result of whether the network quality of the network corresponding to the first network identification information meets the third preset condition, and write the newly added commonly used location and the network identification information corresponding to the newly added commonly used location into the location network database.

[0095] As another embodiment of the present application, the location network database includes a plurality of location information and first network identification information corresponding to a network whose network quality corresponding to each of the plurality of location information satisfies a third preset condition, which can be referred to in Figure 8 A flowchart of another network connection method is shown.

[0096] like Figure 8 As shown, the network connection method at least includes the following steps:

[0097] Step 801: Obtain current location information of the electronic device.

[0098] Specifically, step 801 is consistent with step 401 and will not be repeated here.

[0099] Step 802: If the current location information successfully matches the location information in the location network database, the first network identification information corresponding to the network whose network quality corresponding to the successfully matched location information meets the third preset condition is used as the matching result.

[0100] Specifically, when the location network database includes multiple location information and first network identification information corresponding to a network whose network quality corresponding to each of the multiple location information meets the third preset condition, if the electronic device detects that the current location successfully matches the location in the location network database, it indicates that the network quality of the first network identification information corresponding to the current location is high, and the first network identification information corresponding to the current location in the location network database can be used as the matching result.

[0101] Taking the example that the first network identification information includes one or more wireless local area network identifications, if the electronic device detects that the current location successfully matches any location in the location network database, the one or more wireless local area network identifications corresponding to the successfully matched location can be used as the network matching result of the current location. It can be understood that, as a preference, the electronic device can use the wireless local area network identification with a higher network quality ranking among the one or more wireless local area network identifications corresponding to the successfully matched location as the network matching result of the current location.

[0102] Step 803: If the current location information fails to match the location information in the location network database, determine all or part of the second network identification information corresponding to the current location information according to a preset rule.

[0103] Specifically, when the location network database includes multiple location information and first network identification information corresponding to networks whose network quality corresponds to each of the multiple location information and meets the third preset condition, if the electronic device detects that the current location fails to match the location in the location network database, it indicates that there is a network with poor network quality in the first network identification information corresponding to the current location. In order to ensure the quality of network communication, all or part of the second network identification information can be filtered out in the second network identification information corresponding to the current location according to preset rules.

[0104] Here, taking the example that the first network identification information includes one or more wireless local area network identifications and the second network identification information includes one or more cellular network identifications, if the electronic device detects that the current location fails to match any location in the location network database, indicating that there is a wireless local area network with poor network quality in the wireless local area network corresponding to the current location, one or more cellular networks corresponding to the current location can be obtained, and the cellular network with the highest network quality ranked from high to low can be determined among the one or more cellular networks.

[0105] It can be understood here that, in the process of writing multiple location information and the first network identification information corresponding to the network whose network quality corresponding to each of the multiple location information meets the third preset condition into the location network database, the electronic device has already obtained the second network identification information corresponding to each of the multiple location information. Based on this, when the electronic device obtains the second network identification information corresponding to the current location, it can directly retrieve the obtained second network identification information corresponding to the current location. In addition, in order to ensure the real-time nature of the second network identification information, the electronic device can also obtain the second network identification information corresponding to the current location at a preset time interval and save the updated second network identification information.

[0106] Step 804: Use all or part of the second network identification information as a matching result.

[0107] Specifically, when the electronic device obtains only one second network identifier corresponding to the current location, the second network identifier can be directly used as the network matching result of the current location. When the electronic device obtains multiple second network identifiers corresponding to the current location, the second network identifier with the highest network quality in descending order can be selected as the network matching result of the current location, wherein the highest second network identifier can be but is not limited to the second network identifiers with the highest network quality in descending order.

[0108] Step 805: Connect the electronic device to the network according to the matching result.

[0109] Specifically, after obtaining the network matching result of the current location, the electronic device may connect to the network according to the network identification information determined in the matching result. Possibly, when the matching result is the first network identification information corresponding to the network whose network quality corresponding to the current location meets the third preset condition, the electronic device may select a first network identification by default from one or more first network identifications included in the first network identification information for connection, wherein the default method may be, but is not limited to, selecting the first network identification with the highest network quality or the most connections.

[0110] It is understandable that the electronic device can also display one or more first network identifiers included in the first network identifier information to the user. For example, a list of first network identifiers sorted from high to low in terms of network quality can be displayed on the current display interface. After the user selects any first network identifier in the first network identifier list, the electronic device can connect according to the selected first network identifier. Among them, the first network identifier list displayed by the electronic device can be the network names corresponding to one or more first network identifiers. For example, taking the first network identifier information including one or more wireless local area network identifiers, the wireless local area network list displayed by the electronic device can include one or more wireless local area network names sorted from high to low in terms of network quality to improve the user experience.

[0111] Possibly, when the matching result is all or part of the second network identification information, the electronic device may select a second network identification by default from one or more second network identifications included in the all or part of the second network identification information for connection, wherein the default method may be but is not limited to selecting the second network identification with the highest network quality or the most connections.

[0112] As another embodiment of the present application, the location network database includes multiple location information, first network identification information corresponding to the network whose network quality corresponding to each of the multiple location information does not meet the third preset condition, and all or part of the second network identification information, which can be referred to Fig. 9 A flowchart of another network connection method is shown.

[0113] like Fig. 9 As shown, the network connection method at least includes the following steps:

[0114] Step 901: Obtain current location information of the electronic device.

[0115] Specifically, step 901 is consistent with step 801 and step 401 and will not be repeated here.

[0116] Step 902: If the current location information successfully matches the location information in the location network database, all or part of the second network identification information corresponding to the successfully matched location information is used as a matching result.

[0117] Specifically, when the location network database includes multiple location information, first network identification information corresponding to networks whose network quality corresponding to each of the multiple location information does not meet the third preset condition, and all or part of the second network identification information, if the electronic device detects that the current location successfully matches the location in the location network database, it indicates that there is a network with poor network quality in the first network identification information corresponding to the current location, and all or part of the second network identification information corresponding to the successfully matched location information can be used as the matching result. Among them, all or part of the second network identification information can be screened out from the second network identification information corresponding to the current location according to the preset rules. The preset rules here can refer to the above description, and no further elaboration is given here.

[0118] Taking the example that the first network identification information includes one or more wireless local area network identifications and the second network identification information includes one or more cellular network identifications, the location network database includes multiple location information corresponding to wireless local area networks with poor network quality, wireless local area networks with poor network quality corresponding to each of the multiple location information, and all or part of the cellular networks corresponding to each of the multiple locations. If the electronic device detects that the current location successfully matches any location in the location network database, indicating that one or more wireless local area networks corresponding to the current location have a wireless local area network with poor network quality, all or part of the cellular network identifications corresponding to the successfully matched location can be used as the network matching result of the current location.

[0119] It is understandable that the location network database may also include multiple location information and all or part of the second network identification information, which not only reduces the data storage space of the location network database but also improves the data search efficiency.

[0120] Step 903: If the current location information fails to match the location information in the location network database, obtain first network identification information corresponding to a network whose network quality corresponding to the current location information meets a third preset condition.

[0121] Step 904: Take the first network identification information corresponding to the network whose network quality meets the third preset condition as a matching result.

[0122] Specifically, when the location network database includes multiple location information, first network identification information corresponding to a network whose network quality corresponding to each of the multiple location information does not meet a third preset condition, and all or part of the second network identification information, if the electronic device detects that the current location fails to match the location in the location network database, indicating that the network quality of the first network identification information corresponding to the current location is higher, the first network identification information corresponding to the current location can be obtained.

[0123] Here, taking the example that the first network identification information includes one or more wireless local area network identifications and the second network identification information includes one or more cellular network identifications, the location network database includes multiple location information corresponding to wireless local area networks with poor network quality, wireless local area networks with poor network quality corresponding to each of the multiple location information, and all or part of the cellular networks corresponding to each of the multiple locations. If the electronic device detects that the current location fails to match any location in the location network database, it can obtain one or more wireless local area networks corresponding to the current location, and use the one or more wireless local area networks as the network matching result for the current location.

[0124] It should be noted that, as a preference, when using one or more wireless local area networks as the network matching result for the current location, the first network identification information corresponding to the networks whose network quality meets the third preset condition can be sorted from high to low according to the network quality of the corresponding networks, and the first network identification information corresponding to some of the networks whose network quality meets the third preset condition and is ranked high can be used as the matching result to further ensure the quality of network communication.

[0125] It can be understood here that the electronic device has already obtained the first network identification information corresponding to each of the multiple location information in the process of writing the multiple location information, the first network identification information corresponding to the network whose network quality corresponding to each of the multiple location information does not meet the third preset condition, and all or part of the second network identification information into the location network database. Based on this, when the electronic device obtains the first network identification information corresponding to the current location, it can directly retrieve the first network identification information corresponding to the current location that has been obtained. In addition, in order to ensure the real-time nature of the first network identification information, the electronic device can also obtain the first network identification information corresponding to the current location at a preset time interval and save the updated first network identification information.

[0126] Step 905: Connect the electronic device to the network according to the matching result.

[0127] Specifically, after obtaining the network matching result of the current location, the electronic device can connect to the network according to the network identification information determined in the matching result. Possibly, when the matching result is all or part of the second network identification information corresponding to the location information that has successfully matched, the electronic device can select a second network identification by default from one or more second network identifications included in the all or part of the second network identification information for connection, wherein the default method can be but is not limited to selecting the second network identification with the highest network quality or the most number of connections.

[0128] Possibly, when the matching result is the first network identification information corresponding to a network whose network quality meets the third preset condition, the electronic device may select a first network identification by default for connection from one or more first network identifications included in the first network identification information corresponding to the network whose network quality meets the third preset condition, wherein the default method may be but is not limited to selecting the first network identification with the highest network quality or the most connections.

[0129] As another embodiment of the present application, when an electronic device is connected to a network based on a matching result, the network quality of the networks corresponding to the network identification information can be ranked from high to low based on the matching result, and the electronic device can be connected to the network based on the network identification information with the highest network quality ranking.

[0130] Specifically, the electronic device can sort the network identification information obtained from the matching results according to network quality from high to low, and use the network identification with the highest network quality as the preferred network connection to ensure that the network communication quality of the electronic device is good and avoid additional cost losses.

[0131] As another embodiment of the present application, the network quality of the network identification information can also be obtained through a trained deep learning model. Specifically, the electronic device can obtain any at least one of the network strength, network speed and network analysis data of the network identification information.

[0132] Among them, the network strength can be the signal strength provided by the electronic device when connecting to the network corresponding to the network identification information, which can be specifically presented through the signal grid displayed on the display interface of the electronic device. The more signal grids there are, the greater the signal strength is, and the fewer signal grids there are, the smaller the signal strength is. The network speed can be determined by the electronic device sending a fixed-size data packet when connecting to the network corresponding to the network identification information, and determining the network speed corresponding to the network identification information according to the transmission time of the data packet. The network resolution data can be determined by the electronic device sending a fixed decompression packet when connecting to the network corresponding to the network identification information, and determining the network resolution data corresponding to the network identification information according to the resolution of the fixed decompression packet. For example, when the resolution of the fixed decompression packet is unable to be resolved, the signal resolution data value is set to 0, and when the resolution of the decompression packet is successful, the signal resolution data value is set to 1.

[0133] Furthermore, taking the example of an electronic device obtaining the network strength, network speed and network resolution data of the network identification information, the electronic device can bring the numerical values ​​corresponding to the network strength, network speed and network resolution data of the network identification information into a row vector, and input the row vector into a trained deep learning model to obtain the network quality of the network identification information.

[0134] Among them, the deep learning model can be but not limited to a feedforward neural network, including an input layer, multiple hidden layers and an output layer, the input layer can correspond to an input row vector, multiple hidden layers can use a RELU activation function to calculate the input layer input vector, and the output layer can output a network quality. It can be understood that the output result of the output layer here can be specifically a score value. In the process of training the deep learning model, the row vector converted by the sample network identification information of multiple known network qualities can be input into the deep learning model, and the obtained network quality can be combined with the corresponding known network quality to bring into the loss function for calculation, and the parameters are continuously adjusted to minimize the calculation of the loss function, and in the process of verification, the deep learning model whose output network quality meets the preset accuracy rate is used as the deep learning model for training. The preset accuracy rate here can be the proportion of the number of correct results in the output results of multiple deep learning models to all output results, and it can be preferably set to 95%.

[0135] See also Fig.10 , Fig.10 A diagram showing the network connection effect of an electronic device provided in an embodiment of the present application is shown.

[0136] like Fig.10 As shown, after the electronic device determines to connect to the wireless local area network by combining the current location information with the matching result of the location network database, a prompt dialog box 1001 with the content "Connected to the wireless local area network!" may be popped up on the current display interface 1000 of the electronic device, and a confirmation control 1002 and a change control 1003 are also provided below the text content of the prompt dialog box 1001. When the user selects the confirmation control 1002, the prompt dialog box 1001 may automatically disappear, and when the user selects the change control 1003, the current display interface 1000 may continue to pop up a selection box including other wireless local area network names, so that the user can select other wireless local area networks. Among them, when the prompt dialog box 1001 with the content "Connected to the wireless local area network!" is popped up on the current display interface 1000 of the electronic device, the network connection status of the electronic device may be displayed as a wireless network connection status, and it can be understood that if the network connection status of the electronic device is previously a cellular network connection status, the cellular network connection status may be switched to a wireless network connection status.

[0137] It should be noted that the embodiment of the present application is not limited to the text prompt content form of the above prompt dialog box 1001.

[0138] See also Fig.11 , Fig.11 A schematic diagram of the structure of a network connection device provided in an embodiment of the present application is shown.

[0139] like Fig.11As shown, the network connection device 1100 may include at least a first acquisition module 1001, a first processing module 1102 and a connection module 1103, wherein:

[0140] A first acquisition module 1101 is used to acquire current location information of an electronic device;

[0141] The first processing module 1102 is used to match the current location information with the location network database to obtain a matching result, where the location network database includes multiple location information and network identification information corresponding to each of the multiple location information;

[0142] The connection module 1103 is used to connect the electronic device to the network according to the matching result.

[0143] In some possible embodiments, the network identification information includes first network identification information and second network identification information, and the first network identification information and the second network identification information are of different network types.

[0144] In some possible embodiments, the first network identification information includes one or more first network identifications, and each first network identification corresponds to a wireless local area network whose network quality meets a first preset condition.

[0145] In some possible embodiments, the second network identification information includes one or more second network identifications, and each second network identification corresponds to a cellular network whose network quality satisfies a second preset condition.

[0146] In some possible embodiments, it further includes:

[0147] A second acquisition module, used to acquire first network identification information and second network identification information corresponding to the location information;

[0148] A second processing module is configured to write the first network identification information and the corresponding location information corresponding to the network whose network quality satisfies the third preset condition into a location network database if the network quality of the network corresponding to the first network identification information satisfies the third preset condition; or

[0149] for determining all or part of the second network identification information according to a preset rule if the first network identification information corresponds to a network whose network quality does not meet a third preset condition;

[0150] The first network identification information, all or part of the second network identification information, and the corresponding location information corresponding to the network whose network quality does not meet the third preset condition are written into the location network database.

[0151] In some possible embodiments, the preset rules include:

[0152] Sort the second network identification information from high to low according to the network quality of the corresponding network;

[0153] The part of the second network identification information that is ranked first is used as all or part of the second network identification information.

[0154] In some possible embodiments, the location network database includes a plurality of location information and first network identification information corresponding to a network whose network quality corresponding to each of the plurality of location information satisfies a third preset condition;

[0155] The first processing module 1102 is specifically configured to:

[0156] If the current location information successfully matches the location information in the location network database, the first network identification information corresponding to the network whose network quality corresponding to the successfully matched location information meets the third preset condition is used as the matching result;

[0157] If the current location information fails to match the location information in the location network database, determining all or part of the second network identification information corresponding to the current location information according to a preset rule;

[0158] All or part of the second network identification information is used as a matching result.

[0159] In some possible embodiments, the location network database includes a plurality of location information, first network identification information corresponding to a network whose network quality corresponding to each of the plurality of location information does not meet a third preset condition, and all or part of the second network identification information;

[0160] The first processing module 1102 is specifically configured to:

[0161] If the current location information successfully matches the location information in the location network database, all or part of the second network identification information corresponding to the successfully matched location information is used as a matching result;

[0162] If the current location information fails to match the location information in the location network database, obtaining first network identification information corresponding to a network whose network quality corresponding to the current location information meets a third preset condition;

[0163] The first network identification information corresponding to the network whose network quality meets the third preset condition is used as the matching result.

[0164] In some possible embodiments, the first processing module 1102 is specifically configured to:

[0165] Sorting the first network identification information corresponding to the networks whose network quality meets the third preset condition from high to low according to the network quality of the corresponding networks;

[0166] The first network identification information corresponding to the networks whose quality meets the third preset condition is taken as the matching result.

[0167] In some possible embodiments, the connection module 1103 is specifically used to:

[0168] According to the matching results, the network qualities of the networks corresponding to the network identification information are sorted from high to low;

[0169] The electronic device is connected to the network according to the network identification information with the highest network quality ranking.

[0170] See also Fig.12 , Fig.12 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown.

[0171] like Fig.12 As shown, the electronic device 1200 may include: at least one processor 1201 , at least one network interface 1204 , a user interface 1203 , a memory 1205 , a touch screen 1206 and at least one communication bus 1202 .

[0172] The communication bus 1202 may be used to realize the connection and communication among the above-mentioned components.

[0173] The user interface 1203 may include buttons, and the optional user interface may also include a standard wired interface or a wireless interface.

[0174] The network interface 1204 may optionally include a Bluetooth module, an NFC module, a Wi-Fi module, etc.

[0175] Among them, the processor 1201 may include one or more processing cores. The processor 1201 uses various interfaces and lines to connect various parts within the entire electronic device 1200, and executes various functions and processes data of the routing device 1200 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1205, and calling data stored in the memory 1205. Optionally, the processor 1201 can be implemented in at least one hardware form of DSP, FPGA, and PLA. The processor 1201 can integrate one or a combination of CPU, GPU, modem, etc. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1201, and it can be implemented separately through a chip.

[0176] Among them, the memory 1205 may include RAM and may also include ROM. Optionally, the memory 1205 includes a non-transitory computer-readable medium. The memory 1205 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1205 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1205 may also be optionally at least one storage device located away from the aforementioned processor 1201. As Fig.12 As shown, the memory 1205 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a network connection application.

[0177] Specifically, the processor 1201 may be used to call the network connection application stored in the memory 1205, and specifically perform the following operations:

[0178] Obtaining current location information of the electronic device;

[0179] Matching the current location information with a location network database to obtain a matching result, wherein the location network database includes a plurality of location information and network identification information corresponding to each of the plurality of location information; and

[0180] The electronic device is connected to the network according to the matching result.

[0181] In some possible embodiments, the network identification information includes first network identification information and second network identification information, and the first network identification information and the second network identification information are of different network types.

[0182] In some possible embodiments, the first network identification information includes one or more first network identifications, and each first network identification corresponds to a wireless local area network whose network quality meets a first preset condition.

[0183] In some possible embodiments, the second network identification information includes one or more second network identifications, and each second network identification corresponds to a cellular network whose network quality satisfies a second preset condition.

[0184] In some possible embodiments, the processor 1201 is further configured to execute:

[0185] Acquire first network identification information and second network identification information corresponding to the location information;

[0186] If the network quality of the network corresponding to the first network identification information meets the third preset condition, the first network identification information and the corresponding location information corresponding to the network whose network quality meets the third preset condition are written into the location network database;

[0187] If the first network identification information corresponds to a network whose network quality does not meet the third preset condition, determining all or part of the second network identification information according to a preset rule;

[0188] The first network identification information, all or part of the second network identification information, and the corresponding location information corresponding to the network whose network quality does not meet the third preset condition are written into the location network database.

[0189] In some possible embodiments, the preset rules include:

[0190] Sort the second network identification information from high to low according to the network quality of the corresponding network;

[0191] The part of the second network identification information that is ranked first is used as all or part of the second network identification information.

[0192] In some possible embodiments, the location network database includes a plurality of location information and first network identification information corresponding to a network whose network quality corresponding to each of the plurality of location information satisfies a third preset condition;

[0193] The processor 1201 matches the current location information with the location network database, and when a matching result is obtained, is specifically used to execute:

[0194] If the current location information successfully matches the location information in the location network database, the first network identification information corresponding to the network whose network quality corresponding to the successfully matched location information meets the third preset condition is used as the matching result;

[0195] If the current location information fails to match the location information in the location network database, determining all or part of the second network identification information corresponding to the current location information according to a preset rule;

[0196] All or part of the second network identification information is used as a matching result.

[0197] In some possible embodiments, the location network database includes a plurality of location information, first network identification information corresponding to a network whose network quality corresponding to each of the plurality of location information does not meet a third preset condition, and all or part of the second network identification information;

[0198] The processor 1201 matches the current location information with the location network database, and when a matching result is obtained, is specifically used to execute:

[0199] If the current location information successfully matches the location information in the location network database, all or part of the second network identification information corresponding to the successfully matched location information is used as a matching result;

[0200] If the current location information fails to match the location information in the location network database, obtaining first network identification information corresponding to a network whose network quality corresponding to the current location information meets a third preset condition;

[0201] The first network identification information corresponding to the network whose network quality meets the third preset condition is used as the matching result.

[0202] In some possible embodiments, when the processor 1201 uses the first network identification information corresponding to the network whose network quality satisfies the third preset condition as the matching result, it is specifically configured to execute:

[0203] Sorting the first network identification information corresponding to the networks whose network quality meets the third preset condition from high to low according to the network quality of the corresponding networks;

[0204] The first network identification information corresponding to the networks whose quality meets the third preset condition is taken as the matching result.

[0205] In some possible embodiments, when the processor 1201 connects the electronic device to the network according to the matching result, it is specifically used to execute:

[0206] According to the matching results, the network qualities of the networks corresponding to the network identification information are sorted from high to low;

[0207] The electronic device is connected to the network according to the network identification information with the highest network quality ranking.

[0208] The embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a computer or a processor, the computer or the processor executes the above-mentioned Figure 4 or Figure 5 or Figure 8 or Fig. 9 One or more steps in the illustrated embodiment. If the components of the electronic device described above are implemented in the form of software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium.

[0209] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted by the computer-readable storage medium. The computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0210] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes. In the absence of conflict, the technical features in this embodiment and the implementation scheme can be combined arbitrarily.

[0211] The embodiments described above are merely preferred embodiments of the present application and are not intended to limit the scope of the present application. Without departing from the design spirit of the present application, various modifications and improvements made to the technical solutions of the present application by ordinary technicians in this field should fall within the protection scope determined by the claims of the present application.

Claims

1. A network connection method, characterized in that: include: Acquire first network identification information and second network identification information corresponding to the location information, where the first network identification information and the second network identification information have different network types; If the first network identification information corresponds to a network whose network quality does not meet a third preset condition, determining all or part of the second network identification information according to a preset rule; Writing the first network identification information corresponding to the network whose network quality does not meet the third preset condition, all or part of the second network identification information, and the corresponding location information into a location network database, wherein the location network database includes a plurality of location information, the first network identification information corresponding to the network whose network quality does not meet the third preset condition corresponding to each of the plurality of location information, and all or part of the second network identification information; Obtaining current location information of the electronic device; Matching the current location information with the location network database to obtain a matching result; as well as Connecting the electronic device to a network according to the matching result; The matching of the current location information with the location network database to obtain a matching result includes: If the current location information successfully matches the location information in the location network database, all or part of the second network identification information corresponding to the successfully matched location information is used as the matching result; if the current location information fails to match the location information in the location network database, the first network identification information corresponding to the network whose network quality corresponding to the current location information meets the third preset condition is obtained; and the first network identification information corresponding to the network whose network quality meets the third preset condition is used as the matching result; The connecting the electronic device to a network according to the matching result includes: According to the matching results, the network qualities of the networks corresponding to the network identification information are sorted from high to low; Connecting the electronic device to the network according to the network identification information with the highest network quality ranking; The method for determining the network quality corresponding to the network identification information includes: Obtain the network strength, network speed and network resolution data of the network identification information, where the network resolution data is determined based on the resolution of a fixed resolution packet, and the fixed resolution packet is sent when connecting to the network corresponding to the network identification; bring the network strength, network speed and network resolution data of the network identification information into a row vector, and input the row vector into a trained deep learning model to obtain the network quality corresponding to the network identification information.

2. The method according to claim 1, characterized in that The first network identification information includes one or more first network identifications, and each of the first network identifications corresponds to a wireless local area network whose network quality meets a first preset condition.

3. The method according to claim 1, characterized in that The second network identification information includes one or more second network identifications, and each of the second network identifications corresponds to a cellular network whose network quality meets a second preset condition.

4. The method according to claim 1, characterized in that The preset rules include: Sort the second network identification information from high to low according to the network quality of the corresponding network; The part of the second network identification information that is ranked first is used as all or part of the second network identification information.

5. A network connection device, characterized in that: include: A second acquisition module is configured to acquire first network identification information and second network identification information corresponding to the location information, wherein the first network identification information and the second network identification information have different network types; A second processing module, if the first network identification information corresponds to a network whose network quality does not meet the third preset condition, determines all or part of the second network identification information according to a preset rule; writes the first network identification information corresponding to the network whose network quality does not meet the third preset condition, all or part of the second network identification information, and the corresponding location information into a location network database, wherein the location network database includes a plurality of location information, the first network identification information corresponding to the network whose network quality does not meet the third preset condition corresponding to each of the plurality of location information, and all or part of the second network identification information; A first acquisition module, used to acquire current location information of the electronic device; A first processing module, used for matching the current location information with a location network database to obtain a matching result; A connection module, used for connecting the electronic device to a network according to the matching result; The first processing module is specifically configured to use all or part of the second network identification information corresponding to the successfully matched location information as the matching result if the current location information successfully matches the location information in the location network database; If the current location information fails to match the location information in the location network database, obtaining first network identification information corresponding to a network whose network quality corresponding to the current location information meets the third preset condition; and taking the first network identification information corresponding to the network whose network quality meets the third preset condition as the matching result; The connection module is used to sort the network qualities of the networks corresponding to the network identification information from high to low according to the matching result; and to connect the electronic device to the network according to the network identification information with the highest network quality ranking; The method for determining the network quality corresponding to the network identification information includes: Obtain the network strength, network speed and network resolution data of the network identification information, where the network resolution data is determined based on the resolution of a fixed resolution packet, and the fixed resolution packet is sent when connecting to the network corresponding to the network identification; bring the network strength, network speed and network resolution data of the network identification information into a row vector, and input the row vector into a trained deep learning model to obtain the network quality corresponding to the network identification information.

6. An electronic device, Its characteristics are that it includes a processor and a memory; The processor is connected to the memory; The memory is used to store executable program code; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the method according to any one of claims 1 to 4.

7. A 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 4 is implemented.

Citation Information

Patent Citations

  • Network quality detection method and device and computer equipment

    CN106658588A

  • System for automatic switch of networks and electronic equipment

    CN108391298A

  • Method and apparatus for switching network

    CN109548103A