Domain name resolution method and device, electronic equipment, chip and medium
By judging abnormal DNS requests and classifying access frequencies, the domain name resolution process is optimized, which solves the problems of low resolution efficiency and high cache failure rate in the existing technology, and improves user experience and network resource utilization efficiency.
Patent Information
- Application Number
- CN202410984564.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-10-08
AI Technical Summary
Existing domain name resolution technology has low resolution efficiency and high cache failure rate, resulting in reduced user experience and poor utilization of network resources.
By judging the abnormality of DNS requests, the access frequency of the target domain name is classified, and the anomaly detection algorithm and feature extraction network are used to determine the request category and access frequency, optimize the domain name resolution process, avoid interference from abnormal requests, and improve resolution efficiency and cache update efficiency.
It improves the efficiency and user experience of domain name resolution, reduces the cache failure rate, and enhances the security of domain name resolution and the efficiency of network resource utilization.
Smart Images

Figure CN118748668A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the computer field, and in particular to a domain name resolution method, device, electronic device, chip and medium. Background Art
[0002] Domain name resolution is the process of converting domain names into corresponding Internet Protocol (IP) addresses on the Internet, so that users can access websites through easy-to-remember domain names rather than complex numeric sequences. This process is usually performed by a Domain Name System (DNS) server. However, in existing domain name resolution technologies, when a user initiates a resolution request, if the local DNS server does not cache the record of the domain name, it is necessary to query the superior or even the root server. This process may involve multiple network jumps, resulting in increased resolution delay. Secondly, since the domain name resolution results are frequently cached and updated, the cache failure rate may be high. If the time (Time to Live, TTL) of the cached resolution server is improperly set, it may cause the user to still obtain an old or invalid IP address after the domain name record is updated, or frequently make unnecessary resolution requests when the record remains unchanged, thereby affecting the user experience and the utilization efficiency of network resources. Therefore, in the relevant domain name resolution technology, there are problems of low resolution efficiency and high cache failure rate. Summary of the invention
[0003] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
[0004] The present invention provides a domain name resolution method, device, electronic device, chip and medium to solve the problems of low resolution efficiency and high cache miss rate in domain name resolution, to judge abnormal DNS requests, to classify the access frequency of the requested target domain name, and to improve the efficiency of domain name resolution, to correctly resolve the domain name into the corresponding IP address and synchronize it in the cache, and to reduce the cache miss rate. The user experience of domain name resolution and the utilization efficiency of network resources are improved.
[0005] A first aspect of the present disclosure provides a domain name resolution method, the method comprising:
[0006] In response to a domain name query request from a client, perform anomaly detection on the domain name query request and confirm a request category of the domain name query request, where the request category includes an abnormal request and a normal request;
[0007] If the request category of the domain name query request is a normal request, confirming whether the target domain name corresponding to the domain name query request exists in the cache; if the target domain name already exists in the cache, querying the first network address corresponding to the target domain name from the cache, and sending the first network address to the client;
[0008] If the target domain name does not exist in the cache, the target domain name is classified by access frequency, including high-frequency access and low-frequency access; if the target domain name is accessed frequently, the second network address corresponding to the target domain name is recursively queried in the domain name server, and the second network address is sent to the client.
[0009] In some embodiments of the present disclosure, anomaly detection is performed on a domain name query request to confirm the request category of the domain name query request, including:
[0010] Based on the domain name query request and the network address database, construct characteristic information of the domain name query request;
[0011] According to the binary anomaly detection algorithm, a hyperplane for classifying feature information is determined;
[0012] According to the hyperplane, the feature information is classified to determine the request category.
[0013] In some embodiments of the present disclosure, the feature information is classified according to the hyperplane to determine the request category, including:
[0014] Determine the target distance between feature information and the hyperplane;
[0015] If the target distance is greater than a preset distance threshold, the feature information is used as target feature information;
[0016] If the target distance is less than or equal to the preset distance threshold, the feature information is moved to the side away from the hyperplane by the preset distance value to form the target feature information;
[0017] The request category is determined based on the target feature information and the normal vector of the hyperplane.
[0018] In some embodiments of the present disclosure, after responding to a domain name query request from a client, performing anomaly detection on the domain name query request, and confirming the request category of the domain name query request, the following further includes:
[0019] If the request category of the domain name query request is an abnormal request, the third network address that initiates the abnormal request is stored in the network address list, and the domain name query request is rejected;
[0020] If the request category of the domain name query request is a normal request, the target domain name of the domain name query request is queried in the cache.
[0021] In some embodiments of the present disclosure, the target domain name is classified by access frequency, including:
[0022] Constructing a query feature of the access frequency of the target domain name according to the domain name, query type and query time information of the domain name query request, wherein the query time information includes a first duration and a second duration, wherein the first duration is the duration from the first query time of the domain name in the domain name query request to the current query time, and the second duration is the duration from the most recent query time to the current query time;
[0023] Based on the query features, the global and local features of the target domain name's access frequency are extracted through the feature extraction network;
[0024] The global vector and the local vector are fused into a hybrid feature vector;
[0025] Normalize the mixed feature vector to obtain the feature vector weight;
[0026] According to the mixed feature vector and feature vector weight, the target domain name is classified through a fully connected classifier.
[0027] In some embodiments of the present disclosure, based on the query features, the global features and local features of the access frequency of the target domain name are extracted through a feature extraction network, including:
[0028] Use the long short-term memory network to extract the global features of the target domain name's access frequency from the query features;
[0029] A convolutional neural network is used to extract local features of the target domain name’s access frequency from the query features.
[0030] In some embodiments of the present disclosure, the target domain name is classified by a fully connected classifier according to the mixed feature vector and the feature vector weight, including:
[0031] Determine the key eigenvector according to the mixed eigenvector and the eigenvector weight;
[0032] The relu activation function and sigmoid activation function of the fully connected classifier are used to process the key feature vectors in turn to obtain the access probability value of the target domain name;
[0033] If the access probability value is greater than the preset probability, the access frequency of the target domain name is a high-frequency access; otherwise, the access frequency of the target domain name is a low-frequency access.
[0034] In some embodiments of the present disclosure, after recursively querying the second network address corresponding to the target domain name and sending the second network address to the client, the process further includes:
[0035] The second network address and the target domain name are stored in a cache.
[0036] A second aspect of the present disclosure provides a domain name resolution device, the device comprising:
[0037] An abnormal request detection module is used to respond to a domain name query request from a client, perform abnormal detection on the domain name query request, and confirm the request category of the domain name query request, where the request category includes abnormal request and normal request;
[0038] A domain name classification module, configured to, if the request category of the domain name query request is a normal request, confirm whether a target domain name corresponding to the domain name query request exists in a cache, and if the target domain name already exists in the cache, query a first network address corresponding to the target domain name from the cache, and send the first network address to the client;
[0039] The domain name resolution module is used to classify the target domain name by access frequency if the target domain name does not exist in the cache, and the access frequency includes high-frequency access and low-frequency access; if the target domain name is accessed frequently, the second network address corresponding to the target domain name is recursively queried and the second network address is sent to the client.
[0040] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the methods in the first aspect embodiment of the present disclosure.
[0041] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, characterized in that the computer instructions are used to enable a computer to execute the method in the first aspect embodiment of the present disclosure.
[0042] The fifth aspect embodiment of the present disclosure proposes a computer program product, characterized in that it includes a computer program, and when the computer program is executed by a processor, it implements any method in the first aspect embodiment of the present disclosure.
[0043] In summary, according to the domain name resolution method proposed in the present disclosure, in response to the domain name query request of the client, the domain name query request is detected abnormally, and the request category of the domain name query request is confirmed, and the request category includes abnormal request and normal request, thereby avoiding the interference of abnormal request on domain name resolution and improving the security of domain name resolution; if the request category of the domain name query request is a normal request, then it is confirmed in the cache whether the target domain name corresponding to the domain name query request exists, and if the target domain name already exists in the cache, then the first network address corresponding to the target domain name is queried from the cache, and the first network address is sent to the client, thereby shortening the time for re-performing the full process domain name resolution, improving the efficiency of domain name resolution, and reducing the failure rate of the cache; if the target domain name does not exist in the cache, then the target domain name is classified by the access frequency, and the access frequency includes high-frequency access and low-frequency access. If the access frequency of the target domain name is high-frequency access, the second network address corresponding to the target domain name is recursively queried in the domain name server, and the second network address is sent to the client, thereby quickly determining the IP address of the target domain name that is frequently accessed. This improves the efficiency of domain name resolution and enhances the user experience.
[0044] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0046] Figure 1 A flowchart of a domain name resolution method according to an embodiment of the present disclosure;
[0047] Figure 2 A flowchart of performing abnormality detection on a domain name query request and confirming a request category of the domain name query request according to an embodiment of the present disclosure;
[0048] Figure 3 This is a flow chart of classifying feature information and determining a request category according to a hyperplane according to an embodiment of the present disclosure;
[0049] Figure 4 A flowchart of processing a query request according to a category of a domain name query request according to an embodiment of the present disclosure;
[0050] Figure 5 This is a flow chart of classifying the access frequency of a target domain name according to an embodiment of the present disclosure;
[0051] Figure 6A flowchart of an embodiment of the present disclosure for extracting global features and local features of the access frequency of a target domain name through a feature extraction network based on query features;
[0052] Figure 7 This is a flow chart of classifying a target domain name by a fully connected classifier according to a mixed feature vector and a feature vector weight according to an embodiment of the present disclosure;
[0053] Figure 8 A schematic diagram of a domain name resolution according to an embodiment of the present disclosure;
[0054] Fig. 9 A schematic diagram of the structure of a domain name resolution device according to an embodiment of the present disclosure;
[0055] Fig.10 The present invention is a block diagram of an electronic device for implementing the domain name resolution method disclosed in the present invention according to an exemplary embodiment. DETAILED DESCRIPTION
[0056] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout identify the same or similar originals or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0057] First, a brief introduction to the relevant terms in this disclosure is given:
[0058] Domain Name System (DNS): In this disclosure, it may also be referred to as the domain name server system. DNS, the full name of which is Domain Name System, is a key service on the Internet. Its main function is to convert easy-to-remember domain names into machine-readable IP addresses. The working principle of DNS involves multiple components. First, when a user tries to access a website, the user enters the domain name, such as "www.example.com". Then, this request is sent to the local DNS server, which is usually provided by the user's Internet Service Provider (ISP). The local DNS server checks whether the resolution result for the domain name has been cached. If so, it will immediately return the IP address; if not, it will query the superior DNS server.
[0059] The query process may involve multiple levels of DNS servers, including root servers, top-level domain servers, and authoritative name servers. The root server is the highest level of DNS server, which provides references to top-level domain servers. Top-level domain servers are responsible for managing the resolution of top-level domain names (such as .com, .org, etc.), while authoritative name servers maintain resolution records for specific domain names. When the query reaches the authoritative name server, it returns the corresponding IP address, and this result is sent back to the user's computer and cached by the local DNS server for later use.
[0060] In order to improve resolution efficiency, DNS servers usually cache recent query results. In this way, when there is a new request, if there is a corresponding record in the cache, the DNS server can respond quickly without having to perform the entire query process again. However, this caching mechanism also brings some security issues, such as DNS hijacking and cache pollution. These issues may cause users to be redirected to the wrong website or privacy leaks.
[0061] In addition to traditional DNS, encrypted DNS (such as DNS-over-HTTPS) is becoming increasingly popular. Encrypted DNS provides a more secure query process, protecting user privacy and preventing man-in-the-middle attacks through encrypted communications.
[0062] For example, when you enter "www.example.com" in the browser, the computer will first check whether there is a corresponding record in the local DNS cache. If not, it will initiate a query request to the local DNS server according to the configuration. The local DNS server will check its own cache, and if it finds a corresponding record, it will directly return the result; if not, it will query the superior DNS server until it finally obtains the IP address corresponding to "www.example.com" from the authoritative name server. Then, this address is returned to the computer and cached by the local DNS server for next use.
[0063] Internet Protocol (IP) address: In this disclosure, it may also be referred to as an IP address, that is, an Internet Protocol Address, which is a unique address used to identify a device on the Internet. The main function of an IP address is to assign a logical address to each network and each host on the Internet to mask the differences in physical addresses. An IPv4 address consists of a 32-bit binary number, usually expressed in dotted decimal form, such as 192.168.1.1. An IP address consists of two parts: a network identifier and a host identifier. The network identifier is used to distinguish different network segments, while the host identifier is used to identify a specific device within the same network segment. In addition to the common IPv4, there is also a newer IPv6 version, which provides more address space and more advanced functions to cope with the rapid development of the Internet and the demand for more device addresses.
[0064] Domain name resolution is one of the basic services on the Internet. It resolves domain names into corresponding IP addresses, allowing users to access Internet resources through domain names. At present, there are a large number of domain names and websites on the Internet. The load and response speed of domain name resolution services are crucial to user experience and network security. In related technologies, Domain Name System Security Extensions (DNSSEC) resolution technology and Extension Mechanisms for DNS (EDNS) are used for domain name resolution. DNSSEC security resolution technology is a security extension protocol that can improve the security of domain name resolution. It can prevent spoofing and man-in-the-middle attacks in the domain name resolution process through digital signatures and authentication technologies. However, the disadvantages of DNSSEC are high complexity, difficulty in implementation, and significant performance impact. In addition, EDNS security extension technology is a security extension protocol that can improve the security and efficiency of domain name resolution. It can support more functions and protocols, such as DNS-over-TLS and DNS-over-HTTPS, by adding extension fields to DNS messages. However, the disadvantages of EDNS technology are poor compatibility, difficulty in implementation, and the need for additional hardware and software support.
[0065] In summary, in the related technologies, domain name resolution has the problems of low resolution efficiency and high cache miss efficiency, which directly affects the user experience.
[0066] The present disclosure aims to solve the problems of low resolution efficiency and high cache miss rate in domain name resolution. By making abnormal judgments on DNS requests and classifying the access frequency of the requested target domain name, the efficiency of domain name resolution is improved, the interference of abnormal requests is avoided, and the security of domain name resolution is improved. The domain name is correctly resolved into the corresponding IP address and synchronized in the cache, reducing the cache miss rate. The user experience of domain name resolution and the utilization efficiency of network resources are improved.
[0067] The method proposed in this disclosure is applied to domain name resolution tasks and plays an important role in multiple fields and scenarios. The details are as follows:
[0068] Enterprise applications: including game applications (Application, APP) and enterprise apps, which rely on DNS resolution for service scheduling. In these applications, DNS attacks may cause a serious decline in user experience, so it is particularly important to improve resolution efficiency and security.
[0069] Financial industry: Systems in the financial sector store a large amount of sensitive information and have extremely high security requirements. Improving the security performance of DNS can effectively resist hacker attacks, protect user data security, and meet the compliance requirements of relevant policies and regulations.
[0070] Website promotion: During promotional activities held on corporate websites, traffic surges. At this time, DNS attacks will cause website access delays, affecting transactions and promotional effects. Therefore, efficient domain name resolution technology can provide necessary traffic protection to ensure the smooth progress of activities.
[0071] Disaster recovery switching and global traffic management: By using routing technologies such as weighted polling and Geographic Domain Name System (GeoDNS), combined with application health checks, automatic fault shielding and failover of services are achieved to ensure high service availability.
[0072] Anti-Distributed Denial of Service (DDOS) attack: For users of live broadcast, video, games, etc., it is crucial to improve the anti-attack capability of DNS. By using the built-in high-defense DNS and high-defense IP in Cloud Resolution, you can add protection measures in both resolution requests and website sites.
[0073] Mobile resolution: With the development of mobile Internet, domain name resolution technology also needs to adapt to the characteristics of mobile devices, such as supporting different network environments and mobile operating systems.
[0074] Internet basic resource management: As a distributed database that maps domain names and IP addresses, the security and autonomy of the domain name system are crucial to the national informatization plan.
[0075] Supports the conversion of host names to IP addresses in Transmission Control Protocol / Internet Protocol (TCP / IP) networks: This is the most basic application of domain name resolution, allowing users to access websites through easy-to-remember domain names without having to remember complex IP addresses.
[0076] Supporting large-scale deployment of Internet Protocol version 6 (IPv6): As IPv4 addresses are gradually exhausted, the promotion of IPv6 becomes particularly important, and domain name resolution technology needs to adapt to support the new address system.
[0077] Development of software and information technology service industry: The upgrading and transformation of domain name system is also a part of software research and development, which is of great significance to improving the technical level and service capability of the whole industry.
[0078] To sum up, after improving the efficiency, security and cache failure rate of domain name resolution, this technology has a wide range of applications in many fields and scenarios such as enterprise applications, financial industry, website promotion, disaster recovery switching, anti-DDOS attack, mobile resolution, Internet basic resource management, host name to IP address conversion, support for large-scale deployment of IPv6, and the development of software and information technology services.
[0079] There is no limitation on the application scenario in the embodiments of the present disclosure.
[0080] The domain name resolution method provided by the present disclosure is described in detail below with reference to the accompanying drawings.
[0081] Figure 1 FIG. 1 is a flow chart of a domain name resolution method according to an embodiment of the present disclosure. Figure 1 In the embodiment shown, the domain name resolution method includes:
[0082] Step 101, in response to a domain name query request from a client, an abnormality detection is performed on the domain name query request to confirm a request category of the domain name query request, where the request category includes an abnormal request and a normal request.
[0083] In this embodiment, the client refers to the server that issues a domain name query request. A domain name query request refers to the process of converting a domain name into an IP address in a DNS, which is completed by a DNS server. The request categories of a domain name query request include abnormal requests and normal requests. An abnormal request refers to an abnormal or erroneous response encountered during a DNS query, including returning a false IP address, no response, or the resolution result is inconsistent with expectations. For example, a DNS server is attacked by DDOS, threatened by malware, etc. In a domain name query request, in addition to abnormal requests, requests that can be responded to normally are normal requests. After receiving the domain name query request issued by the client, the DNS server performs an abnormality detection on the domain name query request to confirm that the request category of the domain name query request is an abnormal request or a normal request. This provides security for domain name resolution and prevents attacks by malicious domain name resolution requests.
[0084] Step 102: If the request category of the domain name query request is a normal request, confirm whether the target domain name corresponding to the domain name query request exists in the cache. If the target domain name already exists in the cache, query the first network address corresponding to the target domain name from the cache and send the first network address to the client.
[0085] In this embodiment, the cache refers to a variable in a hardware memory or software that stores domain names in a DNS server. The target domain name refers to the domain name that the domain name query request is querying. The first network address refers to the IP address queried by the domain name query request, and the IP address is located in the cache. If the request category of the domain name query request is determined to be a normal request after abnormality detection, then the cache is queried to see whether the target domain name corresponding to the domain name query request exists. If the target domain name exists in the cache, the IP address corresponding to the target domain name is directly determined from the cache, and the IP address is sent to the client, thereby completing the domain name query.
[0086] Step 103, if the target domain name does not exist in the cache, the target domain name is classified according to the access frequency, and the access frequency includes high-frequency access and low-frequency access; if the access frequency of the target domain name is high-frequency access, the second network address corresponding to the target domain name is recursively queried in the domain name server, and the second network address is sent to the client.
[0087] In this embodiment, the access frequency refers to the ratio of the number of times the target domain name is accessed to the time. The higher the ratio, the more times the target domain name is accessed within a certain period of time, and it can be considered as a target domain name with high frequency of access. The lower the ratio, the fewer times the target domain name is accessed within a certain period of time, and it can be considered as a target domain name with low frequency of access. The second network address refers to the IP address corresponding to the target domain name, which corresponds to the target domain name with high frequency of access. If the target domain name is accessed frequently, the second network address corresponding to the target domain name is determined in the domain name server by recursive query, and the second network address is sent to the client.
[0088] In summary, according to the domain name resolution method proposed in the present disclosure, in response to the domain name query request of the client, the domain name query request is detected abnormally, and the request category of the domain name query request is confirmed, and the request category includes abnormal request and normal request, thereby avoiding the interference of abnormal request on domain name resolution and improving the security of domain name resolution; if the request category of the domain name query request is a normal request, then it is confirmed in the cache whether the target domain name corresponding to the domain name query request exists, and if the target domain name already exists in the cache, then the first network address corresponding to the target domain name is queried from the cache, and the first network address is sent to the client, thereby shortening the time for re-performing the full process domain name resolution, improving the efficiency of domain name resolution, and reducing the failure rate of the cache; if the target domain name does not exist in the cache, then the target domain name is classified by the access frequency, and the access frequency includes high-frequency access and low-frequency access. If the access frequency of the target domain name is high-frequency access, the second network address corresponding to the target domain name is recursively queried in the domain name server, and the second network address is sent to the client, thereby quickly determining the IP address of the target domain name that is frequently accessed. This improves the efficiency of domain name resolution and enhances the user experience.
[0089] Figure 2 The present invention is a flowchart of an embodiment of the present invention for detecting anomalies in a domain name query request and confirming the request category of the domain name query request. Figure 2 Yes Figure 1 Further explanation of step 101 is based on Figure 2 The embodiment shown comprises the following steps:
[0090] Step 201: construct characteristic information of the domain name query request based on the domain name query request and the network address database.
[0091] In this embodiment, the network address database refers to a database system containing IP addresses and related information, which can be used to resolve and query IP addresses to obtain detailed data of the address, such as geographic location, Internet service provider (ISP), network owner, etc. The characteristic information of the domain name query request refers to the characteristic data of the domain name query request formed by the IP address and the query request information. The query request information includes the query domain name (domain), query type (qtype), and client source address (srcIP) extracted from the domain name query request. The continent (continent), country (country), province (region), and city (city) where the client is located can be obtained in the network address database. Since in most cases, the query request will give priority to the DNS server that is closer to the client, the distance (distance) between the client and the DNS server is introduced into the characteristic information of the query request. Therefore, the characteristic information Ei of the domain name query request can be encoded and spliced into the following representation through the above information, thereby serving as the input of the anomaly detection model. For example:
[0092] Ei=[domain, qtype, srcIP, continent, country, region, city, distance].
[0093] Step 202: Determine a hyperplane for classifying feature information according to a binary classification anomaly detection algorithm.
[0094] In this embodiment, the binary anomaly detection algorithm refers to a classification algorithm that can classify the target input into one of two categories, one is a normal request and the other is an abnormal request. The hyperplane refers to a dividing line, a dividing plane or a higher-dimensional space dividing surface that optimally divides normal requests and abnormal requests, and is used to classify feature information. Using the binary anomaly detection algorithm, the dividing hyperplane between the feature information Ei of normal and abnormal domain name query requests can be determined.
[0095] Step 203: classify the feature information according to the hyperplane to determine the request category.
[0096] In this embodiment, the characteristic information of the query request can be classified according to the hyperplane, so as to determine whether the request category of the DNS query request is a normal request or an abnormal request. For example, if the characteristic information of the domain name query request is located above the hyperplane, the request category of the domain name query request is considered to be an abnormal request, and if the characteristic information of the domain name query request is located below the hyperplane, the request category of the domain name query request is considered to be a normal request, and vice versa.
[0097] In this embodiment, by sorting out the characteristic information of the domain name query request, the hyperplane between the characteristic information of different request categories is determined using the anomaly detection algorithm. Through the hyperplane, the request category of the domain name query request is determined, the abnormal request is screened out, and the normal request is retained. The abnormal request is intercepted for the domain name query, the possibility of security risks in the domain name resolution is avoided, and the efficiency of the domain name resolution is improved.
[0098] Figure 3 The present invention is a flowchart of classifying feature information according to a hyperplane and determining a request category according to an embodiment of the present invention. Figure 3 Yes Figure 2 Further description of step 203 is based on Figure 3 The embodiment shown comprises the following steps:
[0099] Step 301, determining the target distance between feature information and the hyperplane.
[0100] In this embodiment, the target distance is the distance between the vector of the feature information and the hyperplane, which represents the distance between the coordinates of the feature information point of the domain name query request and the hyperplane.
[0101] In one implementation of this embodiment, the hyperplane is a straight line, its normal vector is w, the feature information is Ei, and the offset of the straight line is b. Then the target distance d can be expressed as:
[0102]
[0103] In the formula, w T is the transpose of the hyperplane normal vector. ||w|| represents the norm of the hyperplane normal vector w.
[0104] Step 302: If the target distance is greater than a preset distance threshold, the characteristic information is used as target characteristic information.
[0105] In this embodiment, the preset distance threshold is a distance value used to characterize that the target distance is large. The target feature information is feature information based on the hyperplane that ultimately determines the request category of the domain name query request. If the target distance is greater than the preset distance threshold, it is considered that the point formed by the feature information of the current domain name query request is far away from the hyperplane, and the request category of the domain name query request can be determined without doubt, so the feature information is used as the target feature information.
[0106] Step 303: If the target distance is less than or equal to the preset distance threshold, the feature information is moved to a side away from the hyperplane by a preset distance value to form target feature information.
[0107] In this embodiment, if the target distance is less than or equal to the preset distance threshold, it means that the characteristic information of the domain name query request is very close to the hyperplane, and the characteristic information is located near the dividing line or dividing plane, and it is difficult to clearly determine the request category of the domain name query request. Therefore, the point formed by the characteristic information is moved to the side away from the hyperplane by a preset distance value, and the moved characteristic information is used as the target characteristic information. The preset distance value is used to represent the distance that the characteristic information is moved.
[0108] In one implementation of this embodiment, the preset distance threshold is 1. The preset distance value is c, which is used to represent the moving distance of the feature information. As shown in the following formula, L represents the distance between the target feature information and the hyperplane.
[0109] In order to make Normal requests and abnormal requests can be distinguished to the greatest extent possible, so that L is maximized.
[0110] Step 304: Determine the request category based on the target feature information and the normal vector of the hyperplane.
[0111] In this embodiment, the request category of the domain name query request can be determined based on the target feature information and the normal vector of the hyperplane. For example, the target feature information Ei and the bias term b are input into the expression of the hyperplane. If the calculation result w T E i +b>0, indicating that the target feature information Ei is above the hyperplane, and the request category of the domain name query request is marked as a normal request. T E i +b<0, indicating that the target feature information Ei is below the hyperplane, and the request category of the domain name query request is marked as an abnormal request.
[0112] In one embodiment of this embodiment, the following formula is used as a classification model:
[0113] f(E i )=g(w·E i +b)
[0114]
[0115] If f(E i )>0, g(x)=1, then the domain name query request is a normal request. Otherwise, f(E i)<0, g(x)=-1, then the domain name query request is an abnormal request. Some servers are only available to employees within the company through the company's internal network. Even if the employees are outside the company, they need to use a specific VPN to use them. In view of this situation, in order to ensure absolute safety and reliability, the classification results of the anomaly detection model are forcibly corrected. For example, Company A is in Suzhou, Jiangsu Province, China, Asia, and the IP address segment of the company's network is aa0.0.-aa99.99. Then all query requests that meet these characteristics are forcibly converted into normal requests.
[0116] In this embodiment, according to the hyperplane, the distance between the feature information and the hyperplane is enlarged as the target feature information, which is convenient for classifying the request category of the domain name query request, thereby obtaining an accurate request category. Different request categories are provided for domain name resolution, which is convenient for rejecting abnormal requests and retaining normal requests, thereby improving the efficiency and security of domain name resolution.
[0117] Figure 4 The present invention is a flowchart of processing a query request according to the category of a domain name query request according to an embodiment of the present invention. Figure 4 Yes Figure 1 The specific description after step 101 is based on Figure 4 The embodiment shown comprises the following steps:
[0118] Step 401: If the request type of the domain name query request is an abnormal request, the third network address that initiates the abnormal request is stored in a network address list, and the domain name query request is rejected.
[0119] In this embodiment, the third network address is the IP address of the client that initiates the domain name query request. If the request category of the domain name query request is an abnormal request, the third network address of the client that initiates the domain name query request is saved in the network address list, and the access of the domain name query request is denied. It is ensured that the abnormal request will not cause harm to the domain name resolution.
[0120] Step 402: If the request type of the domain name query request is a normal request, the target domain name of the domain name query request is queried in the cache.
[0121] In this embodiment, if the request type of the domain name query request is a normal request, the target domain name of the domain name query request is queried in the cache. It is confirmed that the domain name query request is a normal domain name query request, and then the corresponding target domain name is directly searched in the cache.
[0122] In this embodiment, query requests are processed according to the type of domain name query requests, abnormal requests are rejected, and the corresponding target domain names of normal requests are determined in the cache, thereby providing security protection for domain name resolution and improving the efficiency of domain name resolution.
[0123] Figure 5 The present invention is a flowchart of classifying the access frequency of a target domain name according to an embodiment of the present invention. Figure 5 Yes Figure 1 The specific description of step 103 is based on Figure 5 The embodiment shown comprises the following steps:
[0124] Step 501, construct a query feature of the access frequency of the target domain name according to the domain name, query type and query time information of the domain name query request, the query time information includes a first duration and a second duration, the first duration is the duration from the first query time of the domain name in the domain name query request to the current query time, and the second duration is the duration from the most recent query time to the current query time.
[0125] In this embodiment, the query type refers to various types of records used in the DNS server to specify how to resolve a domain name to a specific resource record, such as server records, text records, pointer records, service records, certificate authorization access records, geographic location records, and other types. The first duration refers to the duration from the first query time of the domain name in the domain name query request to the current query time (interval_f), and the second duration refers to the duration from the most recent query time to the current query time (interval_l). The query time information includes the first duration and the second duration. The query feature refers to the feature data Di of the access frequency of the target domain name, which is composed of the domain name (domain) feature information of the domain name query request, the query type (qtype) feature information, and the query time information. It can be expressed as Di = [domain, qtype, interval_f, interval_l].
[0126] Step 502: Based on the query features, extract global features and local features of the access frequency of the target domain name through a feature extraction network.
[0127] In this embodiment, the feature extraction network refers to a neural network structure used to extract the features of input data. The global feature refers to the vector composed of the feature data Di. and reverse Concatenated word vectors Local features refer to the word vector DC after the feature data Di is processed by convolution operation. i =Conv(D i ). According to D i =[domain, qtype, interval_f, interval_l], the features of Di are extracted through a feature extraction network composed of a long short-term memory network and a convolutional neural network to obtain the global and local features of the target domain name's access frequency.
[0128] Step 503: merge the global vector and the local vector into a mixed feature vector.
[0129] In this embodiment, the global variable refers to the vector DB corresponding to the global feature i The local variable is the vector DC corresponding to the local feature direction. i The hybrid feature vector is the feature vector obtained by fusing the global vector and the local vector. i and DC i Bitwise addition as mixed eigenvector DL i .
[0130] Step 504: normalize the mixed feature vector to obtain the feature vector weight.
[0131] In this embodiment, the feature vector weight refers to the weight parameter of each mixed feature vector. i Normalize and compress to (0,1), so as to give each mixed feature vector a weight between 0 and 1. n Optionally, use the softmax function to DL the mixed feature vector i After normalization, we get a n =softmax(DL i ).
[0132] Step 505: classify the target domain name through a fully connected classifier according to the mixed feature vector and the feature vector weight.
[0133] In this embodiment, the fully connected classifier refers to a fully connected layer in the neural network that is responsible for summarizing the learned features and performing the final classification. i and the feature vector weight a n , as the input of the fully connected classifier to classify the target domain name.
[0134] In this embodiment, the feature vector of the domain name query request is extracted, and the target domain name is classified by access frequency using a fully connected classifier, which provides a target domain name with high frequency access for domain name resolution and improves the efficiency of domain name resolution.
[0135] Figure 6 The present invention is a flowchart of an embodiment of the present invention for extracting global features and local features of the access frequency of a target domain name through a feature extraction network based on query features. Figure 6 Yes Figure 5 The specific description of step 502 is based on Figure 6 The embodiment shown comprises the following steps:
[0136] Step 601: extracting global features of the access frequency of the target domain name from the query features using a long short-term memory network.
[0137] In this embodiment, the Long Short-Term Memory (LSTM) is a special recurrent neural network (RNN) that can learn long-term dependencies. LSTM solves the gradient vanishing or exploding problem of traditional RNN when processing long sequences by introducing a gate structure. LSTM is used to extract the global features of the access frequency of the target domain name from the query features. Optionally, a bidirectional long short-term memory (Bi-directional Long Short-Term Memory, Bi-LSTM) is used to extract features from the feature data Di of the access frequency of the target domain name to obtain global features.
[0138] Step 602: Use a convolutional neural network to extract local features of the access frequency of the target domain name from the query features.
[0139] In this embodiment, a convolutional neural network (CNN) is a deep learning model specifically used to process data with a grid-like structure. CNN is used to extract local features of the target domain name's access frequency from the query features. For example, CNN is used to extract local features from feature data Di of the target domain name's access frequency.
[0140] In this embodiment, based on the query features, the global features and local features of the target domain name's access frequency are extracted through a feature extraction network, which provides feature data for the classification of the target domain name's access frequency, and helps to improve the efficiency of domain name resolution.
[0141] Figure 7 The present invention is a flowchart of classifying a target domain name through a fully connected classifier according to a mixed feature vector and a feature vector weight according to an embodiment of the present invention. Figure 7 Yes Figure 5 The specific description of step 505 is based on Figure 7 The embodiment shown comprises the following steps:
[0142] Step 701, determining a key eigenvector according to the mixed eigenvector and the eigenvector weight.
[0143] In this embodiment, the key feature vector refers to the feature vector after the mixed feature vector is weighted. i and the feature vector weight a n The product of , we get the key eigenvector DTi = a n ·DL i .
[0144] Step 702: Use the relu activation function and the sigmoid activation function of the fully connected classifier to process the key feature vectors in sequence to obtain the access probability value of the target domain name.
[0145] In this embodiment, the Rectified Linear Unit (relu) and the sigmoid activation function are two commonly used activation functions in deep learning. The mathematical expression of the relu function is f(x) = max(0,x), which means that the function outputs x itself when x>0, and outputs 0 when x≤0. Due to its simple linear characteristics and non-saturated properties, ReLU can effectively solve the gradient vanishing problem and has high computational efficiency, so it is widely used in deep networks. The mathematical expression of the sigmoid function is Map the input value x to between 0 and 1, regardless of whether the input value is positive or negative. The sigmoid function can be interpreted as a probability in a physical sense, so it is often used in the output layer of a binary classification problem. The access probability value refers to the probability value that the current target domain name will be accessed. The key feature vector DTi is processed by the relu activation function to obtain the first activation value Vh=relu(DTi), and the first activation value is processed by the sigmoid activation function to obtain the access probability value p=sigmoid(Vh) of the target domain name.
[0146] Step 703: If the access probability value is greater than the preset probability, the access frequency of the target domain name is a high-frequency access; otherwise, the access frequency of the target domain name is a low-frequency access.
[0147] In this embodiment, the preset probability is a number between 0 and 1, which is used to indicate that the access probability value is very large. If the access probability value is greater than the preset probability, the target domain name is frequently accessed, otherwise, the target domain name is infrequently accessed.
[0148] In this embodiment, the target domain name is classified by a fully connected classifier according to the mixed feature vector and the feature vector weight, and the access frequency of the target domain name is obtained as high-frequency access or low-frequency access, which provides a basis for the quick processing of domain name resolution and improves the efficiency of domain name resolution.
[0149] In the embodiment of the present disclosure, Figure 1After step 103 of the embodiment shown, it also includes: saving the second network address and the target domain name in the cache. In this embodiment, after recursively querying the second network address corresponding to the target domain name and sending the second network address to the client. In order to facilitate the quick resolution of the target domain name in future use, the target domain name and the corresponding second network address are saved in the cache, thereby realizing the update of the cache, thereby ensuring that the cache will not be cleared immediately, reducing the failure rate of the cache. It provides a fast resolution service for the domain name resolution in the user's subsequent network use, improving the user's experience.
[0150] Figure 8 FIG. 1 is a schematic diagram of a domain name resolution according to an embodiment of the present disclosure. Figure 8 In the embodiment shown, the client initiates a domain name query request; an abnormal DNS request, such as a DDOS attack, malware, etc., is detected through an anomaly detection algorithm, thereby reducing threats to network security. The normal requests screened by the anomaly detection algorithm are predicted and intelligently cached using an access frequency classification model for the most likely DNS records to be accessed, thereby reducing the time and bandwidth occupied by DNS resolution. It is also checked whether the DNS domain name has been recorded in the cache. If so, the query result is returned to the client. Otherwise, the DNS domain name is resolved using a traditional recursive or iterative algorithm, and the resolution is completed and the resolution result is returned to the client. At the same time, the domain name and the corresponding resolution result are saved in the cache, and the frequently accessed domain name is updated. Improve the efficiency of domain name resolution, reduce cache failure rate, and improve the user experience.
[0151] The present disclosure proposes a domain name resolution method, in response to a domain name query request of a client, an abnormality detection is performed on the domain name query request, and the request category of the domain name query request is confirmed, and the request category includes abnormal request and normal request, thereby avoiding the interference of abnormal request on domain name resolution and improving the security of domain name resolution; if the request category of the domain name query request is a normal request, then confirm whether the target domain name corresponding to the domain name query request exists in the cache, if the target domain name already exists in the cache, then query the first network address corresponding to the target domain name from the cache, and send the first network address to the client, thereby shortening the time of re-performing the full process domain name resolution, improving the efficiency of domain name resolution, and reducing the failure rate of the cache; if the target domain name does not exist in the cache, then the target domain name is classified by the access frequency, and the access frequency includes high-frequency access and low-frequency access. If the access frequency of the target domain name is high-frequency access, then the second network address corresponding to the target domain name is recursively queried in the domain name server, and the second network address is sent to the client, thereby quickly determining the IP address of the target domain name that is frequently accessed. The efficiency of domain name resolution is improved, and the user experience is enhanced.
[0152] Corresponding to the methods provided in the above-mentioned embodiments, the present disclosure also provides a domain name resolution device. Since the device provided in the embodiments of the present disclosure corresponds to the methods provided in the above-mentioned embodiments, the implementation method of the method is also applicable to the device provided in this embodiment and will not be described in detail in this embodiment.
[0153] Fig. 9 FIG. 9 is a schematic diagram of the structure of a domain name resolution device 900 according to an embodiment of the present disclosure. Fig. 9 As shown, the domain name resolution device includes:
[0154] The abnormal request detection module 910 is used to respond to the domain name query request of the client, perform abnormal detection on the domain name query request, and confirm the request category of the domain name query request, where the request category includes abnormal request and normal request;
[0155] A domain name classification module 920 is configured to, if the request category of the domain name query request is a normal request, confirm whether a target domain name corresponding to the domain name query request exists in the cache, and if the target domain name already exists in the cache, query the cache for a first network address corresponding to the target domain name, and send the first network address to the client;
[0156] The domain name resolution module 930 is used to classify the target domain name by access frequency if the target domain name does not exist in the cache, and the access frequency includes high-frequency access and low-frequency access; if the access frequency of the target domain name is high-frequency access, recursively query the second network address corresponding to the target domain name and send the second network address to the client.
[0157] In some embodiments, the abnormal request detection module 910 is used to:
[0158] Based on the domain name query request and the network address database, construct characteristic information of the domain name query request;
[0159] According to the binary anomaly detection algorithm, a hyperplane for classifying feature information is determined;
[0160] According to the hyperplane, the feature information is classified to determine the request category.
[0161] In some embodiments, the abnormal request detection module 910 classifies the feature information according to the hyperplane and determines the request category using the following method:
[0162] Determine the target distance between feature information and the hyperplane;
[0163] If the target distance is greater than a preset distance threshold, the feature information is used as target feature information;
[0164] If the target distance is less than or equal to the preset distance threshold, the feature information is moved to the side away from the hyperplane by the preset distance value to form the target feature information;
[0165] The request category is determined based on the target feature information and the normal vector of the hyperplane.
[0166] In some embodiments, the abnormal request detection module 910 is used to respond to the domain name query request of the client, perform abnormality detection on the domain name query request, and after confirming the request category of the domain name query request, further to:
[0167] If the request category of the domain name query request is an abnormal request, the third network address that initiates the abnormal request is stored in the network address list, and the domain name query request is rejected;
[0168] If the request category of the domain name query request is a normal request, the target domain name of the domain name query request is queried in the cache.
[0169] In some embodiments, the domain name classification module 920 is used to:
[0170] Constructing query features of the access frequency of the target domain name based on the domain name, query type and query time information of the domain name query request, wherein the query time information includes the time from the first query time to the current query time and the time from the last query time to the current query time of the domain name in the domain name query request;
[0171] Based on the query features, the global and local features of the target domain name's access frequency are extracted through the feature extraction network;
[0172] The global vector and the local vector are fused into a hybrid feature vector;
[0173] Normalize the mixed feature vector to obtain the feature vector weight;
[0174] According to the mixed feature vector and feature vector weight, the target domain name is classified through a fully connected classifier.
[0175] In some embodiments, the domain name classification module 920 extracts global features and local features of the target domain name's access frequency based on the query features through a feature extraction network in the following manner:
[0176] Use the long short-term memory network to extract the global features of the target domain name's access frequency from the query features;
[0177] A convolutional neural network is used to extract local features of the target domain name’s access frequency from the query features.
[0178] In some embodiments, the domain name classification module 920 classifies the target domain name through a fully connected classifier according to the mixed feature vector and the feature vector weight in the following manner:
[0179] Determine the key eigenvector according to the mixed eigenvector and the eigenvector weight;
[0180] The relu activation function and sigmoid activation function of the fully connected classifier are used to process the key feature vectors in turn to obtain the access probability value of the target domain name;
[0181] If the access probability value is greater than the preset probability, the access frequency of the target domain name is a high-frequency access; otherwise, the access frequency of the target domain name is a low-frequency access.
[0182] In some embodiments, after being used to recursively query the second network address corresponding to the target domain name and sending the second network address to the client, the domain name resolution module 930 is further used to:
[0183] The second network address and the target domain name are stored in a cache.
[0184] In summary, through the domain name resolution device, in response to the domain name query request of the client, the domain name query request is detected abnormally, and the request category of the domain name query request is confirmed, and the request category includes abnormal request and normal request; if the request category of the domain name query request is a normal request, then confirm whether the target domain name corresponding to the domain name query request exists in the cache, if the target domain name already exists in the cache, then query the first network address corresponding to the target domain name from the cache, and send the first network address to the client; if the target domain name does not exist in the cache, then the target domain name is classified by the access frequency, and the access frequency includes high-frequency access and low-frequency access; if the target domain name is accessed frequently, then the second network address corresponding to the target domain name is recursively queried, and the second network address is sent to the client. This device solves the problems of low resolution efficiency and high cache failure rate in domain name resolution technology, improves the domain name resolution efficiency, reduces the cache failure rate, and improves the user experience.
[0185] In the above embodiments provided by the present disclosure, the methods and devices provided by the embodiments of the present disclosure are introduced. In order to implement the functions in the methods provided by the above embodiments of the present disclosure, the electronic device may include a hardware structure and a software module, and implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. One of the above functions may be executed in the form of a hardware structure, a software module, or a hardware structure plus a software module.
[0186] Fig.10 is a block diagram of an electronic device 1000 for implementing the above-mentioned domain name resolution method according to an exemplary embodiment.
[0187] For example, the electronic device 1000 may be a mobile phone, a computer, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0188] Reference Fig.10 , the electronic device 1000 may include one or more of the following components: a processing component 1002 , a memory 1004 , a power component 1006 , a multimedia component 1008 , an audio component 1010 , an input / output (I / O) interface 1012 , a sensor component 1014 , and a communication component 1016 .
[0189] The processing component 1002 generally controls the overall operation of the electronic device 1000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1002 may include one or more processors 1020 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1002 may include one or more modules to facilitate the interaction between the processing component 1002 and other components. For example, the processing component 1002 may include a multimedia module to facilitate the interaction between the multimedia component 1008 and the processing component 1002.
[0190] The memory 1004 is configured to store various types of data to support operations on the electronic device 1000. Examples of such data include instructions for any application or method operating on the electronic device 1000, contact data, phone book data, messages, pictures, videos, etc. The memory 1004 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0191] The power supply component 1006 provides power to various components of the electronic device 1000. The power supply component 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 1000.
[0192] The multimedia component 1008 includes a screen that provides an output interface between the electronic device 1000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1008 includes a front camera and / or a rear camera. When the electronic device 1000 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0193] The audio component 1010 is configured to output and / or input audio signals. For example, the audio component 1010 includes a microphone (MIC), and when the electronic device 1000 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1004 or sent via the communication component 1016. In some embodiments, the audio component 1010 also includes a speaker for outputting audio signals.
[0194] I / O interface 1012 provides an interface between processing component 1002 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0195] The sensor assembly 1014 includes one or more sensors for providing various aspects of status assessment for the electronic device 1000. For example, the sensor assembly 1014 can detect the open / closed state of the electronic device 1000, the relative positioning of components, such as the display and keypad of the electronic device 1000, and the sensor assembly 1014 can also detect the position change of the electronic device 1000 or a component of the electronic device 1000, the presence or absence of user contact with the electronic device 1000, the orientation or acceleration / deceleration of the electronic device 1000, and the temperature change of the electronic device 1000. The sensor assembly 1014 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1014 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0196] The communication component 1016 is configured to facilitate wired or wireless communication between the electronic device 1000 and other devices. The electronic device 1000 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5G NR (NewRadio) or a combination thereof. In an exemplary embodiment, the communication component 1016 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1016 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0197] In an exemplary embodiment, the electronic device 1000 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0198] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1004 including instructions, and the instructions can be executed by the processor 1020 of the electronic device 1000 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0199] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the domain name resolution method described in the above embodiments of the present disclosure.
[0200] The embodiments of the present disclosure further provide a computer program product, including a computer program, which executes the domain name resolution method described in the above embodiments of the present disclosure when a processor is used.
[0201] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0202] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0203] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present disclosure belong.
[0204] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.
[0205] It should be understood that the various parts of the embodiments of the present disclosure can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0206] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0207] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0208] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present disclosure.
Claims
1. A domain name resolution method, characterized in that: The method comprises: In response to a domain name query request from a client, perform anomaly detection on the domain name query request to confirm a request category of the domain name query request, where the request category includes an abnormal request and a normal request; If the request category of the domain name query request is the normal request, confirming in the cache whether the target domain name corresponding to the domain name query request exists; if the target domain name already exists in the cache, querying the cache for a first network address corresponding to the target domain name, and sending the first network address to the client; If the target domain name does not exist in the cache, the target domain name is classified by access frequency, where the access frequency includes high-frequency access and low-frequency access. If the access frequency of the target domain name is high-frequency access, the second network address corresponding to the target domain name is recursively queried in the domain name server, and the second network address is sent to the client.
2. The method according to claim 1, characterized in that: The performing abnormality detection on the domain name query request to confirm the request category of the domain name query request includes: Constructing characteristic information of the domain name query request based on the domain name query request and the network address database; Determining a hyperplane for classifying the feature information according to a binary classification anomaly detection algorithm; The feature information is classified according to the hyperplane to determine the request category.
3. The method according to claim 2, characterized in that The classifying the characteristic information according to the hyperplane to determine the request category includes: Determining a target distance between the feature information and the hyperplane; If the target distance is greater than a preset distance threshold, the characteristic information is used as target characteristic information; If the target distance is less than or equal to the preset distance threshold, the feature information is moved to a side away from the hyperplane by a preset distance value to form the target feature information; The request category is determined based on the target feature information and the normal vector of the hyperplane.
4. The method according to claim 1, characterized in that: After performing abnormality detection on the domain name query request in response to the domain name query request from the client and confirming the request category of the domain name query request, the method further includes: If the request category of the domain name query request is the abnormal request, storing the third network address that initiates the abnormal request into the network address list, and rejecting the domain name query request; If the request category of the domain name query request is the normal request, the target domain name of the domain name query request is queried in the cache.
5. The method according to claim 1, characterized in that The classifying the target domain name by access frequency includes: Constructing a query feature of the access frequency of the target domain name according to the domain name, query type and query time information of the domain name query request, wherein the query time information includes a first duration and a second duration, wherein the first duration is the duration from the first query time of the domain name of the domain name query request to the current query time, and the second duration is the duration from the most recent query time to the current query time; Based on the query feature, extracting global features and local features of the access frequency of the target domain name through a feature extraction network; Merging the global vector and the local vector into a mixed feature vector; Normalizing the mixed feature vector to obtain a feature vector weight; The target domain name is classified by a fully connected classifier according to the mixed feature vector and the feature vector weight.
6. The method according to claim 5, characterized in that The extracting global features and local features of the access frequency of the target domain name through a feature extraction network based on the query features includes: Extracting a global feature of the access frequency of the target domain name from the query feature using a long short-term memory network; A convolutional neural network is used to extract local features of the access frequency of the target domain name from the query features.
7. The method according to claim 5, characterized in that The classifying the target domain name by a fully connected classifier according to the mixed feature vector and the feature vector weight includes: Determining a key feature vector according to the mixed feature vector and the feature vector weight; The key feature vectors are processed in sequence using the relu activation function and the sigmoid activation function of the fully connected classifier to obtain a probability value of the target domain name being visited; If the access probability value is greater than a preset probability, the access frequency of the target domain name is a high-frequency access; otherwise, the access frequency of the target domain name is a low-frequency access.
8. The method according to claim 1, characterized in that After recursively querying the second network address corresponding to the target domain name and sending the second network address to the client, the method further includes: The second network address and the target domain name are stored in the cache.
9. A domain name resolution device, characterized in that: The device comprises: an abnormal request detection module, configured to respond to a domain name query request from a client, perform abnormality detection on the domain name query request, and confirm a request category of the domain name query request, wherein the request category includes an abnormal request and a normal request; a domain name classification module, configured to, if the request category of the domain name query request is the normal request, confirm whether a target domain name corresponding to the domain name query request exists in a cache, and if the target domain name already exists in the cache, query a first network address corresponding to the target domain name from the cache, and send the first network address to the client; A domain name resolution module is used to classify the target domain name by access frequency if the target domain name does not exist in the cache, wherein the access frequency includes high-frequency access and low-frequency access. If the access frequency of the target domain name is high-frequency access, a second network address corresponding to the target domain name is recursively queried and the second network address is sent to the client.
10. 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 instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-8.
12. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 8.
