Domain name information prefetching method and device, equipment and storage medium

By pre-geting the IP address of the domain name information during cold startup of the application, the problem of DNS pre-fetching cannot be performed during cold startup of the application is solved, and the DNS query process is omitted during network connections is achieved, which shortens the connection time.

CN119996371APending Publication Date: 2025-05-13GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510113217.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The existing DNS prefetch method cannot perform DNS prefetching when the application is cold-started, resulting in waiting for the DNS query process during network connection, which increases delay.

Method used

When the target application is cold-started, by looking for domain name information in the cache queue, the domain name system server is requested in advance to obtain the IP address, and the connection is established using these pre-acquisitioned IP addresses when the application makes a network connection request.

Benefits of technology

By obtaining the IP addresses of domain name information in advance, these IP addresses can be used directly when the application is connecting to the network, avoiding the DNS query process and thus shortening the network connection time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119996371A_ABST
    Figure CN119996371A_ABST
Patent Text Reader

Abstract

The invention discloses a domain name information prefetching method and device, equipment and a storage medium, and the method comprises the steps: searching the first domain name information of a target application based on the first domain name information of different applications in a first cache queue under the condition that the target application is in a first cold start; the first domain name information comprises domain name information which is related to a main service and has access times of K when the application is in cold start; k > = 1; requesting a first IP address from a domain name system server based on the first domain name information; and establishing network connection between the target application and the corresponding server based on the first IP address of the first domain name information of the target application under the condition that the target application performs the network connection request.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to cache management technology, and in particular to a method and device, equipment, and storage medium for pre-fetching domain name information. Background Art

[0002] The Domain Name System (DNS) is a service on the Internet that allows users to access resources on the Internet through domain names by converting domain names into IP addresses. DNS prefetching refers to performing DNS resolution on the requested domain name before network connection access, which can omit the DNS query process in network connection access, thereby shortening the time required for network connection access.

[0003] An existing DNS prefetching method is that the application itself performs DNS prefetching when it is active and before the network connection is accessed. However, in the case of a cold start of the application, since the first thing after the cold start is to make a network connection request, the application has no time to perform DNS prefetching. Summary of the invention

[0004] The present application provides a method, device, equipment, and storage medium for pre-fetching domain name information.

[0005] The technical solution of this application is implemented as follows:

[0006] In a first aspect, a method for pre-fetching domain name information is provided, the method comprising:

[0007] When the target application is in the first cold start, searching for the first domain name information of the target application based on the first domain name information of different applications in the first cache queue; the first domain name information includes domain name information related to the main business during the cold start of the application and accessed K times; K≥1;

[0008] Requesting a first IP address from a domain name system server based on the first domain name information;

[0009] When the target application makes a network connection request, a network connection is established between the target application and a corresponding server based on the first IP address of the first domain name information of the target application.

[0010] In a second aspect, a device for pre-fetching domain name information is provided, the device comprising:

[0011] A search unit, configured to search for first domain name information of the target application based on first domain name information of different applications in the first cache queue when the target application is in the first cold start; wherein the first domain name information includes domain name information related to the main business during the cold start of the application and accessed K times; K≥1;

[0012] A requesting unit, configured to request a first IP address from a domain name system server based on the first domain name information;

[0013] The communication unit is used to establish a network connection between the target application and a corresponding server based on the first IP address of the first domain name information of the target application when the target application makes a network connection request.

[0014] According to a third aspect, an electronic device is provided, comprising: a processor and a memory configured to store a computer program that can be run on the processor, wherein the processor is configured to execute the steps of the method of the first aspect when running the computer program.

[0015] According to a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, wherein the computer program implements the steps of the method according to the first aspect when executed by a processor.

[0016] According to a fifth aspect, a computer program product is provided, comprising a computer program, wherein the computer program implements the steps of the method according to the first aspect when executed by a processor.

[0017] The present application provides a method and device for pre-fetching domain name information, equipment, and storage medium, the method comprising: when the target application is in the first cold start, based on the first domain name information of different applications in the first cache queue, searching for the first domain name information of the target application; the first domain name information includes the domain name information related to the main business when the application is cold started and the number of accesses reaches K times; K≥1; requesting a first IP address from a domain name system server based on the first domain name information; when the target application makes a network connection request, establishing a network connection between the target application and the corresponding server based on the first IP address of the first domain name information of the target application. In this way, when the target application is in the cold start, the operating system obtains the first domain name information of the target application from the first cache queue, and requests the first IP address of the first domain name information from the DNS server, that is, pre-requesting the first IP address of the first domain name information of the target application before the network connection. Until the target application makes a network connection request, based on the first IP address of the first domain name information of the target application, find out the IP address of the domain name information included in the network connection request, and then establish a network connection between the target application and the corresponding server. Thus, the DNS server query process in the network connection request can be omitted, thereby shortening the time required for the network connection request. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 The process diagram of the method for pre-fetching domain name information in the embodiment of the present application is shown as follows: Figure 1 ;

[0019] Figure 2 The process diagram of the method for pre-fetching domain name information in the embodiment of the present application is shown as follows: Figure 2 ;

[0020] Figure 3 The process diagram of the method for pre-fetching domain name information in the embodiment of the present application is shown as follows: Figure 3 ;

[0021] Figure 4 The process diagram of the method for pre-fetching domain name information in the embodiment of the present application is shown as follows: Figure 4 ;

[0022] Figure 5 The process diagram of the method for pre-fetching domain name information in the embodiment of the present application is shown as follows: Figure 5 ;

[0023] Figure 6 The process diagram of the method for pre-fetching domain name information in the embodiment of the present application is shown as follows: Figure 6 ;

[0024] Figure 7 The process diagram of the method for pre-fetching domain name information in the embodiment of the present application is shown as follows: Figure 7 ;

[0025] Figure 8 This is a schematic diagram of the structure of the domain name information pre-fetching device in the embodiment of the present application;

[0026] Fig. 9 It is a schematic diagram of the structure of the electronic device in the embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.

[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing this embodiment and are not intended to limit this application.

[0029] In the following description, references to “some embodiments,” “this embodiment,” “this embodiment,” and examples, etc., describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.

[0030] If similar descriptions of "first / second" appear in the application documents, the following instructions are added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the present embodiment described here can be implemented in an order other than that illustrated or described here.

[0031] In this embodiment, the term "and / or" is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, object A and / or object B may represent three situations: object A exists alone, object A and object B exist at the same time, and object B exists alone.

[0032] The present application embodiment provides a method for pre-fetching domain name information. Figure 1 The process diagram of the method for pre-fetching domain name information in the embodiment of the present application is shown as follows: Figure 1 , applied to electronic devices, including but not limited to smartphones, tablets and desktop computers. Figure 1 As shown, the method for pre-fetching domain name information includes the following steps S101 to S102:

[0033] S101: When the target application is in a first cold start, first domain name information of the target application is searched based on first domain name information of different applications in a first cache queue; wherein the first domain name information includes domain name information related to the main business of the application and accessed K times; K≥1.

[0034] In the embodiment of the present application, the target application can be understood as the current application or the foreground application. The first cold start refers to the process of restarting the application after being forcibly closed. The first cold start refers to the application not being in the cold start for the first time.

[0035] In the embodiment of the present application, the first cache queue caches the first domain name information related to the main business of different applications and accessed K times. Based on this, when the target application is not in the first cold start, the target application first performs the cold start and initialization operation, and then performs the network connection request operation. It takes a period of time to perform the cold start and initialization operation. During this period of time, the operating system queries the first domain name information related to the main business of the target application from the first cache queue, and requests the first IP address of the first domain name information from the domain name system server, that is, the first IP address of the first domain name information of the target application is pre-requested before the network connection. K≥1, and K is an integer.

[0036] For example, if the target application is a video application, the main service may be a video service. If the target application is a music application, the main service may be an audio streaming service.

[0037] S102: Request a first IP address from a domain name system server based on the first domain name information.

[0038] Specifically, the operating system sends a request including the first domain name information to the domain name system server, so that the domain name system server responds to the request, resolves the first domain name information, obtains the first IP address of the first domain name information, and returns it to the operating system.

[0039] S103: When the target application makes a network connection request, a network connection is established between the target application and a corresponding server based on the first IP address of the first domain name information of the target application.

[0040] The first domain name information of the application includes the domain name information of the first server accessed by the application and the domain name information of the second server, the first server is used to obtain a link including the domain name information of the second server accessed by the main business of the application, and the second server is used to obtain the server of the content related to the main business. In other words, the first domain name information of the application includes the domain name information related to the main business of the application.

[0041] Based on this, when the target application makes a network connection request, the network connection request includes the domain name information of the first server and the domain name information of the second server. First, based on the first IP address of the first domain name information of the target application, the IP address corresponding to the domain name information of the first server is searched to establish a network connection between the target application and the first server (i.e., the first network connection), and a link to the domain name information of the second server accessed by the main business of the application is obtained from the first server. Then, based on the first IP address of the first domain name information of the target application, the IP address corresponding to the domain name information of the second server in the link is searched to establish a network connection between the target application and the second server (i.e., the second network connection), so that the target application can request the corresponding content of the main business from the second server and display it.

[0042] Exemplarily, if the target application is a video application, the network connection request includes domain name information of a first server for obtaining a video link and domain name information of a second server for obtaining relevant content of the main business. First, based on the first IP address of the first domain name information of the video application, the IP address corresponding to the domain name information of the first server is searched to establish a network connection between the video application and the first server, and a link to the domain name information of the second server accessed by the video business is obtained from the first server. Then, based on the first IP address of the first domain name information of the video application, the IP address corresponding to the domain name information of the second server in the link is searched to establish a network connection between the video application and the second server (i.e., the second network connection), so that the video application can request the corresponding content of the video business from the second server and display it.

[0043] In the embodiment of the present application, when the target application is in a cold start, the operating system obtains the first domain name information of the target application from the first cache queue, and requests the first IP address of the first domain name information from the DNS server, that is, the first IP address of the first domain name information of the target application is requested in advance before the network connection. When the target application makes a network connection request, the IP address of the domain name information included in the network connection request is found based on the first IP address of the first domain name information of the target application, and then the network connection between the target application and the corresponding server is established. In this way, the DNS server query process in the network connection request can be omitted, thereby shortening the time required for the network connection request.

[0044] In some embodiments of the present application, how the first domain name information of different applications is cached in the first cache queue includes the following steps S201 to S203:

[0045] S201: When the target application is in a second cold start and / or running process and makes a network connection request, determine whether the domain name information accessed by the target application is domain name information related to the main business; wherein the start time of the second cold start is earlier than the start time of the first cold start.

[0046] In the embodiment of the present application, the second cold start is before the first cold start. Exemplarily, the second cold start may be the first cold start of the application.

[0047] It should be noted that since the business performed by the application during cold start is the same as that performed during operation, in any case where the target application is in the second cold start and / or operation process, a pre-screening process of the domain name information accessed by the target application is performed, that is, the domain name information related to the main business is pre-screened.

[0048] S202: When the domain name information accessed by the target application is domain name information related to the main business, count the number of accesses to the domain name information related to the main business of the target application, and select the first domain name information with a number of accesses reaching K times.

[0049] In the embodiment of the present application, after the domain name information accessed by the target application is pre-screened, the number of accesses to at least one domain name information of the target application that has passed the pre-screening is counted, and the domain name information with the number of accesses reaching K times is screened out as the first domain name information, and then the first domain name information of the target application is cached in the first cache queue. In this way, the domain name information frequently accessed by the main business of the cached application is cached in the first cache queue. Furthermore, before the application is cold-started and the network is connected, the domain name information corresponding to the application in the first cache queue is used to request the corresponding IP address from the DNS server in advance, and then when the network connection is made, the required IP address can be directly searched from the requested IP address, so that the DNS server query process in the network connection request can be omitted, thereby shortening the time required for the network connection request.

[0050] S203: Cache the first domain name information of the target application in a first cache queue.

[0051] In some embodiments of the present application, counting the number of accesses to the domain name information related to the main business of the target application and selecting the first domain name information having a number of accesses of K times includes the following steps S301 to S302:

[0052] S301: Based on the domain name information related to the main business of the target application, the second cache queue is updated, and the second cache queue includes the corresponding relationship between the domain name information and the number of accesses.

[0053] In an embodiment of the present application, when the domain name information accessed by the target application is the domain name information related to the main business, it is detected whether the second cache queue has the domain name information accessed by the target application; if it exists, 1 is added to the last access count, that is, the correspondence between the domain name information accessed by the target application and the last access count in the second cache queue is updated; if it does not exist, the correspondence between the domain name information accessed by the target application and the corresponding access count 1 is cached in the second cache queue, that is, the second cache queue is updated.

[0054] S302: When the number of accesses to the domain name information in the second cache queue is K, the domain name information of the target application with the number of accesses being K is used as the first domain name information of the target application.

[0055] In an embodiment of the present application, when the number of accesses to the domain name information in the second cache queue is K, the domain name information of the target application with a number of accesses of K is deleted from the second cache queue, and the domain name information of the target application with a number of accesses of K is used as the first domain name information of the target application to be cached in the first cache queue.

[0056] In some embodiments of the present application, determining whether the domain name information accessed by the target application is domain name information related to the primary business includes the following steps S401 to S402:

[0057] S401: Extracting a target character string corresponding to a target location based on the domain name information accessed by a target application.

[0058] In the embodiment of the present application, the target character string corresponding to the target position of the domain name information is used to determine whether the domain name information is domain name information related to the main business. The target position can be the position from the Xth position to the Yth position, where X is greater than Y.

[0059] Exemplarily, the target position may be the 5th to 11th position.

[0060] It should be noted that for the same server, the domain name information corresponding to different locations is slightly different, but the character string at the target location is the same. Therefore, based on the target character string corresponding to the target location of the domain name information, it is determined whether the domain name information is domain name information related to the main business.

[0061] S402: Based on whether at least one preset character string includes a target character string, determine whether the domain name information accessed by the target application is domain name information related to a main business of the target application.

[0062] In the embodiment of the present application, the domain name information corresponding to the preset string representation is the domain name information related to the main business. Based on this, if at least one preset string includes the target string, it is determined that the domain name information accessed by the target application is the domain name information related to the main business. If at least one preset string does not include the target string, it is determined that the domain name information accessed by the target application is not the domain name information related to the main business.

[0063] In some embodiments of the present application, caching the first domain name information of the target application in the first cache queue includes the following steps S501 to S502:

[0064] S501: When it is detected that the first cache queue does not include the first domain name information of the target application and the first cache queue is full, the domain name information with the earliest access time in the first cache queue is deleted.

[0065] In the embodiment of the present application, the first cache queue includes the correspondence between the first domain name information of the application and the last access time. Based on this, if it is detected that the first cache queue does not include the first domain name information of the target application and the first cache queue is full, the domain name information with the earliest access time in the first cache queue is first deleted, and then the correspondence between the first domain name information of the target application and the current access time is cached in the first cache queue. In this way, the domain name information related to the main business of the cached application and frequently accessed recently is cached in the first cache queue.

[0066] S502: Cache the correspondence between the first domain name information of the target application and the current access time in a first cache queue.

[0067] In some embodiments of the present application, the method further includes the following steps S601 to S603:

[0068] S601: Cache the second domain name information and the second IP address accessed by the target application when making a network connection request in a third cache queue, and record the lifetime of the second IP address; the network connection request includes the network connection request initiated after a cold start and during operation.

[0069] In the embodiment of the present application, after the target application is in the first cold start and a network connection request is made, the network connection request includes the second domain name information accessed by the target application, based on the first IP address of the first domain name information of the target application, the second IP address of the second domain name information accessed by the target application is found, and then the second domain name information accessed by the target application and the second IP address are cached in the third cache queue, and the survival time of the second IP address is recorded. When the target application is in the running process and a network connection request is made, firstly, the third cache queue is searched to see whether the second domain name information currently accessed exists. If it exists, it means that the corresponding second IP address is valid, the corresponding second IP address is obtained and the network connection operation is performed; if it does not exist, the second IP address is requested from the DNS server based on the second domain name information currently accessed, and then cached in the third cache queue, and the survival time of the second IP address is recorded, so that it is convenient for the subsequent access to the domain name information before the survival time expires. If the domain name information accessed again can be found in the third cache queue, the IP address of the domain name information accessed is directly used, and then the network connection with the corresponding server is established, so that the DNS server query process in the network connection request can be omitted, thereby shortening the time required for the network connection request. After the survival time expires, the corresponding domain name information and IP address in the third cache queue are deleted.

[0070] Furthermore, after the expiration of the lifetime, in order to avoid accessing the expired IP address again, it needs to be renewed, including:

[0071] S602: When the target application is an application that the user is interested in and the lifetime of the second IP address of the target application reaches a preset time threshold, a second IP address is re-requested from the domain name system server based on the second domain name information.

[0072] In the embodiment of the present application, the application that the user pays attention to can be understood as the application that the user frequently uses. For example, the application with the longest usage time is regarded as the application that the user frequently uses, or the application with the most startup times is regarded as the application that the user frequently uses.

[0073] In the embodiment of the present application, the preset time threshold can be understood as the longest validity period or the longest survival time of the corresponding second IP address. The second IP addresses of different domain name information can correspond to different survival times or the same survival time.

[0074] S603: Re-cache the second domain name information and the second IP address of the target application in the third cache queue, and record the lifetime of the second IP address.

[0075] That is, when the second IP address of the target application is invalid, the operating system re-requests the second IP address from the domain name system server based on the second domain name information of the invalid second IP address, re-caches the second domain name information and the second IP address of the target application in the third cache queue, and re-records the life span of the second IP address, so as to achieve the purpose of renewing the expired second domain name information and the corresponding second IP address.

[0076] In some embodiments of the present application, the method further includes:

[0077] When the target application makes a network connection request again, searching for the second IP address of the second domain name information accessed by the target application based on the third cache queue;

[0078] A network connection is established between the target application and a corresponding server based on the second IP address of the second domain name information accessed by the target application.

[0079] In the embodiment of the present application, when the target application makes a network connection request again, the operating system first searches the third cache queue to see whether the second domain name information currently being accessed is included. If it is included, the second IP address corresponding to the second domain name information currently being accessed is obtained, and the network connection operation is performed. In this way, the DNS server query process in the network connection request can be omitted, thereby shortening the time required for the network connection request.

[0080] Based on the above embodiments, the present application specifically illustrates a method for pre-fetching domain name information. Figure 7 The process diagram of the method for pre-fetching domain name information in the embodiment of the present application is shown as follows: Figure 7 ,like Figure 7 As shown, the method for pre-fetching domain name information includes the following steps:

[0081] S701: When the target application is cold started for the first time and is running, and a network connection request is made, if it is determined that the domain name information accessed by the target application is domain name information related to the main business, a first cache queue is obtained through maintenance using a least recently used K times algorithm.

[0082] The specific maintenance steps of the Least Recently Used-K (LRU-K) algorithm are as follows: if it is determined that the domain name information accessed by the target application is the domain name information related to the main business, the domain name information related to the main business of the target application is cached in the second cache queue, and its access count is updated until the access count is K, the domain name information with the target application access count of K is deleted from the second cache queue, and the domain name information with the target application access count of K is used as the first domain name information of the target application and cached in the first cache queue. The value of K can be set according to the developer's experiment or experience.

[0083] S702: When the target application is in a cold start again, the first domain name information of the target application is searched based on the first domain name information of different applications in the first cache queue.

[0084] S703: Request a first IP address from a domain name system server based on the first domain name information.

[0085] S704: When the target application makes a network connection request, based on the first IP address of the first domain name information of the target application, the IP address of the domain name information currently accessed in the network connection request is obtained, and then the network connection operation between the target application and the corresponding server is performed.

[0086] Based on this, when the target application is in a cold start, the operating system obtains the first domain name information of the target application from the first cache queue, and requests the first IP address of the first domain name information from the DNS server, that is, the first IP address of the first domain name information of the target application is pre-requested before the network connection. Until the target application makes a network connection request, based on the first IP address of the first domain name information of the target application, the IP address of the domain name information included in the network connection request is found, and then the network connection between the target application and the corresponding server is established. In this way, the DNS server query process in the network connection request can be omitted, thereby shortening the time required for the network connection request. In addition, the application does not need to develop the DNS pre-fetching function by itself, that is, the function optimization does not rely on the application itself. The application does not need to do access adaptation, so it is easy to expand.

[0087] Secondly, when the target application is cold-started for the first time and is running, and a network connection request is made, the second domain name information and the second IP address accessed by the target application when making a network connection request are cached in the third cache queue, and the survival time of the second IP address is recorded. When the survival time of the second IP address of the target application reaches the preset time threshold, the second IP address is requested from the domain name system server again based on the second domain name information. The second domain name information and the second IP address of the target application are cached in the third cache queue again, and the survival time of the second IP address is recorded. This achieves the purpose of renewing the expired second domain name information and the corresponding second IP address.

[0088] To implement the method of the embodiment of the present application, based on the same inventive concept, the embodiment of the present application also provides a pre-fetching device for domain name information. Figure 8 FIG. 1 is a schematic diagram of the structure of the domain name information pre-fetching device in the embodiment of the present application. Figure 8 As shown, the domain name information pre-fetching device 80 includes:

[0089] The search unit 801 is used to search for the first domain name information of the target application based on the first domain name information of different applications in the first cache queue when the target application is in the first cold start; wherein the first domain name information includes the domain name information related to the main business when the application is cold started and the number of accesses reaches K times; K≥1;

[0090] A requesting unit 802 is configured to request a first IP address from a domain name system server based on the first domain name information;

[0091] The communication unit 803 is used to establish a network connection between the target application and a corresponding server based on the first IP address of the first domain name information of the target application when the target application makes a network connection request.

[0092] In the embodiment of the present application, when the target application is in a cold start, the operating system obtains the first domain name information of the target application from the first cache queue, and requests the first IP address of the first domain name information from the DNS server, that is, the first IP address of the first domain name information of the target application is requested in advance before the network connection. When the target application makes a network connection request, the IP address of the domain name information included in the network connection request is found based on the first IP address of the first domain name information of the target application, and then the network connection between the target application and the corresponding server is established. In this way, the DNS server query process in the network connection request can be omitted, thereby shortening the time required for the network connection request.

[0093] In some embodiments of the present application, a processing unit is further included, which is used to determine whether the domain name information accessed by the target application is domain name information related to the main business of the target application when the target application is in the second cold start and / or running process and makes a network connection request; wherein the start time of the second cold start is earlier than the start time of the first cold start; when the domain name information accessed by the target application is domain name information related to the main business, the number of accesses to the domain name information related to the main business of the target application is counted, and the first domain name information with a number of accesses reaching K times is screened out; and the first domain name information of the target application is cached in the first cache queue.

[0094] In some embodiments of the present application, the processing unit is further used to update a second cache queue based on domain name information related to the main business of the target application, wherein the second cache queue includes a correspondence between domain name information and access times; when the access times of the domain name information in the second cache queue is K, the domain name information of the target application with an access time of K is used as the first domain name information of the target application.

[0095] In some embodiments of the present application, the processing unit is further used to extract a target string corresponding to a target location based on the domain name information accessed by the target application; and determine whether the domain name information accessed by the target application is domain name information related to a main business based on whether the target string is included in at least one preset string.

[0096] In some embodiments of the present application, the processing unit is further used to delete the domain name information with the earliest access time in the first cache queue when it is detected that the first domain name information of the target application is not included in the first cache queue and the first cache queue is full; and cache the correspondence between the first domain name information of the target application and the current access time in the first cache queue.

[0097] In some embodiments of the present application, the processing unit is further used to cache the second domain name information and the second IP address accessed by the target application when making a network connection request in a third cache queue, and record the lifetime of the second IP address; the network connection request includes a network connection request initiated after a cold start and during operation; the request unit 802 is further used to, when the lifetime of the second IP address of the target application reaches a preset time threshold, re-request the second IP address from the domain name system server based on the second domain name information; the processing unit is further used to re-cache the second domain name information and the second IP address of the target application in the third cache queue, and record the lifetime of the second IP address.

[0098] In some embodiments of the present application, the search unit 801 is also used to search for the second IP address of the second domain name information accessed by the target application based on the third cache queue when the target application makes a network connection request again; the communication unit 803 is also used to establish a network connection between the target application and the corresponding server based on the second IP address of the second domain name information accessed by the target application.

[0099] The present application also provides another electronic device, Fig. 9 Schematic diagram of the structure of the electronic device in the embodiment of the present application. Fig. 9 As shown, the electronic device 90 includes: a processor 901 and a memory 902 configured to store a computer program that can be run on the processor;

[0100] The processor 901 is configured to execute the method steps in the aforementioned embodiment when running a computer program.

[0101] Of course, in practical applications, Fig. 9 As shown, the components in the electronic device 90 are coupled together via a bus system 903. It is understood that the bus system 903 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 903 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Fig. 9 Various buses are labeled as bus system 903.

[0102] In practical applications, the processor may be at least one of an application-specific integrated circuit (ASIC), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a controller, a microcontroller, and a microprocessor. It is understandable that for different devices, the electronic device used to implement the functions of the processor may also be other, and the embodiments of the present application do not specifically limit this.

[0103] The above-mentioned memory can be a volatile memory (volatile memory), such as a random access memory (RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD); or a combination of the above-mentioned types of memory, and provide instructions and data to the processor.

[0104] In an exemplary embodiment, the present application also provides a computer-readable storage medium for storing a computer program.

[0105] Optionally, the computer-readable storage medium can be applied to any one of the methods in the embodiments of the present application, and the computer program enables the computer to execute the corresponding processes implemented by the processor in each method in the embodiments of the present application. For the sake of brevity, they are not repeated here.

[0106] Illustratively, an embodiment of the present application further provides a computer program product, including a computer program, which can be executed by a processor of an electronic device to complete the steps of any of the aforementioned methods.

[0107] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0108] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

[0109] In addition, all functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units. A person of ordinary skill in the art may understand that all or part of the steps of implementing the above method embodiments may be completed by hardware related to program instructions, and the above program may be stored in a computer-readable storage medium, which, when executed, executes the steps of the above method embodiments; and the above storage medium includes various media that can store program codes, such as mobile storage devices, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.

[0110] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0111] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0112] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0113] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A method for pre-fetching domain name information, characterized in that: The method comprises: When the target application is in the first cold start, searching for the first domain name information of the target application based on the first domain name information of different applications in the first cache queue; the first domain name information includes domain name information related to the main business of the application and accessed K times; K≥1; Requesting a first IP address from a domain name system server based on the first domain name information; When the target application makes a network connection request, a network connection is established between the target application and a corresponding server based on the first IP address of the first domain name information of the target application.

2. The method according to claim 1, characterized in that The method further comprises: When the target application is in the second cold start and / or running process and makes a network connection request, determining whether the domain name information accessed by the target application is domain name information related to the main business of the target application; wherein the start time of the second cold start is earlier than the start time of the first cold start; In the case where the domain name information accessed by the target application is the domain name information related to the main business of the target application, counting the number of accesses to the domain name information related to the main business of the target application, and selecting the first domain name information with a number of accesses reaching K times; The first domain name information of the target application is cached in the first cache queue.

3. The method according to claim 2, characterized in that The counting of the number of visits to the domain name information related to the main business of the target application, and selecting the first domain name information having the number of visits reaching K times, includes: Based on the domain name information related to the main business of the target application, updating the second cache queue, the second cache queue including the corresponding relationship between the domain name information and the number of accesses; When the number of accesses to the domain name information in the second cache queue is K, the domain name information of the target application with the number of accesses being K is used as the first domain name information of the target application.

4. The method according to claim 2, characterized in that: The determining whether the domain name information accessed by the target application is domain name information related to the main business of the target application includes: Extracting a target character string corresponding to a target location based on the domain name information accessed by the target application; Based on whether the target character string is included in at least one preset character string, it is determined whether the domain name information accessed by the target application is domain name information related to the main business of the target application.

5. The method according to claim 2, characterized in that: The caching the first domain name information of the target application in the first cache queue includes: When it is detected that the first cache queue does not include the first domain name information of the target application and the first cache queue is full, deleting the domain name information with the earliest access time in the first cache queue; The correspondence between the first domain name information of the target application and the current access time is cached in the first cache queue.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: caching the second domain name information and the second IP address accessed by the target application when making a network connection request in a third cache queue, and recording the lifetime of the second IP address; the network connection request includes a network connection request initiated after a cold start and during operation; When the target application is an application that the user is interested in and the lifetime of the second IP address of the target application reaches a preset time threshold, re-requesting the second IP address from the domain name system server based on the second domain name information; The second domain name information and the second IP address of the target application are re-cached in the third cache queue, and the lifetime of the second IP address is recorded.

7. The method according to claim 6, characterized in that The method further comprises: When the target application makes a network connection request again, searching for the second IP address of the second domain name information accessed by the target application based on the third cache queue; A network connection is established between the target application and a corresponding server based on the second IP address of the second domain name information accessed by the target application.

8. A device for pre-fetching domain name information, characterized in that: The device comprises: A search unit, configured to search for first domain name information of the target application based on first domain name information of different applications in the first cache queue when the target application is in the first cold start; wherein the first domain name information includes domain name information related to the main business during the cold start of the application and accessed K times; K≥1; A requesting unit, configured to request a first IP address from a domain name system server based on the first domain name information; The communication unit is used to establish a network connection between the target application and a corresponding server based on the first IP address of the first domain name information of the target application when the target application makes a network connection request.

9. An electronic device, characterized in that: The electronic device comprises: a processor and a memory configured to store a computer program capable of running on the processor, Wherein, the processor is configured to execute the steps of the method according to any one of claims 1 to 7 when running the computer program.

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

Citation Information

Patent Citations

  • Buffer processing method and device for domain name resolution

    CN104935683A

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

    CN113452808A

  • Domain name resolution processing method and device, equipment and storage medium

    CN118869654A

  • Method for operating a distributed application

    US20220407910A1