DNS information processing method and device, electronic equipment and storage medium

By querying and updating historical DNS resolution results in the first DNS cache pool when the electronic device switches the network, the frequent domain name resolution problems caused by DNS cache clearance are solved, and the efficiency and user experience of DNS query are improved.

CN120034518APending Publication Date: 2025-05-23BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311577078.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-23
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The existing DNS cache mechanism will be cleared when users switch network environments, resulting in frequent domain name resolution processes, which consumes a lot of time and affects the user experience.

Method used

A DNS information processing method is provided, by detecting DNS query requests when an electronic device switches a network, and querying and updating historical DNS resolution results in the first DNS cache pool to reduce duplicate domain name resolution.

Benefits of technology

It improves DNS query efficiency, optimizes DNS cache persistence and utilization in multi-network environments, significantly reduces RTT query delay, thereby improving network connection speed and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120034518A_ABST
    Figure CN120034518A_ABST
Patent Text Reader

Abstract

The invention relates to a DNS information processing method and device, electronic equipment and a storage medium. The method comprises the following steps: detecting that the electronic equipment initiates a DNS query request under the condition that the electronic equipment is switched from a first network to a second network; querying a first DNS cache pool based on first domain name information in the DNS query request; wherein the first DNS cache pool is used for caching historical DNS analysis results obtained by the electronic equipment under different networks; and determining a historical DNS analysis result corresponding to the first domain name information in the first DNS cache pool as a target analysis result corresponding to the DNS query request. According to the method, the query efficiency of the DNS can be improved, DNS cache persistence and utilization in a multi-network environment are optimized, and the query delay of RTT is greatly reduced, so that the network connection speed is obviously improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technology, and in particular to a method, device, electronic device and storage medium for processing DNS information. Background Art

[0002] In the current network environment, user needs are constantly expanding, and they need to access resources in various ranges such as WAN and Internet. These resources are scattered on many hosts, and the IP addresses corresponding to each host are different. The key to obtaining these resources is to establish a connection with the corresponding host, which requires the conversion of domain names to IP addresses through the Domain Name System (DNS). Usually, these IP addresses remain stable for a long period of time.

[0003] The current DNS cache mechanism has some limitations. When a user changes the network environment, such as switching from one Wi-Fi network to another Wi-Fi network or a mobile data network, the current DNS cache will be cleared and the system will re-resolve the domain name to obtain a new IP address. This query process takes about a round-trip time (RTT). If the user needs to switch network environments frequently, this will result in a lot of time consumption. Furthermore, if this query action occurs multiple times during network use, it may account for 50% or even more of the network connection delay, which has a significant impact on the user experience. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present disclosure provides a method, device, electronic device and storage medium for processing DNS information, so as to overcome the problem that re-resolving domain name consumes a lot of time and has a significant impact on user experience.

[0005] According to a first aspect of an embodiment of the present disclosure, a method for processing DNS information is provided, including:

[0006] When the electronic device switches from the first network to the second network, detecting a DNS query request initiated by the electronic device; querying a first DNS cache pool based on the first domain name information in the DNS query request; wherein the first DNS cache pool is used to cache historical DNS resolution results obtained by the electronic device under different networks;

[0007] The historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool is determined as the target resolution result corresponding to the DNS query request.

[0008] In some embodiments, querying the first DNS cache pool based on the first domain name information in the DNS query request includes:

[0009] Based on the identifier configured for the first network, obtaining, from a second DNS cache pool corresponding to the first network, second domain name information obtained by the electronic device under the first network and a first DNS resolution result corresponding to the second domain name information;

[0010] The first DNS resolution result is updated to the first DNS cache pool, and the updated first DNS cache pool is queried based on the first domain name information.

[0011] In some embodiments, the method further comprises:

[0012] If there is no historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool, sending the DNS query request to a DNS server;

[0013] Receiving a second DNS resolution result obtained by the DNS server resolving the first domain name information;

[0014] Update the second DNS resolution result to the first DNS cache pool.

[0015] In some embodiments, the method further comprises:

[0016] In the case where the electronic device successfully switches from the first network to the second network, based on the identifier configured for the second network, creating a third DNS cache pool corresponding to the second network;

[0017] The updating the second DNS resolution result to the first DNS cache pool includes:

[0018] When receiving the second DNS resolution result returned by the DNS server, updating the second DNS resolution result to the third DNS cache pool;

[0019] When the electronic device switches from the second network to the third network, the second DNS resolution result is updated from the third DNS cache pool to the first DNS cache pool, and the third DNS cache pool is cleared.

[0020] In some embodiments, updating the first DNS resolution result to the first DNS cache pool includes:

[0021] If the historical domain name information corresponding to the first domain name information does not exist in the first DNS cache pool, updating the first DNS resolution result to the first DNS cache pool;

[0022] The method further comprises:

[0023] After updating the first DNS resolution result to the first DNS cache pool, clearing the second DNS cache pool.

[0024] In some embodiments, updating the first DNS resolution result to the first DNS cache pool includes:

[0025] If there is historical domain name information corresponding to the first domain name information in the first DNS cache pool, determining whether the first DNS resolution result is the same as the historical DNS resolution result corresponding to the historical domain name information;

[0026] When the first DNS resolution result is different from the historical DNS resolution result corresponding to the historical domain name information, the historical DNS resolution result corresponding to the historical domain name information is updated to the first DNS resolution result.

[0027] In some embodiments, the method further comprises:

[0028] Determine the cache duration of each historical DNS resolution result in the first DNS cache pool;

[0029] The historical DNS resolution results whose cache duration is longer than the preset duration are cleared from the first DNS cache pool.

[0030] According to a second aspect of an embodiment of the present disclosure, a device for processing DNS information is provided, including:

[0031] a detection module, configured to detect a DNS query request initiated by the electronic device when the electronic device switches from the first network to the second network;

[0032] A query module, configured to query a first DNS cache pool based on the first domain name information in the DNS query request; wherein the first DNS cache pool is used to cache historical DNS resolution results obtained by the electronic device under different networks;

[0033] The first determination module is configured to determine the historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool as the target resolution result corresponding to the DNS query request.

[0034] In some embodiments, the query module is configured to:

[0035] Based on the identifier configured for the first network, obtaining, from a second DNS cache pool corresponding to the first network, second domain name information obtained by the electronic device when accessing a website under the first network and a first DNS resolution result corresponding to the second domain name information;

[0036] The first DNS resolution result is updated to the first DNS cache pool, and the updated first DNS cache pool is queried based on the first domain name information.

[0037] In some embodiments, the apparatus further comprises:

[0038] a sending module, configured to send the DNS query request to a DNS server when there is no historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool;

[0039] A receiving module is configured to receive a second DNS resolution result obtained by the DNS server resolving the first domain name information;

[0040] An update module is configured to update the second DNS resolution result to the first DNS cache pool.

[0041] In some embodiments, the apparatus further comprises:

[0042] a creation module configured to create a third DNS cache pool corresponding to the second network based on an identifier configured for the second network when the electronic device successfully switches from the first network to the second network;

[0043] The update module is configured as follows:

[0044] When receiving the second DNS resolution result returned by the DNS server, updating the second DNS resolution result to the third DNS cache pool;

[0045] When the electronic device switches from the second network to the third network, the second DNS resolution result is updated from the third DNS cache pool to the first DNS cache pool, and the third DNS cache pool is cleared.

[0046] In some embodiments, the query module is configured to:

[0047] If the historical domain name information corresponding to the first domain name information does not exist in the first DNS cache pool, updating the first DNS resolution result to the first DNS cache pool;

[0048] The device also includes:

[0049] After updating the first DNS resolution result to the first DNS cache pool, clearing the second DNS cache pool.

[0050] In some embodiments, the query module is configured to:

[0051] If there is historical domain name information corresponding to the first domain name information in the first DNS cache pool, determining whether the first DNS resolution result is the same as the historical DNS resolution result corresponding to the historical domain name information;

[0052] When the first DNS resolution result is different from the historical DNS resolution result corresponding to the historical domain name information, the historical DNS resolution result corresponding to the historical domain name information is updated to the first DNS resolution result.

[0053] In some embodiments, the apparatus further comprises:

[0054] A second determination module is configured to determine the cache duration of each historical DNS resolution result in the first DNS cache pool;

[0055] The clearing module is configured to clear the historical DNS resolution results whose cache time is longer than a preset time from the first DNS cache pool.

[0056] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0057] processor;

[0058] a memory configured to store processor-executable instructions;

[0059] Wherein, the processor is configured to: implement the steps in any one of the DNS information processing methods in the first aspect when executed.

[0060] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute any one of the DNS information processing methods in the first aspect.

[0061] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0062] When an electronic device switches from a first network to a second network, a DNS query request initiated by the electronic device is detected, a first DNS cache pool is queried based on the first domain name information in the DNS query request, and a historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool is determined as a target resolution result corresponding to the DNS query request, wherein the first DNS cache pool is used to cache historical DNS resolution results obtained by the electronic device under different networks.

[0063] The technical solution disclosed in the present invention can integrate the historical DNS resolution results obtained by the electronic device's historical visits to various websites and cache them in a first DNS cache pool, that is, it can integrate the existing DNS caches to form a comprehensive and efficient cache pool, so that after the user switches the network environment, the current network cache can be quickly loaded into the first DNS cache pool. When the user initiates a new DNS query request in the new network environment, the system no longer needs to go through the cumbersome domain name resolution process, but can directly query the corresponding DNS resolution results from the first DNS cache pool, which can improve the DNS query efficiency, optimize the DNS cache persistence and utilization in multiple network environments, greatly reduce the RTT query delay, thereby significantly improving the network connection speed, and thus improving the user experience.

[0064] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0066] Figure 1 The following is a flow chart of a method for processing DNS information according to an exemplary embodiment. Figure 1 .

[0067] Figure 2 It is a schematic diagram of an architecture based on DNS query according to related technologies.

[0068] Figure 3 It is a schematic diagram of interaction based on DNS query according to the related technology.

[0069] Figure 4 The diagram is a schematic diagram of an architecture based on DNS query according to an exemplary embodiment.

[0070] Figure 5 The diagram is a schematic diagram of interaction based on DNS query according to an exemplary embodiment.

[0071] Figure 6The following is a flow chart of a method for processing DNS information according to an exemplary embodiment. Figure 2 .

[0072] Figure 7 The present invention is a block diagram of a device for processing DNS information according to an exemplary embodiment.

[0073] Figure 8 It is a hardware structure block diagram of an electronic device 800 according to an exemplary embodiment. DETAILED DESCRIPTION

[0074] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0075] Figure 1 The following is a flow chart of a method for processing DNS information according to an exemplary embodiment. Figure 1 ,like Figure 1 As shown, the method mainly includes the following steps:

[0076] In step 101, when the electronic device switches from the first network to the second network, a DNS query request initiated by the electronic device is detected;

[0077] In step 102, a first DNS cache pool is queried based on the first domain name information in the DNS query request; wherein the first DNS cache pool is used to cache historical DNS resolution results obtained by the electronic device under different networks;

[0078] In step 103, the historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool is determined as the target resolution result corresponding to the DNS query request.

[0079] It should be noted that the method can be applied to electronic devices. The electronic devices may include terminal devices. The terminal devices may include mobile terminals and fixed terminals, such as mobile phones, tablet computers, PDAs, laptop computers, desktop computers, wearable devices, smart speakers, televisions, and vehicle-mounted terminals.

[0080] Wearable devices may include: portable devices that are worn directly on the user or integrated into the user's accessories. For example, they may include: wearable devices supported by the head (including headphones, glasses, helmets, headbands, etc.). They may also include: smart clothing, school bags, crutches, accessories, etc.

[0081] In an embodiment of the present disclosure, when a DNS query request initiated by an electronic device is detected, it can be determined whether the network to which the electronic device is connected has changed, for example, whether the electronic device has switched from a first network to a second network. Here, the network to which the electronic device is connected is related to the application scenario of the electronic device. In an embodiment of the present disclosure, the network environment can be monitored in real time. For example, the network environment in which the electronic device is located can be continuously monitored by a network environment monitoring system, wherein the network environment may include: Wi-Fi network, mobile data network (such as 4G or 5G), Ethernet, etc. The network environment monitoring system can identify and classify the current network environment in real time according to various parameters (such as network speed, delay, stability, etc.), and then determine whether the electronic device has switched from the first network to the second network. Here, the first network may include: Wi-Fi network, mobile data network (such as 4G or 5G), Ethernet, etc.; the second network may also include: Wi-Fi network, mobile data network (such as 4G or 5G), Ethernet, etc.

[0082] For example, taking the electronic device as a mobile terminal (for example, a smart phone, a tablet computer, a mobile hotspot device, etc.), since the mobile terminal often needs to switch between different network environments, such as switching from home Wi-Fi to office Wi-Fi, or from Wi-Fi to a mobile data network, these can all be understood as scenarios of network changes mentioned in the present disclosure.

[0083] For example, taking an enterprise network scenario as an example, in an enterprise network, electronic devices often need to switch between an internal network and an external network, or switch between multiple subnets, which can also be understood as a scenario in which the network mentioned in the present disclosure changes.

[0084] For example, taking the application of electronic devices in cloud computing and data centers as an example, in the cloud computing and data center environment, a large number of virtual machines and containers need to frequently perform network switching, which can also be understood as the scenario of network changes mentioned in the present disclosure.

[0085] For example, taking the electronic device as an Internet of Things (IoT) device, in the IoT device and network, the IoT device may need to switch between multiple network environments, such as switching from a home network to a public Wi-Fi, or from Wi-Fi to a cellular network, which can also be understood as a scenario in which the network changes mentioned in the present disclosure.

[0086] In an embodiment of the present disclosure, when a change in the network to which the electronic device is connected is detected, that is, when the electronic device switches from the first network to the second network, the first DNS cache pool can be queried based on the first domain name information in the DNS query request. Here, the first DNS cache pool is used to cache the historical DNS resolution results obtained by the electronic device when accessing various websites under different networks. It can be understood that all DNS resolution results obtained by the electronic device from all websites accessed through different networks before the current moment are stored in the first DNS cache pool in the form of historical data. In some embodiments, while storing the historical DNS resolution results in the first DNS cache pool, the historical domain name information corresponding to the historical DNS resolution results can also be synchronously stored in the first DNS cache pool. Among them, the DNS resolution result can be an IP address. For example, the DNS resolution result corresponding to the historical domain name information www.baidu.com can be 220.181.38.149.

[0087] In the embodiment of the present disclosure, the process of querying the first DNS cache pool based on the first domain name information in the DNS query request can be to determine whether the first domain name information exists in the first DNS cache pool. Specifically, determining whether the first domain name information exists in the first DNS cache pool can be: matching the first domain name information with each historical domain name information in the first DNS cache pool, and determining that there is historical domain name information matching the first domain name information in the first DNS cache pool, then determining that the first domain name information exists in the first DNS cache pool. Among them, the historical domain name information matching the first domain name information can be the same historical domain name information as the first domain name information, or it can be historical domain name information whose similarity with the first domain name information is greater than a similarity threshold.

[0088] In some embodiments, when there is historical domain name information matching the first domain name information in the first DNS cache pool, it is determined that there is a historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool. At this time, the historical DNS resolution result corresponding to the historical domain name information matching the first domain name information can be determined as the historical DNS resolution result corresponding to the first domain name information, that is, the historical DNS resolution result corresponding to the historical domain name information matching the first domain name information is determined as the target resolution result corresponding to the DNS query request.

[0089] When it is detected that an electronic device initiates a DNS query request and the network to which the electronic device is connected changes, a first DNS cache pool is queried based on the first domain name information in the DNS query request, and a historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool is determined as a target resolution result corresponding to the DNS query request, wherein the first DNS cache pool is used to cache historical DNS resolution results obtained when the electronic device historically visited various websites.

[0090] The technical solution disclosed in the present invention can integrate the historical DNS resolution results obtained by the electronic device's historical visits to various websites and cache them in a first DNS cache pool, that is, it can integrate the existing DNS caches to form a comprehensive and efficient cache pool, so that after the user switches the network environment, the current network cache can be quickly loaded into the first DNS cache pool. When the user initiates a new DNS query request in the new network environment, the system no longer needs to go through the cumbersome domain name resolution process, but can directly query the corresponding DNS resolution results from the first DNS cache pool, which can improve the DNS query efficiency, optimize the DNS cache persistence and utilization in multiple network environments, greatly reduce the RTT query delay, thereby significantly improving the network connection speed, and thus improving the user experience.

[0091] In some embodiments, querying the first DNS cache pool based on the first domain name information in the DNS query request includes:

[0092] Based on the identifier configured for the first network (the identifier of the first network), obtaining, from a second DNS cache pool corresponding to the first network, second domain name information obtained by the electronic device under the first network and a first DNS resolution result corresponding to the second domain name information;

[0093] The first DNS resolution result is updated to the first DNS cache pool, and the updated first DNS cache pool is queried based on the first domain name information.

[0094] Here, the first network may include: Wi-Fi network, mobile data network (such as 4G or 5G), Ethernet, etc. The second network may also include: Wi-Fi network, mobile data network (such as 4G or 5G), Ethernet, etc. Among them, the first network and the second network may be networks of the same type or networks of different types. For example, the first network may be a first Wi-Fi network, and the second network may be a second Wi-Fi network. For another example, the first network may be a Wi-Fi network, and the second network may be a mobile data network, which is not specifically limited here.

[0095] In the disclosed embodiment, a network environment identifier (i.e., the identifier of the network) can be configured for each network. It can be understood that each detected network will be assigned a unique identifier so as to associate each network with the corresponding DNS cache pool. In this way, each network will be clearly defined and a corresponding relationship will be established with a set DNS cache pool. In order to ensure that each network has a DNS cache pool, a separate cache pool strategy can be adopted to configure an independent DNS cache pool for each network. The DNS cache pool is used to temporarily store the DNS resolution results related to the network, thereby realizing the separation of the DNS cache pool. A one-to-one correspondence is established between the network and the DNS cache pool to achieve more efficient network resource management and DNS resolution performance optimization.

[0096] Exemplarily, the first network in the present disclosure has a corresponding second DNS cache pool, and the second DNS cache pool is associated with the identifier of the first network. When the electronic device accesses a website under the first network, it can obtain the second domain name information obtained by accessing the website under the first network and the first DNS resolution result corresponding to the second domain name information, and update the first DNS resolution result corresponding to the second domain name information and the second domain name information to the first DNS cache pool, and query the updated first DNS cache pool based on the first domain name information.

[0097] In the disclosed embodiment, after switching networks, the current network cache can be quickly loaded into the first DNS cache pool. When the user initiates a new DNS query request in the new network environment, the system no longer needs to go through the cumbersome domain name resolution process, but can directly query the corresponding DNS resolution result from the first DNS cache pool, which can improve the DNS query efficiency, optimize the DNS cache persistence and utilization in multiple network environments, greatly reduce the RTT query delay, thereby significantly improving the network connection speed, and thus improving the user experience.

[0098] And when a network switch occurs, the existing cache is first effectively managed, and the existing cache entries (first DNS resolution results) are added to the first DNS cache pool to ensure that the previously obtained DNS query results are still available for subsequent use, which helps to reduce the need for repeated DNS queries, thereby improving network performance and reducing resource overhead.

[0099] In some embodiments, the method further comprises:

[0100] If there is no historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool, sending the DNS query request to a DNS server;

[0101] Receiving a second DNS resolution result obtained by the DNS server resolving the first domain name information;

[0102] Update the second DNS resolution result to the first DNS cache pool.

[0103] In some embodiments, when there is no historical domain name information matching the first domain name information in the first DNS cache pool, it is determined that there is no historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool. At this time, a DNS query request can be sent to a DNS server, and a second DNS resolution result obtained by the DNS server resolving the first domain name information is received, and the second DNS resolution result is updated to the first DNS cache pool.

[0104] In the embodiment of the present disclosure, if there is no historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool, a DNS query request can be initiated to the DNS server to obtain a second DNS resolution result, and the second DNS resolution result is updated to the first DNS cache pool for future use. At the same time, the second DNS resolution result can also be returned to the application to meet the network communication needs of the application.

[0105] In some embodiments, the DNS query request in the present disclosure may be initiated by an application program. After determining the target resolution result corresponding to the DNS query request, the target resolution result may be returned to the application program.

[0106] In the embodiment of the present disclosure, when there is no historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool, a DNS query request can also be initiated to the DNS server to ensure normal network communication, and after obtaining the second DNS resolution result, the second DNS resolution result can be updated to the first DNS cache pool, thereby ensuring the real-time performance of the first DNS cache pool.

[0107] In some embodiments, the method further comprises:

[0108] In the case where the electronic device successfully switches from the first network to the second network, based on the identifier configured for the second network, creating a third DNS cache pool corresponding to the second network;

[0109] The updating the second DNS resolution result to the first DNS cache pool includes:

[0110] When receiving the second DNS resolution result returned by the DNS server, updating the second DNS resolution result to the third DNS cache pool;

[0111] When the electronic device switches from the second network to the third network, the second DNS resolution result is updated from the third DNS cache pool to the first DNS cache pool, and the third DNS cache pool is cleared.

[0112] It should be noted that after the network is switched, a new DNS cache pool can be created to store the upcoming DNS query results. This new DNS cache pool will be used to temporarily store and provide DNS resolution results in subsequent queries, thereby reducing network latency and resource consumption.

[0113] In the embodiment of the present disclosure, when the electronic device successfully switches from the first network to the second network, a third DNS cache pool corresponding to the second network can be created based on the identifier configured for the second network (identifier of the second network). It can be understood that the second network in the present disclosure has a corresponding third DNS cache pool, and the third DNS cache pool is associated with the identifier of the second network. When the electronic device accesses a website under the second network, the third domain name information obtained by accessing the website under the second network and the second DNS resolution result corresponding to the third domain name information can be obtained, and the third domain name information and the second DNS resolution result corresponding to the third domain name information can be updated to the third DNS cache pool.

[0114] For example, when the second DNS resolution result returned by the DNS server is received, the second DNS resolution result can be updated to the third DNS cache pool, and when the electronic device switches from the second network to the third network, the second DNS resolution result is updated from the third DNS cache pool to the first DNS cache pool, and the third DNS cache pool is cleared. The second DNS resolution result can be updated to the first DNS cache pool before the third DNS cache pool is cleared, which can ensure the persistence of the second DNS resolution result.

[0115] In the disclosed embodiment, after switching from the second network to the third network, the cache of the second network can be quickly loaded into the first DNS cache pool. When the user initiates a new DNS query request in the new network environment, the system no longer needs to go through the cumbersome domain name resolution process, but can directly query the corresponding DNS resolution result from the first DNS cache pool, which can improve the DNS query efficiency, optimize the DNS cache persistence and utilization in multiple network environments, greatly reduce the RTT query delay, thereby significantly improving the network connection speed, and thus improving the user experience.

[0116] When the network environment switches, it can switch to the corresponding DNS cache pool according to the current network identifier. In this way, there is no need to re-acquire the DNS resolution results in different networks, but directly provide the resolution results from the corresponding cache, which improves the response speed of the application. Through this one-to-one association between the network environment and the DNS cache, we have achieved highly optimized network communication performance and resource management.

[0117] In some embodiments, updating the first DNS resolution result to the first DNS cache pool includes:

[0118] If the historical domain name information corresponding to the first domain name information does not exist in the first DNS cache pool, updating the first DNS resolution result to the first DNS cache pool;

[0119] The method further comprises:

[0120] After updating the first DNS resolution result to the first DNS cache pool, clearing the second DNS cache pool.

[0121] In the process of updating the first DNS resolution result to the first DNS cache pool, the second domain name information can be matched with each historical domain name information in the first DNS cache pool. If there is no historical domain name information matching the second domain name information in the first DNS cache pool, the second domain name information and the first DNS resolution result corresponding to the second domain name information are directly cached in the first DNS cache pool. The historical domain name information matching the second domain name information can be the same historical domain name information as the second domain name information, or can be the historical domain name information whose similarity with the second domain name information is greater than a similarity threshold.

[0122] In the disclosed embodiment, after the first DNS resolution result is updated to the first DNS cache pool, the second DNS cache pool can be cleared. The first DNS resolution result can be updated to the first DNS cache pool before the second DNS cache pool is cleared, which can ensure the persistence of the first DNS resolution result.

[0123] In some embodiments, updating the first DNS resolution result to the first DNS cache pool includes:

[0124] If there is historical domain name information corresponding to the first domain name information in the first DNS cache pool, determining whether the first DNS resolution result is the same as the historical DNS resolution result corresponding to the historical domain name information;

[0125] When the first DNS resolution result is different from the historical DNS resolution result corresponding to the historical domain name information, the historical DNS resolution result corresponding to the historical domain name information is updated to the first DNS resolution result.

[0126] When there is historical domain name information matching the second domain name information in the first DNS cache pool, it is determined whether the first DNS resolution result and the historical DNS resolution result corresponding to the historical domain name information are the same. When the first DNS resolution result and the historical DNS resolution result corresponding to the historical domain name information are different, the historical DNS resolution result corresponding to the historical domain name information is updated to the first DNS resolution result, thereby refreshing the historical DNS resolution results in the first DNS cache pool.

[0127] In some embodiments, the method further comprises:

[0128] Determine the cache duration of each historical DNS resolution result in the first DNS cache pool;

[0129] The historical DNS resolution results whose cache duration is longer than the preset duration are cleared from the first DNS cache pool.

[0130] Here, the cache duration can be the time period between the time when each historical DNS resolution result is stored in the first DNS cache pool and the current time. The preset duration can be set as needed, for example, it can be 1 day, 2 days, etc.

[0131] In the disclosed embodiment, by setting a cache expiration mechanism, historical DNS resolution results whose cache time is longer than a preset time can be cleared from the first DNS cache pool, thereby enabling the historical DNS resolution results in the first DNS cache pool to be updated and maintaining the accuracy and real-time performance of the DNS cache of each network.

[0132] Figure 2 is a schematic diagram of an architecture based on DNS query according to related technologies, such as Figure 2 As shown, when the electronic device 201 initiates a DNS query request, it is necessary to perform DNS resolution for each network (network 1 . . . network n) and return the DNS resolution results respectively. Figure 3 is a schematic diagram of interaction based on DNS query according to the related art, such as Figure 3As shown, when an electronic device 301 (for example, a mobile device) initiates a DNS query request based on the current network, it can only query the cache pool 302 corresponding to the current network. When there is no DNS resolution result corresponding to the DNS query request in the cache pool 302 corresponding to the current network, a DNS query request is sent to the DNS server 303, and the DNS resolution result returned by the DNS server 303 is obtained. In the related art, only the cache pool 302 corresponding to the current network can be queried. In this way, repeated DNS queries need to be performed for different networks. If the user needs to switch networks frequently, a lot of time will be consumed. Through the solution of the related art, the cache cannot be hit after the network connected to the electronic device changes, and the DNS query speed is low.

[0133] Figure 4 is a schematic diagram of an architecture based on DNS query according to an exemplary embodiment, such as Figure 4 As shown, when electronic device 401 initiates a DNS query request, the first DNS cache pool can be queried based on the first domain name information in the DNS query request, and the first DNS cache pool caches historical DNS resolution results obtained by the electronic device when accessing various websites under different networks (network 1...network n). Figure 5 is a schematic diagram of interaction based on DNS query according to an exemplary embodiment, such as Figure 5 As shown, when the electronic device 501 initiates a DNS query request based on the current network, the first DNS cache pool 502 that caches the historical DNS resolution results obtained by the electronic device accessing various websites under different networks (network 1...network n) can be queried. When there is no DNS resolution result corresponding to the DNS query request in the first DNS cache pool 502, a DNS query request is sent to the DNS server 503, and the second DNS resolution result returned by the DNS server 503 is obtained, and the second DNS resolution result is updated to the first DNS cache pool. Through the technical solution disclosed in the present invention, the cache can be hit after the network connected to the electronic device changes, and by reusing the cache, the query speed can be improved, the number of queries can be reduced, and the power consumption and traffic consumption can be lower.

[0134] Figure 6 The following is a flow chart of a method for processing DNS information according to an exemplary embodiment. Figure 2 ,like Figure 6 As shown, the method mainly includes the following steps:

[0135] In step 601, a change in the network to which the electronic device is connected is detected.

[0136] For example, if the electronic device switches from the first network to the second network, it is determined that the network connected to the electronic device has changed. Exemplarily, if the switch between the Wi-Fi module and the data module is detected, it is determined that the network connected to the electronic device has changed.

[0137] In step 602, a first DNS resolution result obtained by an electronic device accessing a website under a first network is updated to a first DNS cache pool.

[0138] Here, the first DNS resolution result obtained by the electronic device accessing the website under the first network can be obtained from the second DNS cache pool corresponding to the first network.

[0139] In step 603, a third DNS cache pool corresponding to the second network is created.

[0140] Here, when the electronic device successfully switches from the first network to the second network, a third DNS cache pool corresponding to the second network may be created based on the identifier of the second network.

[0141] In step 604, it is determined whether there is a historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool.

[0142] In step 605, a DNS query request is sent to a DNS server.

[0143] Here, when there is no historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool, the DNS query request is sent to the DNS server.

[0144] In step 606, a second DNS resolution result is obtained by receiving the resolution of the first domain name information by the DNS server, and the second DNS resolution result is determined as a target resolution result corresponding to the DNS query request.

[0145] Here, a second DNS resolution result obtained by the DNS server resolving the first domain name information may be received, and the second DNS resolution result may be determined as a target resolution result corresponding to the DNS query request, and then the target resolution result may be returned to the user.

[0146] The historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool is determined as the target resolution result corresponding to the DNS query request.

[0147] Here, when there is a historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool, the historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool is determined as the target resolution result corresponding to the DNS query request, and then the target resolution result is returned to the user.

[0148] The technical solution disclosed in the present invention can integrate the historical DNS resolution results obtained by the electronic device's historical visits to various websites and cache them in a first DNS cache pool, that is, it can integrate the existing DNS caches to form a comprehensive and efficient cache pool, so that after the user switches the network environment, the current network cache can be quickly loaded into the first DNS cache pool. When the user initiates a new DNS query request in the new network environment, the system no longer needs to go through the cumbersome domain name resolution process, but can directly query the corresponding DNS resolution results from the first DNS cache pool, which can improve the DNS query efficiency, optimize the DNS cache persistence and utilization in multiple network environments, greatly reduce the RTT query delay, thereby significantly improving the network connection speed, and thus improving the user experience.

[0149] The technical solution disclosed in this disclosure realizes an efficient network switching process, reduces the dependence on network resources, improves user experience, and reduces the cost of network traffic through cache management and optimized DNS resolution. The technical solution disclosed in this disclosure is applicable to mobile devices, wireless communication networks, and various network applications, and can bring significant improvements in the fields of network performance and resource management.

[0150] Figure 7 FIG. 1 is a block diagram of a device for processing DNS information according to an exemplary embodiment. Figure 7 As shown, the DNS information processing device 700 mainly includes:

[0151] The detection module 701 is configured to detect a DNS query request initiated by the electronic device when the electronic device switches from the first network to the second network;

[0152] The query module 702 is configured to query a first DNS cache pool based on the first domain name information in the DNS query request; wherein the first DNS cache pool is used to cache historical DNS resolution results obtained by the electronic device accessing various websites under different networks;

[0153] The first determination module 703 is configured to determine the historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool as the target resolution result corresponding to the DNS query request.

[0154] In some embodiments, the query module 702 is configured to:

[0155] Based on the identifier configured for the first network, obtaining, from a second DNS cache pool corresponding to the first network, second domain name information obtained by the electronic device when accessing a website under the first network and a first DNS resolution result corresponding to the second domain name information;

[0156] The first DNS resolution result is updated to the first DNS cache pool, and the updated first DNS cache pool is queried based on the first domain name information.

[0157] In some embodiments, the apparatus 700 further includes:

[0158] a sending module, configured to send the DNS query request to a DNS server when there is no historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool;

[0159] A receiving module is configured to receive a second DNS resolution result obtained by the DNS server resolving the first domain name information;

[0160] An update module is configured to update the second DNS resolution result to the first DNS cache pool.

[0161] In some embodiments, the apparatus 700 further includes:

[0162] a creation module configured to create a third DNS cache pool corresponding to the second network based on an identifier configured for the second network when the electronic device successfully switches from the first network to the second network;

[0163] The update module is configured as follows:

[0164] When receiving the second DNS resolution result returned by the DNS server, updating the second DNS resolution result to the third DNS cache pool;

[0165] When the electronic device switches from the second network to the third network, the second DNS resolution result is updated from the third DNS cache pool to the first DNS cache pool, and the third DNS cache pool is cleared.

[0166] In some embodiments, the query module 702 is configured to:

[0167] If the historical domain name information corresponding to the first domain name information does not exist in the first DNS cache pool, updating the first DNS resolution result to the first DNS cache pool;

[0168] The device 700 further includes:

[0169] After updating the first DNS resolution result to the first DNS cache pool, clearing the second DNS cache pool.

[0170] In some embodiments, the query module 702 is configured to:

[0171] If there is historical domain name information corresponding to the first domain name information in the first DNS cache pool, determining whether the first DNS resolution result is the same as the historical DNS resolution result corresponding to the historical domain name information;

[0172] When the first DNS resolution result is different from the historical DNS resolution result corresponding to the historical domain name information, the historical DNS resolution result corresponding to the historical domain name information is updated to the first DNS resolution result.

[0173] In some embodiments, the apparatus 700 further includes:

[0174] A second determination module is configured to determine the cache duration of each historical DNS resolution result in the first DNS cache pool;

[0175] The clearing module is configured to clear the historical DNS resolution results whose cache time is longer than a preset time from the first DNS cache pool.

[0176] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0177] Figure 8 1 is a hardware structure block diagram of an electronic device 800 according to an exemplary embodiment. For example, the device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, a wearable device, etc.

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

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

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

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

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

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

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

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

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

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

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

[0189] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform a method for processing DNS information, the method comprising:

[0190] When the electronic device switches from the first network to the second network, detecting a DNS query request initiated by the electronic device; querying a first DNS cache pool based on the first domain name information in the DNS query request; wherein the first DNS cache pool is used to cache historical DNS resolution results obtained by the electronic device under different networks;

[0191] The historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool is determined as the target resolution result corresponding to the DNS query request.

[0192] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0193] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for processing DNS information, It is characterized in that include: When the electronic device switches from the first network to the second network, detecting a DNS query request initiated by the electronic device; Querying a first DNS cache pool based on the first domain name information in the DNS query request; wherein the first DNS cache pool is used to cache historical DNS resolution results obtained by the electronic device under different networks; The historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool is determined as the target resolution result corresponding to the DNS query request.

2. The method according to claim 1, It is characterized in that The querying the first DNS cache pool based on the first domain name information in the DNS query request includes: Based on the identifier configured for the first network, obtaining, from a second DNS cache pool corresponding to the first network, second domain name information obtained by the electronic device under the first network and a first DNS resolution result corresponding to the second domain name information; The first DNS resolution result is updated to the first DNS cache pool, and the updated first DNS cache pool is queried based on the first domain name information.

3. The method according to claim 1 or 2, It is characterized in that The method further comprises: If there is no historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool, sending the DNS query request to a DNS server; Receiving a second DNS resolution result obtained by the DNS server resolving the first domain name information; Update the second DNS resolution result to the first DNS cache pool.

4. The method according to claim 3, It is characterized in that The method further comprises: In the case where the electronic device successfully switches from the first network to the second network, based on the identifier configured for the second network, creating a third DNS cache pool corresponding to the second network; The updating the second DNS resolution result to the first DNS cache pool includes: When receiving the second DNS resolution result returned by the DNS server, updating the second DNS resolution result to the third DNS cache pool; When the electronic device switches from the second network to the third network, the second DNS resolution result is updated from the third DNS cache pool to the first DNS cache pool, and the third DNS cache pool is cleared.

5. The method according to claim 2, It is characterized in that The updating of the first DNS resolution result to the first DNS cache pool includes: If the historical domain name information corresponding to the first domain name information does not exist in the first DNS cache pool, updating the first DNS resolution result to the first DNS cache pool; The method further comprises: After updating the first DNS resolution result to the first DNS cache pool, clearing the second DNS cache pool.

6. The method according to claim 2, It is characterized in that The updating of the first DNS resolution result to the first DNS cache pool includes: In the case where historical domain name information corresponding to the first domain name information exists in the first DNS cache pool, determining whether the first DNS resolution result is the same as the historical DNS resolution result corresponding to the historical domain name information; When the first DNS resolution result is different from the historical DNS resolution result corresponding to the historical domain name information, the historical DNS resolution result corresponding to the historical domain name information is updated to the first DNS resolution result.

7. The method according to claim 1, It is characterized in that The method further comprises: Determine the cache duration of each historical DNS resolution result in the first DNS cache pool; The historical DNS resolution results whose cache duration is longer than the preset duration are cleared from the first DNS cache pool.

8. A device for processing DNS information, It is characterized in that include: a detection module, configured to detect a DNS query request initiated by the electronic device when the electronic device switches from the first network to the second network; A query module, configured to query a first DNS cache pool based on the first domain name information in the DNS query request; wherein the first DNS cache pool is used to cache historical DNS resolution results obtained by the electronic device under different networks; The first determination module is configured to determine the historical DNS resolution result corresponding to the first domain name information in the first DNS cache pool as the target resolution result corresponding to the DNS query request.

9. An electronic device, It is characterized in that include: processor; a memory configured to store processor-executable instructions; Wherein, the processor is configured to: implement the steps in any one of the DNS information processing methods in claims 1 to 7 when executed.

10. A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any one of the DNS information processing methods of claims 1 to 7.