A domain name query method and device, and equipment

By dynamically adjusting the waiting time based on historical DNS query duration and performing retransmission operations, the problem of long waiting times and result loss caused by packet loss in DNS queries is solved, thus improving the efficiency and accuracy of DNS queries.

CN122293634APending Publication Date: 2026-06-26GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610290430.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-10
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies can lead to prolonged waiting periods when encountering packet loss or network anomalies during DNS queries, reducing query efficiency and potentially resulting in the loss of valid DNS query results.

Method used

The waiting time is determined based on the duration of multiple historical DNS queries, and the results received within the waiting time are considered valid. Different waiting times are set for different DNS query requests to avoid fixed time settings, and retransmission operations are performed to ensure the accuracy and efficiency of the results.

Benefits of technology

It improves the efficiency of DNS queries, reduces waiting time, and ensures the accuracy of DNS query results, avoiding resource waste and loss caused by fixed timeout waiting time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122293634A_ABST
    Figure CN122293634A_ABST
Patent Text Reader

Abstract

This application provides a domain name query method, apparatus, and device. The method includes: sending a target domain name query request corresponding to a target domain name; determining the waiting time corresponding to the target domain name query request based on the historical query durations corresponding to multiple historical domain name query requests; and determining the domain name query result received within the waiting time as the target domain name query result corresponding to the target domain name.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a domain name query method, apparatus, and device. Background Technology

[0002] Existing technologies trigger specific timeout mechanisms when performing Domain Name System (DNS) queries, especially in the event of network anomalies such as packet loss. This mechanism causes the system to enter a prolonged waiting state, significantly reducing overall query efficiency. Summary of the Invention

[0003] This application provides a method, apparatus, computer-readable storage medium, and computer program product, XXX.

[0004] This application provides a domain name query method, apparatus, device, chip, storage medium, product, and program that can improve the efficiency of DNS queries.

[0005] The technical solution of this application is implemented as follows: In a first aspect, embodiments of this application provide a domain name query method, the method comprising: Send a target domain query request corresponding to the target domain; Based on the historical query durations corresponding to multiple historical domain name query requests, determine the waiting time corresponding to the target domain name query request; The domain query results received within the waiting period will be determined as the target domain query results corresponding to the target domain.

[0006] In the above domain name query method, sending a target domain name query request corresponding to the target domain name includes: Determine the target domain name to be queried; For the target domain name, construct a first domain name query request under the first domain name type and a second domain name query request under the second domain name type respectively; Send the first domain name query request and the second domain name query request.

[0007] In the above domain name query method, the domain name query results received within the waiting period will be determined as the target domain name query results corresponding to the target domain name, including: If, within the waiting time, a first query result is received for a query request to the first domain name, and / or a second query result is received for a query request to the second domain name, then the received first query result and / or second query result shall be determined as the target domain name query result corresponding to the target domain name.

[0008] The above domain name query methods also include: If, within the waiting time, no first query result is received for the query request for the first domain name, and / or no second query result is received for the query request for the second domain name, then it is determined that packet loss occurred in the query request for the first domain name and / or the query request for the second domain name. Perform retransmission operations on the first domain name query request and / or the second domain name query request that resulted in packet loss.

[0009] In the above domain name query method, the waiting time for the target domain name query request is determined based on the historical query durations corresponding to multiple historical domain name query requests, including: Determine the first historical query duration for the first domain type and the second historical query duration for the second domain type among the historical query durations corresponding to multiple historical domain query requests; The first waiting time for the target domain under the first domain type is determined based on the first historical query duration, and the second waiting time for the target domain under the second domain type is determined based on the second historical query duration.

[0010] In the above domain name query method, the domain name query results received within the waiting period will be determined as the target domain name query results corresponding to the target domain name, including: If a first query result is received for a query request for a first domain name within the first waiting period, and / or a second query result is received for a query request for a second domain name within the second waiting period, then the received first query result and / or second query result shall be determined as the target domain name query result corresponding to the target domain name.

[0011] The above domain name query methods also include: If no first query result is received for the query request for the first domain name within the first waiting period, and / or no second query result is received for the query request for the second domain name within the second waiting period, then it is determined that packet loss occurred in the query request for the first domain name and / or the query request for the second domain name. Perform retransmission operations on the first domain name query request and / or the second domain name query request that resulted in packet loss.

[0012] The above domain name query methods also include: Store the target domain name query results and their corresponding target domain names in the first storage space; If other domain query requests targeting the target domain are identified within the first time period, then the target domain query result is retrieved from the first storage space as the query result corresponding to the other domain query request; The first time period is the period after the query result of the target domain name is received.

[0013] Secondly, embodiments of this application provide a domain name query device, the device comprising: The communication unit is configured to send a target domain name query request corresponding to the target domain name; The determining unit is configured to determine the waiting time corresponding to the target domain name query request based on the historical query duration corresponding to multiple historical domain name query requests; and to determine the domain name query result received within the waiting time as the target domain name query result corresponding to the target domain name.

[0014] Thirdly, embodiments of this application provide a domain name query device, characterized in that the device includes: a processor, a memory, and a communication bus; when the processor executes the running program stored in the memory, it implements the domain name query method as described above.

[0015] This application provides a domain name query method, apparatus, device, chip, storage medium, product, and program. The method includes: sending a target domain name query request corresponding to a target domain name; determining a waiting time corresponding to the target domain name query request based on the historical query durations corresponding to multiple historical domain name query requests; and determining the domain name query result received within the waiting time as the target domain name query result corresponding to the target domain name. By adopting the above implementation scheme, the waiting time for the current query can be determined based on the query duration over a historical period, and the domain name query result received within the waiting time can be used as the current query result. Compared to existing dual-stack DNS query methods, this application does not set a fixed time for different requests, but rather determines different waiting times for different requests. This waiting time is usually less than the fixed time set in the prior art, thereby saving waiting time in the DNS query process and improving the efficiency of DNS queries. Furthermore, compared to existing network stack-level DNS query methods, since all query results received within the waiting time can be considered valid, this application can avoid losing correct DNS query results and ensure the accuracy of DNS queries. Attached Figure Description

[0016] Figure 1 A domain name query method flow provided in the embodiments of this application Figure 1 ; Figure 2 A domain name query method flow provided in the embodiments of this application Figure 2 ; Figure 3 A domain name query method flow provided in the embodiments of this application Figure 3 ; Figure 4 A domain name query method flow provided in the embodiments of this application Figure 4 ; Figure 5A domain name query method flow provided in the embodiments of this application Figure 5 ; Figure 6 A domain name query method flow provided in the embodiments of this application Figure 6 ; Figure 7 A flowchart illustrating an exemplary domain name query method provided in this application embodiment; Figure 8 This is a schematic diagram of the composition structure of a domain name query device provided in an embodiment of this application; Figure 9 This is a schematic diagram of the composition structure of a domain name query device provided in an embodiment of this application.

[0017] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] Existing system-level DNS query logic typically initiates dual-stack DNS query requests for both AAAA and A types simultaneously. After both requests return results, the system aggregates the results and reports them together. If one of these queries is lost during network transmission, the system waits for a fixed timeout (e.g., 5 seconds) before retrying that type of query until all dual-stack results are obtained, at which point it reports again. This system-level solution, which forces the aggregation of dual-stack results, introduces significant timeouts in the event of packet loss or other issues.

[0020] Furthermore, the DNS implementation scheme at the application network stack layer provides a switch-based approach using the Happy Eyeballs algorithm, performing an absolute dual-stack race condition: whichever type of DNS request receives a response first uses that type of response. However, this absolute race condition at the application network stack layer has certain problems. Due to the absolute race condition, a significant portion of valid DNS responses are discarded. This reduces the success rate of fallback (i.e., when a DNS response from one server is unavailable, reverting to using another DNS response); it also reduces the effective DNS cache, thus increasing redundant network query processes and time in subsequent DNS queries for the same domain name.

[0021] To address the aforementioned technical issues, this application provides a domain name query method, applied to a domain name query device. Figure 1 A domain name query method flow provided in the embodiments of this application Figure 1 ,like Figure 1 As shown, the domain name query method may include the following steps S110 to S130: Step S110: Send a target domain name query request corresponding to the target domain name.

[0022] In this embodiment of the application, the domain name query device sends a target domain name query request corresponding to the target domain name.

[0023] It should be noted that the domain name query in this embodiment can be understood as querying the Internet Protocol (IP) address corresponding to the domain name, such as the IPv4 address, IPv6 address, etc., and this embodiment does not limit it here.

[0024] It should also be noted that the target domain name can be the domain name to be queried. The target domain name query request can be a query request for the IPv4 address of the target domain name, or it can be a query request for the IPv6 address of the target domain name, or it can be a query request for both the IPv4 address and the IPv6 address of the target domain name, or it can be a query request for other addresses of the target domain name. This embodiment does not limit this.

[0025] Step S120: Determine the waiting time corresponding to the target domain name query request based on the historical query durations corresponding to multiple historical domain name query requests.

[0026] In this embodiment of the application, the domain name query device can obtain the historical query duration corresponding to multiple historical domain name query requests executed within a historical period, and determine the waiting time corresponding to the target domain name query request based on the historical query duration.

[0027] It should be emphasized that the embodiments of this application do not limit the order between steps S120 and S110. Step S110 can be executed first and then step S120, or step S120 can be executed first and then step S110, or steps S110 and S120 can be executed simultaneously.

[0028] It should be noted that the historical period can be the past 5 minutes, or the past 10 minutes, etc., and this embodiment does not limit it.

[0029] It should also be noted that, taking the past 5 minutes as an example, a historical domain query request can be one or more domain query requests that have been sent within the past 5 minutes. Based on this, the historical query duration can be the time elapsed from sending the domain query request to receiving the corresponding domain query result for each domain query request that has been sent within the past 5 minutes.

[0030] In some embodiments, the time it may take to receive the returned domain query result for the current target domain query request can be predicted based on the multiple historical query durations corresponding to multiple historical domain query requests sent within a historical period, and then the corresponding domain query result can be continuously monitored within the predicted waiting time.

[0031] It should be noted that when predicting the current waiting time based on the multiple historical query durations corresponding to multiple historical domain name query requests sent within a historical period, the historical query duration that appears most frequently among the multiple historical query durations can be determined as the current waiting time, or the average historical query duration corresponding to the multiple historical query durations can be determined as the current waiting time, or the multiple historical query durations can be input into a trained model to predict the current waiting time, etc. This embodiment does not limit this.

[0032] Step S130: The domain name query result received within the waiting time is determined as the target domain name query result corresponding to the target domain name.

[0033] In this embodiment of the application, after determining the waiting time, the domain name query device continuously monitors whether the corresponding domain name query result is received within the waiting time, and determines the domain name query result received within the waiting time as the target domain name query result corresponding to the target domain name.

[0034] In some embodiments, if a domain query result for a target domain query request is received within the waiting period, the domain query result can be identified as the target domain query result corresponding to the target domain. Conversely, if a domain query result for a target domain query request is received after the waiting period, or if no domain query result for the target domain query request is received, the domain query can be determined to have failed (e.g., packet loss occurred), and the user can choose to abandon the query or re-initiate a query request for the target domain. This embodiment does not impose any limitations on this.

[0035] In some alternative embodiments, reference is made to Figure 2 The above step S110 can be replaced by the following steps S210 to S230: Step S210: Determine the target domain name to be queried.

[0036] In some embodiments, when a user uses the domain name query function, they can enter the target domain name to be queried. At this time, the domain name query device can obtain / determine the target domain name to be queried.

[0037] Step S220: For the target domain name, construct a first domain name query request under the first domain name type and a second domain name query request under the second domain name type.

[0038] It should be noted that since domain name queries can include queries for AAAA type domain names and queries for A type domain names, when constructing a target domain name query request, you can construct a first domain name query request for the target domain name under the first domain name type. In this case, the first domain name query request can be for the AAAA type, and the request is to query the IPv6 address corresponding to the target domain name. The second domain name query request can be for the A type, and the request is to query the IPv4 address corresponding to the target domain name.

[0039] For example, if the target domain is example.com, the first domain query request will request the IPv6 address corresponding to "example.com", while the second domain query request will request the IPv4 address corresponding to "example.com".

[0040] Step S230: Send the first domain name query request and the second domain name query request.

[0041] It should be noted that the target domain name query request includes the first domain name query request and / or the second domain name query request.

[0042] In some embodiments, a first domain name query request for type AAAA and a second domain name query request for type A can be sent simultaneously to request the IPv6 address and IPv4 address corresponding to the target domain name at the same time. This ensures that the target domain name can be accessed normally regardless of the current network environment, thus improving fault tolerance.

[0043] In other embodiments, if it is only necessary to query the IPv6 address corresponding to the target domain name, it is possible to choose to send only the first domain name query request, or if it is only necessary to query the IPv4 address corresponding to the target domain name, it is possible to choose to send only the second domain name query request. This embodiment does not limit this.

[0044] In some alternative embodiments, reference is made to Figure 3 The above step S130 can be replaced by the following step S310: Step S310: If, within the waiting time, a first query result is received for the query request of the first domain name, and / or a second query result is received for the query request of the second domain name, then the received first query result and / or second query result shall be determined as the target domain name query result corresponding to the target domain name.

[0045] In some embodiments, it is possible to continuously monitor whether a first query result is received for a query request for a first domain name and whether a second query result is received for a query request for a second domain name during the waiting period. If only a first query result is received for a query request for a first domain name during the waiting period, the first query result is determined as the query result for the target domain name corresponding to the target domain name.

[0046] For example, if the target domain is example.com, and the first query result returned for the first domain query request is "2001:db8::1" within the waiting time, then "2001:db8::1" is determined as the target domain query result corresponding to the target domain "example.com".

[0047] Alternatively, if only a second query result is received within the waiting period for the second domain name query request, then the second query result is determined as the target domain name query result corresponding to the target domain name.

[0048] For example, if the target domain is example.com, and the second query result returned by the query request for the second domain is "192.0.2.1" within the waiting time, then "192.0.2.1" is determined as the target domain query result corresponding to the target domain "example.com".

[0049] Alternatively, if a first query result for a query request for the first domain name and a second query result for a query request for the second domain name are received simultaneously within the waiting period, then the first query result and the second query result are determined as the target domain name query results corresponding to the target domain name.

[0050] For example, if the target domain is example.com, and within the waiting time, the first query result returned for the first domain query request is "2001:db8::1" and the second query result returned for the second domain query request is "192.0.2.1", then "2001:db8::1" and "192.0.2.1" are determined as the target domain query results corresponding to the target domain "example.com".

[0051] Based on step S310, in some alternative embodiments, if no first query result is received for the first domain name query request and / or no second query result is received for the second domain name query request within the waiting time, then it is determined that the first domain name query request and / or the second domain name query request has lost packets; and a retransmission operation is performed on the first domain name query request and / or the second domain name query request that has lost packets.

[0052] In some embodiments, if the first query result is not received within the waiting time for the first domain name query request, it can be determined that packet loss occurred during the sending of the first domain name query request. In this case, the first domain name query request can be resent, and the maximum number of retransmissions for the AAAA type can be preset. If the number of retransmissions of the first domain name query request reaches the maximum number of retransmissions for the AAAA type, the retransmission will be stopped.

[0053] Alternatively, if no second query result is received within the waiting time for the second domain query request, it can be determined that packet loss occurred during the sending of the second domain query request. In this case, you can choose to resend the second domain query request, and you can preset the maximum number of retransmissions for type A. If the number of retransmissions of the second domain query request reaches the maximum number of retransmissions for type A, the retransmission will stop.

[0054] Alternatively, if no first query result is received for the first domain query request and no second query result is received for the second domain query request within the waiting time, it can be determined that packet loss occurred during the sending of both the first and second domain query requests. In this case, you can choose to resend the first and second domain query requests, and you can pre-set the maximum number of retransmissions for AAAA and A types respectively. If the number of retransmissions of the first domain query request reaches the maximum number of retransmissions for AAAA type, retransmission will stop. If the number of retransmissions of the second domain query request reaches the maximum number of retransmissions for A type, retransmission will stop.

[0055] It should be noted that the maximum number of retransmissions for type AAAA and the maximum number of retransmissions for type A can be the same or different, and this embodiment does not impose any limitation on this.

[0056] In some alternative embodiments, reference is made to Figure 4 The above step S120 can be replaced by the following steps S410 to S420: Step S410: Determine the first historical query duration for the first domain type and the second historical query duration for the second domain type from the historical query durations corresponding to multiple historical domain query requests.

[0057] In some embodiments, among multiple historical domain name query requests within a historical period, a first historical domain name query request for a first domain name type and a second historical domain name query request for a second domain name type are determined.

[0058] It should be noted that a historical period may include multiple historical domain name query requests sent for multiple historical domain names. For each historical domain name, the historical domain name query request corresponding to that historical domain name may include a first historical domain name query request sent for that historical domain name under the first domain name type, and / or a second historical domain name query request sent for that historical domain name under the second domain name type.

[0059] In some embodiments, multiple historical domain name query requests can typically be sent for the first domain name type. When determining the historical query duration corresponding to each first historical domain name query request, the historical query duration between the time point corresponding to sending the first historical domain name query request and the time point corresponding to receiving the first historical query result of the first historical domain name query request can be determined.

[0060] It should be noted that, for each historical domain name, the historical query duration corresponding to that historical domain name may include the first query duration of that historical domain name under the first domain name type and / or the second query duration of that historical domain name under the second domain name type.

[0061] In some embodiments, the first query duration for each historical domain name under the first domain name type can be the time between the time point when the first historical domain name query request for the historical domain name under the AAAA type is sent and the time point when the IPv6 address returned for the query request for the first historical domain name is received.

[0062] It should be noted that, in this embodiment of the application, the multiple historical query durations corresponding to the multiple first historical domain name query requests for the first domain name type can be referred to as the first historical query durations.

[0063] In some embodiments, the second query duration for each historical domain name under the second domain name type can be the time between the time point when the query request for the historical domain name under type A is sent and the time point when the IPv4 address returned for the query request for the second historical domain name is received.

[0064] It should be noted that, in this embodiment of the application, the multiple historical query durations corresponding to the multiple second historical domain name query requests for the second domain name type can be referred to as the second historical query durations.

[0065] Step S420: Determine the first waiting time of the target domain under the first domain type based on the first historical query duration, and determine the second waiting time of the target domain under the second domain type based on the second historical query duration.

[0066] In some embodiments, the waiting time may include a waiting time for AAAA type and / or a waiting time for A type. Based on this, the first waiting time for the target domain under AAAA type can be determined according to the first historical query time of the historical domain under AAAA type within a historical period. Then, within the first waiting time, it is continuously monitored whether a domain query result under AAAA type is received. Furthermore, the second waiting time for the target domain under A type can be determined according to the second historical query time of the historical domain under A type within a historical period. Then, within the second waiting time, it is continuously monitored whether a domain query result under A type is received.

[0067] It should be noted that the first waiting time and the second waiting time can be the same or different, and this embodiment does not limit this.

[0068] In some alternative embodiments, reference is made to Figure 5 The above step S130 can be replaced by the following step S510: Step S510: If a first query result is received for a query request for a first domain name within the first waiting period, and / or a second query result is received for a query request for a second domain name within the second waiting period, then the received first query result and / or second query result shall be determined as the target domain name query result corresponding to the target domain name.

[0069] In some embodiments, it is possible to continuously monitor whether a first query result is received for a query request for a first domain name during a first waiting period, and to continuously monitor whether a second query result is received for a query request for a second domain name during a second waiting period. If a first query result is received for a query request for a first domain name only during the first waiting period, then the first query result is determined as the query result for the target domain name corresponding to the target domain name.

[0070] For example, if the target domain is example.com, and the first query result returned for the query request for the first domain is "2001:db8::1" is received only within the first waiting time, then "2001:db8::1" is determined as the target domain query result corresponding to the target domain "example.com".

[0071] Alternatively, if a second query result is received only within the second waiting period for a query request for the second domain name, then the second query result is determined as the query result for the target domain name corresponding to the target domain name.

[0072] For example, if the target domain is example.com, and the second query result returned by the query request for the second domain is "192.0.2.1" is received only within the second waiting period, then "192.0.2.1" is determined as the target domain query result corresponding to the target domain "example.com".

[0073] Alternatively, if a first query result is received for a query request for a first domain name within the first waiting period, and a second query result is received for a query request for a second domain name within the second waiting period, then the first query result and the second query result are determined as the target domain name query results corresponding to the target domain name.

[0074] For example, if the target domain is example.com, and the first query result for the first domain is "2001:db8::1" is received within the first waiting period, and the second query result for the second domain is "192.0.2.1" is received within the second waiting period, then "2001:db8::1" and "192.0.2.1" are determined as the target domain query results corresponding to the target domain "example.com".

[0075] Based on step S510 above, in some alternative embodiments, if no first query result is received for the first domain name query request within the first waiting period, and / or no second query result is received for the second domain name query request within the second waiting period, then it is determined that the first domain name query request and / or the second domain name query request has resulted in packet loss; and a retransmission operation is performed on the first domain name query request and / or the second domain name query request that has resulted in packet loss.

[0076] In some embodiments, if the first query result is not received within the first waiting period, it can be determined that packet loss occurred during the sending of the first domain name query request. In this case, the first domain name query request can be resent, and the maximum number of retransmissions for the AAAA type can be preset. If the number of retransmissions of the first domain name query request reaches the maximum number of retransmissions for the AAAA type, the retransmission will be stopped.

[0077] Alternatively, if no second query result is received for the second domain name query request within the second waiting period, it can be determined that packet loss occurred during the sending of the second domain name query request. In this case, you can choose to resend the second domain name query request, and you can pre-set the maximum number of retransmissions for type A. If the number of retransmissions of the second domain name query request reaches the maximum number of retransmissions for type A, the retransmission will stop.

[0078] Alternatively, if no first query result is received for the first domain query request within the first waiting period, and no second query result is received for the second domain query request within the second waiting period, it can be determined that packet loss occurred during the sending of both the first and second domain query requests. In this case, it is possible to resend both the first and second domain query requests, and the maximum number of retransmissions for AAAA and A types can be preset. If the number of retransmissions of the first domain query request reaches the maximum number of retransmissions for AAAA type, retransmission will stop. If the number of retransmissions of the second domain query request reaches the maximum number of retransmissions for A type, retransmission will stop.

[0079] In some alternative embodiments, reference is made to Figure 6 The domain name query method proposed in this embodiment may further include the following steps S610 to S620: Step S610: Store the target domain name query results and the corresponding target domain name in the first storage space.

[0080] It should be noted that the first storage space can be a local cache or a cloud storage space; this embodiment does not limit it.

[0081] In some embodiments, the target domain name, along with the first query result for type AAAA and the second query result for type A, can be stored in the first storage space.

[0082] Step S620: If other domain name query requests targeting the target domain name are identified within the first time period, then the target domain name query result is obtained from the first storage space as the query result corresponding to the other domain name query request.

[0083] It should be noted that the first time period refers to the period after the query results for the target domain name are received.

[0084] It should also be noted that the query results for the target domain can be considered valid within the first time period. Therefore, if another domain query request for the target domain is initiated within the first time period, the query results for the target domain can be returned directly.

[0085] In some embodiments, the same or different valid time periods can be set for AAAA type and A type respectively. That is, the valid time period corresponding to the first query result of the target domain name and the valid time period corresponding to the second query result of the target domain name can be the same or different. This embodiment does not limit this.

[0086] This application provides a domain name query method, which includes: sending a target domain name query request corresponding to a target domain name; determining a waiting time corresponding to the target domain name query request based on the historical query durations corresponding to multiple historical domain name query requests; and determining the domain name query result received within the waiting time as the target domain name query result corresponding to the target domain name. By adopting the above implementation scheme, the waiting time for the current query can be determined based on the query duration over a historical period, and the domain name query result received within the waiting time can be used as the query result for the current query. Compared to existing dual-stack DNS query methods, this application does not set a fixed time for different requests, but rather determines different waiting times for different requests. This waiting time is usually less than the fixed time set in the prior art, thereby saving waiting time in the DNS query process and improving the efficiency of DNS queries. Furthermore, compared to existing network stack-level DNS query methods, since all query results received within the waiting time can be considered valid, this application can avoid losing correct DNS query results and ensure the accuracy of DNS queries.

[0087] The domain name query method provided in the embodiments of this application has been introduced above. To facilitate understanding of the embodiments of this application, the following describes possible implementation schemes of the domain name query method applicable to the embodiments of this application based on actual application scenarios.

[0088] The core idea of ​​this application is that when performing dual-type DNS queries, if one result is normal and the other fails, a race response can be executed to continue subsequent business without retrying until all results are successful. Furthermore, by measuring and calculating DNS timeout in real time, the DNS packet loss scenario can be accurately determined, and dual-stack race response is only performed when DNS packet loss is confirmed.

[0089] The specific solution in this application is to first refer to the Jacobson algorithm and calculate the DNS timeout time in real time based on the DNS query time. During DNS processing, both AAAA and A types of DNS queries are performed simultaneously, and the DNS timeout time is calculated. If both types of DNS query results are returned before the timeout, the entire DNS query result is returned according to the normal process. If either type of DNS query result is returned when the timeout expires, it is assumed that the other query was lost, and the returned DNS query result is used directly.

[0090] refer to Figure 7 This application may include the following steps S710 to S760: S710, calculate timeout based on DNS query time.

[0091] In some embodiments, the timeout (RTO) of the current DNS query can be calculated based on the DNS query times over a historical period (corresponding to the waiting time in the above embodiments).

[0092] S720, perform dual-type DNS queries for AAAA and A.

[0093] In some embodiments, both AAAA-type DNS queries and A-type DNS queries are performed simultaneously.

[0094] S730, set timeout period.

[0095] In some embodiments, timing is performed according to RTO while performing dual-type DNS queries for AAAA and A.

[0096] S740, Determine if the RTO has timed out.

[0097] In some embodiments, if a dual-type DNS query result is received before the RTO times out, then step S750 can be proceeded; conversely, if a single-type DNS query result is received before the RTO times out, then step S760 can be proceeded.

[0098] S750, Use the returned dual-type DNS query results.

[0099] In some embodiments, if a dual-type DNS query result is received before the RTO times out, the returned dual-type DNS query result can be used as the result of this DNS query.

[0100] S760, Use the returned single-type DNS query result.

[0101] In some embodiments, if only a single-type DNS query result is received in the event of an RTO timeout, then the returned single-type DNS query result can be used as the result of this DNS query.

[0102] The solution proposed in this application can achieve the following effects: 1. Adjust the timeout period in real time based on the actual network environment and adjust the DNS packet loss timeout judgment time. This not only avoids the impact of discarding valid DNS results, but also avoids fixed and invalid timeout waiting time.

[0103] 2. When the timeout expires, if either of the dual-type DNS queries is successful, the result will be returned, eliminating the need for retrying and thus reducing the access waiting time for the entire network service.

[0104] 3. Using DNS packet loss timeout as the basis for judging DNS speedup, the failure scenario is accurately identified, and then the speedup is carried out without discarding the return of valid DNS results. Therefore, it will not reduce the success rate of fallback, nor will it introduce redundant network query processes and time for subsequent DNS queries of the same domain name.

[0105] The preferred embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this application, various simple modifications can be made to the technical solutions of this application, and these simple modifications all fall within the protection scope of this application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, this application will not describe the various possible combinations separately. Furthermore, various different embodiments of this application can also be arbitrarily combined, as long as they do not violate the spirit of this application, they should also be considered as the content disclosed in this application. Moreover, without conflict, the various embodiments and / or the technical features in the various embodiments described in this application can be arbitrarily combined with the prior art, and the resulting technical solutions should also fall within the protection scope of this application.

[0106] Based on the above embodiments, in another embodiment of this application, a domain name query device 800 is provided. Figure 8 This is a schematic diagram of the composition structure of a domain name query device provided in this application, as shown below. Figure 8As shown, the domain name query device 800 includes: Communication unit 810 is configured to send a target domain name query request corresponding to the target domain name; The determining unit 820 is configured to determine the waiting time corresponding to the target domain name query request based on the historical query duration corresponding to multiple historical domain name query requests; and to determine the domain name query result received within the waiting time as the target domain name query result corresponding to the target domain name.

[0107] In some embodiments, the domain name query device 800 further includes: a data processing unit; Unit 820 is also configured to determine the target domain name to be queried; The data processing unit is configured to construct a first domain name query request under the first domain name type and a second domain name query request under the second domain name type for the target domain name. The communication unit 810 is also configured to send a first domain name query request and a second domain name query request.

[0108] In some embodiments, the determining unit 820 is further configured to determine the received first query result and / or second query result as the target domain name query result corresponding to the target domain name if, within the waiting period, a first query result is received for a query request for a first domain name and / or a second query result is received for a query request for a second domain name.

[0109] In some embodiments, the determining unit 820 is further configured to determine that the first domain name query request and / or the second domain name query request has experienced packet loss if, within the waiting period, a first query result returned for the first domain name query request is not received, and / or a second query result returned for the second domain name query request is not received. The communication unit 810 is also configured to perform retransmission operations on the first domain name query request that resulted in packet loss, and / or the second domain name query request.

[0110] In some embodiments, the determining unit 820 is further configured to determine, among the historical query durations corresponding to multiple historical domain name query requests, a first historical query duration for a first domain name type and a second historical query duration for a second domain name type; determine a first waiting time for the target domain name under the first domain name type based on the first historical query duration, and determine a second waiting time for the target domain name under the second domain name type based on the second historical query duration.

[0111] In some embodiments, the determining unit 820 is further configured to determine the received first query result and / or second query result as the target domain name query result corresponding to the target domain name if a first query result is received for a query request for a first domain name within a first waiting period, and / or a second query result is received for a query request for a second domain name within a second waiting period.

[0112] In some embodiments, the determining unit 820 is further configured to determine that the first domain name query request and / or the second domain name query request has experienced packet loss if no first query result is received for the first domain name query request within a first waiting period, and / or no second query result is received for the second domain name query request within a second waiting period. The communication unit 810 is also configured to perform retransmission operations on the first domain name query request that resulted in packet loss, and / or the second domain name query request.

[0113] In some embodiments, the domain name query device 800 further includes: a storage unit and an acquisition unit; The storage unit is configured to store the target domain name query results and the corresponding target domain name in the first storage space; The acquisition unit is configured to, if it detects other domain name query requests for the target domain name within a first time period, retrieve the target domain name query result from the first storage space as the query result corresponding to the other domain name query request; wherein, the first time period is the time period after receiving the target domain name query result.

[0114] This application provides a domain name query device, comprising: a communication unit configured to send a target domain name query request corresponding to a target domain name; and a determination unit configured to determine a waiting time corresponding to the target domain name query request based on the historical query durations corresponding to multiple historical domain name query requests; and to determine the domain name query results received within the waiting time as the target domain name query results corresponding to the target domain name. By adopting the above implementation scheme, the waiting time for the current query can be determined based on the query duration over a historical period, and the domain name query results received within the waiting time can be used as the current query results. Compared to existing dual-stack DNS query methods, this application does not set a fixed time for different requests, but rather determines different waiting times for different requests. This waiting time is usually less than the fixed time set in the prior art, thereby saving waiting time in the DNS query process and improving the efficiency of DNS queries. Furthermore, compared to existing network stack-level DNS query methods, since all query results received within the waiting time can be considered valid, this application can avoid losing correct DNS query results and ensure the accuracy of DNS queries.

[0115] Figure 9 This is a schematic diagram of the composition structure of a domain name query device provided in an embodiment of this application. In practical applications, based on the same disclosed concept of the above embodiments, such as... Figure 9 As shown, the domain name query device 900 of this embodiment includes: a processor 910, a memory 920, and a communication bus 930.

[0116] In a specific embodiment, the acquisition unit 820, determination unit 820, data processing unit, and storage unit described above can be implemented by a processor 910 located on the domain name query device 900. The processor 910 can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), CPU, controller, microcontroller, and microprocessor. It is understood that for different domain name query devices, the electronic device used to implement the above processor function can also be other types; this embodiment does not specifically limit its use.

[0117] In this embodiment, the communication bus 930 is used to establish a connection between the processor 910 and the memory 920; when the processor 910 executes the running program stored in the memory 920, it implements the following domain name lookup method: Send a target domain query request corresponding to the target domain; Based on the historical query durations corresponding to multiple historical domain name query requests, determine the waiting time corresponding to the target domain name query request; The domain query results received within the waiting period will be determined as the target domain query results corresponding to the target domain.

[0118] In some embodiments, the processor 910 is further configured to determine the target domain name to be queried; construct a first domain name query request under a first domain name type and a second domain name query request under a second domain name type for the target domain name; and send the first domain name query request and the second domain name query request.

[0119] In some embodiments, the processor 910 is further configured to, if within the waiting period, receive a first query result returned for a query request for a first domain name, and / or receive a second query result returned for a query request for a second domain name, then determine the received first query result and / or second query result as the target domain name query result corresponding to the target domain name.

[0120] In some embodiments, the processor 910 is further configured to determine that the first domain name query request and / or the second domain name query request has resulted in packet loss if, within the waiting period, a first query result returned for the first domain name query request and / or a second query result returned for the second domain name query request is not received, and / or a second query result returned for the second domain name query request is not received; and to perform a retransmission operation on the first domain name query request and / or the second domain name query request that has resulted in packet loss.

[0121] In some embodiments, the processor 910 is further configured to determine, among the historical query durations corresponding to multiple historical domain name query requests, a first historical query duration for a first domain name type and a second historical query duration for a second domain name type; determine a first waiting time for the target domain name under the first domain name type based on the first historical query duration, and determine a second waiting time for the target domain name under the second domain name type based on the second historical query duration.

[0122] In some embodiments, the processor 910 is further configured to determine the received first query result and / or second query result as the target domain name query result corresponding to the target domain name if a first query result is received for a query request for a first domain name within a first waiting period, and / or a second query result is received for a query request for a second domain name within a second waiting period.

[0123] In some embodiments, the processor 910 is further configured to determine that the first domain name query request and / or the second domain name query request has resulted in packet loss if, within a first waiting period, a first query result is not received for the first domain name query request, and / or within a second waiting period, a second query result is not received for the second domain name query request; and to perform a retransmission operation on the first domain name query request and / or the second domain name query request that has resulted in packet loss.

[0124] In some embodiments, the processor 910 is further configured to store the target domain name query result and the target domain name in a first storage space; if other domain name query requests for the target domain name are identified within a first time period, the target domain name query result is obtained from the first storage space as the query result corresponding to the other domain name query request; wherein, the first time period is the time period after the target domain name query result is received.

[0125] This application provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps of the domain name query method as described in any of the above embodiments.

[0126] This application also provides a chip.

[0127] Optionally, the chip can be applied to the domain name query device in the embodiments of this application, and the chip can implement the corresponding processes implemented by the domain name query device in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0128] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0129] This application also provides a computer program product, including computer program instructions.

[0130] Optionally, the computer program product can be applied to the domain name query device in the embodiments of this application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the domain name query device in the various methods of the embodiments of this application. For the sake of brevity, they will not be described in detail here.

[0131] This application also provides a computer program.

[0132] Optionally, the computer program can be applied to the domain name query device in the embodiments of this application. When the computer program is run on a computer, it causes the computer to execute the corresponding processes implemented by the domain name query device in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0133] The aforementioned computer storage media / memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it can be various terminals that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0134] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above steps / processes do not imply a sequential order of execution; the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above embodiments of this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0135] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

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

[0137] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0138] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0139] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.

[0140] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, or the part that contributes to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, magnetic disks, or optical disks.

[0141] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A domain name query method, characterized in that, The method includes: Send a target domain query request corresponding to the target domain; The waiting time for the target domain name query request is determined based on the historical query durations corresponding to multiple historical domain name query requests. The domain name query result received within the waiting period is determined as the target domain name query result corresponding to the target domain name.

2. The method according to claim 1, characterized in that, Sending the target domain name query request corresponding to the target domain name includes: Determine the target domain name to be queried; For the target domain name, construct a first domain name query request under the first domain name type and a second domain name query request under the second domain name type respectively; Send the first domain name query request and the second domain name query request.

3. The method according to claim 2, characterized in that, The step of determining the domain name query result received within the waiting period as the target domain name query result corresponding to the target domain name includes: If, within the waiting period, a first query result is received for the query request of the first domain name, and / or a second query result is received for the query request of the second domain name, then the received first query result and / or second query result shall be determined as the target domain name query result corresponding to the target domain name.

4. The method according to claim 3, characterized in that, The method further includes: If, within the waiting period, no first query result is received for the first domain name query request, and / or no second query result is received for the second domain name query request, then it is determined that packet loss occurred in the first domain name query request and / or the second domain name query request. Perform retransmission operations on the first domain name query request that resulted in packet loss, and / or the second domain name query request.

5. The method according to any one of claims 1-4, characterized in that, The step of determining the waiting time corresponding to the target domain name query request based on the historical query durations corresponding to multiple historical domain name query requests includes: Determine the first historical query duration for the first domain type and the second historical query duration for the second domain type among the historical query durations corresponding to the multiple historical domain query requests; The first waiting time for the target domain name under the first domain name type is determined based on the first historical query duration, and the second waiting time for the target domain name under the second domain name type is determined based on the second historical query duration.

6. The method according to claim 5, characterized in that, The step of determining the domain name query result received within the waiting period as the target domain name query result corresponding to the target domain name includes: If a first query result is received for the query request of the first domain name within the first waiting period, and / or a second query result is received for the query request of the second domain name within the second waiting period, then the received first query result and / or second query result shall be determined as the target domain name query result corresponding to the target domain name.

7. The method according to claim 6, characterized in that, The method further includes: If no first query result is received for the first domain name query request within the first waiting period, and / or no second query result is received for the second domain name query request within the second waiting period, then it is determined that packet loss occurred in the first domain name query request and / or the second domain name query request. Perform retransmission operations on the first domain name query request that resulted in packet loss, and / or the second domain name query request.

8. The method according to any one of claims 1-4, characterized in that, The method further includes: The target domain name query results are stored in the first storage space along with the corresponding target domain name. If other domain name query requests targeting the target domain name are identified within the first time period, then the target domain name query result is obtained from the first storage space as the query result corresponding to the other domain name query request; The first time period is the period after the query result of the target domain name is received.

9. A domain name query device, characterized in that, The device includes: The communication unit is configured to send a target domain name query request corresponding to the target domain name; The determining unit is configured to determine the waiting time corresponding to the target domain name query request based on the historical query duration corresponding to multiple historical domain name query requests; and to determine the domain name query result received within the waiting time as the target domain name query result corresponding to the target domain name.

10. A domain name query device, characterized in that, The device includes: a processor, a memory, and a communication bus; when the processor executes the running program stored in the memory, it implements the method as described in any one of claims 1-8.