CN108810092B - Network access method and device, electronic equipment and computer readable storage medium - Google Patents
Network access method and device, electronic equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN108810092B CN108810092B CN201810471327.5A CN201810471327A CN108810092B CN 108810092 B CN108810092 B CN 108810092B CN 201810471327 A CN201810471327 A CN 201810471327A CN 108810092 B CN108810092 B CN 108810092B
- Authority
- CN
- China
- Prior art keywords
- domain name
- name server
- network access
- alternative
- servers
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000004590 computer program Methods 0.000 claims description 13
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000003672 processing method Methods 0.000 description 3
- 238000013500 data storage Methods 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1036—Load balancing of requests to servers for services different from user content provisioning, e.g. load balancing across domain name servers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/45—Network directories; Name-to-address mapping
- H04L61/4505—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
- H04L61/4511—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephonic Communication Services (AREA)
Abstract
The application relates to a network access method, a network access device, an electronic device and a computer readable storage medium. The method comprises the following steps: judging whether network access can be carried out through a domain name server in a domain name server set; when the domain name server is judged to be incapable of network access, adding an alternative domain name server in the domain name server set; and performing network access through the alternative domain name server. According to the network access method, when the domain name servers acquired by traversing the domain name server set are unavailable, the electronic equipment can access the network through the alternative domain name servers.
Description
Technical Field
The present application relates to the field of network application technologies, and in particular, to a network access method and apparatus, an electronic device, and a computer-readable storage medium.
Background
With the rapid development and popularization of mobile internet and computer technologies, most electronic devices (e.g., mobile phones, tablet computers, etc.) support network access by connecting to a Wireless Fidelity (Wi-Fi) network.
However, the conventional method for accessing the Wi-Fi network by the electronic device is mainly that after connecting the Wi-Fi network, the electronic device generates a set of domain Name servers (Name servers, NS) according to one or more configured domain Name servers (Name servers, NS) of the Wi-Fi network. When the electronic equipment needs to access the network, the available domain name servers are obtained by traversing the domain name server set, and the network access is carried out through the obtained domain name servers. However, when none of the domain name servers acquired by the electronic device traversing the domain name server set is available, the electronic device cannot perform network access.
Disclosure of Invention
Embodiments of the present application provide a network access method and apparatus, an electronic device, and a computer-readable storage medium, which can still perform network access when none of domain name servers acquired by the electronic device traversing a domain name server set is available.
A network access method, comprising:
judging whether network access can be carried out through a domain name server in a domain name server set;
when the domain name server is judged to be incapable of network access, adding an alternative domain name server in the domain name server set;
and performing network access through the alternative domain name server.
A network access device, comprising:
the judging module is used for judging whether network access can be carried out through the domain name servers in the domain name server set;
the adding module is used for adding an alternative domain name server in the domain name server set when judging that the network access can not be carried out through the domain name server;
and the access module is used for carrying out network access through the alternative domain name server.
An electronic device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of the network access method as described above.
A computer-readable storage medium having stored thereon a computer program for executing the steps of the network access method as described above by a processor.
According to the network access method and device, the electronic device and the computer readable storage medium in the embodiment of the application, when it is judged that network access cannot be performed through domain name servers in the domain name server set, the alternative domain name servers are added into the domain name server set, network access is performed through the alternative domain name servers, and when the electronic device cannot use all the domain name servers acquired by traversing the domain name server set, network access can be performed through the alternative domain name servers.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram of an application environment of a network access method in one embodiment;
FIG. 2 is a flow diagram of a method for network access in one embodiment;
FIG. 3 is a flow chart of a network access method in another embodiment;
FIG. 4 is a flow chart of a network access method in another embodiment;
FIG. 5 is a block diagram of the architecture of the network access device in one embodiment;
fig. 6 is a block diagram of a partial structure of a cellular phone in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, a first client may be referred to as a second client, and similarly, a second client may be referred to as a first client, without departing from the scope of the present application. Both the first client and the second client are clients, but they are not the same client.
FIG. 1 is a diagram illustrating an application environment in which a processing method is applied in one embodiment. As shown in fig. 1, the application processing method is applied to an electronic device including a processor, a memory, and a network interface connected through a system bus. Wherein, the processor is used for providing calculation and control capability and supporting the operation of the whole electronic equipment. The memory is used for storing data, programs and the like, and at least one computer program is stored on the memory, and can be executed by the processor to realize the application processing method suitable for the electronic device provided in the embodiment of the application. The Memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random-Access-Memory (RAM). For example, in one embodiment, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by a processor for implementing a network access method provided in the following embodiments. The internal memory provides a cached execution environment for the operating system computer programs in the non-volatile storage medium. The network interface may be an ethernet card or a wireless network card, etc. for communicating with an external electronic device. The electronic device may be a mobile phone, a tablet computer, a personal digital assistant, a wearable device, or the like.
Fig. 2 is a flow diagram of a method for network access in one embodiment. As shown in fig. 2, the network access method includes steps 202 to 205.
Specifically, the domain name server set may be a domain name server list or a domain name server array, and the domain name server set is generated by one or more domain name servers configured by the electronic device according to the Wi-Fi network after the electronic device connects to the Wi-Fi network. Different Wi-Fi networks are connected, and the number of domain name servers acquired by the electronic device may be different, for example, when the connected Wi-Fi network is a home network, the electronic device may acquire one domain name server, and when the connected Wi-Fi network is a network in a public place, the electronic device may acquire a plurality of domain name servers.
And step 204, adding an alternative domain name server in the domain name server set when the judgment result shows that the network access can not be carried out through the domain name server.
In this step, when the electronic device has a network access requirement, the electronic device traverses the domain name servers in the domain name server set until an available domain name server is found, and performs a website query according to the domain name server. When it is determined that the electronic device cannot perform network access through the domain name servers in the domain name server set, an alternative domain name server may be added to the domain name server set, and the electronic device may acquire the alternative domain name server in a process of traversing the domain name server set.
Step 205, network access is performed through the alternative domain name server.
For step 205, the alternate domain name server may select a public network domain name server. The public network domain name server is a domain name server system used by a network operator as a basis, and a professional third-party high-reliability domain name server service platform is built through expansion, and is generally placed according to administrative regions, such as provinces. The platform can be composed of a large number of high-end Central Processing Unit (CPU) cores, and a user can set the public network domain name server as an alternative domain name server within a range covered by a delivery area of the platform and perform network access through the public network domain name server.
Different alternative domain name servers can be selected for network access according to different geographic locations. For example, different alternative domain name servers may be selected in china and non-china, where the alternative domain name server may be set to "114.114.114.114" and the alternative domain name server may be set to "8.8.8.8". The alternative domain name server set as '114.114.114.114' has nodes in China provinces, can satisfy telecom, Unicom, mobile and other operators, and is a safe and reliable alternative domain name server in China. The alternative domain name server set to "8.8.8.8" is a public network domain name server issued by google, which has no node in china, and can be set as an alternative domain name server in a non-chinese area for network access through the alternative domain name server.
In the Chinese area, besides "114.114.114.114", other reliable public network domain name servers can be set as alternative domain name servers, and the reliable alternative domain name servers can be selected for network access according to the geographic position and the network evaluation result released by each public network domain name server. Similarly, in non-Chinese areas, other reliable alternative domain name servers can be selected for network access according to the geographic position and the network evaluation result released by each public network domain name server.
In the network access method in this embodiment, when it is determined that network access cannot be performed through the domain name servers in the domain name server set, the alternative domain name servers are added to the domain name server set, and network access is performed through the alternative domain name servers, so that when the domain name servers acquired by traversing the domain name server set are all unavailable, the electronic device can perform network access through the alternative domain name servers.
In one embodiment, step 202 may determine whether network access is possible through a domain name server in the set of domain name servers by: acquiring historical query success rates corresponding to all domain name servers in a domain name server set; the historical query success rate is obtained according to the number of times of successfully querying the website in the website query record of the domain name server and the total query number; and when the historical query success rates are all smaller than the query success rate threshold, judging that the network access cannot be carried out through the domain name servers in the domain name server set.
In the above embodiment, the domain name server website query record is a record of performing website query through each domain name server in the domain name server set, where the record includes a record of whether each domain name server succeeds in querying each time. The historical query success rate can be the ratio of the number of times of successfully querying the website in the website query record of the domain name server to the total number of times of querying, and can also be the percentage of the number of times of successfully querying the website to the total number of times of querying. Before the domain name server queries the website, the historical query success rate of the domain name server can be obtained, and if the historical query success rate of the domain name server is smaller than a success rate threshold value, the domain name server can be judged to be unavailable; if the historical query success rate of each domain name server in the domain name server set is smaller than the success rate threshold, it can be determined that network access cannot be performed through each domain name server in the domain name server set.
In the above embodiment, before the domain name server performs the website query, it is first determined whether the domain name server is available through the historical query success rate threshold of the domain name server, and when it is determined that the domain name server is not available, the website query is not performed through the domain name server. The method and the device can avoid the electronic equipment from carrying out website query work through the unavailable domain name server, and reduce unnecessary query work.
In one embodiment, step 202 may further determine whether network access is possible through a domain name server in the set of domain name servers by: when the historical query success rate is greater than or equal to the query success rate threshold, performing website query through the domain name server; and if the website query fails, judging that the network access cannot be carried out through the domain name server.
When the domain name server set is traversed to obtain the domain name server, if the historical query success rate corresponding to the obtained domain name server is larger than or equal to the query success rate threshold, the operation of performing website query through the obtained domain name server can be performed, and whether the website query is successful or not is judged.
The following describes how to determine whether the website query is successful in combination with an example. After the electronic device connects to the router, if two domain name servers are obtained, the addresses corresponding to the two domain name servers are "192.158.1.1" and "192.158.1.2", respectively, the electronic device may add the addresses of the two domain name servers to the domain name server set. In the domain name server set, the domain name server address represents the corresponding domain name server. When the electronic device needs to perform network access, for example, when the electronic device needs to access the domain name "www.baidu.com", the electronic device will sequentially send a website query request to each domain name server in the domain name server set. When the electronic device sends the website query request to the domain name server "192.158.1.1", if no reply is received or other wrong returns are received, it is considered that the website query by the domain name server "192.158.1.1" fails, and the electronic device will continue to send the website query request to the domain name server "192.158.1.2". If the domain name server "192.158.1.2" returns an Internet Protocol Address (IP Address) corresponding to "www.baidu.com", if "153.177.151.110", it is considered that the query of the website Address by the domain name server "192.158.1.2" is successful.
If the website query is successful, the electronic equipment can access the network through the domain name server; if the website query fails, the electronic device cannot perform network access through the domain name server, and the electronic device can continue to traverse the domain name server set to acquire other domain name servers. The success or failure of the query can also be added to the statistics of the historical query success rate.
In the above embodiment, before the domain name server performs the website query, it is first determined whether the domain name server is available through the historical query success rate threshold of the domain name server, and when it is determined that the domain name server is not available, the website query is not performed through the domain name server. The method and the device can avoid the electronic equipment from carrying out website query work through the unavailable domain name server, and reduce unnecessary query work.
In one embodiment, when the historical query success rate is greater than or equal to the query success rate threshold, after the domain name server queries the website, the duration of the domain name server querying the website may also be obtained, and if the duration exceeds a specified duration, it is determined that the network access cannot be performed through the domain name server.
In the above embodiment, the timeout interruption is added in the process of performing the website query by the electronic device through the domain name server, that is, if the electronic device does not receive the IP address returned by the domain name server within the specified time, the website query is considered to be failed, and the electronic device cannot perform the network access through the domain name server. The electronic device may add an alternative domain name server in the domain name server set, and perform network access through the alternative domain name server.
The embodiment can avoid the electronic equipment from performing website query work through the unavailable domain name server, and reduce unnecessary query work. And the failure of query or the overlong query time caused by the failure of response of the domain name server can be avoided.
In one embodiment, for step 204, an alternative domain name server may be added by: and when judging that the network access can not be carried out through each domain name server, forbidding each domain name server, and adding an alternative domain name server in the domain name server set.
After each domain name server in the original domain name server set is disabled, the electronic device skips the disabled domain name server sets during traversal of the domain name server set, and directly performs network access through the alternative domain name server. When the electronic equipment has network access requirements, the step of searching for the available domain name server can be skipped, and the alternative domain name server is directly adopted for network access, so that the network access speed is improved.
In one embodiment, for step 204, an alternative domain name server may also be added by: and when the domain name server is judged to be incapable of performing network access, deleting the domain name servers with the historical query success rate smaller than the query success rate threshold in the domain name server set, and adding the alternative domain name servers in the domain name server set.
In the above embodiment, all domain name servers with a historical query success rate smaller than the query success rate threshold are unavailable, and deleting the domain name servers can avoid time waste when the electronic device traverses the domain name server set to acquire the unavailable domain name servers. The number of the alternative domain name servers added in the domain name server can be one or more. The Global Positioning System (GPS) location of the electronic device may also be obtained before adding the domain name server. An appropriate alternative domain name server is selected based on the GPS location of the electronic device.
In one embodiment, step 205 may comprise: and inquiring the website through the alternative domain name server, and accessing the network according to the inquired website.
When receiving a query request of the electronic device, the alternative domain name server may obtain a domain name to be queried carried in the query request, and analyze the domain name to be queried to obtain an IP address corresponding to the domain name. When the alternative domain name server is in website query operation, a domain name resolution database can be established on the electronic equipment or the alternative domain name server. The domain name and its corresponding IP address in the network access request may be stored in a domain name resolution database.
According to the embodiment, when the network access request is received, the IP address corresponding to the domain name to be inquired can be determined through the domain name resolution database, the frequency of sending the domain name resolution request to the alternative domain name server can be greatly reduced, the resource consumption and the network flow of the alternative domain name server can be saved, and the speed of obtaining the network access information can be improved.
In one embodiment, when the number of the alternative domain name servers in the domain name server set is multiple, the first location information of the electronic device and the second location information of each alternative domain name server may be obtained, and the first location information and each second location information may be matched. The location information may be GPS location information or network location information. And determining the successfully matched alternative domain name server as the optimal alternative domain name server, and performing network access through the optimal alternative domain name server.
The first location information may be matched with the respective second location information by: and comparing the first position information with each piece of second position information, and if the first position information is consistent with the second position information or the distance between the first position information and the second position information is within a specified range, determining that the first position information is matched with the second position information.
According to the embodiment, the speed of the alternative domain name server for responding to the network access request is increased by determining the optimal alternative domain name server, the network access speed is further increased on the premise of ensuring the successful network access, and the user experience is improved.
An embodiment of network access by an electronic device is described below in conjunction with fig. 3. When the electronic device is to perform a network access, a website query may be performed through a domain name server in the set of domain name servers, as shown in step 302 of fig. 3. When the website address is queried, step 304 may be executed, step 306 is executed by traversing the domain name server set, and step 308 is executed if the next domain name server exists in the domain name server set. If the next domain name server exists, the next domain name server in the domain name server set is obtained, step 310 is executed to obtain the historical query success rate of the domain name server, step 312 is executed, and whether the domain name server is available is judged according to the historical query success rate corresponding to the domain name server. If the domain name server is not available, returning to step 304, if the domain name server is available, executing step 314, performing website query through the domain name server, and updating the historical query success rate of the domain name server according to the success or failure of the query record. After the historical query success rate of the domain name server is updated, step 316 is executed to determine whether there is no available domain name server in the domain name server set and no alternative domain name server is included, if yes, step 318 is executed to add an alternative domain name server in the domain name server set, and network access is performed through the alternative domain name server.
According to the network access method, when no available domain name server exists in the domain name server set and the alternative domain name server is not included, the alternative domain name server is added in the domain name server set, and network access is performed through the alternative domain name server. The method and the device can avoid the electronic equipment from carrying out website query work through the unavailable domain name server, and reduce unnecessary query work.
As shown in fig. 4, in one embodiment, there is provided a network access method comprising the steps of:
In step 404, when the historical query success rates are all smaller than the query success rate threshold, it is determined that network access cannot be performed through the domain name servers in the domain name server set.
And 406, when the historical query success rate is greater than or equal to the query success rate threshold, performing website query through the domain name server. Step 308 and step 310 may be performed separately after step 305.
And step 408, if the website query fails, determining that the network access cannot be performed through the domain name server.
In step 412, if the duration exceeds the specified duration, it is determined that network access cannot be performed through the domain name server.
After determining that network access is not possible through a domain name server in the set of domain name servers, steps 414 and 416 may be performed.
And 414, when judging that the network access can not be carried out through each domain name server, forbidding each domain name server and/or deleting the domain name servers with the historical query success rate smaller than the query success rate threshold in the domain name server set, and adding the alternative domain name servers in the domain name server set.
And step 416, performing website query through the alternative domain name server, and performing network access according to the queried website.
Before the domain name server queries the website, the network access method judges whether the domain name server is available or not through the historical query success rate threshold of the domain name server, and judges whether the corresponding domain name server is available or not according to the website query duration when the website is queried. The method and the device can avoid the electronic equipment from carrying out website query work through the unavailable domain name server, and reduce unnecessary query work. When judging that the network access can not be carried out through the domain name servers in the domain name server set, forbidding each domain name server and/or deleting the domain name servers with the historical query success rate smaller than the query success rate threshold value in the domain name server set, adding the alternative domain name servers in the domain name server set, and carrying out the network access through the alternative domain name servers, so that the electronic equipment can carry out the network access through the alternative domain name servers when the domain name servers acquired by traversing the domain name server set are unavailable.
It should be understood that although the steps in the flowcharts of fig. 2 to 4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
Fig. 5 is a block diagram of a network access device according to an embodiment. As shown in fig. 5, the network access device of the present embodiment includes:
a judging module 502, configured to judge whether network access can be performed through a domain name server in a domain name server set;
an adding module 504, configured to add an alternative domain name server in the domain name server set when it is determined that network access cannot be performed through the domain name server;
an access module 506 for network access through the alternative domain name server.
According to the network access device in the embodiment of the application, when the situation that network access cannot be performed through the domain name servers in the domain name server set is judged, the alternative domain name servers are added into the domain name server set, and network access is performed through the alternative domain name servers, so that when the electronic equipment traverses the domain name server set and obtains unavailable domain name servers, network access can be performed through the alternative domain name servers.
In one embodiment, the determining module 502 may include a historical query success rate obtaining module and a first determining module. A historical query success rate acquisition module acquires the historical query success rate corresponding to each domain name server in the domain name server set; the historical query success rate is obtained according to the number of times of successfully querying the website in the website query record of the domain name server and the total query number. The first judging module is used for judging that network access can not be carried out through each domain name server in the domain name server set when each historical query success rate is smaller than a query success rate threshold value.
In one embodiment, the determining module 502 may further include a website querying module and a second determining module. The website query module is used for querying websites through the domain name server when the historical query success rate is greater than or equal to the query success rate threshold; and the second judging module is used for judging that the network access cannot be carried out through the domain name server if the website query fails.
In one embodiment, the determining module 502 may further include a duration obtaining module and a third determining module. The time length acquisition module is used for acquiring the time length of the website query of the domain name server; and the third judging module is used for judging that the network access cannot be carried out through the domain name server if the website query fails.
In one embodiment, the adding module 504 is further configured to disable each domain name server and add an alternative domain name server to the set of domain name servers when it is determined that network access is not available through each domain name server.
In one embodiment, the adding module 504 is further configured to delete a domain name server with a historical query success rate smaller than a query success rate threshold in the domain name server set and add an alternative domain name server in the domain name server set when it is determined that network access through the domain name server is not possible.
In one embodiment, the accessing module 506 is further configured to perform a website query through the alternative domain name server, and perform network access according to the queried website.
The division of the modules in the network access device is merely used for illustration, and in other embodiments, the network access device may be divided into different modules as needed to complete all or part of the functions of the network access device.
For specific limitations of the network access device, reference may be made to the above limitations of the network access method, which is not described herein again. The modules in the network access device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
The implementation of each module in the network access device provided in the embodiments of the present application may be in the form of a computer program. The computer program may be run on a terminal or a server. The program modules constituted by the computer program may be stored on the memory of the terminal or the server. Which when executed by a processor, performs the steps of the method described in the embodiments of the present application.
The embodiment of the application also provides a computer readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the steps of:
judging whether network access can be carried out through a domain name server in a domain name server set;
when judging that the network access can not be carried out through the domain name server, adding an alternative domain name server in the domain name server set;
network access is made through an alternative domain name server.
In one embodiment, the computer executable instructions, when executed by the one or more processors, further cause the processors to perform the steps of: acquiring historical query success rates corresponding to all domain name servers in a domain name server set; the historical query success rate is obtained according to the number of times of successfully querying the website in the website query record of the domain name server and the total query number; and when the historical query success rates are all smaller than the query success rate threshold, judging that the network access cannot be carried out through the domain name servers in the domain name server set.
In one embodiment, the computer executable instructions, when executed by the one or more processors, further cause the processors to perform the steps of: when the historical query success rate is greater than or equal to the query success rate threshold, performing website query through the domain name server; and if the website query fails, judging that the network access cannot be carried out through the domain name server.
In one embodiment, the computer executable instructions, when executed by the one or more processors, further cause the processors to perform the steps of: acquiring the time length of the domain name server for website query; and if the duration exceeds the specified duration, judging that the network access cannot be carried out through the domain name server.
In one embodiment, the computer executable instructions, when executed by the one or more processors, further cause the processors to perform the steps of: and when judging that the network access can not be carried out through each domain name server, forbidding each domain name server, and adding an alternative domain name server in the domain name server set.
In one embodiment, the computer executable instructions, when executed by the one or more processors, further cause the processors to perform the steps of: and when the domain name server is judged to be incapable of performing network access, deleting the domain name servers with the historical query success rate smaller than the query success rate threshold in the domain name server set, and adding the alternative domain name servers in the domain name server set.
In one embodiment, the computer executable instructions, when executed by the one or more processors, further cause the processors to perform the steps of: and inquiring the website through the alternative domain name server, and accessing the network according to the inquired website.
A computer program product containing instructions which, when run on a computer, cause the computer to perform the steps of:
judging whether network access can be carried out through a domain name server in a domain name server set;
when judging that the network access can not be carried out through the domain name server, adding an alternative domain name server in the domain name server set;
network access is made through an alternative domain name server.
The embodiment of the application also provides the electronic equipment. As shown in fig. 6, for convenience of explanation, only the parts related to the embodiments of the present application are shown, and details of the technology are not disclosed, please refer to the method part of the embodiments of the present application. The electronic device may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, a wearable device, and the like, taking the electronic device as the mobile phone as an example:
fig. 6 is a block diagram of a partial structure of a mobile phone related to an electronic device provided in an embodiment of the present application. Referring to fig. 6, the handset includes: memory 610, wireless fidelity (WiFi) module 620, processor 630, and GPS module 640. Those skilled in the art will appreciate that the handset configuration shown in fig. 6 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The memory 610 may be used to store software programs and modules, and the processor 620 executes various functional applications and data processing of the mobile phone by operating the software programs and modules stored in the memory 610. The memory 610 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as an application program for a sound playing function, an application program for an image playing function, and the like), and the like; the data storage area may store data (such as audio data, an address book, etc.) created according to the use of the mobile phone, and the like. Further, the memory 610 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help a user to receive and send emails, browse webpages, access streaming media and the like through the WiFi module 620, and provides wireless broadband Internet access for the user. Although fig. 6 shows WiFi module 620, it is understood that it is not an essential component of handset 600 and may be omitted as desired.
The processor 630 is a control center of the mobile phone, connects various parts of the entire mobile phone by using various interfaces and lines, and performs various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 610 and calling data stored in the memory 610, thereby performing overall monitoring of the mobile phone. In one embodiment, processor 630 may include one or more processing units. In one embodiment, the processor 630 may integrate an application processor and a modem processor, wherein the application processor mainly handles operating systems, user interfaces, application programs, and the like; the modem processor handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 630.
The GPS module 640 is configured to locate the electronic device, acquire location information of each domain name server and each alternative domain name server in the domain name server set, and transmit the acquired location information to the processor 630. The processor 630 may select an appropriate domain name server or an alternative domain name server from the set of domain name servers based on the location information.
In one embodiment, the handset 600 may also include a camera, a bluetooth module, and the like.
In an embodiment of the application, the electronic device comprises a processor 630 which, when executing the computer program stored on the memory, implements the steps of the network access method.
Any reference to memory, storage, database, or other medium used herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. A network access method applied to an electronic device includes:
judging whether network access can be carried out through a domain name server in a domain name server set;
when it is determined that network access cannot be performed through the domain name server, adding an alternative domain name server matched with the current geographic position of the electronic device in the domain name server set, including: when the domain name server is judged to be incapable of network access, deleting the domain name servers with the historical query success rate smaller than a query success rate threshold in the domain name server set, and adding alternative domain name servers in the domain name server set, wherein the alternative domain name servers are public network domain name servers;
performing network access through the alternative domain name server, including: and when a plurality of alternative domain name servers are provided, taking the alternative domain name server with the position information consistent with the current geographic position or the difference between the position information and the current geographic position within a preset threshold value as the optimal alternative domain name server, and performing network access through the optimal alternative domain name server.
2. The method of claim 1, wherein determining whether network access is available through a domain name server in the set of domain name servers comprises:
acquiring historical query success rates corresponding to all domain name servers in a domain name server set; the historical query success rate is obtained according to the number of times of successfully querying the website in the website query record of the domain name server and the total query number;
and when the historical query success rate is smaller than the query success rate threshold, judging that the network access cannot be carried out through each domain name server in the domain name server set.
3. The method of claim 2, wherein the determining whether network access is available through a domain name server in the set of domain name servers, further comprises:
when the historical query success rate is greater than or equal to the query success rate threshold, performing website query through the domain name server;
and if the website query fails, judging that the network access cannot be carried out through the domain name server.
4. The method according to claim 3, wherein when the historical query success rate is greater than or equal to the query success rate threshold, after the performing the website query by the domain name server, further comprising:
acquiring the time length of the domain name server for website query;
and if the duration exceeds the specified duration, judging that the network access cannot be carried out through the domain name server.
5. The method according to any one of claims 1 to 4, wherein adding an alternative domain name server in the set of domain name servers when it is determined that network access through the domain name server is not possible comprises:
and when judging that the network access can not be carried out through each domain name server, forbidding each domain name server, and adding an alternative domain name server in the domain name server set.
6. The method according to any of claims 1 to 4, wherein said network access by said alternative domain name server comprises:
and inquiring the website through the alternative domain name server, and accessing the network according to the inquired website.
7. The method of any of claims 1-4, wherein the set of domain name servers is generated by one or more domain name servers configured by the electronic device according to a Wi-Fi network after the electronic device connects to the Wi-Fi network.
8. A network access device, comprising:
the judging module is used for judging whether network access can be carried out through the domain name servers in the domain name server set;
an adding module, configured to add, when it is determined that network access cannot be performed through the domain name server, an alternative domain name server that is matched with a current geographic location of the electronic device in the domain name server set, including: when the domain name server is judged to be incapable of network access, deleting the domain name servers with the historical query success rate smaller than a query success rate threshold in the domain name server set, and adding alternative domain name servers in the domain name server set, wherein the alternative domain name servers are public network domain name servers;
the access module is used for performing network access through the alternative domain name server, and comprises: and when a plurality of alternative domain name servers are provided, taking the alternative domain name server with the position information consistent with the current geographic position or the difference between the position information and the current geographic position within a preset threshold value as the optimal alternative domain name server, and performing network access through the optimal alternative domain name server.
9. An electronic device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of the network access method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the network access method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810471327.5A CN108810092B (en) | 2018-05-17 | 2018-05-17 | Network access method and device, electronic equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810471327.5A CN108810092B (en) | 2018-05-17 | 2018-05-17 | Network access method and device, electronic equipment and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108810092A CN108810092A (en) | 2018-11-13 |
CN108810092B true CN108810092B (en) | 2021-09-14 |
Family
ID=64092577
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810471327.5A Expired - Fee Related CN108810092B (en) | 2018-05-17 | 2018-05-17 | Network access method and device, electronic equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108810092B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110381081B (en) * | 2019-08-07 | 2023-07-18 | 上海视云网络科技有限公司 | Network access method and device and electronic equipment |
CN110519409B (en) * | 2019-08-28 | 2022-09-06 | 北京思维造物信息科技股份有限公司 | Domain name dynamic configuration method, device, equipment and storage medium |
CN114827283B (en) * | 2022-04-18 | 2024-09-03 | 上海擎朗智能科技有限公司 | Resource access method, device, medium and robot |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101924776A (en) * | 2010-09-16 | 2010-12-22 | 网宿科技股份有限公司 | Method and system for domain name resolution server to resist flooding attacks of DNS (Domain Name System) request reports |
CN103002069A (en) * | 2012-12-25 | 2013-03-27 | 北京小米科技有限责任公司 | Domain name resolution method, device and system |
CN103327135A (en) * | 2013-06-27 | 2013-09-25 | 贝壳网际(北京)安全技术有限公司 | Domain name resolution method, device and client |
CN104883282A (en) * | 2015-06-19 | 2015-09-02 | 中国互联网络信息中心 | Method and system for monitoring DNS server of terminal |
US9929943B1 (en) * | 2013-11-14 | 2018-03-27 | Sprint Spectrum L.P. | Management of bearer connections based on policy communication failure |
CN107888716A (en) * | 2017-12-05 | 2018-04-06 | 广东欧珀移动通信有限公司 | A kind of sort method of domain name resolution server, terminal device and storage medium |
-
2018
- 2018-05-17 CN CN201810471327.5A patent/CN108810092B/en not_active Expired - Fee Related
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101924776A (en) * | 2010-09-16 | 2010-12-22 | 网宿科技股份有限公司 | Method and system for domain name resolution server to resist flooding attacks of DNS (Domain Name System) request reports |
CN103002069A (en) * | 2012-12-25 | 2013-03-27 | 北京小米科技有限责任公司 | Domain name resolution method, device and system |
CN103327135A (en) * | 2013-06-27 | 2013-09-25 | 贝壳网际(北京)安全技术有限公司 | Domain name resolution method, device and client |
US9929943B1 (en) * | 2013-11-14 | 2018-03-27 | Sprint Spectrum L.P. | Management of bearer connections based on policy communication failure |
CN104883282A (en) * | 2015-06-19 | 2015-09-02 | 中国互联网络信息中心 | Method and system for monitoring DNS server of terminal |
CN107888716A (en) * | 2017-12-05 | 2018-04-06 | 广东欧珀移动通信有限公司 | A kind of sort method of domain name resolution server, terminal device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN108810092A (en) | 2018-11-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8175584B2 (en) | System and method to facilitate downloading data at a mobile wireless device | |
JP6726426B2 (en) | Login-free method and device between terminals | |
US9560506B2 (en) | Emergency contacts information system | |
CN108810092B (en) | Network access method and device, electronic equipment and computer readable storage medium | |
CN106533944B (en) | Distributed API gateway, management method and management system | |
WO2013131472A1 (en) | Message processing method, device and system | |
US7600011B1 (en) | Use of a domain name server to direct web communications to an intermediation platform | |
CN103686591A (en) | Method and system for acquiring position information | |
CN112600693B (en) | Service request processing method, system, electronic equipment and computer storage medium | |
US20150249636A1 (en) | Resource download method, service server and cellular phone client | |
CN111107176A (en) | Data transmission method and device, computer equipment and storage medium | |
US20170155712A1 (en) | Method and device for updating cache data | |
CN114424600A (en) | Communication method, device, system and storage medium | |
US20140372528A1 (en) | Information processing system, information processing apparatus, and recording medium | |
CN106339267A (en) | Object query method and server side | |
US20110082896A1 (en) | Dynamically Updated Web-Enabled and Embedded Contact Address in Communication Devices | |
US9582306B2 (en) | Method and system to dynamically instantiate virtual repository for any services | |
US8180857B2 (en) | Method for downloading file in parallel | |
US20180018380A1 (en) | Maintaining Consistent Subscriber Data on Geo-Redundant Subscriber Databases | |
US10992608B2 (en) | Proxy presence server | |
CN116761159A (en) | Multi-homing access method and device for equipment, computer equipment and storage medium | |
CN116302424A (en) | Data processing method of distributed system, node and distributed system | |
CN107682271B (en) | Method and device for generating routing line | |
CN114258088B (en) | Method, device and system for discovering intermediate session management function device, and storage medium | |
CN101741889B (en) | Method, system and service for centralized management of network services |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20210914 |