Communication method and system, load balancing server and storage medium
By introducing a custom domain name server into the domain name system and generating and parsing the first subdomain name from the load balancing server, the problems of poor load balancing effect and high operation and maintenance costs in the existing technology are solved, and more efficient load balancing and reducing operation and maintenance costs are achieved.
Patent Information
- Application Number
- CN202311662911.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-06
- Publication Date
- 2025-06-06
AI Technical Summary
In the prior art, the load balancing server and DNS jointly complete the scheduling task, resulting in poor scheduling effect. When the server is expanded and scaled, it is necessary to promptly notify the DNS to update the database and delete the DNS cache, which increases the operation and maintenance costs.
A custom domain name server is introduced into the domain name system. The load balancing server generates the first subdomain name based on the service network address of the target server, and the custom domain name server resolves it to the service network address of the target server. The load balancing server is fully responsible for the scheduling tasks.
Improve load balancing effect, avoid multi-head management problems, reduce operation and maintenance costs, and the parsing results are consistent with the load balancer scheduling results, and there is no need to notify DNS for server scaling to update the database or update the DNS cache.
Smart Images

Figure CN120111047A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a communication method, system, load balancing server and storage medium. Background Art
[0002] Web applications can be understood as software that runs in a web client (such as a web browser). Through web applications, users can conveniently and securely use the functions or services provided by the web application. Currently, the most common website functions such as shopping carts, product search and filtering, instant messaging and social media news feeds are designed as web applications, allowing users to access related functions without installing or configuring software.
[0003] Currently, in order to ensure access security, browsers require all web applications to use domain names to access services, which makes domain name resolution an inevitable part of the service.
[0004] In the prior art, in order to ensure the service quality and service reliability of web services, many web services are designed as distributed service architectures. In the distributed service architecture, load balancing scheduling technology is the core. In the existing scheduling scheme, the Global Server Load Balance (GSLB) server makes a coarse-grained scheduling to specify a certain area, and then the DNS (Domain Name System) makes a fine-grained scheduling to specify a specific server cluster. In other words, the entire scheduling task is completed by both GSLB and DNS. The solution is relatively complicated to implement, and the scheduling at both ends leads to poor load balancing effect. Summary of the invention
[0005] In view of the above problems, the present application is proposed to provide a communication method, system, load balancing server and storage medium that solve the above problems or at least partially solve the above problems.
[0006] Therefore, in one embodiment of the present application, a communication method is provided, which is applied to a load balancing server. The method includes:
[0007] receiving a resource allocation request from a client for a target network service;
[0008] Allocating a target server to the client from a plurality of servers capable of providing the target network service;
[0009] According to the service network address of the target server and the first domain name of the target network service, a first subdomain name under the first domain name is generated; the first subdomain name is used to obtain the service network address of the target server through domain name system resolution; the domain name system includes a first domain name server and a custom domain name server; the first domain name server stores a domain name server record; the domain name server record is used to indicate that the subdomain name under the first domain name is resolved by the custom domain name server; the custom domain name server is used to resolve the host name in the first subdomain name into the service network address of the target server;
[0010] The first subdomain name is sent to the client, so that the client accesses the target server according to the first subdomain name.
[0011] In another embodiment of the present application, a domain name system is provided, including: a first domain name server and a custom domain name server; the first domain name server stores a domain name server record; the domain name server record is used to indicate that a subdomain under a first domain name is resolved by the custom domain name server; the first domain name is a domain name of a target network service;
[0012] The custom domain name server is used to: receive a domain name resolution request from a client for a first subdomain under the first domain name; resolve the host name in the first subdomain into a service network address of a target server; wherein the first subdomain is provided by a load balancing server; the first subdomain is generated by the load balancing server according to the service network address of the target server and the first domain name; the target server is allocated to the client from a plurality of servers that can provide the target network service after the load balancing server receives a resource allocation request from the client for the target network service.
[0013] In another embodiment of the present application, an electronic device is provided. The electronic device includes: a memory and a processor, wherein:
[0014] The memory is used to store programs;
[0015] The processor is coupled to the memory, and is used to execute the program stored in the memory to implement any of the methods described above.
[0016] In yet another embodiment of the present application, a computer-readable storage medium storing a computer program is provided, and when the computer program is executed by a computer, any of the above-mentioned methods can be implemented.
[0017] In the technical solution provided by the embodiment of the present application, the load balancing server schedules a specific target server for providing the target network service for the client; the load balancing server sets the subdomain of the first domain name of the target network service according to the service network address of the target server to obtain the first subdomain name under the first domain name, and returns it to the client. This solution also adds a custom domain name server for resolving the last-level domain name (that is, the first subdomain name under the first domain name) in the domain name system, and the custom domain name server is used to resolve the first subdomain name into the service network address of the target server. In this way, when the client receives the first subdomain name returned by the load balancing server and requests the domain name system to perform domain name resolution on the first subdomain name, the domain name system can resolve the first subdomain name into the service network address of the target server. It can be seen that the technical solution provided by the embodiment of the present application, in the scheduling scheme involving the domain name resolution link, realizes that the scheduling task is fully responsible by the load balancing server, thereby improving the load balancing effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 A schematic diagram of a communication architecture provided for an embodiment of the present application;
[0020] Figure 2 A flow chart of a communication method provided in one embodiment of the present application;
[0021] Figure 3 A structural block diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below according to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0023] In addition, some of the processes described in the specification, claims and the above-mentioned figures of the present application include multiple operations that appear in a specific order, and these operations may not be executed in the order in which they appear in this article or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.
[0024] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0025] First, the vocabulary involved in the embodiments of the present application is explained. It can be understood that this explanation is for a clearer understanding of the embodiments of the present application, and does not necessarily constitute a limitation on the embodiments of the present application.
[0026] Domain name: A domain name is a string of characters separated by dots, which is used to identify the electronic location of a computer on the Internet during data transmission. A domain name can be said to be a synonym for an IP address, which is used to facilitate the memory of the latter. Currently, the length limit for each level of domain name is 63 characters, and the total length of the domain name cannot exceed 253 characters.
[0027] DNS is an Internet service that acts as a distributed database that maps domain names and IP addresses to each other, making it easier for people to access the Internet. DNS uses TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) ports.
[0028] GSLB is a method of distributing Internet traffic among a large number of networked servers distributed around the world. GSLB has benefits such as increased reliability and reduced latency.
[0029] URL (Uniform Resource Locator) represents the address of a given unique resource on the Web. In theory, each valid URL points to a unique resource.
[0030] Native applications are generally based on operating systems, have strong interactions, are complete apps, are highly extensible, and require users to download, install, and use them. In simple terms, native applications are developed specifically for a certain operating system, such as iOS, Android, etc., and they run on their respective terminal devices.
[0031] In the prior art, the load balancing server and DNS jointly complete the scheduling task. The load balancing server can only perform coarse-grained scheduling and cannot accurately schedule the specific server that provides the target network service to the client, resulting in poor load balancing effect; and, when the server that provides the target network service is expanded or reduced, it is necessary to promptly notify the DNS to update the database and delete the DNS cache. It can be seen that the prior art still has the problem of high operation and maintenance costs. In addition, a system has both GSLB scheduling and DNS scheduling, and the division of labor is unclear, which increases the difficulty of design. In addition, there is a conflict between the two. For example, GSLB allocates resources on a certain server IP address, but DNS returns a different IP address, resulting in the resources allocated by GSLB not being used.
[0032] In order to solve or partially solve the above technical problems, the embodiment of the present application provides a new communication method. Before introducing the communication method provided by the embodiment of the present application, the communication architecture involved in the communication method provided by the embodiment of the present application is introduced. Figure 1 As shown, the communication architecture includes: a client 1, a load balancing server 2 and a domain name system 100; the domain name system 100 includes: a first domain name server 6 and a custom domain name server 7. Among them, the client 1 can be a web client, for example: a web browser. Generally, the domain name system 100 can also include: a local domain name server 3, a root domain name server 4 and a first-level domain name server 5. In the embodiment of the present application, the domain name system may include more or fewer domain name servers, and the embodiment of the present application does not specifically limit this. Among them, the load balancing server 2 can specifically be a GSLB server.
[0033] like Figure 2 As shown, the load balancing server 2 is used for:
[0034] 201. Receive a resource allocation request from a client for a target network service.
[0035] 202. Allocate a target server for the client from a plurality of servers that can provide the target network service.
[0036] 203. Generate a first subdomain under the first domain name according to the service network address of the target server and the first domain name of the target network service.
[0037] 204. Send the first subdomain name to the client, so that the client accesses the target server according to the first subdomain name.
[0038] like Figure 1 As shown, the domain name system 100 includes: a first domain name server 6 and a custom domain name server 7; the first domain name server 6 stores a domain name server record; the domain name server record is used to indicate that the subdomain under the first domain name is resolved by the custom domain name server 7;
[0039] The custom domain name server 7 is used to: receive a domain name resolution request for a first subdomain name from the client 1; and resolve the host name in the first subdomain name into a service network address of a target server.
[0040] It should be noted that the domain name system 100 can use an iterative resolution method or a recursive resolution method to complete the domain name resolution, which is not specifically limited in the present embodiment. For the convenience of introduction, the domain name resolution process will be introduced in the iterative resolution method below.
[0041] In the technical solution provided by the embodiment of the present application, the load balancing server schedules a specific target server for providing the target network service for the client; the load balancing server sets the subdomain of the first domain name of the target network service according to the service network address of the target server to obtain the first subdomain name under the first domain name, and returns it to the client. This solution also adds a custom domain name server (also referred to as the terminal domain name server) for resolving the last-level domain name (that is, the first subdomain name under the first domain name) in the domain name system. The custom domain name server is used to resolve the first subdomain name into the service network address of the target server. In this way, when the client receives the first subdomain name returned by the load balancing server and requests the domain name system to perform domain name resolution on the first subdomain name, the domain name system can resolve the first subdomain name into the service network address of the target server. It can be seen that the technical solution provided by the embodiment of the present application, in the scheduling scheme involving the domain name resolution link, realizes that the scheduling task is fully responsible by the load balancing server, which can improve the load balancing effect.
[0042] like Figure 1 As shown, the interaction process involved in the communication architecture includes the following steps:
[0043] 10. When client 1 needs to access the target network service, client 1 sends a resource allocation request for the target network service to load balancing server 2.
[0044] The resource allocation request may carry client information, related fields for indicating the target network service, etc. The client information may include but is not limited to: the service network address of the client, the operating system version information, the browser information, and the user ID number. Taking the target network service as a video conference as an example, the related field for indicating the video conference may be: access meeting room. In this way, the subsequent load balancing server 2 can determine which network service the client needs to access based on the related resources.
[0045] Taking the target network service as a video conference as an example, the client information may also include: the conference number to be joined. The conference number and the user ID number may be provided by the video conference server (not shown) to the client 1 .
[0046] The target network service may be any network service, and the present application embodiment does not specifically limit this. In one example, the target network service may include: a real-time video service or a real-time audio service.
[0047] The resource allocation request may specifically be a URL request.
[0048] The client can send a resource allocation request for the target network service to the load balancing server 2 in response to the user's access operation to the target network service (for example: an access operation triggered by an access control on the terminal interface corresponding to the target network service or a search operation for the first domain name of the target network service entered in the browser search box).
[0049] 11. Load balancing server 2 allocates a target server to the client from multiple servers that can provide target network services.
[0050] In an optional embodiment, a target server may be allocated to the client from a plurality of servers that can provide the target network service based on the client information of the client. Specifically, a target server may be allocated to the client from a plurality of servers that can provide the target network service according to a preset load balancing strategy based on the client information of the client. The preset load balancing strategy is related to the client access speed, cost, server load, etc., and may be formulated according to actual needs.
[0051] Among them, multiple servers that can provide target network services include but are not limited to Figure 1Server 8 (IP: 11.22.33.44) and Server 9 (IP: 55.66.77.88) in the example. Each server can be a real server or a service cluster (the service cluster includes multiple working nodes). For example, the target server is Figure 1 Server 8 (IP: 11.22.33.44) in the embodiment of the present application should be noted that the IP address provided in the embodiment of the present application is written for the convenience of introduction and is not a real IP address.
[0052] 12. The load balancing server 2 generates a first subdomain name under the first domain name according to the service network address of the target server and the first domain name of the target network service.
[0053] The first subdomain under the first domain name can be generated by using the following method 1 or method 2:
[0054] Method 1: Based on the preset transformation rule, the service network address of the target server is transformed into a character string; the character string is added as the host name to the first domain name to generate the first subdomain name of the first domain name. The preset transformation rule can be designed according to actual needs, and the embodiment of the present application does not specifically limit this. For example: the preset transformation rule is to delete the "." character in the IP address.
[0055] For example, the target server is Figure 1 For server 8 (IP: 11.22.33.44), the first domain name is app.company.com, then the first subdomain name is 11223344.app.company.com.
[0056] In this way, the subsequent custom domain name server can also transform the host name in the first subdomain name into the service network address of the target server based on the preset transformation rule. In other words, the custom domain name server does not need to query the database when resolving the domain name, and the performance is improved.
[0057] Method 2: Create the host name of each server that can provide the target network service in advance; create a first correspondence between the host name of each server that can provide the target network service and its service network address; store the first correspondence on the load balancing server 2 and the custom domain name server 7 respectively. Subsequently, the load balancing server 2 queries the first correspondence based on the service network address of the target server to determine the host name of the target server; add the host name of the target server to the subdomain of the first domain name to obtain the first subdomain name under the first domain name. When resolving, the custom domain name server 7 searches for the first correspondence based on the host name in the first subdomain name to obtain the service network address of the target server.
[0058] It should be noted that the first domain name and the first subdomain name in the embodiment of the present application are both fully qualified domain names (Fully Qualified Domain Name, FQDN). In addition to the host name, the fully qualified domain name also includes the domain name where the host name is located. For the first domain name app.company.com, app is the host name and company.com is the domain name to which the host name belongs. For the first subdomain name 11223344.app.company.com, 11223344 is the host name and app.company.com is the domain name to which the host name belongs.
[0059] 13. Load balancing server 2 returns the first subdomain name to client 1.
[0060] 14. Client 1 sends a domain name resolution request for the first subdomain name to the local domain name server 3.
[0061] Specifically, the client 1 may first initiate a first URL request for the first subdomain name. For example, the URL carried in the first URL request is: https: / / 11223344.app.company.com. Among them, https (Hyper Text Transfer Protocol over Secure Socket Layer) is the transmission protocol; 11223344.app.company.com is the first subdomain name; app.company.com is the first domain name. Then, the client initiates a domain name resolution request for the first subdomain name carried in the URL request, that is, executes the following step 15.
[0062] 15. The local domain name server 3 sends a domain name resolution request for the first subdomain name to the root domain name server 4.
[0063] It should be noted that the local domain name server 3 is specifically used to: search for cached data based on the first subdomain name; when the service network address corresponding to the first subdomain name (that is, the service network address of the target server) is found in the cached data, send the service network address corresponding to the first subdomain name cached in the cached data to the client 1; when the service network address corresponding to the first subdomain name is not found in the cached data, execute the above step 15.
[0064] 16. The root domain name server 4 returns the address of the primary domain name server 5 to the local domain name server 3.
[0065] The address of the primary domain name server can be a service network address or a domain name of the primary domain name server. It should be noted that the domain name of the primary domain name server can obtain the service network address of the primary domain name server through domain name resolution. The specific resolution process can be referred to in the prior art and will not be described in detail here.
[0066] 17. The local domain name server 3 sends a domain name resolution request for the first subdomain name to the primary domain name server 5 according to the returned address of the primary domain name server 5.
[0067] 18. The primary domain name server 5 returns the address of the first domain name server 6 to the local domain name server.
[0068] 19. The local domain name server 3 sends a domain name resolution request for the first subdomain name to the first domain name server 6 according to the returned address of the first domain name server 6.
[0069] It should be noted that the first domain name server 6 stores NS (Name Server) records in advance. The NS records are used to indicate that the subdomains under the first domain name are resolved by the custom domain name server 7. The NS records correspond to the domain name format of the subdomains under the first domain name and the address of the custom domain name server 7. The NS records may also record record types such as NS.
[0070] In one example, the address of the custom domain name server 7 recorded in the NS record is the service network address. For example, the first domain name is: app.company.com, and the IP address of the custom domain name server is 66.77.88.99; then, the NS record is: app.company.com NS 66.77.88.99.
[0071] In another example, the address of the custom domain name server 7 recorded in the NS record is a domain name. Exemplarily, the first domain name is: app.company.com, and the domain name of the custom domain name server is ns1.company.com; then, the NS record is: app.company.com NS ns1.company.com. In order to implement domain name resolution for the domain name of the custom domain name server 7, the first domain name server 6 may also store an A record in advance, and the A record is used to specify the service network address corresponding to the domain name of the custom domain name server 7 (that is, the service network address of the custom domain name server 7). Exemplarily, the domain name of the custom domain name server 7 is ns1.company.com, and the IP address of the custom domain name server 7 is 66.77.88.99, then, the A record is: ns1 A 66.77.88.99.
[0072] Specifically, the first domain name server 6 may also execute Figure 1 Step 200 in: Add the above NS record and the above A record.
[0073] 20. The first domain name server 6 returns the address of the custom domain name server 7 to the local domain name server 3.
[0074] 21. The local domain name server 3 sends a domain name resolution request for the first subdomain name to the custom domain name server 7 according to the returned address of the custom domain name server 7.
[0075] If the returned address of the custom domain name server 7 is a service network address, a domain name resolution request for the first subdomain name may be directly sent to the custom domain name server 7 .
[0076] If the returned address of the custom domain name server 7 is a domain name, the domain name resolution can be performed through the domain name system to obtain the service network address of the custom domain name server 7, and then a domain name resolution request for the first subdomain name is sent to the custom domain name server 7. The above-mentioned added A record is required in the domain name resolution process.
[0077] 22. The custom domain name server 7 resolves the first subdomain name into a service network address of the target server.
[0078] In one example, based on the preset transformation rule, the host name in the first subdomain name is transformed into a service network address of the target server.
[0079] 23. The custom domain name server 7 returns the service network address of the target server to the local domain name server 3.
[0080] 24. The local domain name server 3 returns the service network address of the target server to the client 1.
[0081] It should be added that, after receiving the returned service network address of the target server, the local domain name server 3 may also cache the first subdomain name and the service network address of the target server accordingly for use in subsequent domain name resolution.
[0082] 25. Client 1 requests to establish a network connection (eg, http connection) with the target server according to the service network address of the target server.
[0083] After the client receives the service network address of the target server, it replaces the first subdomain in the above-mentioned first URL request with the service network address of the target server, obtains the modified first URL request, and the client sends the modified first URL request through the network. After the client sends the modified first URL request, it will first complete the certificate verification with the target server, and then establish a network connection with the target server, so that the target network service provided by the target server can be accessed later. Among them, the certificate verification process can refer to the existing technology and will not be described in detail here.
[0084] The service network address in the embodiment of the present application may specifically be an IP address, for example: IPv4 or IPv6.
[0085] In summary, in this solution, all scheduling tasks are handled by the load balancing server, that is, which server the client communicates with is completely scheduled by the load balancing server. In this way, multiple management problems can be avoided, such as poor scheduling effect and high operation and maintenance costs. In addition, the custom domain name server does not need to be responsible for the scheduling function or access the database. It only needs to extract the IP address from the domain name through simple preset transformation rules, which improves performance and reduces maintenance costs. In other words, at any location, at any time, and on any operator line, the result of DNS resolution is consistent with the result of load balancer scheduling. There is no need to notify DNS to update the database or update the DNS cache for the expansion and contraction of the server used to provide the target network service, and operation and maintenance are simple. In addition, in this solution, the results of the resolution are cached on the local domain name server, which is theoretically permanent and valid. For others, it can save the time of establishing a connection to the server that can provide the target network service. This solution can make the distributed service architecture consistent in the design of accessing Web applications and the design of accessing native applications, without the need to design an architecture separately for Web applications.
[0086] Figure 2 FIG. 1 is a flow chart of a communication method provided by an embodiment of the present application. The method is applied to the load balancing service in the above communication architecture. Figure 2 As shown, the method comprises:
[0087] 201. Receive a resource allocation request from a client for a target network service.
[0088] 202. Allocate a target server for the client from a plurality of servers that can provide the target network service.
[0089] 203. Generate a first subdomain under the first domain name according to the service network address of the target server and the first domain name of the target network service.
[0090] Among them, the first subdomain name is used to obtain the service network address of the target server through domain name system resolution; the domain name system includes a first domain name server and a custom domain name server; the first domain name server stores a domain name server record; the domain name server record is used to indicate that the subdomain name under the first domain name is resolved by the custom domain name server; the custom domain name server is used to resolve the host name in the first subdomain name into the service network address of the target server.
[0091] 204. Send the first subdomain name to the client, so that the client accesses the target server according to the first subdomain name.
[0092] Optionally, generating a first subdomain under the first domain name according to the service network address of the target server and the first domain name of the target network service includes:
[0093] Based on a preset transformation rule, transform the service network address of the target server into a character string;
[0094] Adding the string as a host name to the first domain name to generate a first subdomain name of the first domain name;
[0095] The custom domain name server is used to transform the host name in the first subdomain name into the service network address of the target server based on the preset transformation rule.
[0096] In this way, the custom domain name server does not need to access the database during resolution, which improves performance and saves database maintenance costs.
[0097] Optionally, the resource allocation request includes: client information of the client;
[0098] Allocating a target server to the client from a plurality of servers capable of providing the target network service comprises:
[0099] Based on the client information of the client, a target server is allocated to the client from a plurality of servers that can provide the target network service.
[0100] It should be noted here that: for the contents of each step not fully described in detail in the method provided in the embodiment of the present application, please refer to the corresponding contents in the above embodiment, which will not be repeated here. In addition, in addition to the above steps, the method provided in the embodiment of the present application may also include other parts or all of the steps in the above embodiments, which can be specifically referred to the corresponding contents in the above embodiments, which will not be repeated here.
[0101] An embodiment of the present application also provides a domain name system. Figure 1As shown, the domain name system includes: a first domain name server 6 and a custom domain name server 7; the first domain name server 6 stores a domain name server record; the domain name server record is used to indicate that the subdomain under the first domain name is resolved by the custom domain name server 7; the first domain name is the domain name of the target network service;
[0102] The custom domain name server 7 is used to: receive a domain name resolution request from a client for a first subdomain under the first domain name; resolve the host name in the first subdomain into a service network address of a target server; wherein the first subdomain is provided by the load balancing server 2; the first subdomain is generated by the load balancing server 2 based on the service network address of the target server and the first domain name; the target server is allocated to the client from a plurality of servers that can provide the target network service after the load balancing server 2 receives a resource allocation request from the client 1 for the target network service.
[0103] In an achievable solution, the first subdomain name is obtained by the load balancing server 2 adding the character string as the host name to the first domain name; the character string is obtained by the load balancing server 2 transforming the service network address of the target server based on a preset transformation rule;
[0104] The custom domain name server 7 is specifically used for:
[0105] Based on the preset transformation rule, the host name in the first subdomain name is transformed into the service network address of the target server.
[0106] In an achievable solution, the system further includes: a local domain name server 3;
[0107] The local domain name server 3 is used to: receive the domain name resolution request of the client 1; send the domain name resolution request to the first domain name server 6, specifically, send the domain name resolution request to the first domain name server 6 through other domain name servers (e.g., root domain name server 4, first-level domain name server 5) with a higher level than the first domain name server 6 in the domain name system. Taking the iterative resolution method as an example, the local domain name server 3 can obtain the address of the first domain name server 6 through other domain name servers (e.g., root domain name server 4, first-level domain name server 5) with a higher level than the first domain name server 6 in the domain name system, and then send the domain name resolution request to the first domain name server 6. The level of the first domain name server is higher than that of the custom domain name server.
[0108] The first domain name server 6 is used to send the address of the custom domain name server to the local domain name server according to the first subdomain name in the domain name resolution request and the domain name server record;
[0109] The local domain name server 3 is further used to: send the domain name resolution request to the custom domain name server according to the address of the custom domain name server; and send the service network address of the target server returned by the custom domain name server to the client.
[0110] In addition, the local domain name server 3 is also used for:
[0111] The first subdomain name and the service network address of the target server are cached accordingly.
[0112] In one example, the local domain name server is specifically used to:
[0113] Searching for cached data according to the first subdomain name;
[0114] When the service network address corresponding to the first subdomain name is found in the cache data, the service network address corresponding to the first subdomain name cached in the cache data is sent to the client;
[0115] When the service network address corresponding to the first subdomain name is not found in the cache data, the domain name resolution request is sent to the first domain name server through the root domain name server.
[0116] If the service network address corresponding to the first subdomain name is found in the cache data, it means that the domain name resolution has been performed on the first subdomain name.
[0117] If the service network address corresponding to the first subdomain name is not found in the cache data, it means that the domain name resolution has never been performed on the first subdomain name.
[0118] It should be noted here that: for the contents not fully described in detail in each part of the system provided in the embodiment of the present application, reference can be made to the corresponding contents in the above embodiments, which will not be repeated here. In addition, in addition to the above parts, the system provided in the embodiment of the present application may also include other parts in the above embodiments, which can be specifically referred to the corresponding contents in the above embodiments, which will not be repeated here.
[0119] Figure 3 FIG. 1 is a schematic diagram showing the structure of an electronic device provided by an embodiment of the present application. Figure 3As shown, the electronic device includes a memory 1101 and a processor 1102. The memory 1101 can be configured to store various other data to support operations on the electronic device. Examples of these data include instructions for any application or method for operating on the electronic device. The memory 1101 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read only memory (EEPROM), an erasable programmable read only memory (EPROM), a programmable read only memory (PROM), a read only memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk.
[0120] The memory 1101 is used to store programs;
[0121] The processor 1102 is coupled to the memory 1101 and is used to execute the program stored in the memory 1101 to implement the methods provided by the above-mentioned method embodiments.
[0122] Further, if Figure 3 As shown, the electronic device also includes: a communication component 1103, a display 1104, a power component 1105, an audio component 1106 and other components. Figure 3 Only some components are shown schematically, which does not mean that the electronic device only includes Figure 3 Components shown.
[0123] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a computer, the steps or functions of the methods provided in the above-mentioned method embodiments can be implemented.
[0124] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0125] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM (Read Only Memory) / RAM (Random Access Memory), a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A communication method, It is characterized in that Applicable to load balancing servers, including: receiving a resource allocation request from a client for a target network service; Allocating a target server to the client from a plurality of servers capable of providing the target network service; According to the service network address of the target server and the first domain name of the target network service, a first subdomain name under the first domain name is generated; the first subdomain name is used to obtain the service network address of the target server through domain name system resolution; the domain name system includes a first domain name server and a custom domain name server; the first domain name server stores a domain name server record; the domain name server record is used to indicate that the subdomain name under the first domain name is resolved by the custom domain name server; the custom domain name server is used to resolve the host name in the first subdomain name into the service network address of the target server; The first subdomain name is sent to the client, so that the client accesses the target server according to the first subdomain name.
2. The method according to claim 1, It is characterized in that Generating a first subdomain under the first domain name according to the service network address of the target server and the first domain name of the target network service includes: Based on a preset transformation rule, transform the service network address of the target server into a character string; Adding the string as a host name to the first domain name to generate a first subdomain name of the first domain name; The custom domain name server is used to transform the host name in the first subdomain name into the service network address of the target server based on the preset transformation rule.
3. The method according to claim 1, It is characterized in that The resource allocation request includes: client information of the client; Allocating a target server to the client from a plurality of servers capable of providing the target network service comprises: Based on the client information of the client, a target server is allocated to the client from a plurality of servers that can provide the target network service.
4. The method according to any one of claims 1 to 3, It is characterized in that The target network service includes: a real-time video service or a real-time audio service.
5. The method according to any one of claims 1 to 3, It is characterized in that The client is a web client.
6. A domain name system, It is characterized in that include: The first domain name server and the custom domain name server; The first domain name server stores a domain name server record; The domain name server record is used to indicate that the subdomain under the first domain name is resolved by the custom domain name server; the first domain name is the domain name of the target network service; The custom domain name server is used to: receive a domain name resolution request from a client for a first subdomain under the first domain name; resolve the host name in the first subdomain into a service network address of a target server; wherein the first subdomain is provided by a load balancing server; the first subdomain is generated by the load balancing server according to the service network address of the target server and the first domain name; the target server is allocated to the client from a plurality of servers that can provide the target network service after the load balancing server receives a resource allocation request from the client for the target network service.
7. The system according to claim 6, It is characterized in that The first subdomain name is obtained by the load balancing server adding a character string as a host name to the first domain name; the character string is obtained by the load balancing server transforming the service network address of the target server based on a preset transformation rule; The custom domain name server is specifically used for: Based on the preset transformation rule, the host name in the first subdomain name is transformed into the service network address of the target server.
8. The system according to claim 6, It is characterized in that Also includes: Local domain name server; The local domain name server is used to: receive the domain name resolution request from the client; Sending the domain name resolution request to the first domain name server; The first domain name server is used to: send the address of the custom domain name server to the local domain name server according to the first subdomain name in the domain name resolution request and the domain name server record; The local domain name server is further used to: send the domain name resolution request to the custom domain name server according to the address of the custom domain name server; and send the service network address of the target server returned by the custom domain name server to the client.
9. The system according to claim 8, It is characterized in that The local domain name server is also used for: The first subdomain name and the service network address of the target server are cached accordingly.
10. The system according to claim 9, It is characterized in that The local domain name server is specifically used for: Searching for cached data according to the first subdomain name; When the service network address corresponding to the first subdomain name is found in the cache data, the service network address corresponding to the first subdomain name cached in the cache data is sent to the client; When the service network address corresponding to the first subdomain name is not found in the cache data, the domain name resolution request is sent to the first domain name server through other domain name servers with a higher level than the first domain name server in the domain name system.
11. A load balancing server, It is characterized in that include: A memory and a processor, wherein The memory is used to store programs; The processor is coupled to the memory, and is configured to execute the program stored in the memory to implement the method according to any one of claims 1 to 5.
12. A computer-readable storage medium storing a computer program, It is characterized in that When the computer program is executed by a computer, the method according to any one of claims 1 to 5 can be implemented.