Domain name resolution method and apparatus, and computer device

By filtering candidate domain names in the target cache and updating their IP addresses, the problem of slow domain name resolution speed in existing technologies is solved, improving network speed and efficient use of cache, and avoiding resource waste and domain name hijacking.

WO2025232321A1PCT designated stage Publication Date: 2025-11-13SHENZHEN TCL DIGITAL TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/078981
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-05-06
Filing Date
2025-02-25
Publication Date
2025-11-13

AI Technical Summary

Technical Problem

In the current domain name resolution process, terminal devices need to perform domain name resolution frequently, resulting in slow network speeds. In particular, when the local cache or DNS cache does not contain the IP address corresponding to the domain name, a new domain name server query is required, which wastes system resources and reduces speed.

Method used

By filtering candidate domains in the target cache that have reached a preset cache time, and sending domain name resolution requests to the domain name server according to the access frequency, the IP address of the candidate domains is updated, ensuring that frequently used domains remain up-to-date in the cache and reducing the number of repeated resolution processes.

Benefits of technology

It improves domain name resolution speed and application network speed, reduces system resource waste, avoids domain name hijacking issues, and ensures IP address accuracy and efficient cache utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025078981_13112025_PF_FP_ABST
    Figure CN2025078981_13112025_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a domain name resolution method and apparatus, and a computer device. The method comprises: determining a candidate domain name from among cached domain names on the basis of cache time; if the access frequency corresponding to the candidate domain name reaches a preset frequency threshold, sending a first domain name resolution request to a domain name server; and acquiring an updated IP address returned by the domain name server on the basis of the first domain name resolution request, and on the basis of the updated IP address, updating an IP address corresponding to the candidate domain name.
Need to check novelty before this filing date? Find Prior Art

Description

Domain name resolution methods, devices and computer equipment

[0001] This application claims priority to Chinese Patent Application No. 202410565238.2, filed on May 6, 2024, entitled "Domain Name Resolution Method, Apparatus, Computer Equipment and Computer-Readable Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of communication technology, specifically to a domain name resolution method, apparatus, and computer equipment. Background Technology

[0003] Connecting to the internet via Wi-Fi is becoming increasingly common, and modern life is inseparable from Wi-Fi technology. Currently, various internet-connected applications on terminal devices need to resolve the internet protocol address (IP address) corresponding to the domain name during use, and then access the network based on the IP address. Technical issues

[0004] The existing domain name resolution process typically includes the following steps: An application constructs a network access request using a domain name. Upon receiving the request, the operating system first checks its local cache or DNS cache for the corresponding IP address. If neither cache contains the IP address, it sends a domain name resolution request to a pre-defined domain name server to retrieve the IP address. Because the IP address returned by the domain name server is valid for a very short time, network applications on the terminal device need to go through the domain name resolution process again the next time they access the network, resulting in slow network speeds. Technical solutions

[0005] This application provides a domain name resolution method, apparatus, and computer equipment, which can improve the domain name resolution speed and the network speed of applications.

[0006] Firstly, this application provides a domain name resolution method, including:

[0007] Retrieve the cache time corresponding to the cached domain name in the target cache. The target cache includes the cached domain name and the IP address corresponding to the cached domain name.

[0008] Candidate domains are determined from cached domains based on cache time. Candidate domains are those whose cache time has reached the first preset time.

[0009] Obtain the access frequency corresponding to the candidate domain name. If the access frequency reaches the preset frequency threshold, send the first domain name resolution request for the candidate domain name to the preset domain name server.

[0010] Obtain the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and update the IP address corresponding to the candidate domain name based on the updated IP address.

[0011] In some implementations of this application, after obtaining the access frequency corresponding to the candidate domain name, the method further includes:

[0012] If the access frequency does not reach the frequency threshold, obtain the domain type corresponding to the candidate domain;

[0013] Determine if the domain name type is the default type;

[0014] If the domain name type is the preset type, send a first domain name resolution request for the candidate domain name to the domain name server;

[0015] Obtain the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and update the IP address corresponding to the candidate domain name based on the updated IP address.

[0016] In some implementation schemes of this application, the domain name types include a first type, a second type, and a third type. The first type of domain name is a pre-set known domain name, the second type of domain name is a non-aging application domain name that the user pre-sets according to their needs, and the third type of domain name is other domain names besides the first type and the second type of domain names.

[0017] In some embodiments of this application, the preset type includes a first type and a second type. Determining whether the domain name type is a preset type includes:

[0018] Determine if the domain name type is type 1;

[0019] If the domain name type is not the first type, obtain the domain name field corresponding to the candidate domain name and match the domain name field with the preset field;

[0020] If the domain name field matches the preset field, the domain name type is determined to be the second type.

[0021] In some implementations of this application, after determining whether the domain name type is the first type, the following is also included:

[0022] If the domain name type is the first type, then the domain name type is determined to be the default type.

[0023] In some embodiments of this application, after matching the domain name field with preset fields, the method further includes:

[0024] If the domain name field does not match the preset field, it is determined that the domain name type is not the preset type.

[0025] In some implementation schemes of this application, after determining whether the domain name type is a preset type, the method further includes:

[0026] If the domain name type is not the preset type, obtain the aging time corresponding to the candidate domain name and compare the cache time with the aging time;

[0027] If the cache expires, the cached domain name and its corresponding IP address will be removed from the target cache.

[0028] In some embodiments of this application, the method further includes:

[0029] Obtain the network access requests of the target application, including the target domain name;

[0030] Based on the network access request, query whether there is a cached domain name in the target cache that matches the target domain name;

[0031] If a cached domain name matching the target domain name exists in the target cache, return the IP address corresponding to the cached domain name matching the target domain name to the target application so that the target application can access the network based on the IP address corresponding to the cached domain name.

[0032] In some embodiments of this application, after querying the target cache for a cached domain name that matches the target domain name based on a network access request, the method further includes:

[0033] If the target cache does not contain a cached domain name that matches the target domain name, a second domain name resolution request for the target domain name is sent to the preset public domain name server;

[0034] Obtain the IP address corresponding to the target domain name returned by the public domain name server based on the second domain name resolution request, and return the IP address corresponding to the target domain name to the target application so that the target application can access the network based on the IP address corresponding to the target domain name.

[0035] In some embodiments of this application, after obtaining the IP address corresponding to the target domain name returned by the public domain name server based on the second domain name resolution request, the method further includes:

[0036] Save the target domain name and its corresponding IP address to the target cache.

[0037] In some embodiments of this application, after sending a second domain name resolution request for the target domain name to a preset public domain name server, the process includes:

[0038] If the public domain name server fails to resolve the domain name, a second domain name resolution request is sent to the domain name server assigned by the router, and the IP address corresponding to the target domain name returned by the domain name server assigned by the router based on the second domain name resolution request is obtained.

[0039] Returns the IP address corresponding to the target domain name to the target application.

[0040] Secondly, embodiments of this application also provide a domain name resolution device, including:

[0041] The information acquisition module is used to obtain the cache time corresponding to the cached domain name in the target cache. The target cache includes the cached domain name and the IP address corresponding to the cached domain name.

[0042] The domain name determination module is used to determine candidate domain names from cached domain names based on cache time. The candidate domain names are the domain names in the cached domains whose cache time has reached the preset first time.

[0043] The domain name resolution module is used to obtain the access frequency corresponding to the candidate domain name. If the access frequency reaches the preset frequency threshold, the first domain name resolution request for the candidate domain name is sent to the preset domain name server.

[0044] The first update module is used to obtain the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and update the IP address corresponding to the candidate domain name based on the updated IP address.

[0045] In some embodiments of this application, the domain name resolution device further includes: a second update module, the second update module being specifically used for:

[0046] If the access frequency does not reach the frequency threshold, obtain the domain type corresponding to the candidate domain;

[0047] Determine if the domain name type is the default type;

[0048] If the domain name type is the preset type, send a first domain name resolution request for the candidate domain name to the domain name server;

[0049] Obtain the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and update the IP address corresponding to the candidate domain name based on the updated IP address.

[0050] In some embodiments of this application, the preset type includes a first type and a second type, and the second update module is further used for:

[0051] Determine whether the domain name type is the first type;

[0052] If the domain name type is not the first type, obtain the domain name field corresponding to the candidate domain name, and match the domain name field with the preset field;

[0053] If the domain name field matches the preset field, the domain name type is determined to be the second type.

[0054] In some embodiments of this application, the domain name resolution device further includes: a domain name aging module, which is specifically used for:

[0055] If the domain name type is not the preset type, obtain the aging time corresponding to the candidate domain name and compare the cache time with the aging time;

[0056] If the cache expires, the cached domain name and its corresponding IP address will be removed from the target cache.

[0057] In some embodiments of this application, the domain name resolution apparatus further includes: a request processing module, which is specifically used for:

[0058] Obtain the network access requests of the target application, including the target domain name;

[0059] Based on the network access request, query whether there is a cached domain name in the target cache that matches the target domain name;

[0060] If a cached domain name matching the target domain name exists in the target cache, return the IP address corresponding to the cached domain name matching the target domain name to the target application so that the target application can access the network based on the IP address corresponding to the cached domain name.

[0061] In some embodiments of this application, the request processing module is further used for:

[0062] If the target cache does not contain a cached domain name that matches the target domain name, a second domain name resolution request for the target domain name is sent to the preset public domain name server;

[0063] Obtain the IP address corresponding to the target domain name returned by the public domain name server based on the second domain name resolution request, and return the IP address corresponding to the target domain name to the target application so that the target application can access the network based on the IP address corresponding to the target domain name.

[0064] In some embodiments of this application, the domain name resolution device further includes: a domain name caching module, which is specifically used for:

[0065] Save the target domain name and its corresponding IP address to the target cache.

[0066] In some embodiments of this application, the request processing module is further configured to:

[0067] If the public domain name server fails to resolve the domain name, the second domain name resolution request is sent to the domain name server assigned by the router, and the IP address corresponding to the target domain name returned by the domain name server assigned by the router based on the second domain name resolution request is obtained;

[0068] Return the IP address corresponding to the target domain name to the target application.

[0069] Thirdly, this application also provides a computer device, which includes:

[0070] One or more processors;

[0071] Memory; and

[0072] One or more applications, wherein the applications are stored in memory and configured to be executed by a processor to implement the domain name resolution method of any of the first aspects.

[0073] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to perform the steps in the domain name resolution method of any of the first aspects. Beneficial effects

[0074] By filtering candidate domains from the target cache that have reached a preset first time, and sending a first domain name resolution request to the domain name server for candidate domains whose access frequency reaches a preset frequency threshold, and updating the IP address corresponding to the candidate domain based on the updated IP address returned by the domain name server based on the first domain name resolution request, the IP addresses of frequently used domains in the target cache can be automatically updated. Since the IP addresses of frequently used domains are always stored in the target cache, the application can directly obtain the IP address corresponding to the domain name from the target cache when making network access, thereby improving the application's network speed. Attached Figure Description

[0075] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0076] Figure 1 is a flowchart of the domain name resolution system provided in an embodiment of this application;

[0077] Figure 2 is a flowchart illustrating the domain name resolution method provided in an embodiment of this application;

[0078] Figure 3 is another flowchart illustrating the domain name resolution method provided in the embodiments of this application;

[0079] Figure 4 is another flowchart illustrating the domain name resolution method provided in an embodiment of this application;

[0080] Figure 5 is a schematic diagram of the process of network access based on target cache provided in an embodiment of this application;

[0081] Figure 6 is another schematic diagram of network access based on target cache provided in an embodiment of this application;

[0082] Figure 7 is a schematic block diagram of the domain name resolution device provided in an embodiment of this application;

[0083] Figure 8 is a schematic diagram of an embodiment of the computer device provided in this application. Detailed Implementation

[0084] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0085] In the description of this application, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. Furthermore, the terms "first," "second," and "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first," "second," "third," etc., may explicitly or implicitly include one or more of the stated features. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0086] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.

[0087] It should be noted that since the method in this application embodiment is executed in a computer device, the processing objects of each computer device exist in the form of data or information, such as time, which is essentially time information. It is understood that if size, quantity, position, etc. are mentioned in subsequent embodiments, they are all corresponding data that exist so that the computer device can process them. Specific details will not be elaborated here.

[0088] This application provides a domain name resolution method, apparatus, computer device, and storage medium, which will be described in detail below.

[0089] Please refer to Figure 1. Figure 1 is a schematic diagram of a domain name resolution system provided in an embodiment of this application. The domain name resolution system may include a computer device 100 and a domain name server 200 that is communicatively connected to the computer device 100. The computer device 100 integrates a domain name resolution device.

[0090] In this embodiment, the computer device 100 is mainly used to obtain the cache time corresponding to the cached domain name in the target cache, the target cache including the cached domain name and the IP address corresponding to the cached domain name; determine the candidate domain name from the cached domain name based on the cache time, the candidate domain name is the domain name whose cache time has reached a preset first time; obtain the access frequency corresponding to the candidate domain name, if the access frequency reaches a preset frequency threshold, send a first domain name resolution request for the candidate domain name to a preset domain name server; obtain the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and update the IP address corresponding to the candidate domain name based on the updated IP address, which can improve the domain name resolution speed and the network speed of the application.

[0091] The computer device 100 used in this embodiment can be a device that includes both receiving and transmitting hardware, i.e., a device with receiving and transmitting hardware capable of performing bidirectional communication on a bidirectional communication link. Such a device may include cellular or other communication devices having a single-line display, a multi-line display, or a cellular or other communication device without a multi-line display. Specifically, the computer device 100 can be a desktop terminal or a mobile terminal, and may also be a mobile phone, tablet computer, laptop computer, etc.

[0092] In this embodiment of the application, the domain name server 200 can be an independent server, or a server network or server cluster composed of servers. For example, the domain name server 200 includes, but is not limited to, a public domain name server (public DNS server), an HTTP DNS server based on the HTTP protocol, etc.

[0093] Those skilled in the art will understand that the application environment shown in Figure 1 is only one application scenario of the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application environments may include more or fewer computer devices than those shown in Figure 1. For example, only one computer device is shown in Figure 1. It is understood that the domain name resolution system may also include one or more other services, which are not specifically limited here.

[0094] In addition, as shown in Figure 1, the domain name resolution system may also include a storage device for storing data, such as domain name information, such as the cache time corresponding to the cached domain name, the IP address corresponding to the cached domain name, and frequency information, such as access frequency and frequency threshold.

[0095] It should be noted that the schematic diagram of the domain name resolution system shown in Figure 1 is merely an example. The domain name resolution system and scenario described in this application are intended to more clearly illustrate the technical solutions of this application and do not constitute a limitation on the technical solutions provided in this application. As those skilled in the art will know, with the evolution of the domain name resolution system and the emergence of new business scenarios, the technical solutions provided in this application are also applicable to similar technical problems.

[0096] First, this application provides a domain name resolution method. The execution subject of this domain name resolution method is a domain name resolution device, which is applied to a computer device. The domain name resolution method includes: obtaining the cache time corresponding to the cached domain name in the target cache, the target cache including the cached domain name and the IP address corresponding to the cached domain name; determining the candidate domain name from the cached domain name based on the cache time, the candidate domain name being the domain name whose cache time has reached a preset first time; obtaining the access frequency corresponding to the candidate domain name, and if the access frequency reaches a preset frequency threshold, sending a first domain name resolution request for the candidate domain name to a preset domain name server; obtaining the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and updating the IP address corresponding to the candidate domain name based on the updated IP address.

[0097] Figure 2 shows a flowchart of an embodiment of the domain name resolution method in this application. The domain name resolution method may include the following steps S201 to S204, as detailed below:

[0098] Step S201: Obtain the cache time corresponding to the cached domain name in the target cache. The target cache includes the cached domain name and the IP address corresponding to the cached domain name.

[0099] The target cache is a pre-defined local cache on the computer device. After the computer device boots up, it can load a pre-defined mapping file from a fixed path in the operating system and save the mapping file in the target cache. This mapping file contains a pre-defined mapping relationship between domain names and IP addresses, which users can modify according to their actual needs.

[0100] The target cache includes the cached domain name and its corresponding IP address. The cached domain name is the domain name cached in the target cache. For example, after saving the mapping file in the target cache, the cached domain name includes the domain name preset in the mapping file. It should be noted that when the target application sends a network access request carrying the target domain name to the computer device, if a cached domain name matching the target domain name exists in the target cache, the computer device can directly return the IP address corresponding to the cached domain name matching the target domain name to the target application without going through the existing domain name resolution process. This not only improves the network speed of the target application but also avoids the waste of system resources caused by repeated domain name resolution processes.

[0101] Cache time refers to the duration for which the IP address corresponding to the cached domain name has been retained in the target cache. It is the time difference between the time when the IP address corresponding to the cached domain name was saved to the target cache and the current time, or the time difference between the time when the IP address corresponding to the cached domain name was updated and the current time. For example, if the IP address A corresponding to the cached domain name A was saved to the target cache at 18:10 and the current time is 18:15, then the cache time corresponding to the cached domain name A is 5 minutes.

[0102] Step S202: Determine candidate domains from the cached domains based on the cache time. The candidate domains are the domains whose cache time has reached the preset first time.

[0103] While storing cached domain names and IP addresses in the target cache can improve application network speed, it consumes memory and impacts cache performance. In severe cases, it may cause memory overflow, leading to cache system crashes. To improve the performance of the target cache, this embodiment sets an aging time for cached domain names and their IP addresses. The aging time refers to the maximum time that the cached domain names and their IP addresses can live. When the aging time is reached, the cached domain names and their IP addresses will be deleted from the target cache.

[0104] The first time is a pre-set threshold used to measure whether the cache time is about to reach the aging time. The first time can be set according to user needs. For example, when the aging time is T1, the first time can be set to... wait.

[0105] It should be noted that the target cache can include multiple cache domains. The initial time for each cache domain can be set to the same or different. For example, the initial time for each cache domain can be set to... For example, the first time corresponding to the cached domain A is set to The first time corresponding to cache domain B is set The first time corresponding to cache domain B is set

[0106] Candidate domains are those cached domains whose cache time has reached a preset first time. When determining candidate domains from cached domains based on cache time, the cache time can be compared with the first time, and the candidate domains can be determined based on the comparison result. For example, candidate domains are those cached domains whose cache time has reached five minutes.

[0107] Step S203: Obtain the access frequency corresponding to the candidate domain name. If the access frequency reaches the preset frequency threshold, send the first domain name resolution request for the candidate domain name to the preset domain name server.

[0108] Access frequency refers to the number of times a candidate domain is accessed within a unit of time. Access frequency can be determined based on the number of times a candidate domain is accessed in a recent period. The frequency threshold is a pre-set threshold used to measure whether a candidate domain is frequently accessed. The frequency threshold can be set according to actual needs. For example, if the frequency threshold is set to 3, and the access frequency of the candidate domain is greater than or equal to 3, it indicates that the candidate domain is accessed frequently. If the access frequency of the candidate domain is less than 3, it indicates that the candidate domain is accessed frequently.

[0109] To improve the access speed of frequently accessed domains, this embodiment selects candidate domains from the cached domains whose caching time has reached a preset first time, obtains the access frequency of the candidate domains, and compares the access frequency with a preset frequency threshold. If the access frequency reaches the preset frequency threshold, it indicates that the candidate domain is accessed more frequently, and then sends a first domain name resolution request for the candidate domain to the preset domain name server.

[0110] A Domain Name Server (DNS) is a server used to translate domain names into their corresponding IP addresses. The DNS maintains a table for resolving domain names and their corresponding IP addresses. In the first domain name resolution request mentioned above, candidate domain names are carried. After receiving the first domain name resolution request, the DNS can obtain the IP address corresponding to the candidate domain name carried in the first domain name resolution request by querying the mapping relationship between domain names and IP addresses recorded in the table.

[0111] The domain name servers used in current domain name resolution processes are typically assigned by the routers to which computer devices are connected. Router-assigned domain name servers are unreliable; when faced with domain name hijacking, they can easily obtain unpredictable IP addresses, leading to the computer device accessing unpredictable resources. To address these issues, the domain name server used in step S203 can be a public domain name server (public DNS server) or an HTTP-based domain name server (HTTPDNS server). Compared to the current use of router-assigned domain name servers for domain name resolution, this avoids domain name hijacking and ensures the accuracy of the obtained IP address.

[0112] Step S204: Obtain the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and update the IP address corresponding to the candidate domain name based on the updated IP address.

[0113] After receiving the first domain name resolution request, the domain name server resolves the candidate domain name carried in the request to obtain the updated IP address corresponding to the candidate domain name, and returns the updated IP address to the computer device. Upon receiving the updated IP address returned by the domain name server, the computer device updates the IP address corresponding to the candidate domain name in the target cache based on the updated IP address, thus enabling the application to quickly obtain the IP address corresponding to the candidate domain name the next time it connects to the internet.

[0114] It should be noted that after the computer device updates the IP address corresponding to the candidate domain name based on the updated IP address, the cache time corresponding to the cached domain name will be recalculated from the time when the IP address corresponding to the cached domain name is updated, and the above steps S201 to S204 will be repeated until the candidate domain name and the IP address corresponding to the candidate domain name are deleted from the target cache.

[0115] In one specific implementation, referring to Figure 3, after obtaining the access frequency corresponding to the candidate domain name in step S203 above, the following steps S301 to S304 may be included, as follows:

[0116] Step S301: If the access frequency does not reach the frequency threshold, obtain the domain name type corresponding to the candidate domain name.

[0117] The domain name type refers to the type corresponding to the candidate domain name. The domain name type includes, but is not limited to, the first type, the second type, and the third type. Among them, the first type domain name is a known domain name that is preset in the computer device, such as some fixed URL applications of the company's self-developed applications. The second type domain name is a non-aging application domain name that is preset by the user according to the needs, such as video applications such as iQiyi and Aurora TV. The third type domain name is other domain names other than the first type and the second type domain names.

[0118] It should be noted that the first and second types of domain names are those that will not be aged out and deleted. Once the preset cache time is reached, the computer will automatically send a domain name resolution request to the domain name server and automatically update the IP address corresponding to that type of domain name in the target cache. The third type of domain name is those that will be aged out and deleted. After the preset cache time is reached, the computer will determine whether to delete that type of domain name from the target cache based on the frequency of access to that type of domain name.

[0119] Step S302: Determine whether the domain name type is the preset type.

[0120] The default type is a pre-set domain name type that will not be aged out or deleted. Determining whether the domain name type is the default type determines whether the domain name type is a domain name type that will not be aged out or deleted.

[0121] In one specific implementation, the preset type includes a first type and a second type, and the steps for determining whether the domain name type is a preset type specifically include:

[0122] (1) Determine whether the domain name type is the first type;

[0123] (2) If the domain name type is not the first type, obtain the domain name field corresponding to the candidate domain name and match the domain name field with the preset field;

[0124] (3) If the domain name field matches the preset field, determine the domain name type as the second type.

[0125] Specifically, the first type of domain name is a pre-defined known domain name in the computer device. Determining whether the domain name type is the first type means determining whether the candidate domain name is a pre-defined known domain name in the computer device. If the domain name type is determined to be the first type, then the domain name type is determined to be the pre-defined type. If the domain name type is determined not to be the first type, then the domain name field corresponding to the candidate domain name is further obtained, and the domain name field is matched with the pre-defined field. If the domain name field matches the pre-defined field, then the domain name type is determined to be the second type, that is, the domain name type is determined to be the pre-defined type. Otherwise, the domain name type is determined not to be the pre-defined type.

[0126] It should be noted that matching the domain name field with the preset field can mean that the domain name field is the same as the preset field, or that the domain name field is similar to the preset field. For example, if the domain name field is "tv.qq.com" and the preset field is "tv.qq", then the domain name field matches the preset field.

[0127] Step S303: If the domain name type is a preset type, send a first domain name resolution request for the candidate domain name to the domain name server.

[0128] Step S304: Obtain the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and update the IP address corresponding to the candidate domain name based on the updated IP address.

[0129] If the domain name type is a preset type, it indicates that the candidate domain name is a domain name that will not be aged out and deleted. At this time, although the access frequency of the candidate domain name has not reached the preset frequency threshold, the computer device will still send a first domain name resolution request for the candidate domain name to the domain name server, and obtain the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request. The IP address corresponding to the candidate domain name is then updated based on the updated IP address. Steps S303 and S304 are the same as those described in steps S203 and S204 above. For details, please refer to the discussion of steps S203 and S204 above. To avoid repetition, this application will not repeat them here.

[0130] In one specific implementation, referring to Figure 4, after determining whether the domain name type is a preset type in step S302 above, the following steps S401 to S402 can be included, as follows:

[0131] Step S401: If the domain name type is not the preset type, obtain the aging time corresponding to the candidate domain name and compare the cache time with the aging time.

[0132] Step S402: If the cache time reaches the aging time, delete the cached domain name and the corresponding IP address from the target cache.

[0133] To improve the caching performance of the target cache, if the access frequency of the candidate domain does not reach the preset frequency threshold, and the domain type of the candidate domain is not the preset type, that is, the candidate domain is a domain with low access frequency that can be aged out and deleted, then the aging time corresponding to the candidate domain is obtained, and the cache time is compared with the aging time. If the cache time reaches the aging time, the cache domain and the IP address corresponding to the cache domain are deleted from the target cache.

[0134] In this context, the aging time of multiple cached domains in the target cache can be set to the same or different. For example, the aging time of all cached domains in the target cache can be set to T1; or the aging time of cached domain A in the target cache can be set to T1, the aging time of cached domain B in the target cache can be set to T2, and the aging time of cached domain C in the target cache can be set to T3, where T1, T2, and T3 are not the same.

[0135] In one specific implementation, referring to Figure 5, the above domain name resolution method may further include the following steps S501 to S503, as detailed below:

[0136] Step S501: Obtain the network access request of the target application, which includes the target domain name;

[0137] Step S502: Based on the network access request, query whether there is a cached domain name in the target cache that matches the target domain name;

[0138] Step S503: If a cached domain name that matches the target domain name exists in the target cache, return the IP address corresponding to the cached domain name that matches the target domain name to the target application so that the target application can access the network based on the IP address corresponding to the cached domain name.

[0139] Computer devices typically include multiple applications, such as video applications, game applications, and communication applications. The target application is the application on the computer device that needs to access the network. The target domain name is the domain name address used by the target application to access the network. Different target applications correspond to different domain name addresses. For example, when the target application is iQiyi video, the target domain name is "tv.qq.com", and when the target application is Aurora TV, the target domain name is "tv.qq.com".

[0140] A network access request is a request constructed by a target application using a target domain name. When the target application needs to access the network, it can send a network access request carrying the target domain name to the operating system of the computer device. After receiving the network access request, the operating system of the computer device first checks whether there is a cached domain name matching the target domain name in the target cache. If there is a cached domain name matching the target domain name in the target cache, the computer device directly returns the IP address corresponding to the cached domain name matching the target domain name to the target application, so that the target application can access the network based on the IP address corresponding to the cached domain name. Since the IP address corresponding to the target application is directly resolved from the target cache, compared with the existing domain name resolution process, the target application can obtain the IP address for network access faster, thereby improving the application's network speed and avoiding the waste of system resources caused by repeated domain name resolution processes.

[0141] Furthermore, if no cached domain name matching the target domain name exists in the target cache, the computer device needs to send a domain name resolution request for the target domain name to the domain name server. Accordingly, referring to Figure 6, after querying whether a cached domain name matching the target domain name exists in the target cache based on the network access request in step S502 above, the following steps S601 to S602 may also be included, as follows:

[0142] Step S601: If there is no cached domain name matching the target domain name in the target cache, send a second domain name resolution request for the target domain name to the preset public domain name server;

[0143] Step S602: Obtain the IP address corresponding to the target domain name returned by the public domain name server based on the second domain name resolution request, and return the IP address corresponding to the target domain name to the target application so that the target application can access the network based on the IP address corresponding to the target domain name.

[0144] If no cached domain name matching the target domain name exists in the target cache, the computer device sends a second domain name resolution request for the target domain name to a preset public domain name server. After the public domain name server successfully resolves the IP address corresponding to the target domain name, it returns the IP address corresponding to the target domain name to the computer device, which then returns the IP address corresponding to the target domain name to the target application so that the target application can access the network based on the IP address corresponding to the target domain name. Compared with the servers allocated by the router currently used, the public domain name server can effectively avoid the problem of domain name hijacking and improve the accuracy of obtaining the IP address corresponding to the target domain name.

[0145] In cases where public domain name servers fail to resolve a target domain name, in one specific embodiment, if the public domain name server fails to resolve the target domain name, the computer device sends a second domain name resolution request for the target domain name to the domain name server assigned by the router, obtains the IP address corresponding to the target domain name returned by the domain name server assigned by the router based on the second domain name resolution request, and returns the IP address corresponding to the target domain name to the target application, so that the target application can access the network based on the IP address corresponding to the target domain name.

[0146] In one specific implementation, after obtaining the IP address corresponding to the target domain name returned by the public domain name server based on the second domain name resolution request in step S602 above, the method further includes:

[0147] Store the target domain name and its corresponding IP address in the target cache.

[0148] After storing the target domain name and its corresponding IP address in the target cache, the computer device can directly retrieve the IP address of the target domain name from the target cache the next time the target domain name needs to be resolved, thereby improving the resolution speed of the target domain name and thus improving the network speed of the application.

[0149] To better implement the domain name resolution method in this application embodiment, based on the domain name resolution method, this application embodiment also provides a domain name resolution device, as shown in Figure 7. The domain name resolution device 700 includes:

[0150] The information acquisition module 710 is used to acquire the cache time corresponding to the cached domain name in the target cache. The target cache includes the cached domain name and the IP address corresponding to the cached domain name.

[0151] The domain name determination module 720 is used to determine candidate domain names from cached domain names based on cache time. The candidate domain names are the domain names in the cached domain names whose cache time has reached the preset first time.

[0152] The domain name resolution module 730 is used to obtain the access frequency corresponding to the candidate domain name. If the access frequency reaches the preset frequency threshold, it sends the first domain name resolution request for the candidate domain name to the preset domain name server.

[0153] The first update module 740 is used to obtain the update IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and update the IP address corresponding to the candidate domain name based on the update IP address.

[0154] In this embodiment, candidate domains whose caching time reaches a preset first time are selected from the target cache. For candidate domains whose access frequency reaches a preset frequency threshold, a first domain name resolution request is sent to the domain name server. The IP address corresponding to the candidate domain is updated based on the updated IP address returned by the domain name server based on the first domain name resolution request. This allows for automatic updating of the IP addresses of frequently used domains in the target cache. Since the IP addresses of frequently used domains are always stored in the target cache, applications can directly obtain the IP address corresponding to the domain from the target cache when accessing the network, thereby improving the network speed of the application.

[0155] In some embodiments of this application, the domain name resolution device 700 further includes a second update module, which is specifically used for:

[0156] If the access frequency does not reach the frequency threshold, obtain the domain type corresponding to the candidate domain;

[0157] Determine if the domain name type is the default type;

[0158] If the domain name type is the preset type, send a first domain name resolution request for the candidate domain name to the domain name server;

[0159] Obtain the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and update the IP address corresponding to the candidate domain name based on the updated IP address.

[0160] In some embodiments of this application, the preset type includes a first type and a second type, and the second update module is further used for:

[0161] Determine if the domain name type is type 1;

[0162] If the domain name type is not the first type, obtain the domain name field corresponding to the candidate domain name and match the domain name field with the preset field;

[0163] If the domain name field matches the preset field, the domain name type is determined to be the second type.

[0164] In some embodiments of this application, the domain name update device 700 further includes a domain name aging module, which is specifically used for:

[0165] If the domain name type is not the preset type, obtain the aging time corresponding to the candidate domain name and compare the cache time with the aging time;

[0166] If the cache expires, the cached domain name and its corresponding IP address will be removed from the target cache.

[0167] In some embodiments of this application, the domain name resolution device 700 further includes a request processing module, which is specifically used for:

[0168] Obtain the network access requests of the target application, including the target domain name;

[0169] Based on the network access request, query whether there is a cached domain name in the target cache that matches the target domain name;

[0170] If a cached domain name matching the target domain name exists in the target cache, return the IP address corresponding to the cached domain name matching the target domain name to the target application so that the target application can access the network based on the IP address corresponding to the cached domain name.

[0171] In some embodiments of this application, the request processing module is further configured to:

[0172] If the target cache does not contain a cached domain name that matches the target domain name, a second domain name resolution request for the target domain name is sent to the preset public domain name server;

[0173] Obtain the IP address corresponding to the target domain name returned by the public domain name server based on the second domain name resolution request, and return the IP address corresponding to the target domain name to the target application so that the target application can access the network based on the IP address corresponding to the target domain name.

[0174] In some embodiments of this application, the domain name resolution device 700 further includes a domain name caching module, which is specifically used for:

[0175] Save the target domain name and its corresponding IP address to the target cache.

[0176] This application also provides a computer device that integrates any of the domain name resolution devices provided in this application. The computer device includes:

[0177] One or more processors;

[0178] Memory; and

[0179] One or more applications, wherein the applications are stored in memory and configured to be executed by a processor in the steps of the domain name resolution method in any of the embodiments described above.

[0180] This application also provides a computer device that integrates any of the domain name resolution devices provided in this application. Figure 8 shows a schematic diagram of the structure of the computer device involved in this application. Specifically:

[0181] The computer device may include components such as a processor 801 with one or more processing cores, a memory 802 with one or more computer-readable storage media, a power supply 803, and an input unit 804. Those skilled in the art will understand that the computer device structure shown in FIG8 does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0182] The processor 801 is the control center of the computer device. It connects various parts of the computer device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 802, and by calling data stored in the memory 802, it performs various functions of the computer device and processes data, thereby providing overall monitoring of the computer device. Optionally, the processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 801.

[0183] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and data processing by running the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 802 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.

[0184] The computer device also includes a power supply 803 that supplies power to the various components. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 803 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0185] The computer device may also include an input unit 804, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0186] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 801 in the computer device loads the executable files corresponding to the processes of one or more application programs into the memory 802 according to the following instructions, and the processor 801 runs the application programs stored in the memory 802 to realize various functions, as follows:

[0187] Retrieve the cache time corresponding to the cached domain name in the target cache. The target cache includes the cached domain name and the IP address corresponding to the cached domain name.

[0188] Candidate domains are determined from cached domains based on cache time. Candidate domains are those whose cache time has reached the first preset time.

[0189] Obtain the access frequency corresponding to the candidate domain name. If the access frequency reaches the preset frequency threshold, send the first domain name resolution request for the candidate domain name to the preset domain name server.

[0190] Obtain the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and update the IP address corresponding to the candidate domain name based on the updated IP address.

[0191] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0192] Therefore, embodiments of this application provide a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a disk, or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any of the domain name resolution methods provided in embodiments of this application. For example, the computer program loaded by the processor can execute the following steps:

[0193] Retrieve the cache time corresponding to the cached domain name in the target cache. The target cache includes the cached domain name and the IP address corresponding to the cached domain name.

[0194] Candidate domains are determined from cached domains based on cache time. Candidate domains are those whose cache time has reached the first preset time.

[0195] Obtain the access frequency corresponding to the candidate domain name. If the access frequency reaches the preset frequency threshold, send the first domain name resolution request for the candidate domain name to the preset domain name server.

[0196] Obtain the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and update the IP address corresponding to the candidate domain name based on the updated IP address.

[0197] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.

[0198] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.

[0199] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0200] The foregoing has provided a detailed description of a domain name resolution method, apparatus, and computer device provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A domain name resolution method, wherein, include: Obtain the cache time corresponding to the cached domain name in the target cache, wherein the target cache includes the cached domain name and the IP address corresponding to the cached domain name; Based on the cache time, candidate domains are determined from the cached domains, wherein the candidate domains are the domains whose cache time has reached a preset first time. Obtain the access frequency corresponding to the candidate domain name; if the access frequency reaches a preset frequency threshold, send a first domain name resolution request for the candidate domain name to a preset domain name server. Obtain the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and update the IP address corresponding to the candidate domain name based on the updated IP address.

2. The method according to claim 1, wherein, After obtaining the access frequency corresponding to the candidate domain name, the method further includes: If the access frequency does not reach the frequency threshold, obtain the domain name type corresponding to the candidate domain name; Determine whether the domain name type is a preset type; If the domain name type is the preset type, send a first domain name resolution request for the candidate domain name to the domain name server; Obtain the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and update the IP address corresponding to the candidate domain name based on the updated IP address.

3. The method according to claim 2, wherein, The domain name types include a first type, a second type, and a third type. The first type of domain name is a preset known domain name. The second type of domain name is a non-aging application domain name that the user has preset according to their needs. The third type of domain name is other domain names besides the first type and the second type.

4. The method according to claim 2, wherein, The preset type includes a first type and a second type, and determining whether the domain name type is a preset type includes: Determine whether the domain name type is the first type; If the domain name type is not the first type, obtain the domain name field corresponding to the candidate domain name, and match the domain name field with the preset field; If the domain name field matches the preset field, the domain name type is determined to be the second type.

5. The method according to claim 4, wherein, After determining whether the domain name type is the first type, the process further includes: If the domain name type is the first type, then the domain name type is determined to be a preset type.

6. The method according to claim 4, wherein, After matching the domain name field with the preset field, the method further includes: If the domain name field does not match the preset field, it is determined that the domain name type is not the preset type.

7. The method according to claim 2, wherein, After determining whether the domain name type is a preset type, the process further includes: If the domain name type is not the preset type, obtain the aging time corresponding to the candidate domain name, and compare the cache time with the aging time; If the cache time reaches the aging time, the cached domain name and the IP address corresponding to the cached domain name will be deleted from the target cache.

8. The method according to claim 1, wherein, The method further includes: Obtain the network access request of the target application, wherein the network access request includes the target domain name; Based on the network access request, query whether there is a cached domain name in the target cache that matches the target domain name; If a cached domain name matching the target domain name exists in the target cache, the IP address corresponding to the cached domain name matching the target domain name is returned to the target application, so that the target application can access the network based on the IP address corresponding to the cached domain name.

9. The method according to claim 8, wherein, After querying the target cache for a cached domain name that matches the target domain name based on the network access request, the method further includes: If the target cache does not contain a cached domain name that matches the target domain name, a second domain name resolution request for the target domain name is sent to a preset public domain name server; Obtain the IP address corresponding to the target domain name returned by the public domain name server based on the second domain name resolution request, and return the IP address corresponding to the target domain name to the target application so that the target application can access the network based on the IP address corresponding to the target domain name.

10. The method according to claim 9, wherein, After obtaining the IP address corresponding to the target domain name returned by the public domain name server based on the second domain name resolution request, the method further includes: Save the target domain name and the corresponding IP address to the target cache.

11. The method according to claim 9, wherein, After sending a second domain name resolution request for the target domain name to a preset public domain name server, the process includes: If the public domain name server fails to resolve the domain name, the second domain name resolution request is sent to the domain name server assigned by the router, and the IP address corresponding to the target domain name returned by the domain name server assigned by the router based on the second domain name resolution request is obtained; Return the IP address corresponding to the target domain name to the target application.

12. A domain name resolution device, wherein, include: The information acquisition module is used to acquire the cache time corresponding to the cached domain name in the target cache, wherein the target cache includes the cached domain name and the IP address corresponding to the cached domain name; A domain name determination module is used to determine candidate domain names from the cached domain names based on the cache time, wherein the candidate domain names are the domain names in the cached domain names whose cache time has reached a preset first time. The domain name resolution module is used to obtain the access frequency corresponding to the candidate domain name. If the access frequency reaches a preset frequency threshold, a first domain name resolution request for the candidate domain name is sent to a preset domain name server. The first update module is used to obtain the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and update the IP address corresponding to the candidate domain name based on the updated IP address.

13. The apparatus according to claim 12, wherein, Also includes: The second update module is specifically used for: If the access frequency does not reach the frequency threshold, obtain the domain name type corresponding to the candidate domain name; Determine whether the domain name type is a preset type; If the domain name type is the preset type, send a first domain name resolution request for the candidate domain name to the domain name server; Obtain the updated IP address corresponding to the candidate domain name returned by the domain name server based on the first domain name resolution request, and update the IP address corresponding to the candidate domain name based on the updated IP address.

14. The apparatus according to claim 13, wherein, The preset types include a first type and a second type, and the second update module is further used for: Determine whether the domain name type is the first type; If the domain name type is not the first type, obtain the domain name field corresponding to the candidate domain name, and match the domain name field with the preset field; If the domain name field matches the preset field, the domain name type is determined to be the second type.

15. The apparatus according to claim 13, wherein, Also includes: The domain name aging module is specifically used for: If the domain name type is not the preset type, obtain the aging time corresponding to the candidate domain name, and compare the cache time with the aging time; If the cache time reaches the aging time, the cached domain name and the IP address corresponding to the cached domain name will be deleted from the target cache.

16. The apparatus according to claim 12, wherein, Also includes: The request processing module is specifically used for: Obtain the network access request of the target application, wherein the network access request includes the target domain name; Based on the network access request, query whether there is a cached domain name in the target cache that matches the target domain name; If a cached domain name matching the target domain name exists in the target cache, the IP address corresponding to the cached domain name matching the target domain name is returned to the target application, so that the target application can access the network based on the IP address corresponding to the cached domain name.

17. The apparatus according to claim 16, wherein, The request processing module is further specifically used for: If the target cache does not contain a cached domain name that matches the target domain name, a second domain name resolution request for the target domain name is sent to a preset public domain name server; Obtain the IP address corresponding to the target domain name returned by the public domain name server based on the second domain name resolution request, and return the IP address corresponding to the target domain name to the target application so that the target application can access the network based on the IP address corresponding to the target domain name.

18. The apparatus according to claim 17, wherein, It also includes: a domain name caching module, which is specifically used for: Save the target domain name and the corresponding IP address to the target cache.

19. The apparatus according to claim 17, wherein, The request processing module is further specifically used for: If the public domain name server fails to resolve the domain name, the second domain name resolution request is sent to the domain name server assigned by the router, and the IP address corresponding to the target domain name returned by the domain name server assigned by the router based on the second domain name resolution request is obtained; Return the IP address corresponding to the target domain name to the target application.

20. A computer device, wherein, The computer device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the domain name resolution method of any one of claims 1 to 11.

Citation Information

Patent Citations

  • Intelligent computer Internet address searching control system

    CN107302603A

  • Target domain name scheduling method and device, equipment and storage medium

    CN110636072A

  • Domain name resolution method and device, computer readable storage medium and computer device

    CN111193815A

  • Network request processing method and device, terminal and storage medium

    CN113285979A

  • Domain name resolution method and device, computer equipment and computer readable storage medium

    CN118368270A