WO2018233140A1 - 域名解析装置、方法及计算机可读存储介质 - Google Patents

域名解析装置、方法及计算机可读存储介质 Download PDF

Info

Publication number
WO2018233140A1
WO2018233140A1 PCT/CN2017/105021 CN2017105021W WO2018233140A1 WO 2018233140 A1 WO2018233140 A1 WO 2018233140A1 CN 2017105021 W CN2017105021 W CN 2017105021W WO 2018233140 A1 WO2018233140 A1 WO 2018233140A1
Authority
WO
WIPO (PCT)
Prior art keywords
domain name
target
address
mapping relationship
network request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2017/105021
Other languages
English (en)
French (fr)
Inventor
何兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2018233140A1 publication Critical patent/WO2018233140A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a domain name resolution apparatus, method, and computer readable storage medium.
  • the domain name has a corresponding relationship with the IP address, and the domain name system (DNS) is used to resolve the domain name to the IP address.
  • DNS domain name system
  • Each server has its own IP address.
  • the DNS server will be based on the client.
  • the IP address of the end and the domain name to be accessed are returned to the corresponding server IP address.
  • the client obtains the real IP address and then accesses the data through the IP address.
  • relying on the remote DNS server for domain name resolution causes the following problems: not only due to the high resolution pressure of the DNS server.
  • the network response delay is delayed, resulting in slow network response; and there is no rule to avoid the situation that the public network DNS server is attacked, and in the case of the public network DNS server, the application cannot perform normal network request.
  • the invention provides a domain name resolution device, a method and a computer readable storage medium, the main purpose of which is to solve the problem of domain name resolution by relying on a remote DNS server.
  • the present invention provides a domain name resolution apparatus, the apparatus comprising: a memory, a processor, and a domain name resolution program stored on the memory and operable on the processor, the domain name resolution program being The following steps are implemented when the processor is executed:
  • a network request is initiated to the corresponding server based on the found target IP address.
  • the processor is further configured to execute the domain name resolution program, before the step of parsing the network request to obtain a target domain name corresponding to the network request, when the network request sent by the application is detected, The following steps are also implemented:
  • the processor is further configured to execute the domain name resolution program to search for a target IP address corresponding to the target domain name in a domain name and IP address mapping relationship table matched with the application. , also implement the following steps:
  • a step of initiating a network request to the corresponding server based on the found target IP address is performed.
  • the processor is further configured to execute the domain name resolution program to search for a target IP address corresponding to the target domain name in a domain name and IP address mapping relationship table matched with the application. , also implement the following steps:
  • the target IP address corresponding to the target domain name is found in the domain name and IP address mapping relationship table, performing a step of initiating a network request to the corresponding server based on the found target IP address;
  • the network request is sent to the DNS server for resolution;
  • the receiving DNS server parses the target IP address obtained by the network request, and sends a network request to the corresponding server based on the received IP address.
  • the processor is further configured to execute the domain name resolution program to implement the following steps:
  • the present invention further provides a domain name resolution method, the method comprising:
  • a network request is initiated to the corresponding server based on the found target IP address.
  • the method further includes: before the step of parsing the network request to obtain a target domain name corresponding to the network request, when the network request sent by the application is detected, the method further includes:
  • the method further includes:
  • a step of initiating a network request to the corresponding server based on the found target IP address is performed.
  • the method further includes:
  • the target IP address corresponding to the target domain name is found in the domain name and IP address mapping relationship table, performing a step of initiating a network request to the corresponding server based on the found target IP address;
  • the network request is sent to the DNS server for resolution;
  • the receiving DNS server parses the target IP address obtained by the network request, and sends a network request to the corresponding server based on the received IP address.
  • the present invention further provides a computer readable storage medium, where the domain name resolution program is stored on the computer readable storage medium, and the domain name resolution program is executed by the processor to implement the following steps:
  • a network request is initiated to the corresponding server based on the found target IP address.
  • the domain name resolution device, the method and the computer readable storage medium provided by the present invention directly parse the network request locally when detecting the network request sent by the application, and obtain the target domain name requested by the network, and the domain name stored locally
  • the IP address mapping relationship table queries the target IP address corresponding to the target domain name, and directly initiates a network request to the server corresponding to the target IP address based on the found target IP address, and no longer relies on the remote DNS server for domain name resolution, even if The failure of the DNS server will not affect the normal access network of the application.
  • the local domain name resolution improves the acquisition speed of the target IP address and speeds up the network response.
  • FIG. 1 is a schematic diagram of a preferred embodiment of a domain name resolution device according to the present invention.
  • FIG. 2 is a flowchart of a preferred embodiment of a domain name resolution method according to the present invention.
  • FIG. 1 is a schematic diagram of a preferred embodiment of a domain name resolution device of the present invention.
  • the domain name resolution device may be a smart phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) player, and an MP4 (Moving Picture Experts Group). Audio Layer IV, dynamic imaging experts compress standard audio layers 3) terminal devices such as players and portable computers.
  • the domain name resolution device includes a memory 11, a processor 12, and a network interface 13.
  • the memory 11 may be a high speed RAM memory or a non-volatile memory such as a disk memory.
  • the memory 11 may be an internal storage unit of the terminal, such as a hard disk or a memory of the terminal, and may alternatively be a storage device independent of the processor 12 described above.
  • the network interface 13 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface).
  • the memory 11 may be an internal storage unit of the domain name resolution device, such as a hard disk or memory of the domain name resolution device, in some embodiments. In other embodiments, the memory 11 may also be an external storage device of the domain name resolution device, such as a plug-in hard disk equipped with a domain name resolution device, a smart memory card (SMC), and a secure digital (SD). Card, flash card, etc. Further, the memory 11 may also include both an internal storage unit of the domain name resolution device and an external storage device. The memory 11 can be used not only for storing application software installed in the domain name resolution device and various types of data, such as code of a domain name resolution program, but also for temporarily storing data that has been output or will be output.
  • the processor 12 may be a Central Processing Unit (CPU), microprocessor or other data processing chip for running program code or processing data stored in the memory 11, such as performing a domain name resolution program. Wait.
  • CPU Central Processing Unit
  • microprocessor or other data processing chip for running program code or processing data stored in the memory 11, such as performing a domain name resolution program. Wait.
  • Figure 1 shows only the domain name resolution means with components 11-13 and the domain name resolution program, but it should be understood that not all illustrated components may be implemented and that more or fewer components may be implemented instead.
  • the device may further include a user interface
  • the user interface may include a display, an input unit such as a keyboard, and the optional user interface may further include a standard wired interface and a wireless interface.
  • the domain name resolution device may further include a display, and in some embodiments, an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch sensor. Wait.
  • the display is used to display information processed in the domain name resolution device and a user interface for displaying visualizations.
  • the device may further include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like.
  • sensors such as light sensors, motion sensors, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein if the device is a mobile terminal, the ambient light sensor may adjust the brightness of the display screen according to the brightness of the ambient light, and the proximity sensor may move when the mobile terminal moves to the ear. , turn off the display and / or backlight.
  • the gravity acceleration sensor can detect the magnitude of acceleration in each direction (usually three axes), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the mobile terminal (such as horizontal and vertical screen switching, Related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; of course, the mobile terminal can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc. No longer.
  • the memory 11 as a computer storage medium may include an operating system and a domain name resolution program;
  • the network interface 13 is mainly used to connect to an application server, and perform data communication with the server, for example, a terminal.
  • the network request is sent to the server based on the network interface 13; when the processor 12 executes the domain name resolution program stored in the memory 11, the following steps are implemented:
  • the network request sent by the application is detected, the network request is parsed to obtain a target domain name corresponding to the network request.
  • a network request is initiated to the corresponding server based on the found target IP address.
  • Each application has a pre-configured domain name and IP address mapping relationship table.
  • the application server sets the domain name that the application can access and each The IP address corresponding to a domain name.
  • a mapping between a domain name and an IP address can be established.
  • the domain name and the corresponding IP address can be stored in the form of a list, and a mapping table between the domain name and the IP address is established and sent to the client.
  • the device when the application is started, the device obtains an acquisition request for obtaining a mapping between a domain name and an IP address according to the preset interface, and receives a mapping table between the domain name and the IP address sent by the application server according to the obtaining request, and caches To local.
  • the application requests the latest domain name and IP address mapping relationship table from the application server to update and store the locally stored mapping table for use when the application makes a network request.
  • the locally stored mapping table may be deleted, and each time the application is started, the latest mapping between the domain name and the IP address may be requested from the application server.
  • the processor 12 is further configured to execute a domain name resolution program stored in the memory 11 to search for a target IP address corresponding to the target domain name in a domain name and IP address mapping relationship table matched with the application.
  • a step of initiating a network request to the corresponding server based on the found target IP address is performed.
  • the terminal does not need to request the domain name and IP address mapping relationship table from the application server every time the application starts.
  • the mapping between the domain name and the IP address of the local storage is preferentially used.
  • the target IP address corresponding to the target domain name in the network request cannot be queried.
  • the latest mapping relationship table update can also be stored locally for subsequent use.
  • an APP on the mobile phone communicates with the server of the APP based on the HTTP protocol (Hyper Text Transfer Protocol), the APP initiates a network request, and the processor 12 acquires the network request.
  • URL Uniform Resource Locator
  • the URL includes protocol information, a network address, and a resource path, where the network address is generally a domain name, and the resource path is generally used to indicate which one to obtain from the application server. Item resources.
  • the processor 12 calls the domain name resolution program to parse the network request to obtain the target domain name, and then calls the domain name and IP address mapping relationship table stored in the memory 11 to search for an IP address, a general domain name and an IP address that have a mapping relationship with the target domain name. There is a one-to-one or many-to-one relationship. Therefore, a target domain name generally has only one corresponding target IP address. After finding the corresponding IP address, a network request is initiated to the server corresponding to the target IP address, specifically The processor 12 organizes a requested data packet according to the requirements of the HTTP protocol.
  • the data packet includes specific request information, including the requested resource path, the identity information of the terminal, and the like, so that the server searches for the corresponding resource data and returns.
  • the mapping relationship table stored on the memory 11 may be when the APP is started, and the processor 11 requests the server to acquire and store.
  • the processor 12 is further configured to execute a domain name resolution program stored in the memory 11 to search for the target in a domain name and IP address mapping relationship table matched with the application. After the step of the destination IP address corresponding to the domain name, the following steps are also implemented:
  • the target IP address corresponding to the target domain name is found in the domain name and IP address mapping relationship table, performing a step of initiating a network request to the corresponding server based on the found target IP address;
  • the network request is sent to the DNS server for resolution;
  • the receiving DNS server parses the target IP address obtained by the network request, and sends a network request to the corresponding server based on the received IP address.
  • the remote DNS server resolves the domain name as an auxiliary means.
  • the remote DNS server directly inquired by the terminal, when there is no IP address corresponding to the target domain name, it will ask its superior server, and the upper-level server may also have no, and then look up one layer at a time, up to the maximum Root node, found or not found.
  • a new domain name may appear in the new version of the application, but the developer may update the domain name and IP address mapping table in the future, so that the target domain name cannot be found.
  • the terminal directly sends the network request to the remote DNS server, and the DNS server performs domain name resolution.
  • the network request includes the IP address of the terminal, and after the DNS server resolves the target IP address, the target IP address is sent to the terminal according to the IP address of the terminal.
  • the processor is further configured to execute the domain name resolution program to implement the following steps:
  • the terminal may use the destination IP address to send a network request to the application server, or associate the IP address with the corresponding target domain name and report it to the application server for maintenance by the server.
  • the domain name and IP address mapping relationship table is updated.
  • the domain name resolution device of the present embodiment when detecting the network request sent by the application, directly parses the network request locally, obtains the target domain name requested by the network, and queries from the locally stored domain name and IP address mapping relationship table. Go to the target IP address corresponding to the target domain name, and directly initiate a network request to the server corresponding to the target IP address based on the found target IP address, and no longer rely on the remote DNS server for domain name resolution, even if the DNS server fails. Affects the normal access network. In addition, local domain name resolution improves the acquisition speed of the target IP address and speeds up the network response.
  • the domain name resolution program may also be divided into one or more modules, and one or more modules are stored in the memory 11 and are composed of one or more processors (this embodiment is The processor 12) is executed to complete the present invention.
  • module refers to a series of computer program instruction segments capable of performing a specific function, and is more suitable than the program to describe the execution process of the message pushing device in the domain name resolution device.
  • the domain name resolution program can be divided into a parsing module and a lookup module. And a sending module, wherein:
  • the parsing module is configured to parse the network request to obtain a target domain name corresponding to the network request when detecting a network request sent by the application;
  • the searching module is configured to search for a target IP address corresponding to the target domain name from a domain name and IP address mapping relationship table that matches the application;
  • the sending module is configured to initiate a network request to the corresponding server based on the found target IP address.
  • the present invention also provides a domain name resolution method.
  • FIG. 2 it is a flowchart of a preferred embodiment of the domain name resolution method of the present invention. The method can be performed by a device that can be implemented by software and/or hardware.
  • the domain name resolution method includes:
  • Step S10 When detecting a network request sent by the application, parsing the network request to obtain a target domain name corresponding to the network request.
  • Step S20 Search for a target IP address corresponding to the target domain name from a domain name and IP address mapping relationship table matched with the application.
  • Step S30 initiating a network request to the corresponding server based on the found target IP address.
  • Each application has a pre-configured domain name and IP address mapping relationship table.
  • the application server sets the domain name that the application can access and each The IP address corresponding to a domain name.
  • a mapping between a domain name and an IP address can be established.
  • the domain name and the corresponding IP address can be stored in the form of a list, and a mapping table between the domain name and the IP address is established and sent to the client.
  • the method further includes the following steps:
  • the method for obtaining a domain name and IP address mapping relationship table is sent to the server according to the preset interface; and the domain name and IP address mapping relationship table sent by the application server based on the obtaining request is received and cached locally.
  • the application requests the latest domain name and IP address mapping relationship table from the application server to update and store the locally stored mapping table for use when the application makes a network request.
  • the locally stored mapping table may be deleted, and each time the application is started, the latest mapping between the domain name and the IP address may be requested from the application server.
  • step S20 the method of this embodiment further includes the following steps:
  • step S30 is performed.
  • the terminal does not need to request the domain name and IP address mapping relationship table from the application server every time the application starts.
  • the mapping between the domain name and the IP address of the local storage is preferentially used.
  • the target IP address corresponding to the target domain name in the network request cannot be queried.
  • the latest mapping relationship table update can also be stored locally for subsequent use.
  • an APP on the mobile phone communicates with the server of the APP based on the HTTP protocol (Hyper Text Transfer Protocol), and the APP initiates a network request to obtain the URL of the network request.
  • HTTP protocol Hyper Text Transfer Protocol
  • the URL includes protocol information, a network address, and a resource path, where the network address is generally a domain name, and the resource path is generally used to indicate which resource is obtained from the application server.
  • Calling the domain name resolution program to resolve the network request obtaining the target domain name, and then searching for the IP address that has a mapping relationship with the target domain name from the domain name and IP address mapping relationship table.
  • a target domain name generally has only one corresponding target IP address.
  • a network request is initiated to the server corresponding to the target IP address, specifically, a request is organized according to the HTTP protocol requirement.
  • the data packet contains specific request information, including the requested resource path and the identity information of the terminal, for the server to find the corresponding resource data and return.
  • the mapping relationship table may be when the APP starts, and the terminal requests the server to acquire and store.
  • the method further includes the following steps:
  • the target IP address corresponding to the target domain name is found in the domain name and IP address mapping relationship table, performing a step of initiating a network request to the corresponding server based on the found target IP address;
  • the network request is sent to the DNS server for resolution;
  • the receiving DNS server parses the target IP address obtained by the network request, and sends a network request to the corresponding server based on the received IP address.
  • the remote DNS server resolves the domain name as an auxiliary means.
  • the remote DNS server directly inquired by the terminal, when there is no IP address corresponding to the target domain name, it will ask its superior server, and the upper-level server may also have no, and then look up one layer at a time, up to the maximum Root node, found or not found.
  • a new domain may appear in a new version of the application. Name, but the developer can update the domain name and IP address mapping table in the future. Therefore, when the target IP address matching the target domain name is not found, the terminal directly sends the network request to the remote DNS server, and the DNS server Perform domain name resolution.
  • the network request includes the IP address of the terminal, and after the DNS server resolves the target IP address, the target IP address is sent to the terminal according to the IP address of the terminal.
  • the method further includes the steps of: sending the received target IP address and the target domain name to the application server when receiving the target IP address obtained by the DNS server to parse the network request And the application server updates the domain name and IP address mapping relationship table based on the received target IP address and the target domain name.
  • the terminal may use the destination IP address to send a network request to the application server, or associate the IP address with the corresponding target domain name and report it to the application server for maintenance by the server.
  • the domain name and IP address mapping relationship table is updated.
  • the domain name resolution method proposed by the embodiment when detecting the network request sent by the application, directly parses the network request locally, obtains the target domain name requested by the network, and queries from the locally stored domain name and IP address mapping relationship table. Go to the target IP address corresponding to the target domain name, and directly initiate a network request to the server corresponding to the target IP address based on the found target IP address, and no longer rely on the remote DNS server for domain name resolution, even if the DNS server fails. Affects the normal access network. In addition, local domain name resolution improves the acquisition speed of the target IP address and speeds up the network response.
  • the embodiment of the present invention further provides a computer readable storage medium, where the domain name resolution program is stored on the computer readable storage medium, and the domain name resolution program is executed by the processor to:
  • the network request sent by the application When the network request sent by the application is detected, the network request is parsed to obtain the target domain name corresponding to the network request; and the target corresponding to the target domain name is searched from the domain name and IP address mapping relationship table matched with the application. IP address; initiates a network request to the corresponding server based on the found target IP address.
  • the domain name resolution program when executed by the processor, the following operations are further performed: before the step of parsing the network request to obtain the target domain name corresponding to the network request, when the network request sent by the application is detected,
  • the device When the application is started, the device obtains an acquisition request for obtaining a mapping between a domain name and an IP address according to the preset interface, and receives a mapping table between the domain name and the IP address sent by the application server according to the obtaining request, and caches the local relationship.
  • the following operations are further performed: after the step of searching for the target IP address corresponding to the target domain name in the domain name and IP address mapping relationship table matched with the application, And if the target IP address corresponding to the target domain name is not found in the domain name and IP address mapping relationship table, sending an update request to the application server; receiving a domain name returned by the application server based on the update request IP address mapping relationship table and received from In the domain name and IP address mapping relationship table, the target IP address corresponding to the target domain name is searched; when the corresponding target IP address is found, the step of initiating a network request to the corresponding server based on the found target IP address is performed.
  • the following operations are further performed: after the step of searching for the target IP address corresponding to the target domain name in the domain name and IP address mapping relationship table matched with the application, If the target IP address corresponding to the target domain name is found in the domain name and IP address mapping relationship table, performing a step of initiating a network request to the corresponding server based on the found target IP address; If the target IP address corresponding to the target domain name is not found in the IP address mapping relationship table, the network request is sent to the DNS server for parsing; the receiving DNS server parses the target IP address obtained by the network request, and is received based on the The IP address sends a network request to the corresponding server.
  • portions of the technical solution of the present invention that contribute substantially or to the prior art may be embodied in the form of a software product stored in a storage medium (such as a ROM/RAM as described above).
  • the disk, the optical disk, and the like include a plurality of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the apparatus described in the various embodiments of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了域名解析装置,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的域名解析程序,所述域名解析程序被所述处理器执行时实现如下步骤:当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名;从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址;基于查找到的目标IP地址向对应的服务器发起网络请求。本发明还提出一种域名解析方法以及一种计算机可读存储介质。本发明解决了终端过于依赖远端的DNS服务器进行域名解析的问题。

Description

域名解析装置、方法及计算机可读存储介质
优先权申明
本申请基于巴黎公约申明享有2017年06月24日递交的申请号为CN201710489764.5、名称为“域名解析装置、方法及计算机可读存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本发明涉及通信技术领域,尤其涉及一种域名解析装置、方法及计算机可读存储介质。
背景技术
在计算机网络结构中,域名与IP地址存在对应关系,由域名系统(Domain Name System,简称为DNS)实现域名到IP地址的解析。
在发送网络请求时,都是基于HTTP以及DNS解析来进行的,每个服务器都有自己的IP地址,客户端发送一个网络请求访问一个网址时,往往需要先进行DNS解析,DNS服务器会根据客户端IP地址和欲访问的域名等信息,返回对应的服务器IP地址。客户端得到真正的IP地址,然后再通过IP地址去访问数据,当在移动网络环境下时,过于依赖远端的DNS服务器进行域名解析导致出现如下问题:不仅会由于DNS服务器的解析压力大而造成网络响应延时,导致网络响应速度慢;而且无法规避掉公网DNS服务器被攻击而瘫痪的情况,而在公网DNS服务器瘫痪的情况下,应用无法进行正常的网络请求。
发明内容
本发明提供一种域名解析装置、方法及计算机可读存储介质,其主要目的在于解决过于依赖远端的DNS服务器进行域名解析的问题。
为实现上述目的,本发明提供一种域名解析装置,该装置包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的域名解析程序,所述域名解析程序被所述处理器执行时实现如下步骤:
当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名;
从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址;
基于查找到的目标IP地址向对应的服务器发起网络请求。
可选地,所述处理器还用于执行所述域名解析程序,以在所述当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名的步骤之前,还实现以下步骤:
在检测到所述应用启动时,基于预设接口向服务器发送获取域名与IP地址映射关系表的获取请求;
接收应用服务器基于所述获取请求发送的域名与IP地址映射关系表并缓存至本地。
可选地,所述处理器还用于执行所述域名解析程序,以在从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,还实现以下步骤:
若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则向所述应用服务器发送更新请求;
接收所述应用服务器基于所述更新请求返回的域名与IP地址映射关系表,并从接收的域名与IP地址映射关系表中查找与所述目标域名对应的目标IP地址;
当查找到对应的目标IP地址时,执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤。
可选地,所述处理器还用于执行所述域名解析程序,以在从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,还实现以下步骤:
若从所述域名与IP地址映射关系表中查找到与所述目标域名对应的目标IP地址,则执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤;
若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则将所述网络请求发送至DNS服务器进行解析;
接收DNS服务器解析所述网络请求得到的目标IP地址,并基于接收的IP地址向对应的服务器发送网络请求。
可选地,所述处理器还用于执行所述域名解析程序,以实现如下步骤:
在接收到DNS服务器解析所述网络请求得到的目标IP地址时,将接收的目标IP地址与所述目标域名发送至所述应用服务器,以供所述应用服务器基于接收到的目标IP地址与目标域名更新域名与IP地址映射关系表。
此外,为实现上述目的,本发明还提供一种域名解析方法,该方法包括:
当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名;
从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址;
基于查找到的目标IP地址向对应的服务器发起网络请求。
可选地,所述当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名的步骤之前,所述方法还包括:
在检测到所述应用启动时,基于预设接口向服务器发送获取域名与IP地址映射关系表的获取请求;
接收应用服务器基于所述获取请求发送的域名与IP地址映射关系表并缓存至本地。
可选地,所述从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,所述方法还包括:
若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则向所述应用服务器发送更新请求;
接收所述应用服务器基于所述更新请求返回的域名与IP地址映射关系表,并从接收的域名与IP地址映射关系表中查找与所述目标域名对应的目标IP地址;
当查找到对应的目标IP地址时,执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤。
可选地,所述从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,所述方法还包括:
若从所述域名与IP地址映射关系表中查找到与所述目标域名对应的目标IP地址,则执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤;
若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则将所述网络请求发送至DNS服务器进行解析;
接收DNS服务器解析所述网络请求得到的目标IP地址,并基于接收的IP地址向对应的服务器发送网络请求。
此外,为实现上述目的,本发明还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有域名解析程序,所述域名解析程序被处理器执行时实现如下步骤:
当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名;
从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址;
基于查找到的目标IP地址向对应的服务器发起网络请求。
本发明提出的域名解析装置、方法及计算机可读存储介质,在检测到应用发送的网络请求时,在本地直接对该网络请求进行解析,获取到网络请求的目标域名,从本地存储的域名与IP地址映射关系表中查询到与目标域名对应的目标IP地址,基于查找到的目标IP地址直接向目标IP地址对应的服务器发起网络请求,不再依赖于远端DNS服务器进行域名的解析,即使DNS服务器发生故障也不会影响应用正常的访问网络,此外,在本地进行域名的解析提高了目标IP地址的获取速度,加快网络响应的速度。
附图说明
图1为本发明域名解析装置较佳实施例的示意图;
图2为本发明域名解析方法较佳实施例的流程图。
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
本发明提供一种域名解析装置。参照图1所示,为本发明域名解析装置较佳实施例的示意图。
在本实施例中,域名解析装置可以是智能手机、平板电脑、电子书阅读器、MP3(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)播放器、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面3)播放器、便携计算机等终端设备。
该域名解析装置包括存储器11、处理器12,以及网络接口13。其中,存储器11可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器11可以是该终端的内部存储单元,例如终端的硬盘或者内存,可选的还可以是独立于前述处理器12的存储装置。网络接口13可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。
存储器11在一些实施例中可以是域名解析装置的内部存储单元,例如该域名解析装置的硬盘或内存。存储器11在另一些实施例中也可以是域名解析装置的外部存储设备,例如域名解析装置上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括域名解析装置的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于域名解析装置的应用软件及各类数据,例如域名解析程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行域名解析程序等。
图1仅示出了具有组件11-13以及域名解析程序的域名解析装置,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
可选的,该装置还可以包括用户接口,用户接口可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。
可选地,该实施例中,域名解析装置还可以包括显示器,在一些实施例中可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。显示器用于显示在域名解析装置中处理的信息以及用于显示可视化的用户界面。
可选地,该装置还可以包括摄像头、RF(Radio Frequency,射频)电路,传感器、音频电路、WiFi模块等等。其中,传感器比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,若该装置为移动终端,环境光传感器可根据环境光线的明暗来调节显示屏的亮度,接近传感器可在移动终端移动到耳边时,关闭显示屏和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别移动终端姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;当然,移动终端还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
在图1所示的装置实施例中,作为一种计算机存储介质的存储器11中可以包括操作系统、以及域名解析程序;网络接口13主要用于连接应用服务器,与服务器进行数据通信,例如,终端基于网络接口13向服务器发送网络请求;处理器12执行存储器11中存储的域名解析程序时实现如下步骤:
当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名。
从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址。
基于查找到的目标IP地址向对应的服务器发起网络请求。
上述应用安装并运行在本实施例中的装置中,每一个应用有预先配置好的域名及IP地址映射关系表,开发人员在开发应用时,在应用服务器端设置该应用能够访问的域名以及每一个域名对应的IP地址。建立域名与IP地址之间的映射关系,可以以列表的形式存储域名以及与其对应的IP地址,建立域名与IP地址映射关系表,并发送给客户端。
对于终端来说,关于域名与IP地址映射关系表的获取方式可以有多种方式,以下列举其中两种进行说明。
方式一,在检测到所述应用启动时,基于预设接口向服务器发送获取域名与IP地址映射关系表的获取请求;接收应用服务器基于所述获取请求发送的域名与IP地址映射关系表并缓存至本地。
应用在每一次启动时,从应用服务器处请求最新的域名与IP地址映射关系表对本地存储的映射表进行更新存储,以供在应用进行网络请求时使用。在其他实施例中,为了保证信息的安全性,可以在检测到应用关闭时,删除本地存储的映射表,每次应用启动时,重新向应用服务器请求最新的域名与IP地址的映射关系表。
方式二,所述处理器12还用于执行存储器11中存储的域名解析程序,以在从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,还实现以下步骤:
若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则向所述应用服务器发送更新请求;
接收所述应用服务器基于所述更新请求返回的域名与IP地址映射关系表,并从接收的域名与IP地址映射关系表中查找与所述目标域名对应的目标IP地址;
当查找到对应的目标IP地址时,执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤。
若采用该方式,终端无需每次应用启动都向应用服务器请求域名与IP地址映射关系表。在应用内进行网络请求时,优先使用本地存储的域名与IP地址映射关系表,当出现在本地存储的域名与IP地址映射关系表中查询不到与网络请求中的目标域名对应的目标IP地址时,向应用服务器发送更新请求,以获取最新的域名与IP地址映射关系表,并重新进行目标IP地址的查询,在查找到对应的目标IP地址时,向目标IP地址对应的服务器发起网络请求。进一步的,还可以将最新的映射关系表更新存储到本地,以供后续使用。
以下以一个具体的应用场景为例对本实施例进行说明。以具有android系统的手机为例,该手机上某APP基于HTTP协议(Hyper Text Transfer Protocol,超文本传输协议)与该APP的服务器进行通信,该APP发起一次网络请求,处理器12获取该网络请求的URL(Uniform Resource Locator,统一资源定位器)对象,该URL中包含有协议信息、网络地址、以及资源路径,其中,网络地址一般为域名,资源路径一般用于指示从应用服务器上获取哪一项资源。处理器12调用域名解析程序对该网络请求进行解析,得到目标域名,然后调用存储器11上存储的域名与IP地址映射关系表,从中查找与目标域名具有映射关系的IP地址,一般域名与IP地址之间为一对一或者多对一的关系,因此,一个目标域名一般只有一个对应的目标IP地址,在查找到对应的IP地址后,向该目标IP地址对应的服务器发起网络请求,具体地,处理器12根据HTTP协议要求,组织一个请求的数据包,数据包里包含具体的请求信息,包括请求的资源路径、终端的身份信息等,以供服务器查找对应的资源数据并返回。其中,存储器11上存储的映射关系表可以是APP启动时,处理器11向服务器请求获取并存储的。
优选地,作为另一实施例,所述处理器12还用于执行存储器11中存储的域名解析程序,以在从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,还实现以下步骤:
若从所述域名与IP地址映射关系表中查找到与所述目标域名对应的目标IP地址,则执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤;
若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则将所述网络请求发送至DNS服务器进行解析;
接收DNS服务器解析所述网络请求得到的目标IP地址,并基于接收的IP地址向对应的服务器发送网络请求。
在该实施例中,当终端在本地查找不到与目标域名匹配的目标IP地址时,将远端DNS服务器对域名的解析作为一种辅助手段。对于终端直接询问的远端DNS服务器来说,当没有与目标域名对应的IP地址时,就会向它的上级服务器询问,上级服务器同样可能没有,就依此一层层向上找,最高可达根节点,找到或者全部找不到为止。
例如,在应用的开发维护中,可能会出现新版本的应用中出现了新的域名,但开发人员未来得及对域名与IP地址映射关系表进行更新,因此,在找不到与目标域名匹配的目标IP地址时,终端直接将网络请求发送至远端的DNS服务器,由DNS服务器进行域名解析。此外,网络请求中包含有终端的IP地址,DNS服务器解析得到目标IP地址后,根据终端的IP地址将目标IP地址发送给终端。
进一步地,在其他的实施例中,所述处理器还用于执行所述域名解析程序,以实现如下步骤:
在接收到DNS服务器解析所述网络请求得到的目标IP地址时,将接收的目标IP地址与所述目标域名发送至所述应用服务器,以供所述应用服务器基于接收到的目标IP地址与目标域名更新域名与IP地址映射关系表。
终端在接收到DNS服务器解析得到的目标IP地址后,可以使用该目标IP地址向应用服务器发送网络请求,也可以将IP地址与对应的目标域名关联后上报到应用服务器,以供应用服务器对维护的域名与IP地址映射关系表进行更新。
本实施例提出的域名解析装置,在检测到应用发送的网络请求时,在本地直接对该网络请求进行解析,获取到网络请求的目标域名,从本地存储的域名与IP地址映射关系表中查询到与目标域名对应的目标IP地址,基于查找到的目标IP地址直接向目标IP地址对应的服务器发起网络请求,不再依赖于远端DNS服务器进行域名的解析,即使DNS服务器发生故障也不会影响应用正常的访问网络,此外,在本地进行域名的解析提高了目标IP地址的获取速度,加快网络响应的速度。
可选地,在其他的实施例中,域名解析程序还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个处理器(本实施例为处理器12)所执行,以完成本发明。本发明所称的模块是指能够完成特定功能的一系列计算机程序指令段,比程序更适合于描述消息推送装置在域名解析装置中的执行过程。
例如,在一实施例中,域名解析程序可以被分割为解析模块、查找模块 以及发送模块,其中:
所述解析模块,用于当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名;
所述查找模块,用于从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址;
所述发送模块,用于基于查找到的目标IP地址向对应的服务器发起网络请求。
此外,本发明还提供一种域名解析方法。参照图2所示,为本发明域名解析方法较佳实施例的流程图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。
在本实施例中,域名解析方法包括:
步骤S10,当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名。
步骤S20,从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址。
步骤S30,基于查找到的目标IP地址向对应的服务器发起网络请求。
上述应用安装并运行在本实施例中的装置中,每一个应用有预先配置好的域名及IP地址映射关系表,开发人员在开发应用时,在应用服务器端设置该应用能够访问的域名以及每一个域名对应的IP地址。建立域名与IP地址之间的映射关系,可以以列表的形式存储域名以及与其对应的IP地址,建立域名与IP地址映射关系表,并发送给客户端。
对于终端来说,关于域名与IP地址映射关系表的获取方式可以有多种方式,以下列举其中两种进行说明。
方式一,在步骤S10之前,该方法还包括以下步骤:
在检测到所述应用启动时,基于预设接口向服务器发送获取域名与IP地址映射关系表的获取请求;接收应用服务器基于所述获取请求发送的域名与IP地址映射关系表并缓存至本地。
应用在每一次启动时,从应用服务器处请求最新的域名与IP地址映射关系表对本地存储的映射表进行更新存储,以供在应用进行网络请求时使用。在其他实施例中,为了保证信息的安全性,可以在检测到应用关闭时,删除本地存储的映射表,每次应用启动时,重新向应用服务器请求最新的域名与IP地址的映射关系表。
方式二,在步骤S20之后,该实施例的方法还包括以下步骤:
若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则向所述应用服务器发送更新请求;
接收所述应用服务器基于所述更新请求返回的域名与IP地址映射关系表,并从接收的域名与IP地址映射关系表中查找与所述目标域名对应的目标IP地址;
当查找到对应的目标IP地址时,执行步骤S30。
若采用该方式,终端无需每次应用启动都向应用服务器请求域名与IP地址映射关系表。在应用内进行网络请求时,优先使用本地存储的域名与IP地址映射关系表,当出现在本地存储的域名与IP地址映射关系表中查询不到与网络请求中的目标域名对应的目标IP地址时,向应用服务器发送更新请求,以获取最新的域名与IP地址映射关系表,并重新进行目标IP地址的查询,在查找到对应的目标IP地址时,向目标IP地址对应的服务器发起网络请求。进一步的,还可以将最新的映射关系表更新存储到本地,以供后续使用。
以下以一个具体的应用场景为例对本实施例进行说明。以具有android系统的手机为例,该手机上某APP基于HTTP协议(Hyper Text Transfer Protocol,超文本传输协议)与该APP的服务器进行通信,该APP发起一次网络请求,处获取该网络请求的URL(Uniform Resource Locator,统一资源定位器)对象,该URL中包含有协议信息、网络地址、以及资源路径,其中,网络地址一般为域名,资源路径一般用于指示从应用服务器上获取哪一项资源。调用域名解析程序对该网络请求进行解析,得到目标域名,然后从域名与IP地址映射关系表中查找与目标域名具有映射关系的IP地址,一般域名与IP地址之间为一对一或者多对一的关系,因此,一个目标域名一般只有一个对应的目标IP地址,在查找到对应的IP地址后,向该目标IP地址对应的服务器发起网络请求,具体地,根据HTTP协议要求,组织一个请求的数据包,数据包里包含具体的请求信息,包括请求的资源路径、终端的身份信息等,以供服务器查找对应的资源数据并返回。其中,映射关系表可以是APP启动时,终端向服务器请求获取并存储的。
优选地,作为另一实施例,在从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,该方法还包括以下步骤:
若从所述域名与IP地址映射关系表中查找到与所述目标域名对应的目标IP地址,则执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤;
若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则将所述网络请求发送至DNS服务器进行解析;
接收DNS服务器解析所述网络请求得到的目标IP地址,并基于接收的IP地址向对应的服务器发送网络请求。
在该实施例中,当终端在本地查找不到与目标域名匹配的目标IP地址时,将远端DNS服务器对域名的解析作为一种辅助手段。对于终端直接询问的远端DNS服务器来说,当没有与目标域名对应的IP地址时,就会向它的上级服务器询问,上级服务器同样可能没有,就依此一层层向上找,最高可达根节点,找到或者全部找不到为止。
例如,在应用的开发维护中,可能会出现新版本的应用中出现了新的域 名,但开发人员未来得及对域名与IP地址映射关系表进行更新,因此,在找不到与目标域名匹配的目标IP地址时,终端直接将网络请求发送至远端的DNS服务器,由DNS服务器进行域名解析。此外,网络请求中包含有终端的IP地址,DNS服务器解析得到目标IP地址后,根据终端的IP地址将目标IP地址发送给终端。
进一步地,在其他的实施例中,该方法还包括步骤:在接收到DNS服务器解析所述网络请求得到的目标IP地址时,将接收的目标IP地址与所述目标域名发送至所述应用服务器,以供所述应用服务器基于接收到的目标IP地址与目标域名更新域名与IP地址映射关系表。
终端在接收到DNS服务器解析得到的目标IP地址后,可以使用该目标IP地址向应用服务器发送网络请求,也可以将IP地址与对应的目标域名关联后上报到应用服务器,以供应用服务器对维护的域名与IP地址映射关系表进行更新。
本实施例提出的域名解析方法,在检测到应用发送的网络请求时,在本地直接对该网络请求进行解析,获取到网络请求的目标域名,从本地存储的域名与IP地址映射关系表中查询到与目标域名对应的目标IP地址,基于查找到的目标IP地址直接向目标IP地址对应的服务器发起网络请求,不再依赖于远端DNS服务器进行域名的解析,即使DNS服务器发生故障也不会影响应用正常的访问网络,此外,在本地进行域名的解析提高了目标IP地址的获取速度,加快网络响应的速度。
此外,本发明实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有域名解析程序,所述域名解析程序被处理器执行时实现如下操作:
当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名;从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址;基于查找到的目标IP地址向对应的服务器发起网络请求。
进一步地,所述域名解析程序被处理器执行时还实现如下操作:在所述当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名的步骤之前,在检测到所述应用启动时,基于预设接口向服务器发送获取域名与IP地址映射关系表的获取请求;接收应用服务器基于所述获取请求发送的域名与IP地址映射关系表并缓存至本地。
进一步地,所述域名解析程序被处理器执行时还实现如下操作:在从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则向所述应用服务器发送更新请求;接收所述应用服务器基于所述更新请求返回的域名与IP地址映射关系表,并从接收的 域名与IP地址映射关系表中查找与所述目标域名对应的目标IP地址;当查找到对应的目标IP地址时,执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤。
进一步地,所述域名解析程序被处理器执行时还实现如下操作:在从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,若从所述域名与IP地址映射关系表中查找到与所述目标域名对应的目标IP地址,则执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤;若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则将所述网络请求发送至DNS服务器进行解析;接收DNS服务器解析所述网络请求得到的目标IP地址,并基于接收的IP地址向对应的服务器发送网络请求。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例装置可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的装置。
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (20)

  1. 一种域名解析装置,其特征在于,所述装置包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的域名解析程序,所述域名解析程序被所述处理器执行时实现如下步骤:
    当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名;
    从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址;
    基于查找到的目标IP地址向对应的服务器发起网络请求。
  2. 根据权利要求1所述的域名解析装置,其特征在于,所述处理器还用于执行所述域名解析程序,以在所述当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名的步骤之前,还实现以下步骤:
    在检测到所述应用启动时,基于预设接口向服务器发送获取域名与IP地址映射关系表的获取请求;
    接收应用服务器基于所述获取请求发送的域名与IP地址映射关系表并缓存至本地。
  3. 根据权利要求1所述的域名解析装置,其特征在于,所述处理器还用于执行所述域名解析程序,以在从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,还实现以下步骤:
    若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则向所述应用服务器发送更新请求;
    接收所述应用服务器基于所述更新请求返回的域名与IP地址映射关系表,并从接收的域名与IP地址映射关系表中查找与所述目标域名对应的目标IP地址;
    当查找到对应的目标IP地址时,执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤。
  4. 根据权利要求1所述的域名解析装置,其特征在于,所述处理器还用于执行所述域名解析程序,以在从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,还实现以下步骤:
    若从所述域名与IP地址映射关系表中查找到与所述目标域名对应的目标IP地址,则执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤;
    若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则将所述网络请求发送至DNS服务器进行解析;
    接收DNS服务器解析所述网络请求得到的目标IP地址,并基于接收的IP地址向对应的服务器发送网络请求。
  5. 根据权利要求2所述的域名解析装置,其特征在于,所述处理器还用于执行所述域名解析程序,以在从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,还实现以下步骤:
    若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则向所述应用服务器发送更新请求;
    接收所述应用服务器基于所述更新请求返回的域名与IP地址映射关系表,并从接收的域名与IP地址映射关系表中查找与所述目标域名对应的目标IP地址;
    当查找到对应的目标IP地址时,执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤。
  6. 根据权利要求2所述的域名解析装置,其特征在于,所述处理器还用于执行所述域名解析程序,以在从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,还实现以下步骤:
    若从所述域名与IP地址映射关系表中查找到与所述目标域名对应的目标IP地址,则执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤;
    若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则将所述网络请求发送至DNS服务器进行解析;
    接收DNS服务器解析所述网络请求得到的目标IP地址,并基于接收的IP地址向对应的服务器发送网络请求。
  7. 根据权利要求4所述的域名解析装置,其特征在于,所述处理器还用于执行所述域名解析程序,以实现如下步骤:
    在接收到DNS服务器解析所述网络请求得到的目标IP地址时,将接收的目标IP地址与所述目标域名发送至所述应用服务器,以供所述应用服务器基于接收到的目标IP地址与目标域名更新域名与IP地址映射关系表。
  8. 一种域名解析方法,其特征在于,所述方法包括:
    当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名;
    从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址;
    基于查找到的目标IP地址向对应的服务器发起网络请求。
  9. 根据权利要求8所述的域名解析方法,其特征在于,所述当检测到应 用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名的步骤之前,所述方法还包括:
    在检测到所述应用启动时,基于预设接口向服务器发送获取域名与IP地址映射关系表的获取请求;
    接收应用服务器基于所述获取请求发送的域名与IP地址映射关系表并缓存至本地。
  10. 根据权利要求8所述的域名解析方法,其特征在于,所述从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,所述方法还包括:
    若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则向所述应用服务器发送更新请求;
    接收所述应用服务器基于所述更新请求返回的域名与IP地址映射关系表,并从接收的域名与IP地址映射关系表中查找与所述目标域名对应的目标IP地址;
    当查找到对应的目标IP地址时,执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤。
  11. 根据权利要求8所述的域名解析方法,其特征在于,所述从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,所述方法还包括:
    若从所述域名与IP地址映射关系表中查找到与所述目标域名对应的目标IP地址,则执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤;
    若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则将所述网络请求发送至DNS服务器进行解析;
    接收DNS服务器解析所述网络请求得到的目标IP地址,并基于接收的IP地址向对应的服务器发送网络请求。
  12. 根据权利要求9所述的域名解析方法,其特征在于,所述从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,所述方法还包括:
    若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则向所述应用服务器发送更新请求;
    接收所述应用服务器基于所述更新请求返回的域名与IP地址映射关系表,并从接收的域名与IP地址映射关系表中查找与所述目标域名对应的目标IP地址;
    当查找到对应的目标IP地址时,执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤。
  13. 根据权利要求9所述的域名解析方法,其特征在于,所述从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,所述方法还包括:
    若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则向所述应用服务器发送更新请求;
    接收所述应用服务器基于所述更新请求返回的域名与IP地址映射关系表,并从接收的域名与IP地址映射关系表中查找与所述目标域名对应的目标IP地址;
    当查找到对应的目标IP地址时,执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤。
  14. 根据权利要求11所述的域名解析方法,其特征在于,所述域名解析方法还包括步骤:
    在接收到DNS服务器解析所述网络请求得到的目标IP地址时,将接收的目标IP地址与所述目标域名发送至所述应用服务器,以供所述应用服务器基于接收到的目标IP地址与目标域名更新域名与IP地址映射关系表。
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有域名解析程序,所述域名解析程序被处理器执行时实现如下步骤:
    当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名;
    从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址;
    基于查找到的目标IP地址向对应的服务器发起网络请求。
  16. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述域名解析程序被处理器执行,以在所述当检测到应用发送的网络请求时,解析所述网络请求以获取该网络请求对应的目标域名的步骤之前,还实现以下步骤:
    在检测到所述应用启动时,基于预设接口向服务器发送获取域名与IP地址映射关系表的获取请求;
    接收应用服务器基于所述获取请求发送的域名与IP地址映射关系表并缓存至本地。
  17. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述域名解析程序被处理器执行,以在从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,还实现以下步骤:
    若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目 标IP地址,则向所述应用服务器发送更新请求;
    接收所述应用服务器基于所述更新请求返回的域名与IP地址映射关系表,并从接收的域名与IP地址映射关系表中查找与所述目标域名对应的目标IP地址;
    当查找到对应的目标IP地址时,执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤。
  18. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述处理器还用于执行所述域名解析程序,以在从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,还实现以下步骤:
    若从所述域名与IP地址映射关系表中查找到与所述目标域名对应的目标IP地址,则执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤;
    若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则将所述网络请求发送至DNS服务器进行解析;
    接收DNS服务器解析所述网络请求得到的目标IP地址,并基于接收的IP地址向对应的服务器发送网络请求。
  19. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述处理器还用于执行所述域名解析程序,以在从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,还实现以下步骤:
    若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目标IP地址,则向所述应用服务器发送更新请求;
    接收所述应用服务器基于所述更新请求返回的域名与IP地址映射关系表,并从接收的域名与IP地址映射关系表中查找与所述目标域名对应的目标IP地址;
    当查找到对应的目标IP地址时,执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤。
  20. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述处理器还用于执行所述域名解析程序,以在从与所述应用匹配的域名与IP地址映射关系表中,查找与所述目标域名对应的目标IP地址的步骤之后,还实现以下步骤:
    若从所述域名与IP地址映射关系表中查找到与所述目标域名对应的目标IP地址,则执行基于查找到的目标IP地址向对应的服务器发起网络请求的步骤;
    若从所述域名与IP地址映射关系表中查找不到与所述目标域名对应的目 标IP地址,则将所述网络请求发送至DNS服务器进行解析;
    接收DNS服务器解析所述网络请求得到的目标IP地址,并基于接收的IP地址向对应的服务器发送网络请求。
PCT/CN2017/105021 2017-06-24 2017-09-30 域名解析装置、方法及计算机可读存储介质 Ceased WO2018233140A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710489764.5A CN107682465A (zh) 2017-06-24 2017-06-24 域名解析装置、方法及计算机可读存储介质
CN201710489764.5 2017-06-24

Publications (1)

Publication Number Publication Date
WO2018233140A1 true WO2018233140A1 (zh) 2018-12-27

Family

ID=61134110

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/105021 Ceased WO2018233140A1 (zh) 2017-06-24 2017-09-30 域名解析装置、方法及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN107682465A (zh)
WO (1) WO2018233140A1 (zh)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111935327A (zh) * 2020-02-24 2020-11-13 北京豆萌信息技术有限公司 域名分配方法、装置、设备及计算机可读存储介质
CN113301099A (zh) * 2021-01-18 2021-08-24 阿里巴巴集团控股有限公司 请求处理方法、数据处理方法、装置、设备及cdn系统
CN113472914A (zh) * 2021-06-28 2021-10-01 广州根链国际网络研究院有限公司 Dns定向预取缓存方法及系统
CN113938462A (zh) * 2020-12-28 2022-01-14 京东科技控股股份有限公司 域名解析方法、装置、电子设备和存储介质
CN114301837A (zh) * 2021-12-16 2022-04-08 山石网科通信技术股份有限公司 路由数据处理方法及装置
CN114650221A (zh) * 2022-02-21 2022-06-21 福州汇思博信息技术有限公司 一种服务接口快速调用的方法及系统
CN115297085A (zh) * 2022-06-29 2022-11-04 北京奇艺世纪科技有限公司 一种域名解析的更新方法、装置、电子设备及存储介质
CN116506193A (zh) * 2023-05-04 2023-07-28 杭州迪普科技股份有限公司 网络安全防护方法、系统、网络设备及存储介质
CN117041210A (zh) * 2023-09-22 2023-11-10 北京奇艺世纪科技有限公司 域名解析方法、系统、装置、电子设备及存储介质
CN117082152A (zh) * 2023-09-27 2023-11-17 新华三技术有限公司 服务处理方法、系统及装置

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108769286B (zh) * 2018-05-25 2021-10-01 Oppo(重庆)智能科技有限公司 Dns服务器配置方法及相关产品
CN110913270B (zh) * 2018-09-14 2021-12-21 北京微播视界科技有限公司 直播方法和装置
CN109936641B (zh) * 2019-01-25 2020-12-04 华为技术有限公司 域名解析的方法、虚拟交换机和分布式dns系统
CN110224996A (zh) * 2019-05-20 2019-09-10 深圳壹账通智能科技有限公司 应用程序的网络访问方法、装置、计算机设备和存储介质
CN110321506A (zh) * 2019-07-04 2019-10-11 广州小鹏汽车科技有限公司 网页页面数据加载方法、装置、计算机设备和存储介质
CN110855782B (zh) * 2019-11-14 2022-12-02 北京顺丰同城科技有限公司 一种服务调用系统、方法、电子设备及可读存储介质
CN111414208B (zh) * 2020-03-13 2023-08-01 百度在线网络技术(北京)有限公司 应用程序的启动方法、装置及设备
CN111556178A (zh) * 2020-04-26 2020-08-18 北京达佳互联信息技术有限公司 一种解析系统、方法、设备及存储介质
CN111491033A (zh) * 2020-04-27 2020-08-04 湖南快乐阳光互动娱乐传媒有限公司 一种连接建立方法及装置
CN112019646B (zh) * 2020-07-20 2024-05-14 视联动力信息技术股份有限公司 Mac地址的查重方法、装置、终端设备和存储介质
CN112118226A (zh) * 2020-08-13 2020-12-22 视联动力信息技术股份有限公司 视联网号码的查询方法、装置、终端设备和存储介质
CN112615945B (zh) * 2020-12-18 2022-10-18 平安科技(深圳)有限公司 域名解析记录管理方法、装置、计算机设备及存储介质
CN112804371B (zh) * 2020-12-30 2023-04-07 浙江大华技术股份有限公司 一种域名解析处理方法及装置
CN113206894B (zh) * 2021-05-08 2024-04-23 腾讯科技(深圳)有限公司 Dns服务器的发现方法、装置、计算机设备及存储介质
CN113596185A (zh) * 2021-06-23 2021-11-02 阿里巴巴新加坡控股有限公司 基于可用区的域名解析方法、装置、设备和机器可读介质
CN113810510A (zh) * 2021-07-30 2021-12-17 绿盟科技集团股份有限公司 一种域名访问方法、装置及电子设备
CN116248630B (zh) * 2021-12-08 2025-09-23 腾讯科技(深圳)有限公司 一种应用加速方法、装置、电子设备和存储介质
CN114615175B (zh) * 2022-05-10 2022-07-29 鹏城实验室 服务验证方法、装置及计算机可读存储介质
CN116112466B (zh) * 2022-10-25 2025-09-16 阿里巴巴(中国)有限公司 域名解析方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025793A (zh) * 2010-01-22 2011-04-20 中国移动通信集团北京有限公司 一种ip网络中的域名解析方法、系统及dns服务器
CN103002069A (zh) * 2012-12-25 2013-03-27 北京小米科技有限责任公司 一种域名解析方法、装置及系统
CN104683501A (zh) * 2015-03-30 2015-06-03 乐视致新电子科技(天津)有限公司 域名解析方法以及装置
CN106161664A (zh) * 2015-04-15 2016-11-23 阿里巴巴集团控股有限公司 域名解析方法及装置、数据传输方法及装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102647482B (zh) * 2012-03-31 2015-05-06 北京奇虎科技有限公司 一种访问网站的方法和系统
CN104639672B (zh) * 2015-02-12 2018-06-15 广州华多网络科技有限公司 进行域名解析的方法和装置
CN105338187A (zh) * 2015-11-16 2016-02-17 联想(北京)有限公司 一种信息处理方法及电子设备
CN106506715A (zh) * 2016-10-14 2017-03-15 乐视控股(北京)有限公司 域名解析方法及装置
CN106850813A (zh) * 2017-02-14 2017-06-13 合网络技术(北京)有限公司 网络服务地址切换方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025793A (zh) * 2010-01-22 2011-04-20 中国移动通信集团北京有限公司 一种ip网络中的域名解析方法、系统及dns服务器
CN103002069A (zh) * 2012-12-25 2013-03-27 北京小米科技有限责任公司 一种域名解析方法、装置及系统
CN104683501A (zh) * 2015-03-30 2015-06-03 乐视致新电子科技(天津)有限公司 域名解析方法以及装置
CN106161664A (zh) * 2015-04-15 2016-11-23 阿里巴巴集团控股有限公司 域名解析方法及装置、数据传输方法及装置

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111935327B (zh) * 2020-02-24 2023-07-25 北京豆萌信息技术有限公司 域名分配方法、装置、设备及计算机可读存储介质
CN111935327A (zh) * 2020-02-24 2020-11-13 北京豆萌信息技术有限公司 域名分配方法、装置、设备及计算机可读存储介质
CN113938462A (zh) * 2020-12-28 2022-01-14 京东科技控股股份有限公司 域名解析方法、装置、电子设备和存储介质
CN113301099A (zh) * 2021-01-18 2021-08-24 阿里巴巴集团控股有限公司 请求处理方法、数据处理方法、装置、设备及cdn系统
CN113472914B (zh) * 2021-06-28 2023-09-26 北京天地互连信息技术有限公司 Dns定向预取缓存方法及系统
CN113472914A (zh) * 2021-06-28 2021-10-01 广州根链国际网络研究院有限公司 Dns定向预取缓存方法及系统
CN114301837A (zh) * 2021-12-16 2022-04-08 山石网科通信技术股份有限公司 路由数据处理方法及装置
CN114650221A (zh) * 2022-02-21 2022-06-21 福州汇思博信息技术有限公司 一种服务接口快速调用的方法及系统
CN115297085A (zh) * 2022-06-29 2022-11-04 北京奇艺世纪科技有限公司 一种域名解析的更新方法、装置、电子设备及存储介质
CN115297085B (zh) * 2022-06-29 2024-04-23 北京奇艺世纪科技有限公司 一种域名解析的更新方法、装置、电子设备及存储介质
CN116506193A (zh) * 2023-05-04 2023-07-28 杭州迪普科技股份有限公司 网络安全防护方法、系统、网络设备及存储介质
CN117041210A (zh) * 2023-09-22 2023-11-10 北京奇艺世纪科技有限公司 域名解析方法、系统、装置、电子设备及存储介质
CN117082152A (zh) * 2023-09-27 2023-11-17 新华三技术有限公司 服务处理方法、系统及装置
CN117082152B (zh) * 2023-09-27 2024-01-12 新华三技术有限公司 服务处理方法、系统及装置

Also Published As

Publication number Publication date
CN107682465A (zh) 2018-02-09

Similar Documents

Publication Publication Date Title
WO2018233140A1 (zh) 域名解析装置、方法及计算机可读存储介质
US10798056B2 (en) Method and device for processing short link, and short link server
US10412176B2 (en) Website access method, apparatus, and website system
US10972425B2 (en) Method, device and system for service platform address resolution
EP2985705A2 (en) Webpage access method and apparatus, and router
CN113472901B (zh) 负载均衡方法、装置、设备、存储介质及程序产品
US9754113B2 (en) Method, apparatus, terminal and media for detecting document object model-based cross-site scripting attack vulnerability
CN103678508A (zh) 一种网页打开方法及装置
CN113407662B (zh) 敏感词识别方法、系统及计算机可读存储介质
CN103365695A (zh) 加快子资源加载速度的方法和装置
CN108401026B (zh) 基于区块链的数据存储方法、系统及计算机可读存储介质
CN115668894A (zh) 被配置为服务多个单页应用的服务工作器
RU2642833C2 (ru) Способ и устройство для обеспечения медиаресурса
US20170155741A1 (en) Server, method, and system for providing service data
WO2022135410A1 (zh) 加载源文件的方法及装置
CN115599669A (zh) 微服务的调试方法和装置、电子设备和可读存储介质
US11636035B2 (en) Persisted data cache service
WO2020061731A1 (zh) 资源处理方法、电子设备和计算机可读存储介质
WO2018233141A1 (zh) 数据通信处理终端、方法及计算机可读存储介质
CN107395737A (zh) 访问网络资源的方法、装置、系统及计算机可读存储介质
CN107145488A (zh) 一种记录结果页面中被选择数据项的方法与设备
CN103793459B (zh) 一种网页打开方法及装置
CN115460274A (zh) 发现第三方sdk方法、装置、设备及计算机可读存储介质
US20140325027A1 (en) Method and terminal device for requesting and presenting data
CN113783843A (zh) 基于云waf域名调度方法、装置、设备及可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17914909

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205N DATED 14/02/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17914909

Country of ref document: EP

Kind code of ref document: A1