Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for scheduling a multi-CDN service system. The technical scheme is as follows:
in a first aspect, a method for scheduling a multi-CDN service system is provided, where the method includes:
initiating an analysis request for the access domain name under each view to an authoritative DNS of each CDN service system according to preset view information and the access domain name in each CDN service system configured for a target domain name in advance;
receiving an analysis result which is returned by each CDN service system and carries the IP address under each view, and monitoring the cache service quality of a cache server corresponding to the IP address under each view;
when a target domain name resolution request for the target domain name is received, determining a target view corresponding to the target domain name resolution request, and returning a target IP address corresponding to a cache server to be scheduled under the target view
Further, after monitoring the caching service quality of the caching server corresponding to the IP address under each view, the method further includes:
according to the monitored cache service quality of the cache server corresponding to the IP address under each view, the IP address corresponding to the cache server to be scheduled under each view is predetermined;
the returning of the target IP address corresponding to the cache server to be scheduled in the target view comprises:
and searching a target IP address corresponding to the cache server to be scheduled under the target view from the predetermined IP addresses corresponding to the cache servers to be scheduled under each view, and returning the target IP address.
Further, the returning of the target IP address corresponding to the cache server to be scheduled in the target view includes:
and determining a target IP address corresponding to the cache server to be scheduled in the target view according to the monitored cache service quality of the cache server corresponding to the IP address in the target view, and returning the target IP address.
Further, the determining, according to the monitored cache service quality of the cache server corresponding to the IP address in the target view, the target IP address corresponding to the cache server to be scheduled in the target view includes:
calculating the quality score of each cache server under the target view based on the monitored cache service data of the cache server corresponding to the IP address under the target view;
and determining the cache server with the highest quality score under the target view as a cache server to be scheduled, and determining the IP address corresponding to the cache server to be scheduled as the target IP address.
Further, the method further comprises:
and when the persistence time of the analysis result exceeds the preset time, initiating an analysis request for the access domain name under each view to an authoritative DNS of the CDN service system returning the analysis result again.
In a second aspect, an apparatus for scheduling a multi-CDN service system is provided, where the apparatus includes:
the sending module is used for initiating an analysis request for the access domain name in each view to an authoritative DNS of each CDN service system according to preset view information and the access domain name in each CDN service system configured for a target domain name in advance;
the monitoring module is used for receiving an analysis result which is returned by each CDN service system and carries the IP address under each view, and monitoring the cache service quality of the cache server corresponding to the IP address under each view;
and the determining module is used for determining a target view corresponding to the target domain name resolution request when the target domain name resolution request of the target domain name is received, and returning a target IP address corresponding to a cache server to be scheduled under the target view.
Further, the determining module is further configured to:
according to the monitored cache service quality of the cache server corresponding to the IP address under each view, the IP address corresponding to the cache server to be scheduled under each view is predetermined;
and searching a target IP address corresponding to the cache server to be scheduled under the target view from the predetermined IP addresses corresponding to the cache servers to be scheduled under each view, and returning the target IP address.
Further, the determining module is further configured to:
and determining a target IP address corresponding to the cache server to be scheduled in the target view according to the monitored cache service quality of the cache server corresponding to the IP address in the target view, and returning the target IP address.
Further, the determining module is further configured to:
calculating the quality score of each cache server under the target view based on the monitored cache service data of the cache server corresponding to the IP address under the target view;
and determining the cache server with the highest quality score under the target view as a cache server to be scheduled, and determining the IP address corresponding to the cache server to be scheduled as the target IP address.
Further, the sending module is further configured to:
and when the persistence time of the analysis result exceeds the preset time, initiating an analysis request for the access domain name under each view to an authoritative DNS of the CDN service system returning the analysis result again.
In a third aspect, a scheduling device is provided, which includes a processor and a memory, where at least one instruction, at least one program, a set of codes, or a set of instructions is stored in the memory, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the method for scheduling a multi-CDN service system according to the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a set of codes, or a set of instructions is stored, which is loaded and executed by a processor to implement the method for scheduling a multi-CDN service system according to the first aspect.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in this embodiment, the public DNS only needs to send a domain name resolution request to the CDN scheduling system, and can directly obtain the IP address of the cache server corresponding to the domain name, and does not need to obtain the IP address from the CDN service system where the cache server is located, so that DNS resolution time can be reduced, and scheduling quality of the CDN scheduling system is improved. In addition, when the CDN scheduling system schedules a plurality of CDN service systems to provide CDN services, only the cache service quality of each CDN service system needs to be considered, so that the cache service of each CDN service system can be fully utilized, and in particular, a CDN service system with poor DNS service quality and good cache service quality can be utilized, and the scheduling quality of the CDN scheduling system can be improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The embodiment of the invention provides a method for scheduling a multi-CDN service system, wherein an execution main body of the method can be scheduling equipment in the CDN scheduling system, and the scheduling equipment can be a single server or a cluster consisting of a plurality of servers; the CDN scheduling system can be built by a CDN customer or purchased by the CDN customer from a scheduling system service provider; the CDN client can adopt a plurality of CDN service systems to jointly accelerate the CDN of the website; the CDN service system may be provided by each CDN service provider, and redirect the access request of the user to a cache server closest to the user based on the access request of the user, where the cache server may be a server in the CDN service system that caches content requested by the user, and the cache server may return the cached content requested by the user to the user after receiving the access request of the user. The scheduling device of the CDN scheduling system may perform the determination in the multiple CDN service systems according to the access requests of different users, and schedule the CDN service system with better service quality in real time to process the access request of the user. A specific network scenario may be as shown in fig. 1. The scheduling device may include a processor, a memory, and a transceiver, where the processor may be configured to perform a process of scheduling the multi-CDN service system in the following process, the memory may be configured to store data required in the following process and data generated in the following process, and the transceiver may be configured to receive and transmit related data in the following process.
In the following, a detailed description will be given of a processing flow of the method for scheduling a multi-CDN service system shown in fig. 2 with reference to a specific embodiment, where the content may be as follows:
step 201: and initiating an analysis request for the access domain name in each view to an authoritative DNS of each CDN service system according to the preset view information and the access domain name in each CDN service system configured for the target domain name in advance.
In implementation, the scheduling device may configure an access domain name in each CDN service system for each website domain name in advance based on the CNAME technology, and for convenience of description, the website domain name will be referred to as a target domain name in the following description, and the target domain name may be any website domain name. For example, the target domain name may be www.xxx.com, and the access domain name configured by the scheduling device may be www.xxx.com.abc.com, www.xxx.com.def.com, and the domain of the access domain name abc. In addition, the scheduling device may store preset view information, the preset view information may record specific views corresponding to different IPs or IP segments, such as a beijing view and a guangdong view, the scheduling device may simulate domain name resolution requests in different views based on the preset view information, for example, a certain DNS address of the beijing telecommunications may be recorded as 219.141.136.10 in the preset view information, the view corresponding to the address may be a beijing view, a certain DNS address of the guangdong telecommunications is 202.96.128.86, the view corresponding to the address may be a guangdong view, and the scheduling device may simulate a technical effect of sending a domain name resolution request by 219.141.136.10 or 202.96.128.86, so that a domain name resolution request in the beijing view or the guangdong view is simulated. In this way, the scheduling device may initiate an analysis request for the access domain name to an authoritative DNS of each CDN service system in combination with the preset view information and the access domain name in each CDN service system configured for the target domain name in advance.
Step 202: and receiving an analysis result which is returned by each CDN service system and carries the IP address under each view, and monitoring the cache service quality of the cache server corresponding to the IP address under each view.
In implementation, after initiating a request for resolving an access domain name under each view to an authoritative DNS of each CDN service system, the scheduling device may receive a resolution result returned by each CDN service system for the domain name resolution request under each view, where each resolution result may carry an IP address under a certain view corresponding to the resolution result, and the IP address may correspond to a certain cache server in the CDN service system. Taking the CDN service system A, CDN service system B as an example, the scheduling device may initiate an access domain name resolution request under the beijing view and the guangdong view to an authoritative DNS of the CDN service system A, B, and after the authoritative DNS of the CDN service system A, B completes the domain name resolution request, the scheduling device may receive an resolution result carrying the IP address under the beijing view and an resolution result carrying the IP address under the guangdong view, which are returned by the CDN service system a, and an resolution result carrying the IP address under the beijing view and an resolution result carrying the IP address under the guangdong view, which are returned by the CDN service system B. Then, the scheduling device may monitor the cache service quality of the cache server corresponding to the IP address in each view, and record corresponding cache service data, such as cache response time, cache content hit rate, and cache cost.
Optionally, the scheduling device may determine in advance a cache server to be scheduled, and accordingly, the specific processing may be as follows: and according to the monitored cache service quality of the cache server corresponding to the IP address under each view, predetermining the IP address corresponding to the cache server to be scheduled under each view.
In implementation, the scheduling device may obtain, based on the cache service data of the cache server corresponding to the IP address in each view recorded in the monitoring process, the cache service quality of the cache server corresponding to the IP address in each view returned by each CDN service system, and then the scheduling device may perform analysis statistics on the cache service quality of each cache server in each view to find the cache server with the best cache service quality in each view, and further the scheduling device may determine the cache server with the best cache service quality in each view as the cache server to be scheduled in the corresponding view, and determine the IP address corresponding to the cache server to be scheduled.
Optionally, the scheduling device may adjust the current cache server to be scheduled based on a monitoring condition that changes continuously with time, and accordingly, the specific processing may be as follows: and re-determining the IP address corresponding to the cache server to be scheduled under each view at preset time intervals according to the recorded monitoring condition.
In implementation, considering that the cache service quality of each cache server is dynamically changed, the scheduling device may re-determine the cache server to be scheduled and its corresponding IP address under each view every preset time period, for example, five minutes or ten minutes, so that the scheduling device may determine the cache server currently having the best cache service quality as the cache server to be scheduled as far as possible based on the latest monitoring condition.
Step 203: when a target domain name resolution request for a target domain name is received, a target view corresponding to the target domain name resolution request is determined, and a target IP address corresponding to a cache server to be scheduled under the target view is returned.
In an implementation, when a user accesses a website accelerated by the CDN, the user may input a website domain name (which may be referred to as a target domain name) of the website in a browser application running on the terminal, and then may access the website by clicking an access button. In this way, the terminal can initiate a domain name resolution request for the target domain name to the public DNS. Then, the public DNS may query, based on the target domain name, an address of an authoritative DNS in the CDN scheduling system, and then the public DNS may initiate a domain name resolution request for the target domain name to the authoritative DNS in the CDN scheduling system. Then, the scheduling device may receive a target domain name resolution request for a target domain name, then determine a target view corresponding to the target domain name resolution request based on an IP address of a public DNS or a terminal IP address carried in a data packet corresponding to the target domain name resolution request, and then the scheduling device may obtain an IP address (which may be referred to as a target IP address) of a cache server to be scheduled in the target view, which is determined based on the recorded monitoring condition, and then the scheduling device may return the target IP address to the public DNS. In this way, after receiving the target IP address, the public DNS may return the target IP address to the terminal, and then the terminal may send an access request to the cache server to be scheduled through the target IP address to obtain the website content.
It is easy to understand that through the processing in step 201 and step 203, the technical effect of scheduling the cache server with better cache service quality to process the access request of the user to the website can be achieved, and thus, only the cache service quality of each CDN service system needs to be considered, and the DNS resolution quality of each CDN service system does not need to be considered, so that the cache service in each CDN service system can be fully utilized, and particularly, the CDN service system with better cache service quality due to poorer DNS service quality can be fully utilized.
Optionally, if the scheduling device determines the IP address of the cache server to be scheduled in each view in advance, part of the processing of step 203 may be as follows: and searching a target IP address corresponding to the cache server to be scheduled in the target view from the predetermined IP addresses corresponding to the cache servers to be scheduled in each view, and returning the target IP address.
In implementation, since the scheduling device determines the IP address of the cache server to be scheduled in each view in advance, after determining the target view corresponding to the target domain name resolution request, the scheduling device can find the IP address corresponding to the currently determined cache server to be scheduled in the target view, that is, the target IP address, from the IP addresses corresponding to the cache servers to be scheduled in each view, so that the scheduling device can directly return the target IP address to the public DNS, thereby improving the domain name resolution efficiency.
Optionally, after receiving the target domain name resolution request, the scheduling device may determine the cache server to be scheduled, and accordingly, the specific processing may be as follows: and determining a target IP address corresponding to the cache server to be scheduled in the target view according to the monitored cache service quality of the cache server corresponding to the IP address in the target view, and returning the target IP address.
In implementation, after receiving the analysis result carrying the IP address under each view returned by each CDN service system, the scheduling device may monitor only the cache service quality of the cache server corresponding to the IP address under each view. In this way, the scheduling device may determine, according to the monitored cache service quality of the cache server corresponding to the IP address in the target view, the IP address corresponding to the cache server to be scheduled in the target view only when receiving the target domain name resolution request for the target domain name, and then the scheduling device may return the determined IP address corresponding to the cache server to be scheduled in the target view to the public DNS, so that the system resource utilization rate of the scheduling device may be reduced.
Optionally, the cache server to be scheduled may be determined by calculating a quality score of the cache server, taking determining the cache server to be scheduled in the target view as an example, and accordingly, the specific processing may be as follows: calculating the quality scores of all cache servers under the target view based on the monitored cache service data of the cache servers corresponding to the IP addresses under the target view; and determining the cache server with the highest quality score under the target view as a cache server to be scheduled, and determining the IP address corresponding to the cache server to be scheduled as the target IP address.
In implementation, the scheduling device may monitor the cache service quality of the cache server corresponding to the IP address in each view, and record corresponding cache service data, for example, the cache response time in the last hour, the cache content hit rate, and the like. In this way, the scheduling device may find the cache service data of each cache server in the target view from all the recorded cache service data, and then calculate the quality score of each cache server in the target view, it is easy to understand that the higher the quality score is, the higher the cache service quality of the cache server is. Then, the scheduling device may determine, based on the calculated quality scores of the cache servers, the cache server with the highest quality score in the target view as the cache server to be scheduled, and determine the IP address corresponding to the cache server to be scheduled as the target IP address. Taking the target view as the beijing view and the CDN service system A, CDN service system B as an example, assuming that the CDN service system A, B returns one IP address each, the scheduling device may receive two IP addresses, may then monitor only the cache response times of the cache servers (recorded as cache server a and cache server B, respectively) corresponding to the two IP addresses, may further record the historical cache response times of the cache server A, B within a period of time, may then calculate the average cache response time of each of the cache servers A, B, may convert the average cache response time into a quality score of the cache server, for example, may take the reciprocal of the average cache response time, and use the obtained value as the quality score, for example, the average cache response time of the cache server A, B is 500 milliseconds, and the average cache response time of the cache server B is 500 milliseconds, and the average cache response time of the cache server B, And 1000 milliseconds, the converted quality scores are 0.002 and 0.001, and it can be seen that the quality score of the cache server a is higher than that of the cache server B, so the scheduling device can determine the IP address corresponding to the cache server a as the target IP address.
Optionally, considering that each CDN service system may dynamically adjust an IP address corresponding to each cache server, the scheduling device may periodically initiate an access domain name resolution request, and accordingly, the specific processing may be as follows: and when the persistence time of the analysis result exceeds the preset time, initiating an analysis request for the access domain name under each view to an authoritative DNS of the CDN service system returning the analysis result again.
In implementation, after receiving the analysis result carrying the IP address under each view returned by each CDN service system, the scheduling device may record the persistence time of each analysis result. When the persistence time of a certain analysis result exceeds a preset time, for example, one or three days, the scheduling device may reinitiate an analysis request for the access domain name in each view to the authoritative DNS of the CDN service system that returns the analysis result, so as to obtain the latest analysis result for the access domain name by each CDN service system, thereby ensuring that the IP address in each view is consistent with the actually corresponding cache server.
In this embodiment, the public DNS only needs to send a domain name resolution request to the CDN scheduling system, and can directly obtain the IP address of the cache server corresponding to the domain name, and does not need to obtain the IP address from the CDN service system where the cache server is located, so that DNS resolution time can be reduced, and scheduling quality of the CDN scheduling system is improved. In addition, when the CDN scheduling system schedules a plurality of CDN service systems to provide CDN services, only the cache service quality of each CDN service system needs to be considered, so that the cache service of each CDN service system can be fully utilized, and in particular, a CDN service system with poor DNS service quality and good cache service quality can be utilized, and the scheduling quality of the CDN scheduling system can be improved.
Based on the same technical concept, an embodiment of the present invention further provides a device for scheduling a multi-CDN service system, where as shown in fig. 3, the device includes:
a sending module 301, configured to initiate an analysis request for an access domain name in each view to an authoritative DNS of each CDN service system according to preset view information and the access domain name in each CDN service system configured for a target domain name in advance;
a monitoring module 302, configured to receive an analysis result carrying an IP address under each view returned by each CDN service system, and monitor the cache quality of the cache server corresponding to the IP address under each view;
the determining module 303 is configured to determine, when a target domain name resolution request for the target domain name is received, a target view corresponding to the target domain name resolution request, and return a target IP address corresponding to a cache server to be scheduled in the target view.
Optionally, the determining module 303 is further configured to:
according to the monitored cache service quality of the cache server corresponding to the IP address under each view, the IP address corresponding to the cache server to be scheduled under each view is predetermined;
and searching a target IP address corresponding to the cache server to be scheduled under the target view from the predetermined IP addresses corresponding to the cache servers to be scheduled under each view, and returning the target IP address.
Optionally, the determining module 303 is further configured to:
and determining a target IP address corresponding to the cache server to be scheduled in the target view according to the monitored cache service quality of the cache server corresponding to the IP address in the target view, and returning the target IP address.
Optionally, the determining module 303 is further configured to:
calculating the quality score of each cache server under the target view based on the monitored cache service data of the cache server corresponding to the IP address under the target view;
and determining the cache server with the highest quality score under the target view as a cache server to be scheduled, and determining the IP address corresponding to the cache server to be scheduled as the target IP address.
Optionally, the sending module 301 is further configured to:
and when the persistence time of the analysis result exceeds the preset time, initiating an analysis request for the access domain name under each view to an authoritative DNS of the CDN service system returning the analysis result again.
In this embodiment, the public DNS only needs to send a domain name resolution request to the CDN scheduling system, and can directly obtain the IP address of the cache server corresponding to the domain name, and does not need to obtain the IP address from the CDN service system where the cache server is located, so that DNS resolution time can be reduced, and scheduling quality of the CDN scheduling system is improved. In addition, when the CDN scheduling system schedules a plurality of CDN service systems to provide CDN services, only the cache service quality of each CDN service system needs to be considered, so that the cache service of each CDN service system can be fully utilized, and in particular, a CDN service system with poor DNS service quality and good cache service quality can be utilized, and the scheduling quality of the CDN scheduling system can be improved.
It should be noted that: in the device for scheduling a multi-CDN service system according to the foregoing embodiment, when the multi-CDN service system is scheduled, only the division of the functional modules is described as an example, in practical applications, the function allocation may be completed by different functional modules according to needs, that is, an internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the device for scheduling a multi-CDN service system and the method for scheduling a multi-CDN service system provided in the foregoing embodiments belong to the same concept, and specific implementation processes thereof are described in detail in the method embodiments and are not described herein again.
Fig. 4 is a schematic structural diagram of a scheduling apparatus according to an embodiment of the present invention. The scheduler device 400 may vary significantly due to configuration or performance differences and may include one or more central processors 422 (e.g., one or more processors) and memory 432, one or more storage media 430 (e.g., one or more mass storage devices) storing applications 442 or data 444. Wherein the memory 432 and storage medium 430 may be transient or persistent storage. The program stored on the storage medium 430 may include one or more modules (not shown), each of which may include a sequence of instructions operating on a scheduling device. Still further, the central processor 422 may be arranged to communicate with the storage medium 430 to execute a series of instruction operations in the storage medium 430 on the scheduling device 400.
The scheduling apparatus 400 may also include one or more power supplies 426, one or more wired or wireless network interfaces 450, one or more input-output interfaces 458, one or more keyboards 456, and/or one or more operating systems 441, such as Windows Server (TM), Mac OS XTM, Unix (TM), Linux (TM), FreeBSD (TM), and the like.
The scheduling apparatus 400 may include a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors to include instructions for scheduling the multi-CDN service system as described above.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.