Global load balancing method for efficient query and intelligent scheduling

By employing a global load balancing method that combines efficient querying and intelligent scheduling, and utilizing DB storage modules and regional operator information matching, the problem of cross-operator access latency and hardware resource consumption in existing technologies is solved, achieving a high-efficiency querying and low-cost load balancing solution.

CN119011534AActive Publication Date: 2024-11-22CHINA TELECOM CLOUD TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410802167.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-12-12
Filing Date
2024-06-20
Publication Date
2024-11-22
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

Existing global load balancing technologies suffer from problems such as network latency when accessing networks across different carriers, low query efficiency, high hardware resource consumption, difficult deployment, and high operation and maintenance costs. In particular, they are difficult to effectively distribute access pressure during peak periods.

Method used

A global load balancing method with efficient querying and intelligent scheduling is adopted. By obtaining access policy configuration and DNS request messages, combined with open-source IPv4 address library files and custom files, IP query data packets are generated. The DB storage module is used for efficient querying, and matching and scheduling are performed based on regional operator information.

Benefits of technology

It enables location-based access, avoids cross-carrier network latency, improves query efficiency, reduces hardware resource consumption, lowers hardware costs and maintenance workload, and meets the needs of tens of millions of accesses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119011534A_ABST
    Figure CN119011534A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computer domain name resolution, and discloses a global load balancing method for efficient query and intelligent scheduling, which comprises the following steps of: acquiring access strategy configuration and issuing the access strategy configuration to global load balancing network element equipment, acquiring a DNS (Domain Name Server) request message and transmitting the DNS request message to a GSLB (Global Service Language Broadcasting) network element node for processing, generating service data and analyzing to obtain a request source I P and a request domain name; the method comprises the following steps: acquiring an open source I Pv4 address library file, processing based on the open source I Pv4 address library file to obtain a self-defined file, acquiring an operator data packet, and converting to generate an ip query data packet based on the open source I Pv4 address library file, the self-defined file and an operator data format; the root ip query data packet queries to obtain the regional operator information, that is, the nearby access based on the geographic position is satisfied, and the cross-operator network delay is also avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer domain name resolution, and more specifically, to a global load balancing method for efficient query and intelligent scheduling. Background Art

[0002] Global load balancing technology uses DNS to achieve local access to application services, realizes local access based on geographic location and access acceleration based on operators. There are two main types of traditional global load balancing technologies to implement intelligent scheduling strategies.

[0003] For example, authorization announcement number CN100456690C discloses a global load balancing method based on global network positioning, which is characterized in that the DNS server calculates the IP addresses of multiple servers closest to the Web client based on the GNP coordinates of the Web client in the DNS query message and the GNP coordinates of each mirror Web server with different IP addresses corresponding to the domain name to be resolved, and selects one IP address as the DNS query result to be returned.

[0004] Although it implements the nearby access function based on geographic location through GNP coordinates, there may be network delays in cross-operator access and concurrent query performance bottlenecks. In particular, query timeouts are prone to occur during business peak periods. More GSLB nodes can be deployed through horizontal expansion to share the access pressure, but it occupies more system resources and causes hardware equipment redundancy during off-peak periods. It also has negative impacts such as difficulty in deployment and high operation and maintenance costs.

[0005] Publication number CN103905534A discloses a global load balancing method based on operator city information, which specifically includes: creating an address list, including operators, cities and IP addresses; secondly matching the address list by source address to obtain matched city and operator information; finally matching the obtained city and operator information with the city and operator information pre-configured in each data center to obtain a matching result, and returning the matching result.

[0006] Although it solves the network delay of cross-operator access and has the function of nearby access based on geographic location, the query efficiency is low. For IP address segments, there is an IP address list with inclusion relationship, and multiple data are maintained, which is not only redundant but also reduces query efficiency. For example, 1.0.0.0-1.255.255.255 China; 1.1.1.0-1.1.1.255 China-Beijing-Chaoyang District; 1.1.2.0-1.1.2.255 China-Beijing-Tongzhou District, the first record of the above three records is redundant;

[0007] After obtaining the IP address of the geographic location, it is still necessary to query the operator's ownership separately. At least three queries are required to obtain the final accurate result, which greatly slows down the query speed and affects the performance indicators of the network element nodes. However, if more GSLB nodes are deployed through horizontal expansion to load-share the access pressure during peak hours, it will also lead to the occupation of more system resources and hardware equipment redundancy during off-peak hours. It also has negative effects such as deployment difficulties and high operation and maintenance costs. Summary of the invention

[0008] In order to overcome the above-mentioned defects of the prior art, the present invention provides a global load balancing method with efficient query and intelligent scheduling, including: obtaining access policy configuration and sending it to the global load balancing network element device, obtaining DNS request message and transmitting it to the GSLB network element node for processing, generating business data and parsing to obtain the request source IP and the request domain name, matching the request source IP and the request domain name according to the access policy to determine whether they are hit, if not, directly returning nxdomain, if hit, returning the corresponding request source IP according to the access policy configuration associated with the request domain name; obtaining an open source IPv4 address library file, marked as ip.txt, based on Process ip.txt to obtain a custom file, marked as global.txt, obtain the operator data packet, generate an ip query data packet based on the open source IPv4 address library file, the custom file and the operator data format conversion, marked as ip.cov; obtain the regional operator information according to the ip.cov query; parse the regional operator information to obtain the operator ID, country ID, province ID and city ID, and perform a match based on the associated access policy configuration to determine whether it is successful. If the match is successful, schedule the nearest access based on the operator ID, country ID, province ID and city ID. If the match is not successful, deny access.

[0009] Preferably, the access policy configuration includes policy priority, resolution request source, address pool and health detection information.

[0010] Preferably, the format of the open source address library stored in the open source IPv4 address library file is: start IP|end IP|country|useless field|province|city|operator.

[0011] Preferably, the processing method for obtaining a custom file based on ip.txt processing is: processing based on the open source address library in the open source IPv4 address library file, and the improved address library format stored in the custom file is: city ID, parent city ID, country or city name.

[0012] Preferably, the operator data packet support labels are: 0, 1, 2, ... 8 in sequence, where 0 indicates no support for the operator; 1 indicates the default value, representing all operators, that is, no distinction between operators; 2, 3, 4, ... 8 indicate different operators in sequence.

[0013] Preferably, the format of the final address library stored in the IP query data packet is: starting IP|ending IP|regional operator information.

[0014] A global load balancing system for efficient query and intelligent scheduling is used to implement the above-mentioned global load balancing method for efficient query and intelligent scheduling, including a DB storage module for storing ip.cov and serving efficient query. The DB storage module is divided into the following four layers of storage according to the file pointer from small to large:

[0015] The header information segment occupies a fixed 256-byte space and is used to record header information.

[0016] The vector index segment is the secondary index of the binary index segment and occupies the following space:

[0017] 256×256×8=524288Bytes=512KiB;

[0018] The regional data segment is used to write ip.cov, which corresponds to the regional operator information corresponding to the starting IP and ending IP of each row of data. The string is encoded in utf-8 (before writing, the pointer of the file at that time will be recorded and stored in the data pointer space of the binary index segment below. The regional operator information is divided into 16 characters, corresponding to 8 bytes of hexadecimal formatting. Four characters are taken in turn and converted into unsigned short type, corresponding to the operator ID, country ID, province ID and city ID respectively);

[0019] The binary index segment stores the pointer to the regional operator information and is used for split-half search. Each binary index item occupies 14 bytes.

[0020] Preferably, the first 16 bytes of the header information segment are used to record header information including version number, cache strategy, file generation time, index start address and index end address.

[0021] Preferably, the detailed fields and spatial distribution of the binary index segment are start IP 4 bytes, end IP 4 bytes, data length 2 bytes, and data pointer 4 bytes.

[0022] Preferably, the efficient query method based on the DB storage module comprises the steps of:

[0023] S1, parse the corresponding option subnet in the DNS protocol and obtain the request source IP;

[0024] S2, obtain the binary index segment from the vector index segment, and obtain the starting IP and ending IP of the regional binary index through the binary index segment;

[0025] S3, split the binary index into two halves to obtain the start IP and end IP based on S2, and use the split search between the region indexes to obtain the specific dataLen and dataPtr;

[0026] S4, based on the dataLen and dataPtr obtained in S3, read dataLen bytes from the dataPtr position to obtain the regional operator information.

[0027] The technical effects and advantages of the global load balancing method of efficient query and intelligent scheduling of the present invention are as follows:

[0028] 1. It not only satisfies the need for nearby access based on geographic location, but also avoids network delays across operators. At the same time, the DB storage module is used to meet efficient query requirements. The required operator ID, country ID, province ID, and city ID can be obtained in one search, greatly improving query efficiency.

[0029] 2. At the same time, it does not occupy system resources and saves hardware costs. A single resource pool only needs to deploy 4 GSLB network element devices to meet the access needs of tens of millions of people, reducing hardware resource costs, alleviating deployment workload, and reducing operation and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a schematic diagram of the invention process of the present invention;

[0031] Figure 2 The public network query traffic topology diagram of the global load balancing product of the present invention;

[0032] Figure 3 It is a flow topology diagram inside the resource pool of the global load balancing product of the present invention;

[0033] Figure 4 This is a complete traffic access and deployment model diagram of the global load balancing product of the present invention;

[0034] Figure 5 This is the overall system architecture diagram of the global load balancing product of the present invention;

[0035] Figure 6 A DB space storage structure diagram for efficient query of the global load balancing product of the present invention;

[0036] Figure 7 Efficiently query measured data graphs for the global load balancing product of the present invention;

[0037] Figure 8The present invention obtains a schematic logic diagram of the request source IP;

[0038] Fig. 9 A schematic logic diagram of the start IP and end IP of the regional binary index obtained by the present invention;

[0039] Fig.10 This is a schematic logic diagram of the half-search of the present invention;

[0040] Fig.11 This is a schematic logic diagram of obtaining regional operator information in the present invention. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] Embodiment 1:

[0043] See also Figure 6 As shown, the global load balancing system for efficient query and intelligent scheduling described in this embodiment includes a DB storage module, which serves efficient query. The DB storage module is divided into the following four layer segments for storage according to the file pointer from small to large: a header information segment, a vector index segment, a regional data segment, and a binary index segment;

[0044] Specifically, the header information segment mainly records some header information. This segment occupies a fixed 256-byte space. The specific space usage of the first 16 bytes is as follows: version number, cache strategy, file generation time, index start address and index end address;

[0045] The vector index segment is the secondary index of the binary index segment. It is essentially a 256×256 two-dimensional array, which is equivalent to splitting all IP data segments into 256×256 partitions according to the first two bytes of the IP. In this way, the number of subsequent binary search IO operations can be greatly reduced by using a fixed IO operation.

[0046] It is essentially a 256×256 two-dimensional array. The structure of each vector index item, that is, the structure of each cell of the 256×256 above, starts at the start position of the regional binary index and ends at the end position of the regional secondary index. That is, the vector index divides the entire binary index into 256×256 partitions, which is convenient for reducing the search range of the binary index more quickly, thereby speeding up the query. The space of each cell is fixed, so the space occupied by the entire vector index segment is: 256×256×8=524288Bytes=512KiB, which is fixed and has nothing to do with the number of rows of the original IP data.

[0047] The region information segment layer writes the converted file "ip.cov" corresponding to the region operator information after the start ip and end ip of each line of original data. The original data is the data recorded in the open source IPv4 address library file. The region operator information will be written in the original file. The string uses utf-8 encoding. The generation program will automatically remove duplicates. The same region operator information will only be written in one copy. Before writing, the pointer of the file at that time will be recorded and stored in the data pointer space of the binary index below; the currently designed region information is as follows: 0002000104d0052f is a 16-character string; the interpretation field means that 0002 is the operator (telecom), 0001 is the country ID (China), 04d0 is the province ID (Anhui Province), and 052f is the city ID (Lu'an City);

[0048] The binary index segment is the core of the query. The core of the search process is to perform a split search in the binary index. Each binary index item occupies 14 bytes, with detailed fields and spatial distribution, starting IP 4 bytes, ending IP 4 bytes, data length 2 bytes, and data pointer 4 bytes.

[0049] Furthermore, the efficient query method based on the DB storage module includes the following steps:

[0050] S1, parse the corresponding option subnet in the DNS protocol and obtain the request source IP. For the schematic logic code, refer to Figure 8 , convert the network sequence request source IP into host sequence through the following code, client_subnet = ntohl (request->client_subnet.in.sin_addr.s_addr);

[0051] S2, obtain the binary index segment from the vector index segment, and obtain the starting IP and ending IP of the regional binary index through the binary index segment. For the schematic logic, refer to Fig. 9Each searcher binding has an API to load vectorIndex, which is essentially a one-dimensional byte array. Then, the first two bytes of the IP address are used to quickly get the start and end addresses of the binary index of this partition in vectorIndex. This is also the core of vector indexing. The binary index is divided into 256×256 partitions in one search, which greatly reduces the scanning range of subsequent binary searches, thereby reducing the number of IO operations at runtime and speeding up the query process.

[0052] S3, split the search in the binary index. After obtaining the start IP and end IP based on S2, you can use the split search between the regional indexes to obtain specific information that can locate regional data. For the schematic logic of the split search, see Fig.10 ,After the above search process, the specific dataLen and dataPtr are obtained, that is, the data block is located and the data in it is read, which includes the regional operator information;

[0053] S4, based on the dataLen and dataPtr obtained in S3, read dataLen bytes from the dataPtr position to obtain the regional operator information. For the schematic logic, refer to Fig.11 .

[0054] Embodiment 2:

[0055] See also Figure 1-Figure 6 As shown, based on Example 1, a global load balancing method for efficient query and intelligent scheduling described in this embodiment is implemented based on a global load balancing system for efficient query and intelligent scheduling. The specific steps of the efficient query and intelligent scheduling method include access strategy, address conversion, efficient query and intelligent scheduling in sequence. The latter steps depend on the former steps, and the former steps serve the latter steps.

[0056] Specifically, for access policy, cloud platform users purchase global load balancing product services and complete access policy configuration through cloud management and north-south control plane operations, including policy priority, resolution request source, address pool, and health detection information, which are simultaneously sent to the global load balancing network element device; when public network users access the global load balancing service through DNS request messages, they are routed through the public network and ultimately transmitted to the cloud environment to reach the GSLB network element node, i.e., the global load balancing network element node; the application layer parses the DNS message, obtains the request source IP and the request domain name, searches for the user-configured cname domain name, and directly returns nxdomain if it is not matched; if the domain name is matched, the resolution request source and the primary and backup address pool information are found according to the access policy associated with the domain name, and the IP is intelligently returned.

[0057] Address conversion, obtain the open source IPv4 address library file, marked as ip.txt, the open source IPv4 address library file can be purchased, the open source IPv4 address library file is in txt format, the open source IPv4 address library is recorded in the open source IPv4 address library file, the record file format is (starting IP|ending IP|country|useless field|province|city|operator), covering all IPv4 network segments in the world and China's precise address list, containing a total of 683591 rows of data, see Table 1 for details;

[0058] Start IP|End IP|Country|Useless fields|Province|City|Carrier

[0059] 1.0.0.0|1.0.0.255|Australia|0|0|0|0

[0060] 1.0.1.0|1.0.3.255|China|0|Fujian|Fuzhou|Telecom

[0061] 1.0.4.0|1.0.7.255|Australia|0|Victoria|Melbourne|0

[0062] 1.0.8.0|1.0.15.255|China|0|Guangdong Province|Guangzhou City|Telecom

[0063] 1.0.16.0|1.0.31.255|Japan|0|0|0|0

[0064] 1.0.32.0|1.0.63.255|China|0|Guangdong Province|Guangzhou City|Telecom

[0065] 1.0.64.0|1.0.79.255|Japan|0|Hiroshima Prefecture|0|0

[0066] …

[0067] 223.242.0.0|223.242.31.255|China|0|Anhui Province|Lu'an City|Telecom

[0068] 223.242.32.0|223.242.47.255|China|0|Anhui Province|Wuhu City|Telecom

[0069] 223.242.48.0|223.242.63.255|China|0|Anhui Province|Anqing City|Telecom

[0070] 223.242.64.0|223.242.159.255|China|0|Anhui Province|Bengbu City|Telecom

[0071] 223.242.160.0|223.242.191.255|China|0|Anhui Province|Fuyang City|Telecom

[0072] 223.242.192.0|223.242.223.255|China|0|Anhui Province|Huaibei City|Telecom

[0073] 223.242.224.0|223.242.255.255|China|0|Anhui Province|Huainan City|Telecom

[0074] Table 1

[0075] More specifically, in order to query efficiently and achieve ultra-high performance QPS, the open source address library must be processed twice. In order to query the country ID, province ID, city ID and operator ID more conveniently and efficiently, a custom file is obtained by secondary processing based on the open source lPv4 address library file, marked as global.txt, and the file format is (city ID, parent city ID, country or city name, depth, useless fields), covering all countries in the world and all provinces and cities in China, and containing a total of 3462 rows of data. For details, see Table 2;

[0076] City ID, parent city ID, country or city name, depth, useless fields

[0077] 1,0,China,1,0

[0078] 2,0,Mongolia,1,0

[0079] 3,0,North Korea,1,0

[0080] 4,0,South Korea,1,0

[0081] 5,0,Japan,1,0

[0082] 6,0,Philippines,1,0

[0083] 7,0,Vietnam,1,0

[0084] 8,0,Laos,1,0

[0085] 9,0,Cambodia,1,0

[0086] 10,0,Myanmar,1,0

[0087] 2469,1,Sichuan Province,2,0

[0088] 2470, 2469, Chengdu, 3, 610000

[0089] 2471,2470,Jinjiang District,4,0

[0090] 2472,2470,Qingyang District,4,0

[0091] 2473,2470,Jinniu District,4,0

[0092] 2474,2470,Wuhou District,4,0

[0093] 2475,2470,Chenghua District,4,0

[0094] 2476,2470,Longquanyi District,4,0

[0095] Table 2

[0096] Further, the operator data packet is obtained. The operator data packet of this embodiment is based on the digital processing of some operators in the world. The operator data packet supports numbers: 0, 1, 2, ... 8 in sequence, where 0 indicates that the operator is not supported; 1 indicates the default value, representing all operators, that is, not distinguishing operators; 2, 3, 4, ... 8 represent different operators in sequence, such as 0 (operator is not supported), 1 (all) is the default value, representing all operators, that is, not distinguishing operators, 2 (cu) and telecom, 3 (ct) is Unicom, 4 (cmcc) is mobile, 5 (pbs) is Dr. Peng, 6 (gdw) is radio and television network, 7 (edu) is education network, and 8 (tt) is Tietong network;

[0097] It should be noted that when an unsupported operator is used, 0 is used by default. At the same time, the storage design uses 2 bytes to store operators, and the maximum value is 2 to the 16th power. The space value is large enough to meet the digital storage of enough operators.

[0098] Furthermore, based on the information recorded in ip.txt, global.txt and the operator data packet, the format conversion is performed to obtain the IP query data packet, which is marked as ip.cov. The converted file format is (starting IP|ending IP|regional operator information). The regional operator information corresponding to the memory mapping is divided into 16 characters, that is, corresponding to 8 bytes of hexadecimal formatting. Four characters are taken in turn and converted into unsigned short types, which correspond to the operator ID, country ID, province ID and city ID respectively, so as to facilitate efficient query after storage and achieve ultra-high performance QPS. Each dimension is 2 bytes, and the maximum value of 2 to the 16th power is convenient for subsequent expansion, supports more operators, and refines the geographical location to cities, counties and towns for precise positioning. For details, please refer to Table 3;

[0099] Starting IP|Ending IP|Regional operator information

[0100] 1.0.0.0|1.0.0.255|0000008d00000000

[0101] 1.0.1.0|1.0.3.255|000200010549054a

[0102] 1.0.4.0|1.0.7.255|0000008d00000000

[0103] 1.0.8.0|1.0.15.255|00020001085b085c

[0104] 1.0.16.0|1.0.31.255|0000000500000000

[0105] 1.0.32.0|1.0.63.255|00020001085b085c

[0106] 1.0.64.0|1.0.79.255|0000000500000000

[0107] ……

[0108] 223.242.0.0|223.242.31.255|0002000104d0052f

[0109] 223.242.32.0|223.242.47.255|0002000104d004d9

[0110] 223.242.48.0|223.242.63.255|0002000104d004fe

[0111] 223.242.64.0|223.242.159.255|0002000104d004e1

[0112] 223.242.160.0|223.242.191.255|0002000104d0051a

[0113] 223.242.192.0|223.242.223.255|0002000104d004f5

[0114] 223.242.224.0|223.242.255.255|0002000104d004e9

[0115] 223.243.0.0|223.243.31.255|0002000104d00537

[0116] 223.243.32.0|223.243.63.255|0002000104d00541

[0117] 223.243.64.0|223.243.127.255|0002000104d0052f

[0118] Table 3

[0119] Efficient query: Based on the DB storage module and the internally stored ip.ocv, efficient query is implemented to obtain regional operator information;

[0120] Intelligent scheduling: Based on the regional operator information obtained through efficient query, the operator ID, country ID, province ID and city ID are obtained by parsing according to the format in the address conversion section. Then, the matching is performed according to the resolution request source associated with the access policy configured by the customer. If the match is successful, it is considered that the resolution request source is hit, and the healthy IP information of the address pool associated with the same access policy is returned to realize intelligent scheduling of nearby access. If the match is not successful, the access is denied.

[0121] It is worth mentioning that the command executed if the match is not successful is executed according to the actual configuration of the user. The present embodiment provides access denial. According to the access policy configuration, the default access policy can also be returned. That is, if a specific access policy is not successfully matched, a default access policy can be returned. The policy can be the default processing logic for the unmatched case. For example, a default request source IP can be returned or redirected to a specific server, or the request can be forwarded. If a specific access policy is not successfully matched, but the request is still to be processed, the request can be forwarded to other servers or services for processing, as well as logs and analysis. In the case of an unsuccessful match, relevant log information can be recorded for subsequent analysis and adjustment of the access policy configuration. The specific decision will be made by those skilled in the art according to actual needs.

[0122] Example 3

[0123] See also Figure 2-Figure 7 As shown, based on Example 1 and Example 2, the self-test performance of this embodiment is at the microsecond level for a single query, the standard deployment of a physical machine single node limit is 8 million QPS, and the virtual machine deployment of 2 cores and 8G memory limit is 10WQPS. A single resource pool only needs to deploy 4 GSLB network element devices to meet the access needs of tens of millions, reducing hardware resource costs, reducing deployment workload, and reducing operation and maintenance costs;

[0124] like Figure 2As shown in the figure, the user accesses the business domain name through localDNS to obtain the cname domain name app123.gslb.ctyun.cn; the user accesses ctyun.cn through localDNS to obtain the NS record and gslb.ctyun.cnA record IP; accesses the GSLB authoritative node Region1orRegion2 according to the returned IP address; within the Region, the optimal A record is returned according to the GSLB's efficient query and intelligent resolution strategy.

[0125] like Figure 3 As shown in the figure, users access the resource pool through the blue line access traffic. The ECMP equivalent routing established by BGP inside the resource pool further accesses the GSLB network element node to obtain a healthy A record IP. Then the healthy IP address detects the health status of the real server in real time through the red line traffic to achieve the effect of intelligent resolution.

[0126] like Figure 4 As shown in the figure, the business domain name www.myappname.com is accessed; LocalDNS queries the business authoritative DNS; the business authoritative DNS returns the CNAME domain name app12345678.gslb.ctyun.cn; the GSLB network element node is accessed to efficiently query the regional operator information; GSLB returns the optimal record set based on intelligent resolution and health detection information; LocalDNS returns the result to the end user; the end user initiates access to the target business address based on the returned resolution address.

[0127] like Figure 5 As shown, the bottom layer of this embodiment adopts DPDK to send and receive messages to ensure performance. Before sending to the protocol stack, the east-west traffic and north-south traffic will be diverted according to the port information, that is, DNS is sent to the freeBSD protocol stack, and BGP protocol and http protocol are sent to the Linux protocol stack; the freeBSD protocol stack will process the network layer and transport layer information of the DNS message; the Agent process's addition, deletion and modification services directly modify the configuration information and save it to the disk, and then notify the DNS process of the changed configuration to achieve configuration change loading.

[0128] like Figure 6As shown in the figure, the spatial structure and hierarchical relationship of the DB storage module are as follows: from low address to high address in the memory space, they are header information segment, vector index segment, regional data segment, binary index segment. The fixed length of the header information segment mainly stores the version number and the index start address and end address, etc. The vector index segment mainly maps the first two bytes of the IP address to a two-dimensional array. A single query can locate the address of the binary index segment, i.e., the last two bytes of the IP address, so as to improve the query efficiency and provide ultra-high performance QPS. The regional data segment mainly stores the converted regional operator information segment, each of which is 16 bytes long. The characters are mapped to 8 bytes of hexadecimal. The equal-length design is also for memory alignment and efficient movement of read offsets, and sufficient space is reserved for expansion. For example, 2 bytes of operators support 2 to the power of 16 operators. Currently, only 7 operators are used to facilitate subsequent expansion. Sufficient space length is reserved for national ID, province ID, and city ID for subsequent expansion. The binary index segment mainly stores the last two bytes of the IP address, and the corresponding memory and byte integer sizes are sorted in order of size, with small values ​​in front and large values ​​in the back, so as to facilitate binary search and provide query efficiency. Each data block size is 14 bytes, the data length occupies two bytes and the value is 16; the data pointer executes the regional information, providing many-to-one mapping, that is, the same regional information can have multiple IP address segments. This scenario greatly saves memory space and query efficiency.

[0129] like Figure 7 As shown, this embodiment provides measured data, and the measured data is as follows: a single query takes 13 microseconds, 3417955 queries take 4.231 seconds, and the average single query is 1.238 microseconds; standard deployment of GSLB network elements: a single-node stable value of 500WQPS, and cluster deployment can easily reach 3000WQPS. It meets the pressure-resistant access requirements of the public cloud and greatly saves hardware costs; lightweight deployment of GSLB network elements: 2 cores, 8G memory, 5WQPS; Normal specification equipment 16 cores, 64G memory, easily reaching 40WQPS, which meets the deployment scenarios of private clouds and saves hardware costs.

[0130] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0131] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A global load balancing method with efficient query and intelligent scheduling, characterized in that: include: Obtain access policy configuration and send it to the global load balancing network element device, obtain DNS request message and transmit it to the GSLB network element node for processing, generate business data and parse to obtain the request source IP and request domain name, match the request source IP and request domain name according to the access policy to determine whether they are hit, if not, directly return nxdomain, if hit, return the corresponding request source IP according to the access policy configuration associated with the request domain name; Get the open source IPv4 address library file, marked as ip.txt, obtain the custom file based on ip.txt, marked as global.txt, get the operator data packet, generate the IP query data packet based on the open source IPv4 address library file, the custom file and the operator data format conversion, marked as ip.cov; Obtain regional operator information through ip.cov query; The operator ID, country ID, province ID and city ID are obtained by parsing the regional operator information. A match is performed based on the associated access policy configuration to determine whether it is successful. If the match is successful, the nearest access is scheduled based on the operator ID, country ID, province ID and city ID. If the match is not successful, access is denied.

2. A global load balancing method for efficient query and intelligent scheduling according to claim 1, characterized in that: The access policy configuration includes policy priority, resolution request source, address pool, and health detection information.

3. A global load balancing method for efficient query and intelligent scheduling according to claim 1, characterized in that: The format of the open source address library stored in the open source IPv4 address library file is: start IP|end IP|country|useless field|province|city|operator.

4. A global load balancing method for efficient query and intelligent scheduling according to claim 3, characterized in that: The processing method for obtaining a custom file based on ip.txt is: The processing is performed based on the open source address library in the open source IPv4 address library file, and the improved address library format stored in the custom file is: city ID, parent city ID, country or city name.

5. A global load balancing method for efficient query and intelligent scheduling according to claim 4, characterized in that: The operator data packet support labels are: 0, 1, 2, ... 8 in sequence, where 0 means no operator is supported; 1 means the default value, representing all operators, that is, no distinction between operators; 2, 3, 4, ... 8 represent different operators in sequence.

6. A global load balancing method for efficient query and intelligent scheduling according to claim 5, characterized in that: The format of the final address library stored in the IP query data packet is: starting IP|ending IP|regional operator information.

7. A global load balancing system for efficient query and intelligent scheduling, used to implement a global load balancing method for efficient query and intelligent scheduling as described in any one of claims 1 to 6, characterized in that: It includes a DB storage module for storing ip.cov and serving efficient query. The DB storage module is divided into the following four layers of storage according to the file pointer from small to large: The header information segment occupies a fixed 256-byte space and is used to record header information; The vector index segment is the secondary index of the binary index segment and occupies the following space: 256×256×8=524288Bytes=512KiB; The regional data segment is used to write ip.cov. It corresponds to the regional operator information corresponding to the starting IP and ending IP of each row of data. The string is encoded in utf-8. Before writing ip.cov, the file pointer at that time will be recorded and stored in the data pointer space of the binary index segment below. The regional operator information is divided into 16 characters, corresponding to 8 bytes of hexadecimal format. Four characters are taken in turn and converted into unsigned short type, corresponding to the operator ID, country ID, province ID and city ID respectively; The binary index segment stores the pointer to the regional operator information and is used for split-half search. Each binary index item occupies 14 bytes.

8. A global load balancing system for efficient query and intelligent scheduling according to claim 7, characterized in that: The first 16 bytes of the header information segment are used to record header information including version number, cache strategy, file generation time, index start address and index end address.

9. The global load balancing system with efficient query and intelligent scheduling according to claim 7, characterized in that: The detailed fields and spatial distribution of the binary index segment are: start IP 4 bytes, end IP 4 bytes, data length 2 bytes, data pointer 4 bytes.

10. The global load balancing system with efficient query and intelligent scheduling according to claim 7, characterized in that: The efficient query method based on the DB storage module comprises the following steps: S1, parse the corresponding option subnet in the DNS protocol and obtain the request source IP; S2, obtain the binary index segment from the vector index segment, and obtain the starting IP and ending IP of the regional binary index through the binary index segment; S3, split the binary index into two halves to obtain the start IP and end IP based on S2, and use the split search between the region indexes to obtain the specific dataLen and dataPtr; S4, based on the dataLen and dataPtr obtained in S3, read dataLen bytes from the dataPtr position to obtain the regional operator information.

Citation Information

Patent Citations

  • Global load balancing method and device based on operator city information

    CN103905534A

  • Domain name parsing method, domain name server, domain name access method, system and terminal

    CN104253873A

  • File-based regional information query method and file generation method

    CN112307138A

  • Server load balancing scheduling method and device based on operator

    CN114828097A

  • Efficient big data storage file structure and data storage method

    CN116737666A