Disclosure of Invention
The present disclosure aims to provide a service scheduling method, device, system, global load balancer and client, so as to solve the problem in the related art that the applicability to the GSLB of a system that does not support a virtual host is poor.
In order to achieve the above object, according to a first aspect of the embodiments of the present disclosure, there is provided a service scheduling method applied to a global load balancer, the method including:
receiving a DNS SRV request initiated by a client and forwarded by a local domain name server, wherein a service name in the DNS SRV request is identification information of the client;
returning a first response message for responding to the DNS SRV request according to a corresponding relation between a pre-stored port number of the access node server and the identification information, wherein the first response message comprises the port number and the domain name of the access node server to which the client is dispatched;
receiving a DNS A request or a DNS AAAA request initiated by a client and forwarded by the local domain name server, wherein the DNS A request or the DNS AAAA request comprises a domain name of the access node server;
returning a second response message for responding to the DNS A request or the DNS AAAA request, wherein the second response message comprises the IP address of the access node server.
According to a second aspect of the embodiments of the present disclosure, there is provided a service scheduling method applied to a client, the method including:
initiating a DNS SRV request to a local domain name server, wherein a service name in the DNS SRV request is the identification information of the client;
receiving a first response message of a global load balancer forwarded by a local domain name server to the DNS SRV request, wherein the first response message comprises a port number and a domain name of an access node server to which the client is dispatched;
initiating a DNS A request or a DNS AAAA request to the local domain name server, wherein the DNS A request or the DNS AAAA request comprises the domain name of the access node server;
receiving a second response message of a global load balancer forwarded by a local domain name server to the DNS A request or the DNS AAAA request, wherein the second response message comprises the IP address of the access node server;
initiating a network request to the access node server according to the obtained IP address and the port number of the access node server;
and receiving a network response returned by the access node server and used for responding to the network request.
According to a third aspect of the embodiments of the present disclosure, there is provided a service scheduling method applied to a service scheduling system, where the service scheduling system includes a client, a local domain name server, a global load balancer, and an access node server, the method includes:
the client side initiates a DNS SRV request to a local domain name server, and a service name in the DNS SRV request is identification information of the client side;
the local domain name server forwards the DNS SRV request to the global load balancer;
the global load balancer returns a first response message for responding to the DNS SRV request according to a pre-stored corresponding relation between the port number of the access node server and the identification information, wherein the first response message comprises the port number and the domain name of the access node server to which the client is dispatched;
the local domain name server receives and forwards the first response message to the client;
the client side initiates a DNS A request or a DNS AAAA request to the local domain name server, and the DNS A request or the DNS AAAA request comprises the domain name of the access node server;
the local domain name server forwards the DNS A request or DNS AAAA request to the global load balancer;
the global load balancer returns a second response message for responding to the DNS A request or the DNS AAAA request, wherein the second response message comprises the IP address of the access node server;
the local domain name server receives and forwards the second response message to the client;
the client side initiates a network request to the access node server according to the obtained IP address and the port number of the access node server;
the access node server receives the network request and returns a network response for responding to the network request to the client;
and the client receives the network response returned by the access node server.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a service scheduling apparatus applied to a global load balancer, the apparatus including:
a first receiving module, configured to receive a DNS SRV request initiated by a client and forwarded by a local domain name server, where a service name in the DNS SRV request is identification information of the client;
a first response module, configured to return a first response message for responding to the DNS SRV request according to a correspondence between a pre-stored port number of the access node server and the identification information, where the first response message includes the port number and the domain name of the access node server to which the client is scheduled;
a second receiving module, configured to receive a DNS a request or a DNS AAAA request initiated by a client and forwarded by the local domain name server, where the DNS a request or the DNS AAAA request includes a domain name of the access node server;
a second response module, configured to return a second response message for responding to the DNS a request or the DNS AAAA request, where the second response message includes the IP address of the access node server.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a service scheduling apparatus, applied to a client, the apparatus including:
a first request module, configured to initiate a DNS SRV request to a local domain name server, where a service name in the DNS SRV request is identification information of the client;
a first response receiving module, configured to receive a first response message of the global load balancer to the DNS SRV request, where the first response message includes a port number and a domain name of an access node server to which the client is scheduled;
a second request module, configured to initiate a DNS a request or a DNS AAAA request to the local domain name server, where the DNS a request or the DNS AAAA request includes a domain name of the access node server;
a second response receiving module, configured to receive a second response message of the global load balancer forwarded by the local domain name server for the DNS a request or the DNS AAAA request, where the second response message includes an IP address of the access node server;
the network request module is used for initiating a network request to the access node server according to the obtained IP address and the port number of the access node server;
and the response receiving module is used for receiving the network response which is returned by the access node server and used for responding to the network request.
According to a sixth aspect of the embodiments of the present disclosure, there is provided a service scheduling system, including a client, a local domain name server, a global load balancer, and an access node server;
the client is used for initiating a DNS SRV request to a local domain name server, and a service name in the DNS SRV request is identification information of the client;
the local domain name server is used for forwarding the DNS SRV request to the global load balancer;
the global load balancer is used for returning a first response message for responding to the DNS SRV request according to a pre-stored corresponding relation between the port number of the access node server and the identification information, wherein the first response message comprises the port number and the domain name of the access node server to which the client is dispatched;
the local domain name server is further used for receiving and forwarding the first response message to the client;
the client is further configured to initiate a DNS a request or a DNS AAAA request to the local domain name server, where the DNS a request or the DNS AAAA request includes a domain name of the access node server;
the local domain name server is further configured to forward the DNS a request or DNS AAAA request to the global load balancer;
the global load balancer is further configured to return a second response message for responding to the DNS a request or the DNS AAAA request, where the second response message includes an IP address of the access node server;
the local domain name server is further configured to receive and forward the second response message to the client;
the client is also used for initiating a network request to the access node server according to the obtained IP address and the port number of the access node server;
the access node server is used for receiving the network request and returning a network response for responding to the network request to the client;
the client is further configured to receive the network response returned by the access node server.
According to a seventh aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, performs the steps of the method according to the first and second aspects of embodiments of the present disclosure.
According to an eighth aspect of the embodiments of the present disclosure, there is provided a global load balancer, including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of the first aspect of an embodiment of the disclosure.
According to a ninth aspect of the embodiments of the present disclosure, there is provided a client, including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of the second aspect of the embodiments of the present disclosure.
According to the technical scheme, firstly, a DNS SRV request with a service name as client identification information is analyzed according to the corresponding relation between the port number of an access node server and client identification information, the port number and the domain name of the access node server to which a client is dispatched are obtained, then a DNS A request or a DNS AAAA request comprising the domain name of the access node server is analyzed, the IP address of the access node server is obtained, and therefore the client can carry out network request on the access node server according to the obtained IP address and the port number of the access node server, and service dispatching on the client is achieved. Accordingly, when the same client (user or tenant) is dispatched to different access node servers, the port numbers served by the same client can be the same or different, so that the problem that the available port number is limited due to the limitation of the basic network and the difference of the available port range of each access node server is solved. Moreover, by changing the corresponding relation between the port number of the access node server and the identification information, the port number for serving the client (user or tenant) can be changed without sending a configuration file to the client. Therefore, the technical scheme provided by the disclosure has better applicability to systems which do not support virtual hosts.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to make the technical solutions provided by the embodiments of the present invention easier to understand for those skilled in the art, the related technologies will be briefly described below.
Please refer to fig. 1, which is a signaling interaction diagram of a service scheduling system according to an embodiment of the present disclosure. The service scheduling system includes a client 10, a local domain name server 20, a global load balancer 30, and an access node server 40. A service scheduling method applied to the service scheduling system according to the embodiment of the present disclosure is described below with reference to fig. 2 based on fig. 1.
Fig. 2 is a flowchart of a service scheduling method applied to a service scheduling system, where the service scheduling method is applied to the service scheduling system shown in fig. 1 according to an embodiment of the present disclosure. As shown in fig. 2, the service scheduling method includes the steps of:
in step S11, the client 10 initiates a DNS SRV request to the local domain name server 20, where a service name in the DNS SRV request is identification information of the client 10.
The global load balancer 30GSLB in the existing CDN system can only resolve a Domain Name into an IP, which is implemented based on an a record or an AAAA record of a DNS (Domain Name server). The DNS protocol also supports SRV records, the record format of SRV is: name TTL Class SRV Priority Weight Port Target. Wherein, Service is a Service name, and the prefix _' is to prevent the conflict with DNS Label (common domain name); proto is a communication protocol used by the service, TCP, UDP, other standard protocols or self-defined protocols; name is the domain Name providing the service; TTL is effective time of cache; CLASS, CLASS; priority, wherein the smaller the numerical value, the higher the Priority, the range is 0-65535; weight, the higher the value of the Weight of the record, the higher the Weight, the range is 0-65535; port, service Port number, 0-65535; target is host address. In order to implement Service scheduling for the client 10, in the embodiment of the present disclosure, the Service name in the DNS SRV request is identification information of the client 10, that is, identification information of the client 10 identified by a Service field in the DNS SRV request. The identification information may be, but is not limited to, a user name or ID of the user using the client 10.
In step S12, the local domain name server 20 forwards the DNS SRV request to the global load balancer 30.
In step S13, the global load balancer 30 returns a first response message for responding to the DNS SRV request according to a pre-stored correspondence between the port number of the access node server 40 and the identification information, where the first response message includes the port number and the domain name of the access node server 40 to which the client 10 is scheduled.
The global load balancer 30 determines the address location of the client 10 according to the Local Domain Name Server (LDNS) in the DNS SRV resolution request, and returns the Domain Name of the access node Server 40 closest to the client 10 as a DNS response, which lays a foundation for the client 10 to be dispatched to the access node Server 40 closest to the client. The global load balancer 30 pre-stores the corresponding relationship between the port number of the access node server 40 and the identification information. The correspondence between the port number of the access node server 40 and the identification information may be as shown in table 1.
TABLE 1
As shown in table 1: the identification information is different, for example, the identification information 1 and the identification information 2 are different, and may be user names or IDs of different users (clients). The access node servers are different, that is, the domain names of the access node servers are different, for example, the access node server 1 and the access node server 2 are different, and may be access node servers of different address locations. When the identification information 1 (or the identification information 2) is at different address locations, the identification information can be dispatched to (accessed to) an access node server at different address locations, for example, when the identification information 1 is close to the access node server 1, the identification information is dispatched to (accessed to) the access node server 1; for another example, when the identification information 1 is close to the access node server 2, it is dispatched to (accessed to) the access node server 2. When the identification information 1 and the identification information 2 are at the same address location, they may be dispatched to (accessed to) an access node server at the same address location, for example, when both the identification information 1 and the identification information 2 are close to the access node server 1 (or the access node server 2), they are dispatched to (accessed to) the access node server 1 (or the access node server 2). Because each port number corresponding to each identification information in the table represents a port number of a different access node server, each port number corresponding to each identification information may be the same or different, for example, port number 1 and port number 2 may be the same or different, for example, the values of port number 1 and port number 2 are 20003; for another example, the value of port number 1 is 20003 and the value of port number 2 is 15708. That is, for the same identification information, when it is scheduled to (accessed to) different access node servers, the corresponding port numbers (for serving them) may be the same or different. However, the port numbers of the same access node server corresponding to different identification information are different, for example, the port number 1 corresponding to the access node server 1 corresponding to the identification information 1 is different from the port number 11 corresponding to the access node server 1 corresponding to the identification information 2. For the correspondence relationship including a plurality of identification information, when one or more identification information is scheduled to (accessed to) different access node servers, the corresponding (served) port numbers are different, that is, when at least one identification information exists in the correspondence relationship between the port number of the access node server and the identification information, the corresponding port number is different. Conversely, for the correspondence relationship including multiple pieces of identification information, when all pieces of identification information are scheduled to (accessed to) different access node servers, the corresponding (served) port numbers are the same, that is, in table 1, all the port numbers corresponding to identification information 1 are the same (port number 1 is the same as port number 2, etc.), and all the port numbers corresponding to identification information 2 are the same (port number 11 is the same as port number 12, etc.).
Therefore, the global load balancer 30 determines the address location of the client 10 according to a Local Domain Name Server (LDNS) in the DNS SRV request initiated by the client 10, schedules (accesses) the client 10 to a nearest access node Server, then obtains a corresponding relationship between the identification information of the client 10 and the access node Server, and obtains the access node Server and the port number corresponding to the identification information of the client 10 according to a pre-stored corresponding relationship between the port number of the access node Server and the identification information, so that the first response message returned by the global load balancer 30 for responding to the DNS SRV request includes the port number and the Domain Name of the access node Server to which the client 10 is scheduled.
In step S14, the local domain name server 20 receives and forwards the first response message to the client 10.
In step S15, the client 10 initiates a DNS a request or a DNS AAAA request to the local domain name server 20, where the DNS a request or the DNS AAAA request includes the domain name of the access node server.
In step S16, the local domain name server 20 forwards the DNS a request or DNS AAAA request to the global load balancer 30.
In step S17, the global load balancer 30 returns a second response message for responding to the DNS a request or the DNS AAAA request, where the second response message includes the IP address of the access node server.
In step S18, the local domain name server 20 receives and forwards the second response message to the client 10.
In step S19, the client 10 initiates a network request to the access node server according to the obtained IP address and port number of the access node server.
In step S20, the access node server receives the network request and returns a network response for responding to the network request to the client 10.
In step S21, the client 10 receives the network response returned by the access node server.
In order to more clearly illustrate the service scheduling method provided by the embodiment of the present disclosure, the present disclosure takes one possible implementation as an example to roughly illustrate. A client with cloudminsnds as identification information (user name), using UDP protocol, allocates two access node servers to the user, where the two access node servers are in beijing and shanghai respectively, and the domain names are: bj-001. host.mcs.cloddmins.com, sh-001. host.mcs.cloddmins.com; the service ports of cloudsandds on the two access node servers are respectively: 20003 and 15708, the corresponding relationship between the port number of the global load balancer and the identification information according to the pre-stored access node server can be shown in table 2. A cloudminds client initiates a DNS SRV request in shanghai, for example, as _ cloudminds _ udp.mcs.cloudminds.com, and a first response message returned by the global load balancer to respond to the DNS SRV request may be 0515708 sh _001.host.mcs.cloudminds.com, where 0 and 5 are the priority and weight of the SRV record, 15708 is the port number of the shanghai access node server, and sh _001.host.mcs.cloudminds.com is the domain name of the shanghai access node server, respectively. The cluudinds client initiates a DNS SRV request at beijing, for example, as _ cluudinds. _ udp. mcs. cluudinds. com, and the first response message returned by the global load balancer to respond to the DNS SRV request may be 0520003 bj _001.host. mcs. cluudinds. com, where 0 and 5 are the priority and weight of the SRV record, respectively, 20003 is the port number of the beijing access node server, and bj _001.host. mcs. cluudinds. com is the domain name of the beijing access node server. And then the cluudinds client side initiates a DNS A request or a DNS AAAA request, wherein the DNS A request or the DNS AAAA request comprises a domain name sh _001. host.mcs.cluudinds.com of the Shanghai access node server or a domain name bj _001. host.mcs.cluudinds.com of the Beijing access node server, and a second response message returned by the global load balancer and used for responding to the DNS A request or the DNS AAAA request is the IP address of the Shanghai access node server or the IP address of the Beijing access node server. And the client side initiates a network request to the Shanghai access node server (or the Beijing access node server) according to the acquired IP address and port number of the Shanghai access node server (or the Beijing access node server).
TABLE 2
Through the above steps, the global load balancer 30 firstly resolves the DNS SRV request with the service name as the identification information according to the correspondence between the port number of the access node server and the identification information of the client 10, to obtain the port number and the domain name of the access node server to which the client 10 is scheduled (accessed), and then resolves the DNS a request or DNS AAAA request (IPv6) including the domain name of the access node server to obtain the IP address of the access node server, so that the client 10 can perform a network request for the access node server according to the obtained IP address and port number of the access node server, thereby implementing the service scheduling of the client 10 by the global load balancer 30. Accordingly, for the same client 10 (user or tenant), when it is scheduled to different access node servers, the port numbers served for it may be the same or different, thereby solving the problem that the available port number is limited due to the limitation of the underlying network and the difference of the available port range of each access node server. Moreover, by changing the correspondence between the port number of the access node server and the identification information, it is possible to change the port number serving the client 10 (user or tenant) without sending a configuration file to the client 10. Therefore, the technical scheme provided by the disclosure has better applicability to systems which do not support virtual hosts.
Optionally, the method further comprises:
and modifying the corresponding relation between the pre-stored port number of the access node server and the identification information so as to update the port number of the access node server to which the client 10 is dispatched.
By modifying the corresponding relationship between the port number of the access node server prestored in the global load balancer 30 and the identification information, the port number of the access node server to which the client 10 is scheduled can be updated, that is, the port number for serving the client 10 (user or tenant) is changed, and a configuration file does not need to be sent to the client 10, so that the method is time-saving, labor-saving, convenient and fast.
A block schematic diagram of a service scheduling system provided by the embodiment of the present disclosure is shown in fig. 3. Referring to fig. 1 and fig. 3 in combination, in the service scheduling system provided by the embodiment of the present disclosure:
the client 10 is configured to initiate a DNS SRV request to the local domain name server 20, where a service name in the DNS SRV request is identification information of the client 10.
The local domain name server 20 is configured to forward the DNS SRV request to the global load balancer 30.
The global load balancer 30 is configured to return a first response message for responding to the DNS SRV request according to a correspondence between a pre-stored port number of the access node server and the identification information, where the first response message includes the port number and the domain name of the access node server to which the client 10 is scheduled.
The local domain name server 20 is further configured to receive and forward the first response message to the client 10.
The client 10 is further configured to initiate a DNS a request or a DNS AAAA request to the local domain name server 20, where the DNS a request or the DNS AAAA request includes the domain name of the access node server.
The local domain name server 20 is further configured to forward the DNS a request or DNS AAAA request to the global load balancer 30.
The global load balancer 30 is further configured to return a second response message for responding to the DNS a request or the DNS AAAA request, where the second response message includes the IP address of the access node server.
The local domain name server 20 is further configured to receive and forward the second response message to the client 10.
The client 10 is further configured to initiate a network request to the access node server according to the obtained IP address and port number of the access node server.
The access node server is configured to receive the network request, and return a network response for responding to the network request to the client 10.
The client 10 is further configured to receive the network response returned by the access node server.
The service scheduling system provided by the embodiment of the present disclosure is applied to the service scheduling method, and therefore has similar beneficial effects, which are not described herein again.
Based on the inventive concept, the embodiment of the present disclosure further provides a service scheduling method, which is applied to the global load balancer 30. Fig. 4 is a flowchart of a service scheduling method on the global load balancer 30 side according to an embodiment of the present disclosure. As shown in fig. 4, the service scheduling method includes the steps of:
step S130, receiving a DNS SRV request initiated by the client 10 and forwarded by the local domain name server 20, where a service name in the DNS SRV request is identification information of the client 10.
Step S131, returning a first response message for responding to the DNS SRV request according to a correspondence between a pre-stored port number of the access node server and the identification information, where the first response message includes the port number and the domain name of the access node server to which the client 10 is scheduled.
Step S170, receiving a DNS a request or a DNS AAAA request initiated by the client 10 and forwarded by the local domain name server 20, where the DNS a request or the DNS AAAA request includes the domain name of the access node server.
Step S171, returning a second response message for responding to the DNS a request or DNS AAAA request, where the second response message includes the IP address of the access node server.
Since steps S130 and S131 are substantially the same as step S13, and steps S170 and S171 are substantially the same as step S17, further description is omitted here.
Through the above steps, the global load balancer 30 firstly resolves the DNS SRV request with the service name as the identification information according to the correspondence between the port number of the access node server and the identification information of the client 10, to obtain the port number and the domain name of the access node server to which the client 10 is scheduled (accessed), and then resolves the DNS a request or DNS AAAA request (IPv6) including the domain name of the access node server to obtain the IP address of the access node server, so that the client 10 can perform a network request for the access node server according to the obtained IP address and port number of the access node server, thereby implementing the service scheduling of the client 10 by the global load balancer 30. Accordingly, for the same client 10 (user or tenant), when it is scheduled to different access node servers, the port numbers served for it may be the same or different, thereby solving the problem that the available port number is limited due to the limitation of the underlying network and the difference of the available port range of each access node server. Moreover, by changing the correspondence between the port number of the access node server and the identification information, it is possible to change the port number serving the client 10 (user or tenant) without sending a configuration file to the client 10. Therefore, the technical scheme provided by the disclosure has better applicability to systems which do not support virtual hosts.
Optionally, the method further comprises:
and modifying the corresponding relation between the pre-stored port number of the access node server and the identification information so as to update the port number of the access node server to which the client 10 is dispatched.
By modifying the corresponding relationship between the port number of the access node server prestored in the global load balancer 30 and the identification information, the port number of the access node server to which the client 10 is scheduled can be updated, that is, the port number for serving the client 10 (user or tenant) is changed, and a configuration file does not need to be sent to the client 10, so that the method is time-saving, labor-saving, convenient and fast.
Based on the above inventive concept, the embodiment of the present disclosure further provides a service scheduling method, which is applied to the client 10. Fig. 5 is a flowchart of a service scheduling method on the client 10 side provided by the embodiment of the present disclosure. As shown in fig. 5, the service scheduling method includes the steps of:
step S110, a DNS SRV request is initiated to the local domain name server 20, and a service name in the DNS SRV request is the identification information of the client 10.
Step S140, receiving a first response message of the global load balancer 30 forwarded by the local domain name server 20 to the DNS SRV request, where the first response message includes the port number and the domain name of the access node server to which the client 10 is scheduled.
Step S150, initiating a DNS a request or a DNS AAAA request to the local domain name server 20, where the DNS a request or the DNS AAAA request includes the domain name of the access node server.
Step S180, receiving a second response message of global load balancer 30 forwarded by local domain name server 20 to the DNS a request or DNS AAAA request, where the second response message includes the IP address of the access node server.
Step S190, according to the obtained IP address and the port number of the access node server, a network request is sent to the access node server.
Step S210, receiving a network response returned by the access node server for responding to the network request.
Since step S110 is substantially the same as step S11, step S140 is substantially the same as step S14, step S150 is substantially the same as step S15, step S180 is substantially the same as step S18, step S190 is substantially the same as step S19, and step S210 is substantially the same as step S21, which is not repeated herein.
Through the above steps of the method, the client 10 initiates a DNS SRV request with a service name of identification information, receives a first response message of the DNS SRV request to obtain a port number and a domain name of an access node server to which the client 10 is scheduled (accessed), and then initiates a DNS a request or a DNS AAAA request (IPv6) including the domain name of the access node server to obtain an IP address of the access node server, so that the client 10 can perform a network request on the access node server according to the obtained IP address and port number of the access node server, thereby implementing service scheduling. Accordingly, for the same client 10 (user or tenant), when it is scheduled to different access node servers, the port numbers served for it may be the same or different, thereby solving the problem that the available port number is limited due to the limitation of the underlying network and the difference of the available port range of each access node server. Moreover, by changing the first response message, it is possible to change the port number for serving the client 10 (user or tenant) without sending a configuration file to the client 10. Therefore, the technical scheme provided by the disclosure has better applicability to systems which do not support virtual hosts.
Based on the above inventive concept, the embodiments of the present disclosure further provide a service scheduling apparatus, which is used to implement the steps of the service scheduling method applied to the global load balancer. The service scheduling apparatus may implement part or all of the global load balancer by software, hardware, or a combination of both. As shown in fig. 6, the service scheduling apparatus includes:
a first receiving module 130, configured to receive a DNS SRV request initiated by a client and forwarded by a local domain name server, where a service name in the DNS SRV request is identification information of the client.
A first response module 131, configured to return a first response message for responding to the DNS SRV request according to a correspondence between a pre-stored port number of the access node server and the identification information, where the first response message includes the port number and the domain name of the access node server to which the client is scheduled.
A second receiving module 170, configured to receive a DNS a request or a DNS AAAA request initiated by the client and forwarded by the local domain name server, where the DNS a request or the DNS AAAA request includes the domain name of the access node server.
A second response module 171, configured to return a second response message for responding to the DNS a request or the DNS AAAA request, where the second response message includes the IP address of the access node server.
It should be noted that, as is clear to those skilled in the art, for convenience and brevity of description, the specific working process and description of the apparatus described above may refer to the corresponding process in the foregoing method embodiments, and no further description is provided herein.
By adopting the device, firstly, the DNS SRV request with the service name as the identification information is analyzed according to the corresponding relation between the port number of the access node server and the identification information of the client, the port number and the domain name of the access node server to which the client is dispatched (accessed) are obtained, then the DNS A request or the DNS AAAA request (IPv6) comprising the domain name of the access node server is analyzed, the IP address of the access node server is obtained, therefore, the client can carry out the network request on the access node server according to the obtained IP address and the port number of the access node server, and the service dispatching of the client is realized. Accordingly, when the same client (user or tenant) is dispatched to different access node servers, the port numbers served by the same client can be the same or different, so that the problem that the available port number is limited due to the limitation of the basic network and the difference of the available port range of each access node server is solved. Moreover, by changing the corresponding relation between the port number of the access node server and the identification information, the port number for serving the client (user or tenant) can be changed without sending a configuration file to the client. Therefore, the technical scheme provided by the disclosure has better applicability to systems which do not support virtual hosts.
Optionally, the service scheduling apparatus further includes:
and the updating module modifies the corresponding relation between the pre-stored port number of the access node server and the identification information so as to update the port number of the access node server to which the client is dispatched.
By modifying the corresponding relation between the port number of the access node server in the pre-existing global load balancer and the identification information, the port number of the access node server to which the client is dispatched can be updated, namely, the port number for serving the client (user or tenant) is changed, and a configuration file does not need to be sent to the client, so that the method is time-saving, labor-saving, convenient and quick.
Based on the above inventive concept, the embodiments of the present disclosure further provide a service scheduling apparatus, which is used to implement the steps of the service scheduling method applied to the client. The service scheduler may implement part or all of the client by software, hardware or a combination of both. As shown in fig. 7, the service scheduling apparatus includes:
a first request module 110, configured to initiate a DNS SRV request to a local domain name server, where a service name in the DNS SRV request is identification information of the client.
A first response receiving module 140, configured to receive a first response message of the global load balancer for the DNS SRV request forwarded by the local domain name server, where the first response message includes a port number and a domain name of an access node server to which the client is scheduled.
A second request module 150, configured to initiate a DNS a request or a DNS AAAA request to the local domain name server, where the DNS a request or the DNS AAAA request includes the domain name of the access node server.
A second response receiving module 180, configured to receive a second response message of the global load balancer forwarded by the local domain name server to the DNS a request or the DNS AAAA request, where the second response message includes an IP address of the access node server.
A network request module 190, configured to initiate a network request to the access node server according to the obtained IP address and port number of the access node server.
A response receiving module 210, configured to receive a network response returned by the access node server for responding to the network request.
It should be noted that, as is clear to those skilled in the art, for convenience and brevity of description, the specific working process and description of the apparatus described above may refer to the corresponding process in the foregoing method embodiments, and no further description is provided herein.
By adopting the device, the client initiates a DNS SRV request with a service name of identification information, receives a first response message of the DNS SRV request to obtain a port number and a domain name of an access node server to which the client is dispatched (accessed), and then initiates a DNS A request or a DNS AAAA request (IPv6) comprising the domain name of the access node server to obtain an IP address of the access node server, so that the client can perform network request on the access node server according to the obtained IP address and the port number of the access node server, thereby realizing served dispatching. Accordingly, when the same client (user or tenant) is dispatched to different access node servers, the port numbers served by the same client can be the same or different, so that the problem that the available port number is limited due to the limitation of the basic network and the difference of the available port range of each access node server is solved. Moreover, by changing the first response message, the port number for serving the client (user or tenant) can be changed without sending a configuration file to the client. Therefore, the technical scheme provided by the disclosure has better applicability to systems which do not support virtual hosts.
Fig. 8 is a block diagram of a global load balancer 30 according to an embodiment of the disclosure. For example, global load balancer 30 may be provided as a server. Referring to fig. 8, global load balancer 30 includes a processor 301, which may be one or more in number, and a memory 302 for storing a computer program executable by processor 3012. The computer program stored in memory 302 may include one or more modules that each correspond to a set of instructions. Further, the processor 301 may be configured to execute the computer program to perform the above-described service scheduling method on the global load balancer side.
Additionally, global load balancer 30 may also include a power component 303 and a communication component 304, the power component 303 may be configured to perform power management of global load balancer 30, and the communication component 304 may be configured to enable communication, e.g., wired or wireless communication, of global load balancer 30. In addition, the global load balancer 30 may also include an input/output (I/O) interface 305. Global load balancer 30 may operate based on an operating system stored in memory 302, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, and the like.
Fig. 9 is a block diagram illustrating a client 10 according to an embodiment of the present disclosure. As shown in fig. 7, the client 10 may include: a processor 101 and a memory 102. The client 10 may also include one or more of a multimedia component 103, an input/output (I/O) interface 104, and a communication component 105.
The processor 101 is configured to control the overall operation of the client 10, so as to complete all or part of the steps in the above-mentioned service scheduling method on the client side. The memory 102 is used to store various types of data to support operation at the client 10, which may include, for example, instructions for any application or method operating on the client 10, as well as application-related data, such as contact data, messaging, pictures, audio, video, and so forth. The Memory 102 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia component 103 may include a screen and an audio component. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 102 or transmitted through the communication component 105. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 704 provides an interface between the processor 101 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 105 is used for wired or wireless communication between the client 10 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, which is not limited herein. The corresponding communication component 105 may thus comprise: Wi-Fi module, Bluetooth module, NFC module, etc.
In an exemplary embodiment, the client 10 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components for executing the above-mentioned client-side service scheduling method.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the global load balancer-side service scheduling method described above is also provided. For example, the computer readable storage medium may be the memory 302 described above that includes program instructions executable by the processor 301 of the global load balancer 30 to perform the global load balancer-side service scheduling method described above.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the above-described client-side service scheduling method is also provided. For example, the computer readable storage medium may be the above-described memory 102 comprising program instructions executable by the processor 101 of the client 10 to perform the above-described client-side service scheduling method.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.