CN112954089A - Method, device and equipment for analyzing data and storage medium - Google Patents

Method, device and equipment for analyzing data and storage medium Download PDF

Info

Publication number
CN112954089A
CN112954089A CN202110387876.6A CN202110387876A CN112954089A CN 112954089 A CN112954089 A CN 112954089A CN 202110387876 A CN202110387876 A CN 202110387876A CN 112954089 A CN112954089 A CN 112954089A
Authority
CN
China
Prior art keywords
address
address pool
domain name
pool
selection
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.)
Granted
Application number
CN202110387876.6A
Other languages
Chinese (zh)
Other versions
CN112954089B (en
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 Shanghai 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
Priority to CN202110387876.6A priority Critical patent/CN112954089B/en
Publication of CN112954089A publication Critical patent/CN112954089A/en
Application granted granted Critical
Publication of CN112954089B publication Critical patent/CN112954089B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5061Pools of addresses

Landscapes

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

Abstract

The application is applicable to the technical field of computers, and provides a method, a device, equipment and a storage medium for analyzing data, wherein the method comprises the following steps: receiving a domain name resolution request sent by a terminal; determining position information corresponding to the terminal and operator information of the service terminal according to the domain name resolution request; determining an address pool selection strategy and an address selection strategy according to the domain name to be analyzed, the position information and the operator information; determining a target address pool in a plurality of preset address pools based on an address pool selection strategy; an IP address is determined in a destination address pool based on an address selection policy. According to the method, different address pool selection strategies and address selection strategies are determined according to different domain name resolution requests, so that an optimal IP address can be resolved for a domain name to be resolved in the domain name resolution request by using the different selection strategies, the resolution modes are diversified, the resolution result is more accurate due to targeted resolution, and the user experience is improved.

Description

Method, device and equipment for analyzing data and storage medium
Technical Field
The present application belongs to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for parsing data.
Background
A Domain Name System (DNS) is one of basic systems of the whole Internet service, and is responsible for converting an Internet Domain Name accessed by a user into an Internet Protocol (IP) address, and a process of the conversion is called "Domain Name resolution", so the Domain Name System is also called "Domain Name resolution System" and is equivalent to a destination board accessed by a network.
However, the traditional domain name resolution has a single resolution mode, which results in inaccurate resolution results.
Disclosure of Invention
In view of this, embodiments of the present application provide a method, an apparatus, a device, and a storage medium for resolving data, so as to solve the problem that a resolution result is inaccurate due to a single resolution manner of a conventional domain name resolution.
A first aspect of an embodiment of the present application provides a method for parsing data, including:
receiving a domain name resolution request sent by a terminal, wherein the domain name resolution request comprises a domain name to be resolved, and the domain name resolution request is used for requesting an Internet Protocol (IP) address corresponding to the domain name to be resolved;
determining position information corresponding to the terminal and operator information serving the terminal according to the domain name resolution request;
determining an address pool selection strategy and an address selection strategy according to the domain name to be analyzed, the position information and the operator information;
determining a target address pool in a plurality of preset address pools based on the address pool selection strategy;
and determining the IP address corresponding to the domain name to be resolved in the target address pool based on the address selection strategy.
In the method for analyzing data provided in the first aspect, the DNS server determines, based on the received domain name analysis request, location information of a terminal that sends the domain name analysis request and operator information corresponding to the terminal, and determines, according to the location information and the operator information, an address pool selection policy and an address selection policy corresponding to a domain name to be analyzed. And determining a target address pool in a plurality of preset address pools based on the address pool selection strategy, and determining an IP address corresponding to the domain name to be resolved in the target address pool based on the address selection strategy. According to different position information and operator information corresponding to different domain name resolution requests, different address pool selection strategies and address selection strategies can be determined, the domain name to be resolved is resolved based on the determined address pool selection strategies and address selection strategies, and the optimal IP address corresponding to the domain name to be resolved can be obtained. According to the method, different selection strategies are determined according to different domain name resolution requests, so that an optimal IP address can be resolved for the domain name to be resolved in the domain name resolution request by using the different selection strategies, the resolution mode is diversified, the resolution result is more accurate due to targeted resolution, the domain name resolution accuracy is improved, and the user experience is improved.
Optionally, the address pool selection policy includes any one of an address pool priority policy, an address pool weight policy, an address pool traversal policy, and an address pool intelligent scheduling policy.
Optionally, the address selection policy includes any one of an address priority policy, an address weight policy, an address traversal policy, an address intelligent scheduling policy, and a load balancing policy.
Optionally, before determining the IP address corresponding to the domain name to be resolved in the target address pool based on the address selection policy, the method further includes:
detecting whether the target address pool belongs to a fault address pool or not;
and if the detection result shows that the target address pool belongs to the fault address pool, rejecting the fault address pool, and determining a new target address pool in the remaining preset address pools based on the address pool selection strategy.
Optionally, the detecting whether the target address pool belongs to a failed address pool includes:
monitoring the health state of each IP address in the target address pool based on a preset monitoring method;
when the number of the IP addresses in the healthy state is smaller than a preset value, judging that the target address pool belongs to a fault address pool; or
And when the number of the IP addresses in the healthy state is monitored to be larger than or equal to the preset value, judging that the target address pool does not belong to a fault address pool.
Optionally, the determining an address pool selection policy and an address selection policy according to the domain name to be resolved, the location information, and the operator information includes:
determining an address pool selection strategy matched with the domain name to be analyzed, the position information and the operator information from a plurality of preset address pool selection strategies;
and determining the address selection strategy associated with the matched address pool selection strategies.
A second aspect of an embodiment of the present application provides an apparatus for parsing data, including:
the terminal comprises a receiving unit, a sending unit and a processing unit, wherein the receiving unit is used for receiving a domain name resolution request sent by the terminal, the domain name resolution request comprises a domain name to be resolved, and the domain name resolution request is used for requesting an Internet Protocol (IP) address corresponding to the domain name to be resolved;
a first determining unit, configured to determine, according to the domain name resolution request, location information corresponding to the terminal and operator information serving the terminal;
a second determining unit, configured to determine an address pool selection policy and an address selection policy according to the domain name to be resolved, the location information, and the operator information;
a third determining unit, configured to determine a target address pool in the multiple preset address pools based on the address pool selection policy;
and the fourth determining unit is used for determining the IP address corresponding to the domain name to be resolved in the target address pool based on the address selection strategy.
A third aspect of embodiments of the present application provides an apparatus for parsing data, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the method for parsing data according to the first aspect.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the steps of the method of parsing data as described in the first aspect above.
A fifth aspect of embodiments of the present application provides a computer program product, which, when run on an apparatus for parsing data, causes the apparatus to perform the steps of the method for parsing data according to the first aspect.
The method, the device, the equipment and the storage medium for analyzing the data have the following beneficial effects that:
the DNS server determines the position information of the terminal sending the domain name resolution request and the operator information corresponding to the terminal based on the received domain name resolution request, and determines an address pool selection strategy and an address selection strategy according to the domain name to be resolved, the position information and the operator information. And determining a target address pool in a plurality of preset address pools based on the address pool selection strategy, and determining an IP address corresponding to the domain name to be resolved in the target address pool based on the address selection strategy. According to different position information and operator information corresponding to different domain name resolution requests, different address pool selection strategies and address selection strategies can be determined, the domain name to be resolved is resolved based on the determined address pool selection strategies and address selection strategies, and the optimal IP address corresponding to the domain name to be resolved can be obtained. According to the method, different selection strategies are determined according to different domain name resolution requests, so that an optimal IP address can be resolved for the domain name to be resolved in the domain name resolution request by using the different selection strategies, the resolution mode is diversified, the resolution result is more accurate due to targeted resolution, the domain name resolution accuracy is improved, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flow chart of a method for parsing data according to an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram of a method for parsing data provided by yet another embodiment of the present application;
FIG. 3 is a schematic flow chart diagram of a method for parsing data according to another embodiment of the present invention;
FIG. 4 is a schematic flow chart diagram of a method for parsing data according to yet another embodiment of the present invention;
FIG. 5 is a diagram illustrating an apparatus for parsing data according to an embodiment of the present application;
fig. 6 is a schematic diagram of an apparatus for parsing data according to another embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The Domain Name (Domain Name) is the Name of a particular computer or group of computers on the internet that is made up of a string of characters separated by "dots", such as: the domain name is www.aaa.com. In the Internet, an Internet Service Provider (ISP) can match a corresponding IP address for a domain name, for example: the IP address corresponding to the domain name of www.aaa.com is 111.222.333.444. Domain names are tree-structured, and are classified into multiple levels from a root Domain Name to a direct service Domain Name Server (DNS), for example: www.bojunyixiao.edu.cn is a domain name, which is divided into 4 levels, namely, a host name "www", a tertiary domain name "bojunyixiao", a secondary domain name "edu", and a top-level domain name "cn". Most of the communication between Internet devices is based on Transmission Control Protocol/Internet Protocol (TCP/IP), however, the TCP/IP is based on IP addresses to complete the connection between both parties. Thus, an internet device can only recognize an IP address such as "196.168.10.17" but not a domain name when communicating over a network. Moreover, for the user, it is impossible to accurately memorize the websites with a plurality of IP addresses, and therefore, when the user accesses the websites, the domain name is more input in the address bar of the browser to complete the acquisition of the desired content page. During the acquisition of the desired content page, the DNS server can "translate" the domain name accessed by the user into the corresponding IP address, and then recall the desired content page from the IP address again.
With the increasing number of users of mobile terminals (e.g., mobile phones), the number of service functions supported by various mobile terminals is increasing, and functions such as instant messaging, securities, web browsing, file downloading and the like have gradually become mainstream applications of terminal devices, especially smart phones. In the internet access process, the mobile terminal needs to query a domain name of a Uniform Resource Locator (URL) for an Internet Protocol (IP) address corresponding to the domain name, so as to send a data packet. This process needs to be done by querying the DNS server.
A Domain Name System (DNS) is one of basic systems of the whole Internet service, and is responsible for converting an Internet Domain Name accessed by a user into an Internet Protocol (IP) address, and a process of the conversion is called "Domain Name resolution", so the Domain Name System is also called "Domain Name resolution System" and is equivalent to a destination board accessed by a network.
The traditional domain name resolution can be used for binding one or more IPs for one domain name, but the traditional domain name resolution has single resolution mode and inaccurate resolution result, all bound IPs can be returned during resolution, no judgment is made, the optimal IP address cannot be returned to a user, the IP with faults can be returned to the user, and the service availability is reduced.
When an online sales promotion activity is encountered for a business, such as "618", "double 11", etc., the user request may multiply, which may place a significant traffic pressure on the IP address. In the traditional domain name resolution mode, the IP addresses in the resolution result cannot be reasonably distributed, so that the service load is unbalanced, and the user access experience is reduced.
In view of this, the present application provides a method for resolving data, in which a DNS server receives a domain name resolution request sent by a terminal, the domain name resolution request includes a domain name to be resolved, and the domain name resolution request is used to request an internet protocol IP address corresponding to the domain name to be resolved; the DNS server determines the position information corresponding to the terminal and the operator information serving the terminal according to the domain name resolution request; the DNS server determines an address pool selection strategy and an address selection strategy according to the domain name to be analyzed, the position information and the operator information; determining a target address pool in a plurality of preset address pools based on the address pool selection strategy; and determining the IP address corresponding to the domain name to be resolved in the target address pool based on the address selection strategy.
In the above manner, based on the received domain name resolution request, the DNS server determines the location information of the terminal that sent the domain name resolution request and the operator information corresponding to the terminal, and determines the address pool selection policy and the address selection policy according to the domain name to be resolved, the location information, and the operator information. And determining a target address pool in a plurality of preset address pools based on the address pool selection strategy, and determining an IP address corresponding to the domain name to be resolved in the target address pool based on the address selection strategy. According to different position information and operator information corresponding to different domain name resolution requests, different address pool selection strategies and address selection strategies can be determined, the domain name to be resolved is resolved based on the determined address pool selection strategies and address selection strategies, and the optimal IP address corresponding to the domain name to be resolved can be obtained. According to the method, different selection strategies are determined according to different domain name resolution requests, so that an optimal IP address can be resolved for the domain name to be resolved in the domain name resolution request by using the different selection strategies, the resolution mode is diversified, the resolution result is more accurate due to targeted resolution, the domain name resolution accuracy is improved, and the user experience is improved.
Referring to fig. 1, fig. 1 is a schematic flow chart of a method for parsing data according to an embodiment of the present application. The main execution body of the method for resolving data in this embodiment is a device for resolving data, and the device includes, but is not limited to, a Domain Name Server (DNS), an independent Server, a distributed Server, a Server cluster, a cloud Server, or the like. The method for parsing data as shown in fig. 1 may include S101 to S105, and the specific implementation principle of each step is as follows.
S101: receiving a domain name resolution request sent by a terminal, wherein the domain name resolution request comprises a domain name to be resolved, and the domain name resolution request is used for requesting an Internet Protocol (IP) address corresponding to the domain name to be resolved.
The terminal in this embodiment includes, but is not limited to, a smart phone, a tablet computer, a desktop computer, a Personal Digital Assistant (PDA), a notebook computer, an ultra-mobile Personal computer (UMPC), a netbook, a handheld device with a wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, a terminal device in a 5G network, or a terminal device in a Public Land Mobile Network (PLMN) for future evolution, and the like. The description is given for illustrative purposes only and is not intended to be limiting.
When a user wants to access a certain website through a terminal, the terminal triggers generation of a domain name resolution request and sends the domain name resolution request to a DNS server. The domain name resolution request comprises a domain name to be resolved, and the domain name resolution request is used for requesting an Internet Protocol (IP) address corresponding to the domain name to be resolved. Through the IP address, the user can successfully access the website content corresponding to the domain name to be resolved. For example, the domain name to be resolved may be www.ip.com, and the IP address corresponding to the domain name to be resolved is 1.80.241.252. The corresponding website content can be successfully accessed www.ip.com via IP address 1.80.241.252.
S102: and determining the position information corresponding to the terminal and the operator information serving the terminal according to the domain name resolution request.
When interacting with the DNS server, the terminal may comply with a network Protocol, such as User Datagram Protocol (UDP). Based on the network protocol, the domain name resolution request sent by the terminal to the DNS server also includes the IP address of the source of the request (source IP, i.e. the IP corresponding to the terminal that sent the domain name resolution request).
A database corresponding to the DNS server stores a plurality of source IPs, and position information and operator information corresponding to each source IP in advance. The location information may include a home corresponding to the source IP. Illustratively, the home location may be Shanghai, Beijing, Shaanxi, Henan, Wuhan, Hebei, Hunan, and the like. The operator information may be mobile, telecommunications, connectivity, etc. Alternatively, in one implementable manner, the home may be detailed to a particular city. For example, the attribution may be Sichuan- -Chengdu, Jiangsu- -Suzhou, Guangdong- -Buddha, Shaanxi- -Xian, etc. The description is given for illustrative purposes only and is not intended to be limiting.
And searching a source IP corresponding to the IP address of the request source in the domain name resolution request in the database, and further searching the position information and the operator information corresponding to the source IP according to the searched source IP in the database. The found position information corresponding to the source IP, namely the position information corresponding to the terminal sending the domain name resolution request; the operator information corresponding to the source IP, that is, the operator information serving the terminal, is found. It can be understood that the location information corresponding to the terminal and the operator information serving the terminal are the location information and the operator information corresponding to the current domain name to be resolved.
S103: and determining an address pool selection strategy and an address selection strategy according to the domain name to be analyzed, the position information and the operator information.
The address pool selection strategy is used for selecting an optimal target address pool for the domain name to be resolved from a plurality of preset address pools corresponding to the domain name to be resolved. The address selection strategy is used for selecting the optimal IP address for the domain name to be resolved from a plurality of IP addresses in the target address pool. The optimal target address pool may be any one of an address pool with the highest priority, an address pool with the largest weight value, an address pool that is most matched with the location information corresponding to the domain name to be resolved, an address pool that is most matched with the operator information corresponding to the domain name to be resolved, an address pool that is matched with both the location information corresponding to the domain name to be resolved and the operator information, and the like. The optimal IP address may be any one of an IP address with the highest priority, an IP address with the largest weight value, an IP address that is most matched with the location information corresponding to the domain name to be resolved (the location of the server of the IP address is the same as or closest to the location corresponding to the domain name to be resolved), an IP address that is most matched with the operator information corresponding to the domain name to be resolved (the operator corresponding to the IP address is the same as the operator corresponding to the domain name to be resolved), an IP address that is both matched with the location information corresponding to the domain name to be resolved and the operator information, and the like (the location of the server of the IP address is the same as or closest to the location corresponding to the domain name to be resolved, and the operator corresponding to the IP address is the same as the operator corresponding to the domain name to be resolved). The description is given for illustrative purposes only and is not intended to be limiting.
The method comprises the steps of establishing mapping relations among domain names, position information and operator information corresponding to the domain names, a plurality of preset address pool selection strategies and a plurality of address selection strategies in advance. And storing each domain name, the position information and the operator information corresponding to each domain name, a plurality of preset address pool selection strategies, a plurality of address selection strategies and the mapping relation into a database corresponding to the DNS server.
For example, the same domain name may correspond to different location information and operator information, and for the different location information and operator information corresponding to the domain name, a plurality of different preset address pool selection policies may be set for the domain name in advance. Each address pool selection strategy can correspond to a plurality of address pools, and a place pool selection strategy is preset for each address pool.
For example, regarding the domain name www.bojunyixiao.com, in one case, the location information corresponding to the domain name is shanghai and the operator information is mobile. The domain name is www.bojunyixiao.com, the location information is Shanghai, and the operator information is mobile, and an address pool selection strategy is configured in advance. Configuring the address pool selection policy may be understood as configuring a plurality of available address pools for the domain name based on the address pool selection policy, and further configuring an address selection policy for each address pool corresponding to the address pool selection policy based on the address pool selection policy. After an address pool is determined based on the address pool selection policy, the address selection policy corresponding to the address pool can be obtained, and the IP address corresponding to the domain name www.bojunyixiao.com is determined in the address pool according to the address selection policy.
In another case, the location information corresponding to the domain name is Jiangsu, and the operator information is Unicom. Another address pool selection strategy is configured in advance for the domain name www.bojunyixiao.com, the location information Jiangsu and the operator information Unicom (the address pool selection strategy here is different from that in the above one case). Configuring another address pool selection policy may be understood as configuring a plurality of available address pools for the domain name based on another address pool selection policy, and further, configuring an address selection policy for each address pool corresponding to another address pool selection policy based on another address pool selection policy (the address selection policy here may be the same as or different from the address selection policy in the above-mentioned one case). After an address pool is determined based on the another address pool selection policy, the address selection policy corresponding to the address pool may be obtained, and the IP address corresponding to the domain name www.bojunyixiao.com is determined in the address pool according to the address selection policy.
The above example is a process in which the same domain name corresponds to different location information and operator information, and an address pool selection policy and an address selection policy are preset for the same domain name. For different domain names, the same setting process is also performed, and reference may be made to the above description, which is not described herein again. It should be noted that, for the same domain name, different address pool selection policies are set for different location information and operator information of the same domain name, and for different domain names, the address pool selection policies and the address selection policies corresponding to the different domain names may be the same or different, and may be set and adjusted according to actual situations, which is not limited to this.
Searching address pool selection strategies matched with the domain name to be analyzed, the position information and the operator information in a plurality of preset address pool selection strategies stored in a database; and according to the searched address pool selection strategy, determining a target address pool corresponding to the domain name to be analyzed, and further searching an address selection strategy associated with the target address pool.
The address pool selection strategy can comprise any one of an address pool priority strategy, an address pool weight strategy, an address pool traversal strategy and an address pool intelligent scheduling strategy.
The address pool priority strategy is used for selecting the address pool with the highest priority. And setting priorities for a plurality of address pools corresponding to the address pool priority policy in advance respectively. The priority may be expressed in numbers (e.g., 1, 2, 3, etc.), in chinese characters (e.g., one, two, three, etc.), in english (A, B, C, etc.), etc. The relationship between the number, chinese character, english, etc. and the address pool priority can be preset. For example, the larger the number, the higher the address pool priority corresponding to the number; the smaller the number is, the lower the priority of the address pool corresponding to the number is; or, the smaller the number is, the higher the priority of the address pool corresponding to the number is; the larger the number, the lower the address pool priority corresponding to that number. Chinese characters and English are similar, and are not described in detail here.
Illustratively, the smaller the predetermined number, the higher the address pool priority corresponding to that number. And preferentially returning the address pool with the highest priority as a target address pool corresponding to the domain name to be resolved according to the address pool priority strategy. And when the priorities are the same, randomly returning an address pool as a target address pool. For example, the address pools corresponding to a certain address pool priority policy are respectively: the address pool X, the address pool Y and the address pool Z, wherein the priority of the address pool X is 1, the priority of the address pool Y is 2 and the priority of the address pool Z is 3, the address pool X is returned as a target address pool. Or, the address pools corresponding to a certain address pool priority policy are respectively: and if the priorities of the address pool X and the address pool Y are both 1, randomly returning the address pool X or the address pool Y as a target address pool. The description is given for illustrative purposes only and is not intended to be limiting.
The address pool weight strategy is used for determining the probability of each address pool being selected in a plurality of address pools corresponding to the address pool weight strategy, and determining a target address pool based on the probability. And respectively setting weight values for a plurality of address pools corresponding to the address pool weight strategy in advance. The weight values may be represented by numbers (e.g., 0.1, 0.5, 0.4, etc.). And adding the weighted values corresponding to the plurality of address pools corresponding to the address pool weighted strategy, wherein the sum is 1. The relationship between the weight value and the address pool may be preset. For example, the greater the weight value, the greater the probability that the address pool is selected; the smaller the weight value, the smaller the probability that the address pool is selected. The probability is determined by the sum of the weight value corresponding to the address pool and the weight values of all the address pools (i.e. the sum of the weight values corresponding to the address pools corresponding to the address pool weight policy). For example, the weighted value corresponding to the address pool is divided by 1, and the obtained result is the probability that the address pool is selected.
For example, the address pools corresponding to a certain address pool weight policy are respectively: the address pool O and the address pool P are respectively provided, wherein the weighted value of the address pool O is 0.6, the weighted value of the address pool P is 0.4, the probability that the address pool O is selected is 0.6, and the probability that the address pool P is selected is 0.4. That is, in 10 times of resolution, the address pool O will be selected as the target address pool 6 times, and the address pool P will be selected as the target address pool 4 times. In the actual implementation process, the number of times of each selected address pool is recorded, so that return according to the corresponding probability is guaranteed. The description is given for illustrative purposes only and is not intended to be limiting.
The address pool traversal strategy is used for polling and selecting each address pool from a plurality of address pools corresponding to the address pool traversal strategy. It is also understood that each address pool is selected in turn by a loop. For example, the address pools corresponding to a certain address pool traversal policy are: the address pool M, the address pool N and the address pool V are arranged in this order. When the address pool traversal strategy is used for the first time, the address pool M is selected as a target address pool; when the address pool traversal strategy is used for the second time, the address pool N is selected as a target address pool; when the address pool traversal strategy is used for the third time, the address pool V is selected as a target address pool; when the address pool traversal strategy is used for the fourth time, the address pool M is selected as a target address pool, and so on. The description is given for illustrative purposes only and is not intended to be limiting.
The address pool intelligent scheduling strategy is used for determining a target address pool which is most matched with the attribution corresponding to the domain name to be resolved in a plurality of address pools corresponding to the address pool traversal strategy. Here the attribution is specific to a city. Different cities are respectively set for a plurality of address pools corresponding to the address pool intelligent scheduling strategy in advance. When the position information corresponding to the domain name to be resolved contains a city, an address pool intelligent scheduling strategy is selected, and the address pool which is the same as the city corresponding to the domain name to be resolved is selected as a target address pool from a plurality of address pools corresponding to the address pool intelligent scheduling strategy.
For example, the address pools corresponding to a certain address pool intelligent scheduling policy are respectively: the method comprises the following steps that an address pool G, an address pool H and an address pool K are obtained, a city corresponding to the address pool G is Western Ann, a city corresponding to the address pool H is Yanan, a city corresponding to the address pool K is Baoji, and the city corresponding to the address pool K contains the cities in the position information corresponding to the terminal: and 3, selecting the address pool G as a target address pool if the city corresponding to the domain name to be analyzed is acquired as the city. The description is given for illustrative purposes only and is not intended to be limiting.
The address selection strategy can comprise any one of an address priority strategy, an address weight strategy, an address traversal strategy, an address intelligent scheduling strategy and a load balancing strategy.
And selecting each address pool corresponding to the strategy for the address pool in advance, and setting different address selection strategies. Different address selection strategies are set for a plurality of address pools corresponding to the address pool priority strategy, a plurality of address pools corresponding to the address pool weight strategy, a plurality of address pools corresponding to the address pool traversal strategy and a plurality of address pools corresponding to the address pool intelligent scheduling strategy respectively, and the address selection strategies set for the address pools can comprise any one of the address priority strategy, the address weight strategy, the address traversal strategy, the address intelligent scheduling strategy and the load balancing strategy.
The address priority strategy is used for selecting the IP address with the highest priority. Priorities are set in advance for a plurality of IP addresses in an address pool, respectively. The priority may be expressed in numbers (e.g., 1, 2, 3, etc.), in chinese characters (e.g., one, two, three, etc.), in english (A, B, C, etc.), etc. The relationship between the number, chinese character, english, etc. and the priority of the IP address can be preset. For example, the larger the number, the higher the priority of the IP address corresponding to the number; the smaller the number is, the lower the priority of the IP address corresponding to the number is; or, the smaller the number is, the higher the priority of the IP address corresponding to the number is; the larger the number, the lower the priority of the IP address to which the number corresponds. Chinese characters and English are similar, and are not described in detail here.
Illustratively, the smaller the predetermined number, the higher the priority of the IP address corresponding to the number. And preferentially returning the IP address with the highest priority as the IP address corresponding to the domain name to be resolved according to the address priority strategy. And when the priorities are the same, randomly returning an IP address as the IP address corresponding to the domain name to be resolved. For example, some pool of addresses includes: the IP address x, the IP address y and the IP address z, wherein the priority of the IP address x is 1, the priority of the IP address y is 2 and the priority of the IP address z is 3, the IP address x is returned as the IP address corresponding to the domain name to be resolved. Or, a certain address pool includes: and if the IP address x and the IP address y are 1 in priority, randomly returning the IP address x or the IP address y as the IP address corresponding to the domain name to be resolved. The description is given for illustrative purposes only and is not intended to be limiting.
The address weight strategy is used for determining the probability of each IP address being selected in a plurality of IP addresses corresponding to the address pool, and determining the IP address corresponding to the domain name to be resolved based on the probability. And respectively setting weight values for a plurality of IP addresses in the address pool in advance. The weight values may be represented by numbers (e.g., 0.2, 0.3, 0.5, etc.). And adding the weighted values corresponding to the IP addresses in each address pool, wherein the sum is 1. The relationship between the weight value and the IP address may be set in advance. For example, the greater the weight value, the greater the probability that the IP address is selected; the smaller the weight value, the smaller the probability that the IP address is selected. The probability is determined by the sum of the weight value corresponding to the IP address and the weight values of all the IP addresses (i.e. the weight values corresponding to the IP addresses in the address pool are added). For example, the weight value corresponding to the IP address is divided by 1, and the obtained result is the probability that the IP address is selected.
For example, some pool of addresses includes: the IP address f and the IP address s are respectively provided, the weight value of the IP address f is 0.6, the weight value of the IP address s is 0.4, the probability that the IP address f is selected is 0.6, and the probability that the IP address s is selected is 0.4. That is, in 10 times of resolution, the IP address f will be selected as the IP address corresponding to the domain name to be resolved for 6 times, and the IP address s will be selected as the IP address corresponding to the domain name to be resolved for 4 times. In the actual implementation process, the times of each selected IP address are recorded, so that the return according to the corresponding probability is ensured. The description is given for illustrative purposes only and is not intended to be limiting.
The address traversal strategy is used for polling and selecting each IP address in the address pool. It is also understood that each IP address is selected in turn in a loop. For example, some pool of addresses includes: IP address m, IP address n, IP address v, and IP address m, IP address n, IP address v are arranged in this order. Selecting an IP address m in the address pool as an IP address corresponding to the domain name to be resolved for the first time; selecting an IP address n in the address pool as an IP address corresponding to the domain name to be resolved for the second time; selecting an IP address v from the address pool as an IP address corresponding to the domain name to be resolved for the third time; and selecting the IP address m in the address pool as the IP address corresponding to the domain name to be resolved for the fourth time, and so on. The description is given for illustrative purposes only and is not intended to be limiting.
The intelligent address scheduling strategy is used for marking all IP addresses which can be used for analyzing the domain name and return to the IP addresses as the IP addresses corresponding to the domain name to be analyzed and returning the IP addresses in the address pool. For example, some pool of addresses includes: and if the IP addresses d, u and k are all available, taking the IP addresses d, u and k as the IP addresses corresponding to the domain name to be resolved.
The load balancing policy is used for returning the same IP address in the address pool each time when the same request source (the request source in the domain name resolution request) requests the same address pool. For example, an address selection policy corresponding to a certain address pool is a load balancing policy, and the address pool includes: and the IP address b and the IP address c are used for determining whether the request source request is received again in the address pool or the IP address b is used as the IP address corresponding to the domain name to be resolved when the request is requested to the address pool for the first time and the IP address b is used as the IP address corresponding to the domain name to be resolved. The description is given for illustrative purposes only and is not intended to be limiting.
As shown in fig. 2, fig. 2 is a schematic flowchart of a method for parsing data according to another embodiment of the present application, and optionally, in a possible implementation manner, the S103 may include S1031 to S1032, which are specifically as follows:
s1031: and determining an address pool selection strategy matched with the domain name to be analyzed, the position information and the operator information from a plurality of preset address pool selection strategies.
And searching for an address pool selection strategy matched with the domain name to be analyzed, the position information and the operator information from a plurality of preset address pool selection strategies stored in a database. Illustratively, a certain terminal sends a domain name resolution request that includes the domain name to be resolved www.bojunyixiao.com. Two kinds of preset address pool selection strategies are found in the database and correspond to the domain name, wherein the two kinds of strategies are respectively as follows:
strategy 1
Selecting a strategy from an address pool: address pool priority policy
The request source is as follows: movement in the sea
Strategy 2
Selecting a strategy from an address pool: address pool weight policy
The request source is as follows: all-in-one of Jiangsu
Strategy 3
Selecting a strategy from an address pool: address pool traversal strategy
The request source is as follows: shaanxi telecommunications
If the position information corresponding to the terminal which acquires the sent domain name resolution request is Shanghai and the operator information is mobile, the domain name resolution request is compared with the domain name: www.bojunyixiao.com, location information: shanghai and operator information: and the address pool selection strategy matched with the movement is the address pool priority strategy. If the acquired position information corresponding to the terminal is Jiangsu and the operator information is Unicom, the method comprises the following steps: www.bojunyixiao.com, location information: information of Jiangsu and operators: and the address pool selection strategy matched with the links is an address pool weight strategy. It should be understood that the present invention is only illustrative and not restrictive, and that the present invention is not limited to the actual implementation.
S1032: and determining an address selection strategy associated with the address pool selection strategy.
And according to the searched address pool selection strategy, determining a target address pool corresponding to the domain name to be analyzed, and further searching an address selection strategy associated with the target address pool.
Illustratively, following the above example, policy 1 is specified as follows:
strategy 1
Selecting a strategy from an address pool: address pool priority policy
The request source is as follows: movement in the sea
Address pool X (priority 1) -address priority policy-IP address X (priority 1), IP address y (priority 2), IP address z (priority 3)
Address pool Y (priority 2) -address weight policy-IP address f (weight 0.6), IP address s (weight 0.4)
Address pool Z (priority 3) -address traversal strategy-IP address m, IP address n and IP address v
The address pool priority strategy is used for selecting the address pool with the highest priority, and the smaller the preset number is, the higher the priority of the address pool corresponding to the number is. The priority of the corresponding address pool X is 1, the priority of the address pool X is the highest, and the address pool X is used as a target address pool. And finding out that the address selection strategy corresponding to the address pool X is an address priority strategy, and taking the address priority strategy as the address selection strategy corresponding to the domain name to be analyzed.
Alternatively, the larger the predetermined number is, the higher the priority of the address pool corresponding to the number is. The priority of the corresponding address pool Z is 3, the priority of the address pool Z is the highest, and the address pool Z is used as a target address pool. And finding out that the address selection strategy corresponding to the address pool Z is an address traversal strategy, and taking the address traversal strategy as the address selection strategy corresponding to the domain name to be resolved.
The description is given for illustrative purposes only and is not intended to be limiting.
S104: and determining a target address pool in a plurality of preset address pools based on the address pool selection strategy.
Illustratively, when the address pool selection policy is the address pool priority policy, the address pool with the highest priority is selected as the target address pool from the plurality of address pools corresponding to the address pool priority policy. Based on the IP address finally determined by the address pool priority strategy, the service can be served for multiple activities in the same city and disaster tolerance in different places.
When the address pool selection strategy is the address pool weighting strategy, determining the probability of each address pool being selected in a plurality of address pools corresponding to the address pool weighting strategy, recording the times of each address pool being selected, and determining a target address pool based on the probability and the selected times. For example, if the probability corresponding to the address pool 1 is 0.25, the probability corresponding to the address pool 2 is 0.75, and the number of times the address pool 1 is selected is 1, the address pool 2 is set as the target address pool when the target address pool is determined again among the plurality of address pools corresponding to the address pool weight policy. The description is given for illustrative purposes only and is not intended to be limiting.
And when the address pool selection strategy is the address pool traversal strategy, circularly and sequentially selecting each address pool from a plurality of address pools corresponding to the address pool traversal strategy. Based on the IP address finally determined by the address pool weight strategy or the address pool traversal strategy, service load balancing can be realized.
And when the address pool selection strategy is an address pool intelligent scheduling strategy, selecting an address pool which is the same as the city corresponding to the domain name to be resolved as a target address pool from a plurality of address pools corresponding to the address pool intelligent scheduling strategy. And the IP address finally determined based on the address pool intelligent scheduling strategy can realize nearby access and improve the service access speed.
Exemplarily, if the address pool corresponding to the domain name to be resolved selects the policy 1, that is, it means that
Strategy 1
Selecting a strategy from an address pool: address pool priority policy
The request source is as follows: movement in the sea
Address pool X (priority 1) -address priority policy-IP address X (priority 1), IP address y (priority 2), IP address z (priority 3)
Address pool Y (priority 2) -address weight policy-IP address f (weight 0.6), IP address s (weight 0.4)
Address pool Z (priority 3) -address traversal strategy-IP address m, IP address n and IP address v
The smaller the preset number is, the higher the address pool priority corresponding to the number is. The priority of the corresponding address pool X is 1, the priority of the address pool X is the highest, and the address pool X is used as a target address pool.
If the address pool selection strategy corresponding to the domain name to be resolved is strategy 2, that is to say
Strategy 2
Selecting a strategy from an address pool: address pool weight policy
The request source is as follows: all-in-one of Jiangsu
Address pool O (weight value 0.6) -address priority policy-IP address d (priority 1), IP address u (priority 2)
Address pool P (weight value is 0.4) -load balancing strategy-IP address d and IP address q
And the probability corresponding to the address pool O is 0.6, and the address pool O has not been selected before, so that the address pool O is determined as the target address pool by the large probability.
S105: and determining the IP address corresponding to the domain name to be resolved in the target address pool based on the address selection strategy.
Illustratively, when the address selection policy is an address priority policy, the IP addresses with the highest priority are selected from the IP addresses corresponding to the target address pool as the IP addresses corresponding to the domain name to be resolved.
When the address selection strategy is an address weight strategy, determining the probability of each selected IP address in a plurality of IP addresses corresponding to the target address pool, and determining the IP address corresponding to the domain name to be analyzed based on the probability.
When the address selection strategy is an address traversal strategy, each IP address is selected in a polling mode from a plurality of IP addresses corresponding to the target address pool, and the selected IP address is used as the IP address corresponding to the domain name to be resolved.
And when the address selection strategy is an intelligent scheduling strategy, determining all the IP addresses in the target address pool as the IP addresses corresponding to the domain name to be resolved.
And when the address selection strategy is a load balancing strategy, if the responsible balancing strategy is selected for the first time, determining any available IP address in the target address pool as the IP address corresponding to the domain name to be resolved. And if the responsible balancing strategy is selected for the Nth time (N is an integer larger than 1), determining the available IP address returned from the target address pool at the previous time as the IP address corresponding to the domain name to be resolved.
Illustratively, following the above example, the address pool selection policy corresponding to the domain name to be resolved is an address pool priority policy, and the address pool X is a target address pool. And the address selection strategy corresponding to the address pool X is an address priority strategy. The smaller the preset number is, the higher the priority of the IP address corresponding to the number is, the priority corresponding to the IP address x is 1, the highest priority of the IP address x is, and the IP address x is determined as the IP address corresponding to the domain name to be resolved.
And if the address pool selection strategy is an address pool weight strategy, the address pool O is a target address pool. And the address selection strategy corresponding to the address pool O is an address priority strategy. The smaller the preset number is, the higher the priority of the IP address corresponding to the number is, the priority corresponding to the IP address d is 1, the highest priority of the IP address d is, and the IP address d is determined as the IP address corresponding to the domain name to be resolved. The description is given for illustrative purposes only and is not intended to be limiting.
Optionally, after S105, the method may further include: and returning the IP address corresponding to the domain name to be resolved to the terminal, so that the terminal opens a webpage on a display interface thereof based on the IP address and displays related contents, thereby facilitating the browsing of a user.
In the above manner, based on the received domain name resolution request, the DNS server determines the location information of the terminal that sent the domain name resolution request and the operator information corresponding to the terminal, and determines the address pool selection policy and the address selection policy according to the domain name to be resolved, the location information, and the operator information. And determining a target address pool in a plurality of preset address pools based on the address pool selection strategy, and determining an IP address corresponding to the domain name to be resolved in the target address pool based on the address selection strategy. According to different position information and operator information corresponding to different domain name resolution requests, different address pool selection strategies and address selection strategies can be determined, the domain name to be resolved is resolved based on the determined address pool selection strategies and address selection strategies, and the optimal IP address corresponding to the domain name to be resolved can be obtained. According to the method, different selection strategies are determined according to different domain name resolution requests, so that an optimal IP address can be resolved for the domain name to be resolved in the domain name resolution request by using the different selection strategies, the resolution mode is diversified, the resolution result is more accurate due to targeted resolution, the domain name resolution accuracy is improved, and the user experience is improved.
Optionally, in an implementation manner, when mapping relationships among the domain names, the location information and the operator information corresponding to each domain name, the plurality of preset address pool selection policies, and the plurality of address selection policies are established in advance, different address pool selection policies are set for each domain name according to actual requirements of a user. For example, if a user wants to implement multi-living and disaster recovery in the same city, the address pool selection policy is set as the address pool priority policy, and the address selection policy corresponding to the address pool with the highest priority is set as the address priority policy. And if the user wants to balance the service load, setting the address pool selection strategy as an address pool weight strategy or an address pool traversal strategy. And if the user wants to realize the nearby access and improve the service access speed, setting the address pool selection strategy as an address pool intelligent scheduling strategy. In the implementation mode, different IP addresses are finally determined according to different address pool selection strategies, multi-activity and remote disaster recovery of the same service city, service load balancing and access acceleration of different areas are realized, the access speed of the application service is improved, and the user experience is improved.
Optionally, in a possible implementation manner, examples are set for different domain names in advance, each example has a unique identifier, and mapping relationships among the examples, the location information and the operator information corresponding to the domain name corresponding to each example, a plurality of preset address pool selection policies, and a plurality of address selection policies are set up in advance. And storing the unique identifier of each instance, the position information and the operator information corresponding to each domain name, a plurality of preset address pool selection strategies, a plurality of address selection strategies and the mapping relation into a database corresponding to the DNS server. The specific implementation manner is similar to that in S103, and is not described herein again. In the foregoing implementation manner, if the same domain name resolution request is initiated by a terminal located at the same position and having the same operator, the finally determined address pool selection policy and the address selection policy are the same. In this embodiment, since the instance established for the domain name to be resolved has the unique identifier, which is equivalent to that each domain name to be resolved is unique, the address pool selection policy and the address selection policy that are uniquely matched with the domain name to be resolved can be found according to the unique identifier, and then the optimal IP address is determined for each domain name to be resolved according to the address pool selection policy and the address selection policy.
Illustratively, the domain name to be resolved is: www.reaikedi.com, an instance is generated for the domain name, the unique identification of the instance is: gslb-12345678 and automatically assigns a CNAME access domain name gslb-12345678.g.padns01.com for this instance. The user needs to configure a CNAME record at the DNS setup with a value of gslb-12345678.g.padns01.com, so as to point the domain name www.reaikedi.com to the resolvable domain name gslb-12345678.g.padns01. com. Different address pool selection strategies and address selection strategies are set in advance under the embodiment, for example, strategy 1 and strategy 2 in S104, and according to the location information corresponding to the domain name: shanghai and operator information: and moving, determining that the address pool selection strategy is an address pool priority strategy, the target address pool is an address pool X, and the returned IP address is an IP address X. The description is given for illustrative purposes only and is not intended to be limiting.
Referring to fig. 3, fig. 3 is a schematic flow chart of a method for parsing data according to another embodiment of the present invention. The difference between the embodiment of the present embodiment and the embodiment corresponding to fig. 1 is S205 to S206, where S201 to S204 and S207 in the present embodiment are completely the same as S101 to S104 and S105 in the previous embodiment, and reference is specifically made to the description related to S101 to S104 and S105 in the previous embodiment, which is not repeated herein.
S205: and detecting whether the target address pool belongs to a fault address pool.
Whether to start a health check for detecting whether the address pool belongs to a failed address pool may be set in advance for each address pool. If a certain address pool setting starts a health check and just the address pool is determined as a target address pool, whether the target address pool belongs to a failure address pool or not is detected. The fault address pool means that the number of the IP addresses in the health state in the address pool is smaller than a preset value. The IP address in a healthy state means that the IP address is currently available, that is, a website or a page corresponding to the IP address can be successfully accessed through the IP address. Correspondingly, the IP address in the unhealthy state means that the IP address is not currently available, that is, the website or page corresponding to the IP address cannot be successfully accessed through the IP address. And if the number of the IP addresses in the healthy state in the address pool is greater than or equal to a preset value, the address pool does not belong to the fault address pool.
For example, please refer to fig. 4, fig. 4 is a schematic flow chart of a method for parsing data according to another embodiment of the present invention. Optionally, the above-mentioned S205 may include S2051 to S2053, and it should be noted that, the S2052 and the S2053 are juxtaposed, and the S2053 is not executed after the S2052, and a specific execution manner is subject to practical limitation, and is not limited thereto. S2051 to S2053 are as follows:
s2051: and monitoring the health state of each IP address in the target address pool based on a preset monitoring method.
The preset monitoring method includes any one of an Internet Packet explorer (PING) monitoring method, a Hypertext Transfer Protocol (HTTP) monitoring method, a Hypertext Transfer Protocol over secure session Layer (HTTPs) monitoring method, a User data Packet Protocol (UDP) monitoring method, and a Transmission Control Protocol (TCP) monitoring method, or any combination thereof.
Illustratively, the PING monitoring method is to probe IP addresses in the target address pool by the PING protocol. That is, a certain number of packets are sent to each IP address in the destination address pool (the number can be configured and adjusted by a user), and the number of packets returned by each IP address is obtained. And determining the packet loss rate corresponding to each IP address according to the number of the data packets returned by each IP address and the number of the data packets of each IP address. When the packet loss rate is greater than a preset packet loss rate threshold value, judging that the IP address is in a non-healthy state currently; and when the packet loss rate is less than or equal to a preset packet loss rate threshold value, judging that the IP address is in a healthy state currently.
For example, 20 data packets are sent to a certain IP address, the number of the data packets returned by the IP address is 18, the packet loss rate corresponding to the IP address is 0.9, the preset packet loss rate threshold is 0.8, and the packet loss rate 0.9 is greater than the preset packet loss rate threshold 0.8, so that it is determined that the IP address is currently in a healthy state. If 20 data packets are sent to a certain IP address, the number of the data packets returned by the IP address is 15, the packet loss rate corresponding to the IP address is 0.75, the preset packet loss rate threshold is 0.8, and the packet loss rate 0.75 is smaller than the preset packet loss rate threshold 0.8, so that the IP address is determined to be in an unhealthy state currently. The description is given for illustrative purposes only and is not intended to be limiting.
The HTTP monitoring method is to request an IP address through an HTTP protocol, and judge whether the IP address is available according to a requested IP address return code (also called a status code, and used for indicating a 3-bit digital code of a server response status). The HTTPS monitoring method requests an IP address through an HTTPS protocol, and judges whether the IP address is available according to a requested IP address return code. The UDP monitoring method requests the IP address through a UDP protocol and judges whether the IP address is available according to the requested IP address return code. The TCP monitoring method requests an IP address through a TCP protocol, and judges whether the IP address is available according to the requested IP address return code. The return codes corresponding to these respective protocols are pre-configured by the user. For example, the user configures a normal return code in advance to be 200, 300, etc., and when the return code for acquiring the IP address is 200, 300, etc., the IP address is available, and it is determined that the IP address is currently in a healthy state. When the return code of the acquired IP address is 400, 500 and the like, the IP address is unavailable, and the IP address is judged to be in an unhealthy state currently.
S2052: and when the number of the IP addresses in the healthy state is smaller than a preset value, judging that the target address pool belongs to a fault address pool.
And counting the number of the IP addresses in the healthy state in the target address pool, and if the number is smaller than a preset value, judging that the target address pool belongs to a fault address pool. For example, if the preset value is 5, and the number of the IP addresses in the healthy state in the target address pool is counted to be 3, it is determined that the target address pool belongs to the failed address pool. The description is given for illustrative purposes only and is not intended to be limiting.
S2053: and when the number of the IP addresses in the healthy state is monitored to be larger than or equal to the preset value, judging that the target address pool does not belong to the fault address pool.
And counting the number of the IP addresses in the healthy state in the target address pool, and if the number is greater than or equal to a preset value, judging that the target address pool does not belong to the fault address pool. For example, if the preset value is 5, and the number of the IP addresses in the healthy state in the target address pool is counted to be 6, it is determined that the target address pool does not belong to the failed address pool. The description is given for illustrative purposes only and is not intended to be limiting.
S206: and if the detection result shows that the target address pool belongs to the fault address pool, rejecting the fault address pool, and determining a new target address pool in the remaining preset address pools based on the address pool selection strategy.
And when the target address pool is detected to belong to the fault address pool, the fault address pool is removed, and the IP address cannot be further selected from the target address pool. But a new target address pool is determined in the remaining preset address pools based on the address pool selection strategy.
Illustratively, following the example in the embodiment of fig. 1, policy 1 is specified as follows:
strategy 1
Selecting a strategy from an address pool: address pool priority policy
The request source is as follows: movement in the sea
Address pool X (priority 1) -address priority policy-IP address X (priority 1), IP address y (priority 2), IP address z (priority 3)
Address pool Y (priority 2) -address weight policy-IP address f (weight 0.6), IP address s (weight 0.4)
Address pool Z (priority 3) -address traversal strategy-IP address m, IP address n and IP address v
The target address pool determined in S204 is: and if the address pool X is detected to be a fault address pool in S205, the address pool X is rejected, and a target address pool is redetermined based on an address pool priority policy in the remaining address pool Y and the address pool Z. Since the priority of the address pool Y is 2, which is higher than the priority of the address pool Y, the address pool Y is determined as a new target address pool. And determining the IP address corresponding to the domain name to be resolved in the address pool Y based on the address weight strategy. The description is given for illustrative purposes only and is not intended to be limiting.
Alternatively, in one implementation, the health status of each IP address in the address pool may be monitored in real-time when a health check of the address pool is turned on. It may happen that a certain address pool does not belong to the failed address pool, but the individual IP addresses in the address pool are in an unhealthy state. When the health check is started, if the IP address in the non-health state in the address pool is just analyzed into the IP address corresponding to the domain name to be analyzed, the IP address in the non-health state is not returned to the terminal at this time, but the IP address in the non-health state is marked as an abnormal IP address, the IP address is reselected in the address pool based on an address selection strategy, and finally the IP address in the health state is used as the IP address corresponding to the domain name to be analyzed and returned to the terminal. The description is given for illustrative purposes only and is not intended to be limiting.
In the implementation mode, whether the target address pool belongs to the fault address pool or not is monitored, the health state of each IP address in the target address pool is monitored, and the DNS server can be ensured to return normally available IP addresses in real time, so that the risk of service interruption is reduced, and the stable operation of services is ensured.
Referring to fig. 5, fig. 5 is a schematic diagram of an apparatus for parsing data according to an embodiment of the present disclosure. The device comprises units for performing the steps in the embodiments corresponding to fig. 1, 3, 4. Please refer to the related descriptions in the embodiments corresponding to fig. 1, fig. 3, and fig. 4. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 5, it includes:
a receiving unit 310, configured to receive a domain name resolution request sent by a terminal, where the domain name resolution request includes a domain name to be resolved, and the domain name resolution request is used to request an internet protocol IP address corresponding to the domain name to be resolved;
a first determining unit 320, configured to determine, according to the domain name resolution request, location information corresponding to the terminal and operator information serving the terminal;
a second determining unit 330, configured to determine an address pool selection policy and an address selection policy according to the domain name to be resolved, the location information, and the operator information;
a third determining unit 340, configured to determine a target address pool in multiple preset address pools based on the address pool selection policy;
a fourth determining unit 350, configured to determine, based on the address selection policy, an IP address corresponding to the domain name to be resolved in the target address pool.
Optionally, the address pool selection policy includes any one of an address pool priority policy, an address pool weight policy, an address pool traversal policy, and an address pool intelligent scheduling policy.
Optionally, the address selection policy includes any one of an address priority policy, an address weight policy, an address traversal policy, an address intelligent scheduling policy, and a load balancing policy.
Optionally, the apparatus further comprises:
the detection unit is used for detecting whether the target address pool belongs to a fault address pool or not;
and the eliminating unit is used for eliminating the fault address pool if the detection result shows that the target address pool belongs to the fault address pool, and determining a new target address pool in the rest preset address pools based on the address pool selection strategy.
Optionally, the detection unit is specifically configured to:
monitoring the health state of each IP address in the target address pool based on a preset monitoring method;
when the number of the IP addresses in the healthy state is smaller than a preset value, judging that the target address pool belongs to a fault address pool; or
And when the number of the IP addresses in the healthy state is monitored to be larger than or equal to the preset value, judging that the target address pool does not belong to a fault address pool.
Optionally, the preset monitoring method includes any one of a PING monitoring method, an HTTP monitoring method, an HTTPs monitoring method, a UDP monitoring method, and a TCP monitoring method.
Optionally, the second determining unit 330 is specifically configured to:
determining an address pool selection strategy matched with the domain name to be analyzed, the position information and the operator information from a plurality of preset address pool selection strategies;
and determining the address selection strategy associated with the matched address pool selection strategies.
Referring to fig. 6, fig. 6 is a schematic diagram of an apparatus for parsing data according to another embodiment of the present application. As shown in fig. 6, the apparatus 4 for parsing data of this embodiment includes: a processor 40, a memory 41, and computer instructions 42 stored in the memory 41 and executable on the processor 40. The processor 40, when executing the computer instructions 42, implements the steps in the various method embodiments described above for parsing data, such as S101-S105 shown in fig. 1. Alternatively, the processor 40, when executing the computer instructions 42, implements the functions of the units in the embodiments described above, such as the functions of the units 310 to 350 shown in fig. 5.
Illustratively, the computer instructions 42 may be divided into one or more units that are stored in the memory 41 and executed by the processor 40 to accomplish the present application. The one or more units may be a series of computer instruction segments capable of performing specific functions, which are used to describe the execution of the computer instructions 42 in the device 4 for parsing data. For example, the computer instructions 42 may be divided into a receiving unit, a first determining unit, a second determining unit, a third determining unit, and a fourth determining unit, each of which functions as described above.
The device for parsing data may include, but is not limited to, a processor 40 and a memory 41. It will be appreciated by those skilled in the art that fig. 6 is merely an example of a device 4 that parses data and does not constitute a limitation of a device that parses data, and may include more or fewer components than shown, or some components in combination, or different components, e.g., the device that parses data may also include input output devices, network access devices, buses, etc.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the apparatus for parsing data, such as a hard disk or a memory of the apparatus for parsing data. The memory 41 may also be an external storage terminal of the device for analyzing data, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are equipped on the device for analyzing data. Further, the memory 41 may include both an internal storage unit and an external storage terminal of the device for parsing data. The memory 41 is used for storing the computer instructions and other programs and data required by the terminal. The memory 41 may also be used to temporarily store data that has been output or is to be output.
The embodiment of the present application further provides a computer storage medium, where the computer storage medium may be nonvolatile or volatile, and the computer storage medium stores a computer program, and the computer program, when executed by a processor, implements the steps in the above-mentioned method embodiments for parsing data.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not cause the essential features of the corresponding technical solutions to depart from the spirit scope of the technical solutions of the embodiments of the present application, and are intended to be included within the scope of the present application.

Claims (10)

1. A method of parsing data, comprising:
receiving a domain name resolution request sent by a terminal, wherein the domain name resolution request comprises a domain name to be resolved, and the domain name resolution request is used for requesting an Internet Protocol (IP) address corresponding to the domain name to be resolved;
determining position information corresponding to the terminal and operator information serving the terminal according to the domain name resolution request;
determining an address pool selection strategy and an address selection strategy according to the domain name to be analyzed, the position information and the operator information;
determining a target address pool in a plurality of preset address pools based on the address pool selection strategy;
and determining the IP address corresponding to the domain name to be resolved in the target address pool based on the address selection strategy.
2. The method of claim 1, wherein the address pool selection policy comprises any one of an address pool priority policy, an address pool weight policy, an address pool traversal policy, and an address pool intelligent scheduling policy.
3. The method of claim 1, wherein the address selection policy comprises any one of an address priority policy, an address weight policy, an address traversal policy, an address intelligent scheduling policy, and a load balancing policy.
4. The method according to any one of claims 1 to 3, wherein before determining the IP address corresponding to the domain name to be resolved in the target address pool based on the address selection policy, the method further comprises:
detecting whether the target address pool belongs to a fault address pool or not;
and if the detection result shows that the target address pool belongs to the fault address pool, rejecting the fault address pool, and determining a new target address pool in the remaining preset address pools based on the address pool selection strategy.
5. The method of claim 4, wherein the detecting whether the pool of target addresses belongs to a failed address pool comprises:
monitoring the health state of each IP address in the target address pool based on a preset monitoring method;
when the number of the IP addresses in the healthy state is smaller than a preset value, judging that the target address pool belongs to a fault address pool; or
And when the number of the IP addresses in the healthy state is monitored to be larger than or equal to the preset value, judging that the target address pool does not belong to a fault address pool.
6. The method of claim 1, wherein the determining, by the DNS server, an address pool selection policy and an address selection policy according to the domain name to be resolved, the location information, and the operator information comprises:
determining an address pool selection strategy matched with the domain name to be analyzed, the position information and the operator information from a plurality of preset address pool selection strategies;
and determining the address selection strategy associated with the matched address pool selection strategies.
7. An apparatus for parsing data, comprising:
the terminal comprises a receiving unit, a sending unit and a processing unit, wherein the receiving unit is used for receiving a domain name resolution request sent by the terminal, the domain name resolution request comprises a domain name to be resolved, and the domain name resolution request is used for requesting an Internet Protocol (IP) address corresponding to the domain name to be resolved;
a first determining unit, configured to determine, according to the domain name resolution request, location information corresponding to the terminal and operator information serving the terminal;
a second determining unit, configured to determine an address pool selection policy and an address selection policy according to the domain name to be resolved, the location information, and the operator information;
a third determining unit, configured to determine a target address pool in the multiple preset address pools based on the address pool selection policy;
and the fourth determining unit is used for determining the IP address corresponding to the domain name to be resolved in the target address pool based on the address selection strategy.
8. The apparatus of claim 7, wherein the apparatus further comprises:
the detection unit is used for detecting whether the target address pool belongs to a fault address pool or not;
and the eliminating unit is used for eliminating the fault address pool if the detection result shows that the target address pool belongs to the fault address pool, and determining a new target address pool in the rest preset address pools based on the address pool selection strategy.
9. An apparatus for parsing data, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 6.
CN202110387876.6A 2021-04-12 2021-04-12 Method, device, equipment and storage medium for analyzing data Active CN112954089B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110387876.6A CN112954089B (en) 2021-04-12 2021-04-12 Method, device, equipment and storage medium for analyzing data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110387876.6A CN112954089B (en) 2021-04-12 2021-04-12 Method, device, equipment and storage medium for analyzing data

Publications (2)

Publication Number Publication Date
CN112954089A true CN112954089A (en) 2021-06-11
CN112954089B CN112954089B (en) 2023-07-25

Family

ID=76231663

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110387876.6A Active CN112954089B (en) 2021-04-12 2021-04-12 Method, device, equipment and storage medium for analyzing data

Country Status (1)

Country Link
CN (1) CN112954089B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113395361A (en) * 2021-08-17 2021-09-14 苏州浪潮智能科技有限公司 Load balancing access domain name coordination method, system, terminal and storage medium
CN114244805A (en) * 2021-11-08 2022-03-25 网宿科技股份有限公司 Domain name configuration method and device
CN115297086A (en) * 2022-08-03 2022-11-04 明阳产业技术研究院(沈阳)有限公司 Domain name address resolution method, device, equipment and medium
WO2023041039A1 (en) * 2021-09-18 2023-03-23 上海云盾信息技术有限公司 Secure access control method, system and apparatus based on dns resolution, and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104519146A (en) * 2013-09-29 2015-04-15 中国电信股份有限公司 Method and system for domain name service based on user position
CN108040134A (en) * 2017-12-06 2018-05-15 杭州迪普科技股份有限公司 A kind of method and device of DNS Transparent Proxies
CN108270881A (en) * 2018-01-23 2018-07-10 杭州迪普科技股份有限公司 A kind of method and device of domain name mapping
CN109905496A (en) * 2019-02-26 2019-06-18 上海浪潮云计算服务有限公司 A kind of DNS intelligent dispatching method based on subscriber policy
US20190222553A1 (en) * 2016-11-17 2019-07-18 Tencent Technology (Shenzhen) Company Limited Method, device and system for service platform address resolution

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104519146A (en) * 2013-09-29 2015-04-15 中国电信股份有限公司 Method and system for domain name service based on user position
US20190222553A1 (en) * 2016-11-17 2019-07-18 Tencent Technology (Shenzhen) Company Limited Method, device and system for service platform address resolution
CN108040134A (en) * 2017-12-06 2018-05-15 杭州迪普科技股份有限公司 A kind of method and device of DNS Transparent Proxies
CN108270881A (en) * 2018-01-23 2018-07-10 杭州迪普科技股份有限公司 A kind of method and device of domain name mapping
CN109905496A (en) * 2019-02-26 2019-06-18 上海浪潮云计算服务有限公司 A kind of DNS intelligent dispatching method based on subscriber policy

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113395361A (en) * 2021-08-17 2021-09-14 苏州浪潮智能科技有限公司 Load balancing access domain name coordination method, system, terminal and storage medium
CN113395361B (en) * 2021-08-17 2021-11-05 苏州浪潮智能科技有限公司 Load balancing access domain name coordination method, system, terminal and storage medium
WO2023041039A1 (en) * 2021-09-18 2023-03-23 上海云盾信息技术有限公司 Secure access control method, system and apparatus based on dns resolution, and device
CN114244805A (en) * 2021-11-08 2022-03-25 网宿科技股份有限公司 Domain name configuration method and device
CN114244805B (en) * 2021-11-08 2023-10-03 网宿科技股份有限公司 Domain name configuration method and device
CN115297086A (en) * 2022-08-03 2022-11-04 明阳产业技术研究院(沈阳)有限公司 Domain name address resolution method, device, equipment and medium

Also Published As

Publication number Publication date
CN112954089B (en) 2023-07-25

Similar Documents

Publication Publication Date Title
CN112954089B (en) Method, device, equipment and storage medium for analyzing data
JP6626211B2 (en) Method and apparatus for processing short link and short link server
US8065417B1 (en) Service provider registration by a content broker
US10320628B2 (en) Confidence scoring of device reputation based on characteristic network behavior
CN101904135B (en) DNS wildcard beaconing to determine client location and resolver load for global traffic load balancing
CN107786621B (en) User information management method, access processing method, device and system
US20150271031A1 (en) Systems and methods for improving domain name system traffic routing
US20140280803A1 (en) Optimized Content Distribution Based on Metrics Derived from the End User
CN113366815B (en) Network resource request method, device, electronic equipment and storage medium
CN104158919A (en) Webpage access implementation method, server and client
CN109218457B (en) Network data processing method, device and system
CN110740191B (en) Resource access method, device, electronic equipment and storage medium
CN105337786A (en) Server performance detection method, apparatus and equipment
US8239532B1 (en) System and method of reducing latency using adaptive DNS resolution
CN111106983B (en) Method and device for detecting network connectivity
CN109756584B (en) Domain name resolution method, domain name resolution device and computer readable storage medium
US11372937B1 (en) Throttling client requests for web scraping
CN110769080B (en) Domain name resolution method, related product and computer readable storage medium
CN107395783A (en) A kind of IP address processing method, system, device and electronic equipment
US20170289243A1 (en) Domain name resolution method and electronic device
CN102904765A (en) Method and equipment for data reporting
CN107171889A (en) Network application interface test method and device and electronic equipment
CN110392069B (en) CDN service scheduling processing method and CDN server
CN110392123B (en) Method, device and system for detecting outlet IP address
CN103237089A (en) Method and device for repairing domain name system (DNS) polling mode-based webpages and server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231023

Address after: Room 301-2, No. 206 Kaibin Road, Xuhui District, Shanghai, 200000

Patentee after: Ping An Technology (Shanghai) Co.,Ltd.

Address before: 518000 Guangdong, Shenzhen, Futian District Futian street Fu'an community Yitian road 5033, Ping An financial center, 23 floor.

Patentee before: PING AN TECHNOLOGY (SHENZHEN) Co.,Ltd.