Domain name resolution request processing method, device, equipment, medium and program product
By obtaining and processing domain name resolution requests in the first server, and obtaining candidate node information from the second server when necessary, the problem of poor stability of domain name resolution requests is solved, and the processing speed and user experience are improved.
Patent Information
- Application Number
- CN202210437194.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-18
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-04-18
AI Technical Summary
The stability of domain name resolution requests in the existing technology is poor, resulting in poor user experience.
By obtaining the domain name resolution request information sent by the target client in the first server, if the corresponding target node information is not stored, the candidate node information set is obtained from the second server, and one is selected as the target node information and sent to the client to avoid Depends on the client's Local DNS resolution results and remote domain name resolution.
It improves the stability and speed of domain name resolution request processing, reduces client waiting time, and enhances disaster recovery capabilities.
Smart Images

Figure CN114629911B
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a method, apparatus, device, medium, and program product for processing a domain name resolution request. Background Art
[0002] Currently, the client can request a push-pull stream domain name from the node preferred server, perform local domain name resolution (Local DNS) on the requested push-pull stream domain name, and send the resolved IP address list to the node preferred server and initiate a domain name resolution request when there is a need for live broadcast. Thus, the node preferred server can return the preferred IP address to the client based on the IP address list sent by the client for the client to broadcast live.
[0003] However, in the prior art, the stability of processing domain name resolution requests is poor, resulting in a poor user experience. Summary of the invention
[0004] The embodiments of the present disclosure provide a method, apparatus, device, medium and program product for processing a domain name resolution request, so as to improve the stability when processing the domain name resolution request.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for processing a domain name resolution request, the method being executed by a first server, the method comprising:
[0006] Acquire first request information of a first domain name resolution request sent by a target client, wherein the first request information includes the domain name to be resolved carried in the first domain name resolution request and client information of the target client;
[0007] If the first target node information corresponding to the first request information is not stored in the first server, obtaining a first information set from the second server, wherein the first information set is a set of first candidate node information corresponding to the first request information;
[0008] At least one of the first candidate node information in the first information set is used as first target node information, and the first target node information is sent to the target client.
[0009] In a second aspect, an embodiment of the present disclosure further provides a device for processing a domain name resolution request, the device being configured in a first server, and comprising:
[0010] A request information acquisition module, configured to acquire first request information of a first domain name resolution request sent by a target client, wherein the first request information includes the domain name to be resolved carried in the first domain name resolution request and client information of the target client;
[0011] a node information acquisition module, configured to acquire a first information set from a second server if the first target node information corresponding to the first request information is not stored in the first server, wherein the first information set is a set of first candidate node information corresponding to the first request information;
[0012] The first information sending module is used to use at least one of the first candidate node information in the first information set as the first target node information, and send the first target node information to the target client.
[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, including:
[0014] one or more processors;
[0015] a memory for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing a domain name resolution request as described in the embodiment of the present disclosure.
[0017] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for processing a domain name resolution request as described in an embodiment of the present disclosure.
[0018] In a fifth aspect, the embodiments of the present disclosure further provide a computer program product. When the computer program product is executed by a computer, the computer implements the method for processing a domain name resolution request as described in the embodiments of the present disclosure.
[0019] The method, device, equipment, medium and program product for processing domain name resolution request provided by the embodiment of the present disclosure obtain the first request information of the first domain name resolution request sent by the target client, wherein the first request information includes the domain name to be resolved carried in the first domain name resolution request and the client information of the target client; if the first target node information corresponding to the first request information is not stored in the first server, then the first information set is sent to the second server, wherein the first information set is a set of first candidate node information corresponding to the first request information; at least one first candidate node information in the first information set is used as the first target node information, and the first target node information is sent to the target client. The embodiment of the present disclosure adopts the above technical solution, when the first target node information corresponding to the domain name to be resolved is not stored in the first server, the first target node information is determined based on the node information stored in the second server, without relying on the resolution result of the client Local DNS, and without performing remote domain name resolution on the domain name to be resolved, which can improve the stability of processing the domain name resolution request and the processing speed of the domain name resolution request, and reduce the waiting time of the client. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0021] Figure 1 A flowchart of a method for processing a domain name resolution request provided by an embodiment of the present disclosure;
[0022] Figure 2 A flowchart of another method for processing a domain name resolution request provided by an embodiment of the present disclosure;
[0023] Figure 3 A structural block diagram of a device for processing a domain name resolution request provided by an embodiment of the present disclosure;
[0024] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0026] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0027] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0028] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0029] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0030] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0031] Figure 1 A flowchart of a method for processing a domain name resolution request provided in an embodiment of the present disclosure. The method can be executed by a device for processing a domain name resolution request, wherein the device can be implemented by software and / or hardware, and can be configured in an electronic device, typically, in a computer device, such as in a node preference server. The method for processing a domain name resolution request provided in an embodiment of the present disclosure is suitable for scenarios where domain name resolution is performed, and is particularly suitable for scenarios where live broadcast domain names are resolved. Figure 1 As shown, the method for processing a domain name resolution request provided in this embodiment may include:
[0032] S101. Obtain first request information of a first domain name resolution request sent by a target client, wherein the first request information includes a domain name to be resolved carried in the first domain name resolution request and client information of the target client.
[0033] The first domain name resolution request can be understood as the domain name resolution request that needs to be processed currently, that is, when a received domain name resolution request is processed, the domain name resolution request can be used as the first domain name resolution request. The domain name resolution request can be understood as a request for the first server (such as a node preference server, etc.) to allocate a node corresponding to the domain name requested by it. The target client can be understood as the client that sends the first domain name resolution request.
[0034] The first request information can be understood as relevant information of the first domain name resolution request, such as the domain name to be resolved and / or the client information of the target client carried in the first domain name resolution request. The domain name to be resolved can be understood as the domain name carried in the first domain name resolution request, whose corresponding node information (such as IP address) currently needs to be determined. It can be understood that the first domain name resolution request can carry one or more domain names to be resolved. When there are multiple domain names to be resolved, subsequent operations can be performed for each domain name to be resolved. The target client can be the client that sends the first domain name resolution request. The client information of the target client can include the location information of the target client, such as the identification information of the country and province where the target client is located, and / or the operator information when the target client sends the first domain name resolution request, and so on.
[0035] Specifically, when a domain name resolution request (i.e., a first domain name resolution request) needs to be processed, the first domain name resolution request can be resolved to determine the domain name to be resolved requested by the first domain name resolution request, and based on the IP address of the target client that sends the domain name resolution request, determine the client information of the target client, such as determining the country and province where the target client is located, and the operator information of the target client.
[0036] In order to further shorten the time spent on processing domain name resolution requests, when processing a domain name resolution request, the target client sending the domain name resolution request and the domain names carried in the domain name resolution request can be filtered to reduce the number of domain name resolution requests / domain names to be resolved that need to be processed, thereby reducing the amount of computing power of the first server.
[0037] Exemplarily, when the first domain name resolution request needs to be processed, the IP address of the target client that sent the first domain name resolution request can be obtained first to determine whether the IP address is the user's private IP. If so, the first domain name resolution request is not processed, and a prompt message can be further returned to the target client to prompt the user that the IP address of the target client is a private IP. If not, the first domain name resolution request is parsed to obtain the domain names requested for resolution by the first domain name resolution request, and it is determined whether the determined domain names contain non-existent domain names (i.e., erroneous domain names). If so, the erroneous domain names are deleted, and the remaining correct domain names are used as domain names to be resolved; if not, the determined domain names are directly used as domain names to be resolved. Therefore, after obtaining the domain name to be resolved, the client information of the target client can be further determined based on the IP address of the target client.
[0038] In this embodiment, whether a domain name exists can be determined based on a pre-set business domain name list. Taking the live broadcast scenario as an example, it can be determined whether the domain name is in the live broadcast domain name list. If so, it is determined that the domain name exists; if not, it is determined that the domain name does not exist, that is, the domain name is determined to be a non-existent domain name.
[0039] S102: If the first target node information corresponding to the first request information is not stored in the first server, obtain a first information set from the second server, wherein the first information set is a set of first candidate node information corresponding to the first request information.
[0040] Among them, the first target node information corresponding to the first request information can be the node information of the node corresponding to the first request information. The correspondence between the node and the first request information can be understood as the IP address of the node corresponding to the domain name to be resolved, that is, the IP address of the node is the IP address obtained by resolving the domain name to be resolved; and the relevant information of the node is the same as the client information of the target client. Taking the client information of the target client including the location information and operator information of the target client as an example, the location information of the node (such as the identification information of the country and province) is the same as the location information of the target client, and the operator information of the node is the same as the operator information of the target client. Exemplarily, the target node information of a certain node (including the first target node information) can include the IP address of the node, and can further include the update time, expiration time and / or the Internet protocol followed by the node. The Internet protocol followed by a certain node can be the identification information of the Internet protocol followed by it; it can also be the judgment result of whether the node follows a certain Internet information, such as the judgment result of whether the node follows Internet Protocol Version 6 (IPV6), which is not limited in this embodiment.
[0041] The second server may be a server different from the first server, such as the first server may be a node preferred server, and the second server may be a server for central caching, such as a Redis server. The first server may be used only to cache node information corresponding to a certain number of domain names; the second server may be used to cache node information corresponding to each domain name resolved by a third server (such as a remote domain name resolution server). The first information set may be understood as a collection of first candidate node information corresponding to the first request information, and the first server may select from the first candidate node information as the first target node information and send it to the target client. In other words, the first candidate node information may be node information corresponding to the first request information and available for selection by the first server, and the first target node information may be node information returned by the first server to the target client based on the first domain name resolution request. The candidate node information (including the first candidate node information) of a node may include the IP address of the node, and may further include information such as the update time, expiration time, and / or the Internet protocol followed by the node.
[0042] Exemplarily, after obtaining the first request information of the first domain name resolution request, it can be determined whether the first target node information corresponding to the first request information is stored in the first server, such as determining whether the first target node information corresponding to the first request information is stored in the local cache of the first server. If it is determined that the first target node information corresponding to the first request information is not stored in the first server, the first information set corresponding to the first request information can be obtained from the second server, such as sending an information acquisition request carrying the first request information to the second server, and receiving the first information set returned by the second server based on the information acquisition request.
[0043] In this embodiment, the first server may use a least recently used (LRU) cache component to maintain a preset number of node information corresponding to the most recently requested request information in the local cache. That is, the local cache may store a certain number (such as 5000, 10000, etc.) of node information corresponding to the request information, and the node information corresponding to each request information may be sorted in order from the latest to the earliest according to the time of the last request.
[0044] Taking the example that the client information includes the country and province where the node is located and the operator corresponding to the node, the first server can cache the information of each node with the country + province + operator + domain name as the minimum granularity. In order to realize the fast search of node information, each node information can be stored in the form of a map, such as using country + province + operator as the key and the map from domain name to node information as the value to store the node information corresponding to each request information. Therefore, when judging whether the first target node information corresponding to the first request information is stored in the first server, the corresponding map can be searched in the local cache based on the client information in the first request information, and then the node information corresponding to the domain name to be resolved in the first request information can be searched in the map, and the first target node information corresponding to the first request information can be determined in the first server based on the search result.
[0045] S103: Use at least one of the first candidate node information in the first information set as first target node information, and send the first target node information to the target client.
[0046] Specifically, after obtaining the first information set, at least one first candidate node information in the first information set may be selected as the first target node information according to a preset selection rule, and the first target node information may be sent to the target client.
[0047] When the first target node information is selected according to a preset selection rule, illustratively, a set number (such as 1 or 2, etc.) of first candidate node information can be randomly selected as the first target node information; preferentially, a set number of first candidate node information can be selected as the first target node information in order from high to low access popularity of the nodes corresponding to each first candidate node information, so as to ensure that the node corresponding to the first target node information sent to the target client has a higher access popularity, that is, to ensure that the node providing resources to the target client has better performance.
[0048] In this embodiment, based on the node information stored in the first server and / or the second server, the first target node information corresponding to the domain name to be resolved is determined, and it is not necessary to rely on the resolution result of the target client Local DNS. Therefore, even when the Local DNS is hijacked by the operator or an abnormality occurs, the received domain name resolution request can still be stably processed, which can improve the stability of processing the domain name resolution request. In addition, since it is not necessary to request the third server to perform remote domain name resolution (HttpDNS) when the first target node information corresponding to the domain name to be resolved is not stored locally on the first server, the processing speed of the domain name resolution request can be further improved, reducing the waiting time of the client.
[0049] In one embodiment, the method of using at least one of the first candidate node information in the first information set as the first target node information includes: if the first information set and the second information set have an intersection, sending at least one of the candidate node information in the intersection as the first target node information to the target client; if the first information set and the second information set do not have an intersection, using at least one of the first candidate node information in the first information set as the first target node information; wherein the second information set is a set of second candidate node information corresponding to the first request information, the second candidate node information is parsed by the target client, and the second information set is sent by the target client to the first server.
[0050] The second candidate node information can be understood as the candidate node information corresponding to the first request information determined by the target client performing Local DNS. Accordingly, the second information set can be a set of second candidate node information, which can be sent to the first server together with the first domain name resolution request when the target client sends the first domain name resolution request to the first server.
[0051] In the above implementation, if the target client sends the second information set to the first server when sending the first domain name resolution request, the first target node information can be determined according to the first information set sent by the second server and the second information set sent by the target client.
[0052] Exemplarily, after receiving the first information set sent by the second server, it can be determined whether there is an intersection between the first information set and the second information set sent by the target client, that is, whether the first information set and the second information set contain the same candidate node information. If so, a preset number of candidate node information is obtained from the intersection as the first target node information corresponding to the domain name to be resolved; if not, a preset number of candidate node information is obtained from the first information set as the first target node information corresponding to the domain name to be resolved.
[0053] It should be noted that if the target client is unable to perform Local DNS due to Local DNS being hijacked by the operator, anomalies, etc., resulting in it not sending the second information set to the first server when sending the first domain name resolution request to the first server, that is, if the first server does not receive the second information set corresponding to the first request information sent by the target client, then after receiving the first information set sent by the second server, the first server can obtain a preset number of candidate node information from the first information set as the first target node information corresponding to the domain name to be resolved, without the need to confirm whether there is an intersection between the first information set and the second information set.
[0054] In this embodiment, the first server can update each node information stored in its local cache according to the preset update rules. Exemplarily, the first server can periodically (such as 10s, 20s or 30s, etc.) obtain information sets corresponding to a certain number of request information with the highest access popularity from the second server through an asynchronous coroutine, and store the obtained node information in the local cache of the first server, such as using the obtained node information to replace each node information stored in the local cache before the update. At this time, optionally, the method for processing domain name resolution requests provided in this embodiment may also include: updating each node information stored in the first server according to each information set stored in the second server. Among them, the information set corresponding to a certain request information can be understood as a collection of node information corresponding to the request information.
[0055] In this embodiment, in addition to obtaining the first information set corresponding to the first request information of the first domain name resolution request from the second server, the first server can also update the first information set stored in the second server based on the first domain name resolution request. For example, when the first server receives any domain name resolution request, in addition to obtaining the first target node information corresponding to the domain name resolution request from the first server or the second server, it can also send the domain name resolution request to the third server through an asynchronous coroutine, perform remote domain name resolution on the domain name resolution request through the third server, and update the information set corresponding to the domain name resolution request stored in the second server based on the domain name resolution result of the third server, such as periodically sending the node information corresponding to each request information sent by the third server to the second server, and / or sending it to the second server when the number of node information corresponding to each request information sent by the third server reaches a preset number, and so on.
[0056] In order to reduce the number of domain name resolution requests that require remote domain name resolution while ensuring that the update demand for the node information stored in the second server is small, the received domain name resolution requests can be downsampled, and only the domain name resolution requests after downsampling are sent to the third server for remote domain name resolution. At this time, preferably, the information set includes the first information set, and after obtaining the first request information of the first domain name resolution request sent by the target client, it also includes: determining a target server that has a mapping relationship with the first request information based on a consistent hashing algorithm; if the target server is the first server, processing the first domain name resolution request through the third server to obtain a first information set corresponding to the first request information; and sending the first information set to the second server for storage.
[0057] Exemplarily, the first server can perform a consistent hash operation on the first request information of the first domain name resolution request through an asynchronous coroutine to obtain a hash value of the first request information. Obtain the server identifier corresponding to the hash value in the consistent hash ring, and use the server corresponding to the server identifier as the server (i.e., the target server) with which the first request information has a mapping relationship. Determine whether the target server is the first server. If so, send the first domain name resolution request to the third server to perform remote domain name resolution on the first domain name resolution request through the third server to obtain a first information set corresponding to the first request information, and send the first information set to the second server for storage. For example, if the cache of the second server already stores the original first information set corresponding to the first request information, the first information set sent by the first server can be used to replace the original first information set. If the cache of the second server does not store the original first information set corresponding to the first request information, the first information set can be directly stored in the second server; if not, the first domain name resolution request can be sent to the third server for remote domain name resolution.
[0058] In one embodiment, the information set includes a third information set, and the method for processing domain name resolution requests provided in this embodiment also includes: periodically processing each second domain name resolution request in a preset request queue through a third server to obtain a third information set corresponding to the second request information of each second domain name resolution request, wherein the preset request queue is used to store a preset number of second domain name resolution requests, and each second domain name resolution request is arranged in order from low to high according to the sending frequency; and sending the third information set to the second server for storage.
[0059] In the above implementation, domain name resolution requests with a lower sending frequency can be added to a preset request queue, and each domain name resolution request stored in the preset request queue can be periodically sent to a third server for remote domain name resolution, so that the node information corresponding to the domain name resolution requests with a lower sending frequency can be updated in time in the second server, reducing the impact of consistent hashing processing on the domain name resolution requests with a lower sending frequency, thereby improving the comprehensiveness of the node information stored in the second server.
[0060] Among them, the preset request queue can be a reverse LRU queue, which is used to store the domain name resolution request that has been received least recently, that is, to eliminate the domain name resolution requests that have been received more recently. Correspondingly, the second domain name resolution request can be understood as the domain name resolution request stored in the preset request queue. Each second domain name resolution request can be arranged in the preset request queue in order from low to high in terms of sending frequency. The sending frequency of a domain name resolution request (such as the second domain name resolution request) can be the request frequency of the node information corresponding to the request information of the domain name resolution request, which can be requested by the same client or different clients that match the request information. The second request information can be understood as the request information corresponding to the second domain name resolution request. The second request information of a second domain name resolution request can include the domain name to be resolved carried in the second domain name resolution request and the client information (such as location information and operator information) of the client that sent the second target resolution request. The third information set corresponding to a second request information can be a set of node information corresponding to the second request information.
[0061] Specifically, for each second domain name resolution request in the preset request queue, the first server can periodically send the second domain name resolution request to the third server through an asynchronous coroutine, perform remote domain name resolution on the second domain name resolution request through the third server, receive the third information set corresponding to the second request information of the second domain name resolution request obtained by the third server, and send the second request information and the third information set to the second server. Correspondingly, after receiving the third information set corresponding to the second request information sent by the first server, the second server can store the second request information and the third information set in its cache accordingly, and can further delete the original third information set corresponding to the second request information originally stored in its cache.
[0062] In one embodiment, after determining the target server that has a mapping relationship with the first request information based on the consistent hashing algorithm, it may also include: if the target server is the first server, and the number of second domain name resolution requests in the preset request queue is less than the preset number or the sending frequency of the first domain name resolution request is lower than the sending frequency of the target second domain name resolution request, then the first domain name resolution request is added to the preset request queue, wherein the target second domain name resolution request is the second domain name resolution request with the highest sending frequency in the preset request queue.
[0063] In the above implementation, the first server may update the second domain name resolution request stored in the preset request queue based on the sending frequency of the received domain name resolution request.
[0064] Among them, the target second domain name resolution request is the second domain name resolution request with the highest sending frequency in the preset queue. For example, when the second domain name resolution requests are arranged in order of sending frequency from low to high, the target second domain name resolution request is the last second domain name resolution request in the preset request queue.
[0065] Exemplarily, after the first server determines that the target server with which the first request information has a mapping relationship is the first server, it can further determine whether the number of second domain name resolution requests in the preset request queue is less than the preset number (such as 200 or 500, etc.). If so, the first domain name resolution request is added to the preset request queue as the second domain name resolution request. If not, it can be further determined whether the sending frequency of the first domain name resolution request is less than the sending frequency of the last second domain name resolution request in the preset queue (i.e., the second domain name resolution request with the highest sending frequency in the preset queue). If so, the last second domain name resolution request is deleted from the preset queue, and the first domain name resolution request is added to the preset request queue as the second domain name resolution request; if not, the first domain name resolution request may not be added to the preset request queue.
[0066] In this embodiment, the method of adding the first domain name resolution request as the second domain name resolution request to the preset request queue can be flexibly set. For example, the first domain name resolution request can be directly added to the corresponding position of the preset request queue according to the sending frequency of the first domain name resolution request, so that the sending frequency of the first domain name resolution request after adding is greater than or equal to the sending frequency of each second domain name resolution request located in front of it in the preset queue, and is less than or equal to the sending frequency of each second domain name resolution request located behind it in the preset queue; the first domain name resolution request can also be added to the last position of the preset queue as the second domain name resolution request, and the second domain name resolution requests in the preset queue (including the added first domain name resolution request) can be re-sorted in order of sending frequency from low to high.
[0067] The method for processing a domain name resolution request provided in this embodiment obtains the first request information of the first domain name resolution request sent by the target client, wherein the first request information includes the domain name to be resolved carried in the first domain name resolution request and the client information of the target client; if the first target node information corresponding to the first request information is not stored in the first server, then the first information set is obtained from the second server, wherein the first information set is a set of first candidate node information corresponding to the first request information; at least one first candidate node information in the first information set is used as the first target node information, and the first target node information is sent to the target client. This embodiment adopts the above technical solution, when the first target node information corresponding to the domain name to be resolved is not stored in the first server, the first target node information is determined based on the node information stored in the second server, without relying on the resolution result of the client Local DNS, and without remote domain name resolution of the domain name to be resolved, which can improve the stability of processing domain name resolution requests and the processing speed of domain name resolution requests, and reduce the waiting time of the client.
[0068] Figure 2 A flowchart of another method for processing a domain name resolution request provided for an embodiment of the present disclosure. The solution in this embodiment can be combined with one or more optional solutions in the above embodiments. Optionally, the method for processing a domain name resolution request provided in this embodiment also includes: if the first server stores first target node information corresponding to the first request information, sending the first target node information to the target client.
[0069] Optionally, before taking at least one of the first candidate node information in the first information set as the first target node information, it also includes: deleting unavailable candidate node information in the first information set, the unavailable candidate node information including expired first candidate node information and / or first candidate node information whose corresponding node identifier is located in a node blacklist, the node blacklist is used to store abnormal node identifiers, and the abnormal node identifiers are determined by a node management system and / or a service quality monitoring system.
[0070] Optionally, after deleting the unavailable candidate node information in the first information set, the method further includes: storing the remaining available candidate node information in the first information set in the first server.
[0071] Optionally, the client information includes location information, and the method further includes: when a first preset condition is met, determining a target adjacent area based on the client information, wherein the target adjacent area is an adjacent area of the target area, and the target client is located in the target area; obtaining first target node information of a target node deployed in the target adjacent area, and sending the first target node information to the target client.
[0072] Optionally, the first target node information is available candidate node information, and the first preset condition includes at least one of the following: the client information is preset redirection client information; the first information set is not obtained from the second server; there is no available candidate node information in the first information set.
[0073] Correspondingly, such as Figure 2 As shown, the method for processing a domain name resolution request provided in this embodiment may include:
[0074] S201. Obtain first request information of a first domain name resolution request sent by a target client, wherein the first request information includes the domain name to be resolved carried in the first domain name resolution request and client information of the target client, and the client information includes location information.
[0075] S202, determining whether the client information is preset redirection client information, if so, executing S209; if not, executing S203.
[0076] In this embodiment, the client information that needs to be forcibly redirected can be preset, so that when the client information of the target client is the preset redirected client information, the client information is redirected to other client information.
[0077] The preset redirection client information may be pre-set client information that needs to be forcibly redirected, such as information about a region (such as a country or province, etc.) that needs to be forcibly redirected.
[0078] Thus, after obtaining the first request information (including location information) of the first domain name resolution request, it can be determined whether the location information is location information that requires forced redirection, such as determining whether the country where the target client is located is a country that requires forced redirection, and / or whether the province where the target client is located is a province that requires forced redirection. If the country where the target client is located is a country that requires forced redirection, or the province where the target client is located is a province that requires forced redirection, execute S209; if the country where the target client is located is not a country that requires forced redirection and the province where the target client is located is not a province that requires forced redirection, execute S203.
[0079] It should be noted that this embodiment can also redirect across operators as needed. In this case, the preset redirection client information can further include operator information that needs to be redirected compulsorily. Thus, when the operator corresponding to the target client is an operator that needs to be redirected compulsorily, the target operator to be redirected can be obtained, and the node information corresponding to the location information of the target client, the target operator information, and the domain name to be resolved can be obtained as the first target node information, and sent to the target client.
[0080] S203, determining whether the first target node information corresponding to the first request information is stored in the first server, if so, executing S211; if not, executing S204.
[0081] Exemplarily, when it is determined that the client information in the first request information does not need to be forcibly redirected, it can be determined whether the local cache of the first server stores node information corresponding to the first request information. If so, execute S211 to send the first target node information stored in the local cache of the first server to the target client; if not, execute S204 to obtain the first information set corresponding to the first request information from the second server.
[0082] In this embodiment, when determining whether the first target node information corresponding to the first request information is stored in the first server, the node information corresponding to the first request information can be first searched from the local cache of the first server. If the node information corresponding to the first request information is found, a step can be taken to determine whether the node information contains available node information, such as deleting expired node information and node information whose corresponding node identifiers are in the node blacklist from the node information obtained from the search, and determining whether there is any remaining node information corresponding to the first request information (i.e., available node information) after the deletion is completed. If available node information is contained, a certain amount of node information is obtained from the available information (such as obtained in descending order of access popularity) as the first target node information, and determining whether the first target node information corresponding to the first request information is stored in the first server. Correspondingly, if the available node information is not contained, or if the node information corresponding to the first request information is not found, it is determined that the first target node information corresponding to the first request information is not stored in the first server.
[0083] S204. Obtain a first information set from the second server, wherein the first information set is a set of first candidate node information corresponding to the first request information.
[0084] S205: Determine whether the first information set is successfully acquired, if so, execute S206, if not, execute S209.
[0085] Exemplarily, if the first information set sent by the second server is received, it can be determined that the first information set is successfully acquired, and S206 is executed; if the first information set sent by the second server is not received, it can be determined that the first information set is failed to be acquired, and S209 is executed.
[0086] S206. Delete the unavailable candidate node information in the first information set, wherein the unavailable candidate node information includes expired first candidate node information and / or first candidate node information whose corresponding node identifier is located in a node blacklist, wherein the node blacklist is used to store abnormal node identifiers, and the abnormal node identifiers are determined by a node management system and / or a service quality monitoring system.
[0087] In this embodiment, after receiving the first information set sent by the second server, unavailable candidate node information (i.e., unavailable candidate node information) in the first information set can be filtered out, such as deleting expired first candidate node information in the first information set and / or first candidate node information with a node identifier located in a node blacklist, to ensure that the first target node information subsequently sent to the target client is all available node information.
[0088] In this embodiment, the node management system can detect abnormal nodes (i.e., abnormal nodes) and report them to the second server; the service quality monitoring system can detect the service quality of each node, determine the abnormal nodes based on the service quality of each node, and report them to the second server. The second server can receive the abnormal nodes reported by the node management system and / or the server quality monitoring system, and add the node identifier of the abnormal node to the node blacklist. Accordingly, the first server can obtain the node blacklist from the second server, and determine whether the node corresponding to a certain node information (such as the first candidate node information) is an abnormal node based on the node blacklist, and then determine whether the node information is available node information.
[0089] S207 , determining whether there is available candidate node information in the first information set, if yes, executing S208 , if no, executing S209 .
[0090] Exemplarily, it can be determined whether the first information set is empty after deleting the unavailable candidate node information. If so, it is determined that there is no available candidate node information in the first information set; if not, the remaining candidate node information in the first information set is determined to be available candidate node information, and it is determined that there is available candidate node information in the first information set.
[0091] S208. Store the remaining available candidate node information in the first information set in the first server, and use at least one of the first candidate node information in the first information set as first target node information, and execute S211, wherein the first target node information is available candidate node information.
[0092] In this embodiment, after obtaining the available node information in the first information set, the node information and the first request information can also be stored in the local cache of the first server correspondingly, so that when a domain name resolution request for obtaining the first target node information corresponding to the first request information is received again, the first target node information corresponding to the first request information can be directly obtained from the local cache.
[0093] S209: Determine a target adjacent area according to the client information, wherein the target adjacent area is an adjacent area of a target area, and the target client is located in the target area.
[0094] The target area can be understood as the area where the target client is located; the target adjacent area can be a certain adjacent area of the target area. It can be understood that the target area and the target adjacent area are located at the same location level, such as when the target area is a country, the target adjacent area is the country adjacent to the target area; when the target area is a province in a country, the target adjacent area is the province adjacent to the target area in the country.
[0095] Specifically, the target area where the target client is located can be determined based on the client information (such as location information) of the target client, a pre-set adjacent area list of the target area can be obtained or an adjacent area list of the target area can be determined based on the location information, and an adjacent area can be selected from the adjacent area list as the target adjacent area.
[0096] In this embodiment, the selection method of the target adjacent area can be flexibly set, for example, an adjacent area can be randomly selected from the adjacent area list as the target adjacent area; or, according to the access popularity of each adjacent area in the adjacent area list, an adjacent area with an access popularity greater than a preset access popularity threshold or the highest access popularity can be selected as the target adjacent area to ensure that a better node is deployed in the adjacent area. At this time, optionally, determining the target adjacent area according to the client information includes: obtaining an adjacent area list of the target area according to the client information; obtaining an adjacent area whose access popularity meets a second preset condition from the adjacent area list as the target adjacent area.
[0097] S210: Obtain first target node information of target nodes deployed in the target adjacent area.
[0098] The target node may be understood as a node deployed in the target proximity area and corresponding to the first target node information.
[0099] Taking the client information including location information and operator information as an example, after the target adjacent area is determined, the location information of the target client in the first request information can be replaced by the location information of the target adjacent area, and return to execute S203 to obtain the first target node information corresponding to the replaced first request information, that is, to obtain the first target node information of the target node deployed in the target adjacent area.
[0100] S211. Send the first target node information to the target client.
[0101] The method for processing domain name resolution requests provided in this embodiment reports abnormal nodes through a node management system and / or a service quality monitoring system, and adopts different methods to obtain node information of non-abnormal nodes corresponding to the request information of the domain name resolution request. It can quickly take abnormal nodes offline while improving the stability when processing domain name resolution requests, improve the disaster recovery capability when processing domain name resolution requests, and improve the success rate of processing domain name resolution requests.
[0102] Figure 3 This is a structural block diagram of a domain name resolution request processing device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware, and can be configured in an electronic device, typically, in a computer device, such as in a node optimization server, and can process a domain name resolution request by executing a domain name resolution request processing method. Figure 3 As shown, the domain name resolution request processing device provided in this embodiment may include: a request information acquisition module 301, a node information acquisition module 302 and a first information sending module 303, wherein:
[0103] The request information acquisition module 301 is used to acquire first request information of a first domain name resolution request sent by a target client, wherein the first request information includes the domain name to be resolved carried in the first domain name resolution request and the client information of the target client;
[0104] The node information acquisition module 302 is configured to acquire a first information set from a second server if the first target node information corresponding to the first request information is not stored in the first server, wherein the first information set is a set of first candidate node information corresponding to the first request information;
[0105] The first information sending module 303 is used to use at least one of the first candidate node information in the first information set as the first target node information, and send the first target node information to the target client.
[0106] The processing device of the domain name resolution request provided in this embodiment obtains the first request information of the first domain name resolution request sent by the target client through the request information acquisition module, wherein the first request information includes the domain name to be resolved carried in the first domain name resolution request and the client information of the target client; in response to the situation that the first target node information corresponding to the first request information is not stored in the first server, the node information acquisition module sends a first information set to the second server, wherein the first information set is a set of first candidate node information corresponding to the first request information; at least one first candidate node information in the first information set is used as the first target node information through the first information sending module, and the first target node information is sent to the target client. This embodiment adopts the above technical solution, when the first target node information corresponding to the domain name to be resolved is not stored in the first server, the first target node information is determined based on the node information stored in the second server, without relying on the resolution result of the client Local DNS, and without remote domain name resolution of the domain name to be resolved, which can improve the stability of processing the domain name resolution request and the processing speed of the domain name resolution request, and reduce the waiting time of the client.
[0107] Furthermore, the domain name resolution request processing device provided in this embodiment may also include: a second information sending module, used to send the first target node information to the target client in response to the first server storing the first target node information corresponding to the first request information.
[0108] Furthermore, the domain name resolution request processing device provided in this embodiment may also include: a node information deletion module, used to delete unavailable candidate node information in the first information set before using at least one of the first candidate node information in the first information set as the first target node information, the unavailable candidate node information including expired first candidate node information and / or first candidate node information whose corresponding node identifier is located in a node blacklist, the node blacklist is used to store abnormal node identifiers, and the abnormal node identifiers are determined by a node management system and / or a service quality monitoring system.
[0109] Furthermore, the domain name resolution request processing device provided in this embodiment may also include: a node information storage module, which is used to store the remaining available candidate node information in the first information set in the first server after deleting the unavailable candidate node information in the first information set.
[0110] In the above scheme, the client information may include location information. The domain name resolution request processing device provided in this embodiment may also include: an adjacent area determination module, which is used to determine the target adjacent area according to the client information when a first preset condition is met, wherein the target adjacent area is an adjacent area of the target area, and the target client is located in the target area; a third information sending module, which is used to obtain first target node information of the target node deployed in the target adjacent area, and send the first target node information to the target client.
[0111] In the above scheme, the adjacent area determination module may include: a list acquisition unit, used to obtain an adjacent area list of the target area according to the client information; and an adjacent area determination unit, used to obtain an adjacent area whose access popularity meets a second preset condition from the adjacent area list as a target adjacent area.
[0112] In the above scheme, the first target node information may be available candidate node information, and the first preset condition may include at least one of the following: the client information is preset redirection client information; the first information set is not obtained from the second server; there is no available candidate node information in the first information set.
[0113] In the above scheme, the first information sending module 303 can be specifically used for: if the first information set and the second information set have an intersection, then at least one candidate node information in the intersection is sent to the target client as the first target node information; if the first information set and the second information set do not have an intersection, then at least one of the first candidate node information in the first information set is used as the first target node information; wherein, the second information set is a set of second candidate node information corresponding to the first request information, the second candidate node information is parsed by the target client, and the second information set is sent by the target client to the first server.
[0114] Furthermore, the domain name resolution request processing device provided in this embodiment may also include: a node information updating module, used to update each node information stored in the first server according to each information set stored in the second server.
[0115] In the above scheme, the information set may include the first information set. The domain name resolution request processing device provided in this embodiment may also include: a mapping module, which is used to determine the target server that has a mapping relationship with the first request information based on a consistent hashing algorithm after obtaining the first request information of the first domain name resolution request sent by the target client; a first request processing module, which is used to process the first domain name resolution request through a third server in response to the target server being the first server, and obtain a first information set corresponding to the first request information; and a fourth information sending module, which is used to send the first information set to the second server for storage.
[0116] In the above scheme, the information set may include a third information set, and the domain name resolution request processing device provided in this embodiment may also include: a second request processing module, used to periodically process each second domain name resolution request in a preset request queue through a third server, and obtain a third information set corresponding to the second request information of each second domain name resolution request, wherein the preset request queue is used to store a preset number of second domain name resolution requests, and each second domain name resolution request is arranged in order from low to high according to the sending frequency; a fifth information sending module, used to send the third information set to the second server for storage.
[0117] Furthermore, the domain name resolution request processing device provided in this embodiment may also include: a request adding module, which is used to add the first domain name resolution request to the preset request queue after the target server that has a mapping relationship with the first request information is determined based on the consistent hashing algorithm, if the target server is the first server, and the number of second domain name resolution requests in the preset request queue is less than the preset number or the sending frequency of the first domain name resolution request is lower than the sending frequency of the target second domain name resolution request, wherein the target second domain name resolution request is the second domain name resolution request with the highest sending frequency in the preset request queue.
[0118] The domain name resolution device provided in the embodiment of the present disclosure can execute the domain name resolution request processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the domain name resolution request processing method. For technical details not described in detail in this embodiment, please refer to the domain name resolution request processing method provided in any embodiment of the present disclosure.
[0119] Reference below Figure 4, which shows a schematic diagram of the structure of an electronic device (e.g., a server) 400 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0120] like Figure 4 As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0121] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0122] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0123] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0124] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0125] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0126] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains first request information of a first domain name resolution request sent by a target client, wherein the first request information includes the domain name to be resolved carried in the first domain name resolution request and the client information of the target client; if the first target node information corresponding to the first request information is not stored in the first server, obtains a first information set from a second server, wherein the first information set is a set of first candidate node information corresponding to the first request information; uses at least one of the first candidate node information in the first information set as the first target node information, and sends the first target node information to the target client.
[0127] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0128] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0129] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a module does not, in some cases, constitute a limitation on the unit itself.
[0130] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0131] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0132] According to one or more embodiments of the present disclosure, Example 1 provides a method for processing a domain name resolution request, the method being executed by a first server, and the method comprising:
[0133] Acquire first request information of a first domain name resolution request sent by a target client, wherein the first request information includes the domain name to be resolved carried in the first domain name resolution request and client information of the target client;
[0134] If the first target node information corresponding to the first request information is not stored in the first server, obtaining a first information set from the second server, wherein the first information set is a set of first candidate node information corresponding to the first request information;
[0135] At least one of the first candidate node information in the first information set is used as first target node information, and the first target node information is sent to the target client.
[0136] According to one or more embodiments of the present disclosure, Example 2 is the method according to Example 1, further comprising:
[0137] If the first target node information corresponding to the first request information is stored in the first server, the first target node information is sent to the target client.
[0138] According to one or more embodiments of the present disclosure, Example 3 is the method according to Example 1, and before taking at least one of the first candidate node information in the first information set as the first target node information, further includes:
[0139] Delete the unavailable candidate node information in the first information set, the unavailable candidate node information includes expired first candidate node information and / or first candidate node information whose corresponding node identifier is located in a node blacklist, the node blacklist is used to store abnormal node identifiers, and the abnormal node identifiers are determined by a node management system and / or a service quality monitoring system.
[0140] According to one or more embodiments of the present disclosure, Example 4 is the method according to Example 3, after deleting the unavailable candidate node information in the first information set, further comprising:
[0141] The remaining available candidate node information in the first information set is stored in the first server.
[0142] According to one or more embodiments of the present disclosure, Example 5 is the method according to Example 3, wherein the client information includes location information, and the method further includes:
[0143] When the first preset condition is met, determining a target adjacent area according to the client information, wherein the target adjacent area is an adjacent area of a target area, and the target client is located in the target area;
[0144] First target node information of a target node deployed in the target adjacent area is obtained, and the first target node information is sent to the target client.
[0145] According to one or more embodiments of the present disclosure, Example 6 is the method according to Example 5, wherein determining the target adjacent area according to the client information includes:
[0146] Acquire a list of neighboring areas of the target area according to the client information;
[0147] A neighboring area whose access popularity meets a second preset condition is obtained from the neighboring area list as a target neighboring area.
[0148] According to one or more embodiments of the present disclosure, Example 7 is the method according to Example 5, wherein the first target node information is available candidate node information, and the first preset condition includes at least one of the following:
[0149] The client information is preset redirection client information;
[0150] The first information set is not obtained from the second server;
[0151] There is no available candidate node information in the first information set.
[0152] According to one or more embodiments of the present disclosure, Example 8 is the method according to Example 1, wherein taking at least one of the first candidate node information in the first information set as the first target node information includes:
[0153] If the first information set and the second information set have an intersection, sending at least one candidate node information in the intersection as first target node information to the target client;
[0154] If the first information set and the second information set do not have an intersection, taking at least one of the first candidate node information in the first information set as the first target node information;
[0155] The second information set is a collection of second candidate node information corresponding to the first request information, the second candidate node information is parsed by the target client, and the second information set is sent by the target client to the first server.
[0156] According to one or more embodiments of the present disclosure, Example 9 is a method according to any one of Examples 1-8, further comprising:
[0157] The node information stored in the first server is updated according to the information sets stored in the second server.
[0158] According to one or more embodiments of the present disclosure, Example 10 is the method according to Example 9, wherein the information set includes the first information set, and after obtaining the first request information of the first domain name resolution request sent by the target client, further includes:
[0159] Determine a target server that has a mapping relationship with the first request information based on a consistent hashing algorithm;
[0160] If the target server is the first server, the first domain name resolution request is processed by a third server to obtain a first information set corresponding to the first request information;
[0161] The first information set is sent to the second server for storage.
[0162] According to one or more embodiments of the present disclosure, Example 11 is the method according to Example 10, wherein the information set includes a third information set, and the method further includes:
[0163] Periodically processing each second domain name resolution request in a preset request queue through a third server to obtain a third information set corresponding to the second request information of each second domain name resolution request, wherein the preset request queue is used to store a preset number of second domain name resolution requests, and each second domain name resolution request is arranged in order of sending frequency from low to high;
[0164] The third information set is sent to the second server for storage.
[0165] According to one or more embodiments of the present disclosure, Example 12 is the method according to Example 11, after determining the target server having a mapping relationship with the first request information based on the consistent hashing algorithm, further comprising:
[0166] If the target server is the first server, and the number of second domain name resolution requests in the preset request queue is less than the preset number or the sending frequency of the first domain name resolution request is lower than the sending frequency of the target second domain name resolution request, then the first domain name resolution request is added to the preset request queue, wherein the target second domain name resolution request is the second domain name resolution request with the highest sending frequency in the preset request queue.
[0167] According to one or more embodiments of the present disclosure, Example 13 provides a device for processing a domain name resolution request, the device being configured in a first server, and comprising:
[0168] A request information acquisition module, configured to acquire first request information of a first domain name resolution request sent by a target client, wherein the first request information includes the domain name to be resolved carried in the first domain name resolution request and client information of the target client;
[0169] a node information acquisition module, configured to acquire a first information set from a second server if the first target node information corresponding to the first request information is not stored in the first server, wherein the first information set is a set of first candidate node information corresponding to the first request information;
[0170] The first information sending module is used to use at least one of the first candidate node information in the first information set as the first target node information, and send the first target node information to the target client.
[0171] According to one or more embodiments of the present disclosure, Example 14 provides an electronic device, including:
[0172] one or more processors;
[0173] a memory for storing one or more programs,
[0174] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing a domain name resolution request as described in any one of Examples 1-12.
[0175] According to one or more embodiments of the present disclosure, Example 15 provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for processing a domain name resolution request as described in any one of Examples 1-12.
[0176] According to one or more embodiments of the present disclosure, Example 16 provides a computer program product. When the computer program product is executed by a computer, the computer implements the method for processing a domain name resolution request as described in any one of Examples 1-12.
[0177] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0178] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0179] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A method for processing a domain name resolution request, characterized in that: The method is performed by a first server, and includes: Acquire first request information of a first domain name resolution request sent by a target client, wherein the first request information includes the domain name to be resolved carried in the first domain name resolution request and client information of the target client; If the first target node information corresponding to the first request information is not stored in the first server, a first information set is obtained from the second server, wherein the first information set is a set of first candidate node information corresponding to the first request information, and the second server is a central cache server, and the second server is used to cache node information corresponding to each domain name resolved by the third server; Using at least one of the first candidate node information in the first information set as first target node information, and sending the first target node information to the target client; The second server stores various information sets, the information sets include a third information set, and the method further includes: Periodically processing each second domain name resolution request in a preset request queue through a third server to obtain a third information set corresponding to the second request information of each second domain name resolution request, wherein the preset request queue is used to store a preset number of second domain name resolution requests, and each second domain name resolution request is arranged in order of sending frequency from low to high; The third information set is sent to the second server for storage.
2. The method according to claim 1, characterized in that: Also includes: If the first target node information corresponding to the first request information is stored in the first server, the first target node information is sent to the target client.
3. The method according to claim 1, characterized in that: Before taking at least one of the first candidate node information in the first information set as the first target node information, the method further includes: Delete the unavailable candidate node information in the first information set, the unavailable candidate node information includes expired first candidate node information and / or first candidate node information whose corresponding node identifier is located in a node blacklist, the node blacklist is used to store abnormal node identifiers, and the abnormal node identifiers are determined by a node management system and / or a service quality monitoring system.
4. The method according to claim 3, characterized in that After deleting the unavailable candidate node information in the first information set, the method further includes: The remaining available candidate node information in the first information set is stored in the first server.
5. The method according to claim 3, characterized in that: The client information includes location information, and the method further includes: When the first preset condition is met, determining a target adjacent area according to the client information, wherein the target adjacent area is an adjacent area of a target area, and the target client is located in the target area; First target node information of a target node deployed in the target adjacent area is obtained, and the first target node information is sent to the target client.
6. The method according to claim 5, characterized in that The determining the target adjacent area according to the client information includes: Acquire a list of neighboring areas of the target area according to the client information; A neighboring area whose access popularity meets a second preset condition is obtained from the neighboring area list as a target neighboring area.
7. The method according to claim 5, characterized in that The first target node information is available candidate node information, and the first preset condition includes at least one of the following: The client information is preset redirection client information; The first information set is not obtained from the second server; There is no available candidate node information in the first information set.
8. The method according to claim 1, characterized in that The taking at least one of the first candidate node information in the first information set as the first target node information includes: If the first information set and the second information set have an intersection, sending at least one candidate node information in the intersection as first target node information to the target client; If the first information set and the second information set do not have an intersection, taking at least one of the first candidate node information in the first information set as the first target node information; The second information set is a collection of second candidate node information corresponding to the first request information, the second candidate node information is parsed by the target client, and the second information set is sent by the target client to the first server.
9. The method according to any one of claims 1 to 8, characterized in that: Also includes: The node information stored in the first server is updated according to the information sets stored in the second server.
10. The method according to claim 9, characterized in that The information set includes the first information set, and after obtaining the first request information of the first domain name resolution request sent by the target client, further includes: Determine a target server that has a mapping relationship with the first request information based on a consistent hashing algorithm; If the target server is the first server, the first domain name resolution request is processed by a third server to obtain a first information set corresponding to the first request information; The first information set is sent to the second server for storage.
11. The method according to claim 10, characterized in that After determining the target server having a mapping relationship with the first request information based on the consistent hashing algorithm, the method further includes: If the target server is the first server, and the number of second domain name resolution requests in the preset request queue is less than the preset number or the sending frequency of the first domain name resolution request is lower than the sending frequency of the target second domain name resolution request, then the first domain name resolution request is added to the preset request queue, wherein the target second domain name resolution request is the second domain name resolution request with the highest sending frequency in the preset request queue.
12. A device for processing a domain name resolution request, characterized in that: The device is configured in the first server, and the device includes: A request information acquisition module, configured to acquire first request information of a first domain name resolution request sent by a target client, wherein the first request information includes the domain name to be resolved carried in the first domain name resolution request and client information of the target client; a node information acquisition module, configured to acquire a first information set from a second server if the first target node information corresponding to the first request information is not stored in the first server, wherein the first information set is a collection of first candidate node information corresponding to the first request information, and the second server is a central cache server, and the second server is configured to cache node information corresponding to each domain name resolved by the third server; A first information sending module, configured to use at least one of the first candidate node information in the first information set as first target node information, and send the first target node information to the target client; The second server stores various information sets, the information sets include a third information set, and the device further includes: a second request processing module, used to periodically process each second domain name resolution request in a preset request queue through a third server to obtain a third information set corresponding to the second request information of each second domain name resolution request, wherein the preset request queue is used to store a preset number of second domain name resolution requests, and each second domain name resolution request is arranged in order of sending frequency from low to high; The fifth information sending module is used to send the third information set to the second server for storage.
13. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for processing a domain name resolution request according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for processing a domain name resolution request according to any one of claims 1 to 11 when executed.
15. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the method for processing a domain name resolution request according to any one of claims 1 to 11.
