WO2023087820A1 - Load balancing method and device, and computer-readable storage medium - Google Patents

Load balancing method and device, and computer-readable storage medium Download PDF

Info

Publication number
WO2023087820A1
WO2023087820A1 PCT/CN2022/113706 CN2022113706W WO2023087820A1 WO 2023087820 A1 WO2023087820 A1 WO 2023087820A1 CN 2022113706 W CN2022113706 W CN 2022113706W WO 2023087820 A1 WO2023087820 A1 WO 2023087820A1
Authority
WO
WIPO (PCT)
Prior art keywords
module
domain name
name resolution
service
service modules
Prior art date
Application number
PCT/CN2022/113706
Other languages
French (fr)
Chinese (zh)
Inventor
董西荣
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2023087820A1 publication Critical patent/WO2023087820A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload

Definitions

  • the present application relates to the technical field of communications, for example, to a load balancing method, device, and computer-readable storage medium.
  • CDN Content Delivery Network
  • the CDN scheduling system performs dynamic domain name resolution through the domain name server (Domain Name Server, DNS) to return the address information of the available acceleration server group to the local domain name server (Local Domain Name Server, LDNS).
  • DNS Domain Name Server
  • LDNS Local Domain Name Server
  • the accelerated server group initiates a service request.
  • the load among the acceleration server groups is uneven, resulting in a decrease in the efficiency of the content distribution network.
  • Embodiments of the present application provide a load balancing method, device, and computer-readable storage medium.
  • the embodiment of the present application provides a load balancing method, which is applied to the DNS module of the CDN scheduling system, and the CDN scheduling system includes the DNS module, the LDNS module and a plurality of acceleration service modules; the method includes: receiving a domain name resolution request sent by the LDNS module; selecting a plurality of available service modules from the acceleration service module according to the domain name resolution request and determining a load capacity parameter, the load capacity parameter is used to characterize each of the available services The load capacity ratio between modules; determine the domain name resolution result according to the domain name resolution request and the load capacity parameter, the domain name resolution result carries the service address corresponding to each of the available service modules, and each of the available service modules The ratio of the number of service addresses corresponding to the modules corresponds to the load capacity parameter; sending the domain name resolution result to the LDNS module, so that the LDNS module can send the domain name resolution result to the terminal device according to the domain name resolution result. above service address.
  • the embodiment of the present application provides a load balancing method, which is applied to the LDNS module of the CDN dispatching system, and the CDN dispatching system includes a DNS module, the LDNS module and a plurality of acceleration service modules; the method includes: receiving the domain name resolution result sent by the DNS module, the domain name resolution result carrying service addresses respectively corresponding to a plurality of available service modules, the available service modules are selected by the DNS module from a plurality of the accelerated service modules , and the ratio of the number of service addresses corresponding to each of the available service modules corresponds to the ratio of the load capacity of each of the service modules; the service address is obtained according to the domain name resolution result, and the service address is sent to to the terminal device, so that the terminal device can establish a content acceleration service with the acceleration service module according to the service address.
  • an embodiment of the present application provides a network device, including a memory, a processor, and a computer program stored in the memory and operable on the processor.
  • the processor executes the computer program, the above-mentioned first The load balancing method in the embodiment of the first aspect or the second aspect.
  • an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to make a computer perform the above-mentioned first aspect or the first aspect.
  • the load balancing method in the second aspect embodiment is not limited to:
  • FIG. 1 is a schematic diagram of a CDN scheduling system provided by an embodiment of the present application
  • Fig. 2 is a flowchart of a load balancing method provided by an embodiment of the present application
  • Fig. 3 is an example flowchart of selecting multiple available service modules from accelerated service modules provided by an embodiment of the present application
  • Fig. 4 is the example flowchart of step S220 in Fig. 3;
  • Fig. 5 is an example flowchart of step S223 in Fig. 4;
  • FIG. 6 is an example flow chart for determining load capacity parameters provided by an embodiment of the present application.
  • Fig. 7 is an exemplary flow chart of determining a domain name resolution result according to a domain name resolution request and load capacity parameters provided by an embodiment of the present application
  • FIG. 8 is a flowchart of a load balancing method provided by another embodiment of the present application.
  • FIG. 9 is a flowchart of a load balancing method provided by another embodiment of the present application.
  • FIG. 10 is a flowchart of a load balancing method provided by another embodiment of the present application.
  • Fig. 11 is a schematic diagram of a network device 200 provided by an embodiment of the present application.
  • the embodiment of the present application provides a load balancing method, including receiving the domain name resolution request sent by the LDNS module; selecting multiple available service modules from the acceleration service module according to the domain name resolution request and determining the load capacity parameter, the load capacity parameter is used to represent The load capacity ratio between each available service module; determine the domain name resolution result according to the domain name resolution request and load capacity parameters, the domain name resolution result carries the service address corresponding to each available service module, and the number of service addresses corresponding to each available service module The ratio corresponds to the load capacity parameter; the domain name resolution result is sent to the LDNS module, so that the LDNS module can send the service address to the terminal device according to the domain name resolution result.
  • the ratio of the load capacity among the available service modules can be known.
  • the domain name resolution results are determined by the domain name resolution request jointly determined with the load capacity parameter, so that the ratio of the number of service addresses corresponding to each available service module carried by the domain name resolution result corresponds to the ratio of the load capacity of each available service module represented by the load capacity parameter; since the terminal device is The content acceleration service is established according to the service address carried by the domain name resolution result and the available service modules, and the ratio of the number of service addresses corresponding to each available service module carried by the domain name resolution result corresponds to the load of each available service module represented by the load capacity parameter Therefore, the embodiment of the present application can balance the loads of each available service module in the content delivery network, that is, each acceleration server group, thereby improving the efficiency of the content delivery network.
  • Fig. 1 is a schematic diagram of a CDN dispatching system provided by an embodiment of the present application.
  • the CDN dispatching system includes a DNS module 100, an LDNS module 110 and a plurality of acceleration service modules 120, and the LDNS module 110 can receive the The domain name resolution request sent, and the service address corresponding to the domain name resolution request is sent to the user terminal, so that the user terminal can establish a content acceleration service according to the service address and the acceleration service module 120 corresponding to the service address.
  • the LDNS module 110 can receive the domain name resolution request sent by the user terminal, so as to check whether the LDNS module 110 locally caches the pre-cached resolution result corresponding to the domain name resolution request according to the domain name resolution request, if the LDNS module 110 locally If there is a pre-cached analysis result, the service address represented by the pre-cached analysis result is sent to the user terminal, so that the user terminal can establish a content acceleration service according to the service address and the acceleration service module 120 corresponding to the service address. If the LDNS module 110 does not have a pre-cached resolution result locally, the LDNS module 110 forwards the domain name resolution request to the DNS module 100, obtains the domain name resolution result from the DNS module 100, and caches the domain name resolution result.
  • the DNS module 100 can determine the domain name resolution result according to the domain name resolution request sent by the LDNS module 110 , and send the domain name resolution result to the LDNS module 110 .
  • the DNS module 100 can obtain the real-time performance parameters of the acceleration service module 120, and judge the availability of the acceleration service module 120 according to the real-time performance parameters and weight coefficients of the acceleration service module 120, so as to select available parameters from the acceleration service module 120. service module.
  • the DNS module 100 can determine the weight coefficient of each acceleration service module 120, and select multiple available service modules from the acceleration service module 120 according to the weight coefficient and a preset scheduling policy.
  • the preset scheduling strategy in this embodiment of the present application includes but is not limited to one or more of the following influencing factors: business type, geographical location, disaster recovery requirements, IP address pool, and domain name resolution request type.
  • the acceleration service module 120 can provide content acceleration service, and the acceleration service module 120 is provided with a performance query interface, so as to respond to the performance query request of the external device, for example, the acceleration service module 120 can respond to the DNS module 100 sending The real-time performance parameters are sent to the DNS module 100 in the performance query request.
  • each acceleration service module 120 has at least one service address, that is, an external IP address.
  • the user terminal may be any client that may trigger a domain name resolution request, for example, the user terminal may be a media terminal, a browser, or a server client.
  • the LDNS module 110 of the embodiment of the present application supports deployment in client, area or backbone network.
  • the LDNS module 110 may be a multi-level networking architecture.
  • the DNS module 100 in the embodiment of the present application is composed of at least one server.
  • acceleration service module 120 in the embodiment of the present application is composed of at least one server, each acceleration service module 120 is a server group, and there is at least one server group in the CDN scheduling system.
  • the CDN scheduling system and application scenarios described in the embodiments of this application are to illustrate the technical solutions of the embodiments of the application more clearly, and do not constitute a limitation to the technical solutions provided in the embodiments of the application.
  • Those skilled in the art know that with the CDN
  • the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
  • CDN scheduling system shown in Figure 1 does not constitute a limitation to the embodiment of the present application, and may include more or less components than those shown in the figure, or combine certain components, or have different Part placement.
  • Figure 2 is a flow chart of a load balancing method provided by an embodiment of the present application, which is applied to the DNS module of the CDN scheduling system.
  • the load balancing method of the embodiment of the present application includes but does not It is limited to step S100, step S200, step S300 and step S400.
  • Step S100 receiving a domain name resolution request sent by the LDNS module.
  • the LDNS module can receive the domain name resolution request sent by the user terminal, so as to find out whether the LDNS module locally caches the pre-cached resolution result corresponding to the domain name resolution request according to the domain name resolution request, if the LDNS module locally has a pre-cached If the analysis result is obtained, the service address represented by the pre-cached analysis result is sent to the user terminal, so that the user terminal can establish a content acceleration service according to the service address and the acceleration service module corresponding to the service address. If the LDNS module does not have a pre-cached resolution result locally, the LDNS module forwards the domain name resolution request to the DNS module.
  • Step S200 select a plurality of available service modules from the acceleration service modules according to the domain name resolution request and determine a load capacity parameter, which is used to represent the load capacity ratio among the available service modules.
  • the DNS module can determine the domain name resolution result according to the domain name resolution request sent by the LDNS module, and send the domain name resolution result to the LDNS module.
  • the DNS module can acquire the real-time performance parameters of the acceleration service modules, and judge the availability of the acceleration service modules according to the real-time performance parameters and weight coefficients of the acceleration service modules, so as to select available service modules from the acceleration service modules.
  • the DNS module can determine the weight coefficients of each acceleration service module, and select multiple available service modules from the acceleration service modules according to the weight coefficient and a preset scheduling policy.
  • the preset scheduling strategy in this embodiment of the present application includes but is not limited to one or more of the following influencing factors: business type, geographical location, disaster recovery requirements, IP address pool, and domain name resolution request type.
  • the preset scheduling strategy can select available service modules from all accelerated service modules according to one or more of the above-mentioned influencing factors. If the geographic location of the user terminal that initiates the domain name resolution request is within the same geographic space as some of the acceleration service modules, this part of the acceleration service modules is selected as the available service modules, so as to ensure the response speed of the available service modules.
  • the weight coefficient is used to characterize the preference degree of load distribution to the acceleration service module, for example, two acceleration service modules for providing the same content acceleration service, if the weight coefficient of one acceleration service module is greater than the other If the weight coefficient of the acceleration service module is different, the CDN scheduling system will give priority to allocating load to the acceleration service module with a larger weight coefficient when other influencing factors are the same.
  • the weight coefficient is determined by the total amount of business introduction and the acceleration service module set including all acceleration service modules, and the total amount of business introduction is used to represent all business types introduced into the CDN scheduling system including the acceleration service module set, Since the acceleration performance of different acceleration service modules for different business types is inconsistent, it is necessary to specifically determine the weight coefficient of each acceleration service module according to the total amount of business introduction and the set of acceleration service modules.
  • Step S300 determine the domain name resolution result according to the domain name resolution request and the load capacity parameter, the domain name resolution result carries the service address corresponding to each available service module, and the ratio of the number of service addresses corresponding to each available service module corresponds to the load capacity parameter.
  • the embodiment of the present application can balance the load of each available service module in the content distribution network, so that the load of each available service module matches its own load capacity.
  • Step S400 sending the domain name resolution result to the LDNS module, so that the LDNS module can send the service address to the terminal device according to the domain name resolution result.
  • the terminal device can establish the content acceleration service according to the service address and the available service modules corresponding to the service address.
  • the service address is an IP address of an available service module.
  • the ratio of the load capacity among the available service modules can be known.
  • the domain name resolution results are determined by the domain name resolution request jointly determined with the load capacity parameter, so that the ratio of the number of service addresses corresponding to each available service module carried by the domain name resolution result corresponds to the ratio of the load capacity of each available service module represented by the load capacity parameter; since the terminal device is The content acceleration service is established according to the service address carried by the domain name resolution result and the available service modules, and the ratio of the number of service addresses corresponding to each available service module carried by the domain name resolution result corresponds to the load of each available service module represented by the load capacity parameter Therefore, the embodiment of the present application can balance the loads of each available service module in the content delivery network, that is, each acceleration server group, thereby improving the efficiency of the content delivery network.
  • step S200 includes but is not limited to step S210 and step S220 :
  • Step S210 determining the weight coefficient of each acceleration service module
  • Step S220 selecting a plurality of available service modules from the acceleration service modules according to the weight coefficient and the preset scheduling strategy.
  • the DNS module can acquire the real-time performance parameters of the acceleration service modules, and judge the availability of the acceleration service modules according to the real-time performance parameters and weight coefficients of the acceleration service modules, so as to select available service modules from the acceleration service modules.
  • the DNS module can determine the weight coefficients of each acceleration service module, and select multiple available service modules from the acceleration service modules according to the weight coefficient and a preset scheduling policy.
  • the preset scheduling strategy in this embodiment of the present application includes but is not limited to one or more of the following influencing factors: business type, geographical location, disaster recovery requirements, IP address pool, and domain name resolution request type.
  • the preset scheduling strategy can select available service modules from all accelerated service modules according to one or more of the above-mentioned influencing factors. If the geographic location of the user terminal that initiates the domain name resolution request is within the same geographic space as some of the acceleration service modules, this part of the acceleration service modules is selected as the available service modules, so as to ensure the response speed of the available service modules.
  • the weight coefficient is used to characterize the preference degree of load distribution to the acceleration service module, for example, two acceleration service modules for providing the same content acceleration service, if the weight coefficient of one acceleration service module is greater than the other If the weight coefficient of the acceleration service module is different, the CDN scheduling system will give priority to allocating load to the acceleration service module with a larger weight coefficient when other influencing factors are the same.
  • the weight coefficient is determined by the total amount of business introduction and the acceleration service module set including all acceleration service modules, and the total amount of business introduction is used to represent all business types introduced into the CDN scheduling system including the acceleration service module set, Since the acceleration performance of different acceleration service modules for different business types is inconsistent, it is necessary to specifically determine the weight coefficient of each acceleration service module according to the total amount of business introduction and the set of acceleration service modules.
  • step S220 includes but not limited to step S221, step S222 and step S223:
  • Step S221 determining a hierarchical scheduling strategy according to the weight coefficient and the preset scheduling strategy
  • Step S222 selecting a plurality of service modules to be used from each acceleration service module according to the hierarchical scheduling strategy
  • Step S223 selecting a plurality of available service modules from the service modules to be used according to the hierarchical scheduling strategy.
  • the hierarchical scheduling strategy is used to select the service modules to be used from the accelerated service modules, and then select the available service modules from the service modules to be used, and the service modules not selected as available service modules can be used as available services Backup of modules in case they fail to work properly, thus improving stability.
  • factors affecting the hierarchical scheduling strategy include but are not limited to one or more of the following: business type, geographical location, disaster recovery requirements, IP address pool, and domain name resolution request type.
  • the hierarchical scheduling strategy can select a service module to be used from all accelerated service modules according to one or more of the above-mentioned influencing factors. For example, when the geographic location is selected as the influencing factor of the default scheduling strategy, If the geographic location of the user terminal that initiates the domain name resolution request is within the same or adjacent geographical space as some of the acceleration service modules, then select this part of the acceleration service module as the standby service module.
  • the hierarchical scheduling strategy can select an available service module from all service modules to be used according to one or more of the above-mentioned influencing factors. For example, when selecting a geographic location as an influencing factor of the preset scheduling strategy, if The geographic location of the user terminal that initiates the domain name resolution request is located in the same or adjacent geographic space as part of the acceleration service module, then select this part of the acceleration service module as the service module to be used; and, then select and initiate domain name resolution The requested service module whose geographical location is located in the same geographic space as the available service module is used as the available service module.
  • the selected available service module is in the same geographic space as the user terminal’s geographical location, so it is among all the acceleration service modules
  • the standby service module that has the fastest response speed but is not selected as the available service module has a lower response speed than the available service module, so it can be used as the backup of the available service module, thereby improving the capacity while ensuring the response speed.
  • Disaster capability is provided.
  • step S223 is an example flowchart of step S223 in Figure 4, in the example of Figure 5, step S223 also includes but not limited to step S224, step S225 and step S226:
  • Step S224 divide the standby service module into a first standby module and a second standby module according to the hierarchical scheduling strategy
  • Step S225 using the first standby module as an available service module
  • the above hierarchical scheduling strategy is not limited to only dividing the standby service modules into two levels.
  • the standby service modules can also be divided into a first standby module, a second standby module, and a third standby module. If the first standby module is abnormal and the second standby modules are also abnormal, the third standby module may be selected to replace the abnormal first standby module as an available service module.
  • FIG. 6 is an example flowchart for determining load capacity parameters provided by an embodiment of the present application.
  • step S200 also includes but is not limited to step S230 and step S240:
  • Step S230 obtaining the upper limit information of the load capacity of the available service modules
  • Step S240 determining the load capacity parameter according to the load capacity upper limit information and the weight coefficient.
  • the load capacity parameter is determined according to the load capacity upper limit information and the weight coefficient of the available service modules, and the load capacity upper limit information is used to characterize the maximum load that the available service modules can bear, so as to prevent the available service modules from being allocated The load exceeds the load capacity of the available service module, thereby improving the stability of the CDN scheduling system.
  • step S300 includes but is not limited to step S310, step S320, step S330 and step S340:
  • Step S310 determining the total number of addresses according to the domain name resolution request
  • Step S320 determining allocation parameters according to the load capacity parameters and load capacity upper limit information, and the allocation parameters are used to represent the ratio of the number of addresses required to be loaded by each available service module;
  • Step S330 determining the number of addresses to be loaded by each available service module according to the total number of addresses and the allocation parameters
  • Step S340 determine the domain name resolution result according to the domain name resolution request and the number of addresses.
  • the domain name resolution result is jointly determined by the domain name resolution request and the load capacity parameter, so that the ratio of the number of service addresses corresponding to each available service module carried by the domain name resolution result corresponds to each of the load capacity parameters represented by the load capacity parameter.
  • the ratio of the load capacity of the available service modules; since the terminal device establishes the content acceleration service based on the service address carried by the domain name resolution result and the available service module, the ratio of the number of service addresses corresponding to each available service module carried by the domain name resolution result corresponds to The ratio of the load capacity of each available service module represented by the load capacity parameter, so the embodiment of the present application can balance each available service module in the content distribution network, that is, the load of each acceleration server group, thereby improving the efficiency of the content distribution network .
  • the allocation parameter is used to characterize the ratio of the number of addresses to be loaded by each available service module, because when the number of service addresses to be loaded by each available service module is allocated according to the load capacity parameter, there may be a problem that the available service modules are allocated The load exceeds the upper limit of its load capacity. Therefore, by determining the allocation parameters, the part of the load that exceeds the upper limit of the load capacity of the service module can be transferred to the available service module that does not exceed the upper limit of the load capacity, thereby improving the stability of the CDN scheduling system.
  • Figure 8 is a flowchart of a load balancing method provided by another embodiment of the present application, which is applied to the LDNS module of the CDN scheduling system.
  • the load balancing method of the embodiment of the present application includes but It is not limited to step S500 and step S600.
  • Step S500 receiving the domain name resolution result sent by the DNS module, the domain name resolution result carries service addresses corresponding to multiple available service modules, the available service modules are selected by the DNS module from multiple acceleration service modules, and each available service module corresponds to The ratio of the number of service addresses corresponds to the ratio of the load capacity of each service module;
  • Step S600 obtain the service address according to the domain name resolution result, and send the service address to the terminal device, so that the terminal device can establish a content acceleration service according to the service address and the acceleration service module.
  • each available service module Since the domain name resolution results carry service addresses corresponding to each available service module, and the ratio of the number of service addresses corresponding to each available service module corresponds to the load capacity parameter, after the service addresses carried by the domain name resolution results are allocated, each available The number of terminal device connections of a service module corresponds to the load capacity parameter, so that load balancing between available service modules can be achieved. For example, when there are two available service modules, and the load capacity ratio represented by the load capacity parameter is 3:2, If there are 500 IP addresses in the domain name resolution results sent by the DNS module to the LDNS module, there are 300 IP addresses corresponding to one available service module, and 200 IP addresses corresponding to another available service module.
  • All the IP addresses in the analysis results are sent to the terminal equipment, and after the terminal equipment establishes a connection with the above-mentioned available service modules, the ratio of the number of connections between the two service modules is 3:2, reaching the number of connections of each available service module, and also That is, the load among the available service modules corresponds to the load capacity parameter to achieve the effect of load balancing.
  • FIG. 9 is a flowchart of a load balancing method provided by another embodiment of the present application.
  • the load balancing method of the embodiment of the present application includes but is not limited to step S700, step S800 and step S900.
  • Step S700 receiving a domain name resolution request sent by the terminal device
  • Step S800 in response to the domain name resolution request, search whether there is a pre-cached resolution result corresponding to the domain name resolution request locally in the LDNS module, and the pre-cached resolution result is obtained by the LDNS module caching the domain name resolution result locally in the LDNS module;
  • Step S900 when the LDNS module does not have a pre-cached resolution result locally, forward the domain name resolution request to the DNS module.
  • the LDNS module can receive the domain name resolution request sent by the user terminal, so as to find out whether the LDNS module locally caches the pre-cached resolution result corresponding to the domain name resolution request according to the domain name resolution request, if the LDNS module locally has a pre-cached If the analysis result is obtained, the service address represented by the pre-cached analysis result is sent to the user terminal, so that the user terminal can establish a content acceleration service according to the service address and the acceleration service module corresponding to the service address. If the LDNS module does not have a pre-cached resolution result locally, the LDNS module forwards the domain name resolution request to the DNS module, obtains the domain name resolution result from the DNS module, and caches the domain name resolution result.
  • FIG. 10 is a flowchart of a load balancing method provided by another embodiment of the present application.
  • the load balancing method of the embodiment of the present application includes but is not limited to step S1000 and step S1100 .
  • Step S1000 when the LDNS module has a pre-cached analysis result locally, obtain the service address according to the pre-cached analysis result;
  • Step S1100 sending the service address to the terminal device, so that the terminal device can establish a content acceleration service with the acceleration service module according to the service address.
  • the LDNS module caches the domain name resolution result sent by the DNS module, and the pre-cache resolution result is the local domain name resolution result cached in the LDNS module. During the cache period of the pre-cache resolution result, the LDNS module receives each time When the domain name resolution request corresponding to the pre-cache resolution result is received, the service address is sent to the terminal device according to the pre-cache resolution result.
  • the pre-cache resolution result carries the service address corresponding to each available service module, and the service corresponding to each available service module
  • the ratio of the number of addresses corresponds to the load capacity parameter, so after the service addresses carried by the pre-cache analysis result are allocated, the number of terminal device connections of each available service module corresponds to the load capacity parameter, so that the available service modules can be realized. Load balancing.
  • FIG. 11 is a schematic diagram of a network device 200 provided by an embodiment of the present application.
  • the device includes: a memory 220, a processor 210, and a A computer program running on 210.
  • the processor 210 and the memory 220 may be connected through a bus or in other ways.
  • the memory 220 can be used to store non-transitory software programs and non-transitory computer-executable programs.
  • the memory 220 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices.
  • the memory 220 may optionally include remote memories that are remotely located relative to the processor 210, and these remote memories may be connected to the processor 210 through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the non-transitory software programs and instructions required to realize the load balancing method of the above-mentioned embodiment are stored in the memory 220, and when executed by the processor 210, the load balancing method in the above-mentioned embodiment is executed, for example, executing the above-described Figure 2 to the method steps in FIG. 7 or FIG. 8 to FIG. 10 .
  • an embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by a processor or a controller, for example, by the above-mentioned Execution by a processor in the device embodiment or the device embodiment may cause the above processor to execute the load balancing method in the above embodiment, for example, execute the method steps in Fig. 2 to Fig. 7 or Fig. 8 to Fig. 10 described above .
  • Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, tape, magnetic disk storage or other magnetic storage devices, or can Any other medium used to store desired information and which can be accessed by a computer.
  • communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .

Landscapes

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

Abstract

Provided in the present application are a load balancing method and device, and a computer-readable storage medium. The method comprises: receiving a domain name resolution request sent by an LDNS module (S100); selecting a plurality of available service modules from among acceleration service modules according to the domain name resolution request, and determining a load capability parameter, wherein the load capability parameter is used to represent a load capacity ratio among the available service modules (S200); determining a domain name resolution result according to the domain name resolution request and the load capability parameter, wherein the domain name resolution result carries service addresses corresponding to each available service module, and the ratio of the number of service addresses corresponding to each available service module corresponds to the load capability parameter (S300); and sending the domain name resolution result to the LDNS module, such that the LDNS module can send the service addresses to a terminal device according to the domain name resolution result (S400).

Description

负载均衡方法、设备及计算机可读存储介质Load balancing method, device and computer-readable storage medium
相关申请的交叉引用Cross References to Related Applications
本申请基于申请号为202111366792.0、申请日为2021年11月18日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on a Chinese patent application with application number 202111366792.0 and a filing date of November 18, 2021, and claims the priority of this Chinese patent application. The entire content of this Chinese patent application is hereby incorporated by reference into this application.
技术领域technical field
本申请涉及通信技术领域,例如涉及一种负载均衡方法、设备及计算机可读存储介质。The present application relates to the technical field of communications, for example, to a load balancing method, device, and computer-readable storage medium.
背景技术Background technique
内容分发网络(Content Delivery Network,CDN)是在网络边缘提供对缓存加速内容的缓存,从而在靠近用户的加速服务器组为用户提供加速服务,从而降低对服务源站的压力以及承载网络的压力,同时能够为用户提供更快的服务响应以及更稳定的流式加速服务。CDN调度系统通过域名服务器(Domain Name Server,DNS)进行动态域名解析以向本地域名服务器(Local Domain Name Server,LDNS)返回可用的加速服务器组的地址信息,终端设备根据LDNS返回的地址信息向对应的加速服务器组发起服务请求。在相关技术中,当终端设备归属的加速服务器组存在多个时,各个加速服务器组之间的负载不均,导致内容分发网络的效率降低。Content Delivery Network (CDN) is to provide caching of cached accelerated content at the edge of the network, so as to provide users with accelerated services in the accelerated server group close to the user, thereby reducing the pressure on the service source station and the pressure on the carrying network. At the same time, it can provide users with faster service response and more stable streaming acceleration service. The CDN scheduling system performs dynamic domain name resolution through the domain name server (Domain Name Server, DNS) to return the address information of the available acceleration server group to the local domain name server (Local Domain Name Server, LDNS). The accelerated server group initiates a service request. In the related art, when there are multiple acceleration server groups to which the terminal device belongs, the load among the acceleration server groups is uneven, resulting in a decrease in the efficiency of the content distribution network.
发明内容Contents of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics described in detail in this article. This summary is not intended to limit the scope of the claims.
本申请实施例提供了一种负载均衡方法、设备及计算机可读存储介质。Embodiments of the present application provide a load balancing method, device, and computer-readable storage medium.
第一方面,本申请实施例提供了一种负载均衡方法,应用于CDN调度系统的DNS模块,所述CDN调度系统包括所述DNS模块、LDNS模块和多个加速服务模块;所述方法包括:接收由所述LDNS模块发送的域名解析请求;根据所述域名解析请求从所述加速服务模块中选取多个可用服务模块并确定负载能力参数,所述负载能力参数用于表征各个所述可用服务模块之间的负载能力比;根据所述域名解析请求和所述负载能力参数确定域名解析结果,所述域名解析结果携带有对应于各个所述可用服务模块的服务地址,且各个所述可用服务模块对应的所述服务地址的数量之比对应于所述负载能力参数;将所述域名解析结果发送至所述LDNS模块,以使所述LDNS模块能够根据所述域名解析结果向终端设备发送所述服务地址。In the first aspect, the embodiment of the present application provides a load balancing method, which is applied to the DNS module of the CDN scheduling system, and the CDN scheduling system includes the DNS module, the LDNS module and a plurality of acceleration service modules; the method includes: receiving a domain name resolution request sent by the LDNS module; selecting a plurality of available service modules from the acceleration service module according to the domain name resolution request and determining a load capacity parameter, the load capacity parameter is used to characterize each of the available services The load capacity ratio between modules; determine the domain name resolution result according to the domain name resolution request and the load capacity parameter, the domain name resolution result carries the service address corresponding to each of the available service modules, and each of the available service modules The ratio of the number of service addresses corresponding to the modules corresponds to the load capacity parameter; sending the domain name resolution result to the LDNS module, so that the LDNS module can send the domain name resolution result to the terminal device according to the domain name resolution result. above service address.
第二方面,本申请实施例提供了一种负载均衡方法,应用于CDN调度系统的LDNS模块,所述CDN调度系统包括DNS模块、所述LDNS模块和多个加速服务模块;所述方法包括:接收由所述DNS模块发送的域名解析结果,所述域名解析结果携带有多个可用服务模块分别对应的服务地址,所述可用服务模块由所述DNS模块从多个所述加速服务模块中选取,且各个所述可用服务模块对应的所述服务地址的数量之比与各个所述服务模块之间的负载能力之比对应;根据所述域名解析结果得到服务地址,并将所述服务地址发送至终端设备,以使所述终端设备能够根据所述服务地址与所述加速服务模块之间建立内容加速服务。In the second aspect, the embodiment of the present application provides a load balancing method, which is applied to the LDNS module of the CDN dispatching system, and the CDN dispatching system includes a DNS module, the LDNS module and a plurality of acceleration service modules; the method includes: receiving the domain name resolution result sent by the DNS module, the domain name resolution result carrying service addresses respectively corresponding to a plurality of available service modules, the available service modules are selected by the DNS module from a plurality of the accelerated service modules , and the ratio of the number of service addresses corresponding to each of the available service modules corresponds to the ratio of the load capacity of each of the service modules; the service address is obtained according to the domain name resolution result, and the service address is sent to to the terminal device, so that the terminal device can establish a content acceleration service with the acceleration service module according to the service address.
第三方面,本申请实施例提供了一种网络设备,包括存储器、处理器及存储在存储器上 并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面或第二方面实施例中的负载均衡方法。In a third aspect, an embodiment of the present application provides a network device, including a memory, a processor, and a computer program stored in the memory and operable on the processor. When the processor executes the computer program, the above-mentioned first The load balancing method in the embodiment of the first aspect or the second aspect.
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使计算机执行如上述第一方面或第二方面实施例中的负载均衡方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to make a computer perform the above-mentioned first aspect or the first aspect. The load balancing method in the second aspect embodiment.
本申请的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本申请而了解。本申请的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的内容来实现和获得。Additional features and advantages of the application will be set forth in the description which follows, and, in part, will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the matter particularly pointed out in the written description, claims hereof as well as the appended drawings.
附图说明Description of drawings
附图用来提供对本申请技术方案的进一步理解,并且构成说明书的一部分,与本申请的实施例一起用于解释本申请的技术方案,并不构成对本申请技术方案的限制。The accompanying drawings are used to provide a further understanding of the technical solution of the present application, and constitute a part of the specification, and are used together with the embodiments of the present application to explain the technical solution of the present application, and do not constitute a limitation to the technical solution of the present application.
图1是本申请一个实施例提供的CDN调度系统的示意图;FIG. 1 is a schematic diagram of a CDN scheduling system provided by an embodiment of the present application;
图2是本申请一个实施例提供的负载均衡方法的流程图;Fig. 2 is a flowchart of a load balancing method provided by an embodiment of the present application;
图3是本申请一个实施例提供的从加速服务模块中选取多个可用服务模块的示例流程图;Fig. 3 is an example flowchart of selecting multiple available service modules from accelerated service modules provided by an embodiment of the present application;
图4是图3中步骤S220的示例流程图;Fig. 4 is the example flowchart of step S220 in Fig. 3;
图5是图4中步骤S223的示例流程图;Fig. 5 is an example flowchart of step S223 in Fig. 4;
图6是本申请一个实施例提供的确定负载能力参数的示例流程图;FIG. 6 is an example flow chart for determining load capacity parameters provided by an embodiment of the present application;
图7是本申请一个实施例提供的根据域名解析请求和负载能力参数确定域名解析结果的示例流程图;Fig. 7 is an exemplary flow chart of determining a domain name resolution result according to a domain name resolution request and load capacity parameters provided by an embodiment of the present application;
图8是本申请另一实施例提供的负载均衡方法的流程图;FIG. 8 is a flowchart of a load balancing method provided by another embodiment of the present application;
图9是本申请另一实施例提供的负载均衡方法的流程图;FIG. 9 is a flowchart of a load balancing method provided by another embodiment of the present application;
图10是本申请另一实施例提供的负载均衡方法的流程图;FIG. 10 is a flowchart of a load balancing method provided by another embodiment of the present application;
图11是本申请一个实施例提供的网络设备200的示意图。Fig. 11 is a schematic diagram of a network device 200 provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, not to limit the present application.
需要说明的是,虽然在装置示意图中进行了功能模块划分,在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于装置中的模块划分,或流程图中的顺序执行所示出或描述的步骤。说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that although the functional modules are divided in the schematic diagram of the device, and the logical sequence is shown in the flowchart, in some cases, it can be executed in a different order than the module division in the device or the flowchart in the flowchart. steps shown or described. The terms "first", "second" and the like in the specification and claims and the above drawings are used to distinguish similar objects, and not necessarily used to describe a specific sequence or sequence.
本申请实施例提供了一种负载均衡方法,包括接收由LDNS模块发送的域名解析请求;根据域名解析请求从加速服务模块中选取多个可用服务模块并确定负载能力参数,负载能力参数用于表征各个可用服务模块之间的负载能力比;根据域名解析请求和负载能力参数确定域名解析结果,域名解析结果携带有对应于各个可用服务模块的服务地址,且各个可用服务模块对应的服务地址的数量之比对应于负载能力参数;将域名解析结果发送至LDNS模块,以使 LDNS模块能够根据域名解析结果向终端设备发送服务地址。通过从CDN调度系统的加速服务模块中选取多个可用服务模块并确定可用服务模块的负载能力参数,能够得知各个可用服务模块之间的负载能力之比,此外,域名解析结果由域名解析请求和负载能力参数所共同确定,以使得域名解析结果所携带的对应于各个可用服务模块的服务地址数量之比对应于负载能力参数所表征的各个可用服务模块的负载能力之比;由于终端设备是根据域名解析结果携带的服务地址与可用服务模块建立内容加速服务,而域名解析结果所携带的对应于各个可用服务模块的服务地址数量之比对应于负载能力参数所表征的各个可用服务模块的负载能力之比,因此本申请实施例能够均衡内容分发网络中的各个可用服务模块,也即各个加速服务器组的负载,从而提高内容分发网络的效率。The embodiment of the present application provides a load balancing method, including receiving the domain name resolution request sent by the LDNS module; selecting multiple available service modules from the acceleration service module according to the domain name resolution request and determining the load capacity parameter, the load capacity parameter is used to represent The load capacity ratio between each available service module; determine the domain name resolution result according to the domain name resolution request and load capacity parameters, the domain name resolution result carries the service address corresponding to each available service module, and the number of service addresses corresponding to each available service module The ratio corresponds to the load capacity parameter; the domain name resolution result is sent to the LDNS module, so that the LDNS module can send the service address to the terminal device according to the domain name resolution result. By selecting multiple available service modules from the accelerated service modules of the CDN dispatching system and determining the load capacity parameters of the available service modules, the ratio of the load capacity among the available service modules can be known. In addition, the domain name resolution results are determined by the domain name resolution request jointly determined with the load capacity parameter, so that the ratio of the number of service addresses corresponding to each available service module carried by the domain name resolution result corresponds to the ratio of the load capacity of each available service module represented by the load capacity parameter; since the terminal device is The content acceleration service is established according to the service address carried by the domain name resolution result and the available service modules, and the ratio of the number of service addresses corresponding to each available service module carried by the domain name resolution result corresponds to the load of each available service module represented by the load capacity parameter Therefore, the embodiment of the present application can balance the loads of each available service module in the content delivery network, that is, each acceleration server group, thereby improving the efficiency of the content delivery network.
下面结合附图,对本申请实施例作进一步阐述。The embodiments of the present application will be further described below in conjunction with the accompanying drawings.
图1是本申请一个实施例提供的CDN调度系统的示意图,在图1的示例中,CDN调度系统包括DNS模块100、LDNS模块110和多个加速服务模块120,LDNS模块110能够接收由用户终端发送的域名解析请求,并向用户终端发送对应于域名解析请求的服务地址,使得用户终端能够根据服务地址与对应于该服务地址的加速服务模块120之间建立内容加速服务。Fig. 1 is a schematic diagram of a CDN dispatching system provided by an embodiment of the present application. In the example of Fig. 1, the CDN dispatching system includes a DNS module 100, an LDNS module 110 and a plurality of acceleration service modules 120, and the LDNS module 110 can receive the The domain name resolution request sent, and the service address corresponding to the domain name resolution request is sent to the user terminal, so that the user terminal can establish a content acceleration service according to the service address and the acceleration service module 120 corresponding to the service address.
在一实施例中,LDNS模块110能够接收由用户终端发送的域名解析请求,从而根据域名解析请求查找LDNS模块110本地是否缓存有对应于该域名解析请求的预缓存解析结果,若LDNS模块110本地存在预缓存解析结果,则向用户终端发送该预缓存解析结果所表征的服务地址,以使用户终端能够根据该服务地址与对应于该服务地址的加速服务模块120之间建立内容加速服务。若LDNS模块110本地不存在预缓存解析结果,则LDNS模块110将上述域名解析请求转发至DNS模块100,并从DNS模块100获取域名解析结果并缓存该域名解析结果。In one embodiment, the LDNS module 110 can receive the domain name resolution request sent by the user terminal, so as to check whether the LDNS module 110 locally caches the pre-cached resolution result corresponding to the domain name resolution request according to the domain name resolution request, if the LDNS module 110 locally If there is a pre-cached analysis result, the service address represented by the pre-cached analysis result is sent to the user terminal, so that the user terminal can establish a content acceleration service according to the service address and the acceleration service module 120 corresponding to the service address. If the LDNS module 110 does not have a pre-cached resolution result locally, the LDNS module 110 forwards the domain name resolution request to the DNS module 100, obtains the domain name resolution result from the DNS module 100, and caches the domain name resolution result.
在一实施例中,DNS模块100能够根据由LDNS模块110发送的域名解析请求确定域名解析结果,并将该域名解析结果发送至LDNS模块110。In one embodiment, the DNS module 100 can determine the domain name resolution result according to the domain name resolution request sent by the LDNS module 110 , and send the domain name resolution result to the LDNS module 110 .
在一实施例中,DNS模块100能够获取加速服务模块120的实时性能参数,并根据加速服务模块120的实时性能参数和权重系数判断加速服务模块120的可用性,以便从加速服务模块120中选取可用服务模块。In one embodiment, the DNS module 100 can obtain the real-time performance parameters of the acceleration service module 120, and judge the availability of the acceleration service module 120 according to the real-time performance parameters and weight coefficients of the acceleration service module 120, so as to select available parameters from the acceleration service module 120. service module.
在一实施例中,DNS模块100能够确定各个加速服务模块120的权重系数,并根据权重系数和预设调度策略从加速服务模块120中选取多个可用服务模块。In an embodiment, the DNS module 100 can determine the weight coefficient of each acceleration service module 120, and select multiple available service modules from the acceleration service module 120 according to the weight coefficient and a preset scheduling policy.
需要说明的是,本申请实施例的预设调度策略,包括但不限于以下一种或多种影响因素:业务类型、地理位置、容灾要求、IP地址池和域名解析请求类型。It should be noted that the preset scheduling strategy in this embodiment of the present application includes but is not limited to one or more of the following influencing factors: business type, geographical location, disaster recovery requirements, IP address pool, and domain name resolution request type.
在一实施例中,加速服务模块120能够提供内容加速服务,并且加速服务模块120设置有性能查询接口,以便于响应外部设备的性能查询请求,例如,加速服务模块120能够响应于DNS模块100发送的性能查询请求,向DNS模块100发送实时性能参数。In one embodiment, the acceleration service module 120 can provide content acceleration service, and the acceleration service module 120 is provided with a performance query interface, so as to respond to the performance query request of the external device, for example, the acceleration service module 120 can respond to the DNS module 100 sending The real-time performance parameters are sent to the DNS module 100 in the performance query request.
需要说明的是,每个加速服务模块120至少存在一个服务地址,也即对外的IP地址。It should be noted that each acceleration service module 120 has at least one service address, that is, an external IP address.
需要说明的是,用户终端可以是所有可能会触发域名解析请求的客户端,例如,用户终端可以是媒体终端、浏览器或者服务器客户端。It should be noted that the user terminal may be any client that may trigger a domain name resolution request, for example, the user terminal may be a media terminal, a browser, or a server client.
需要说明的是,本申请实施例的LDNS模块110,支持部署在客户端、区域或者骨干网。LDNS模块110可以是多级组网架构,在LDNS模块110的多级组网架构中至少存在一级用于域名解析代理,每一级LDNS模块110由至少一台服务器组成。It should be noted that, the LDNS module 110 of the embodiment of the present application supports deployment in client, area or backbone network. The LDNS module 110 may be a multi-level networking architecture. In the multi-level networking architecture of the LDNS module 110, there is at least one level for domain name resolution agents, and each level of the LDNS module 110 is composed of at least one server.
需要说明的是,本申请实施例的DNS模块100由至少一台服务器组成。It should be noted that the DNS module 100 in the embodiment of the present application is composed of at least one server.
需要说明的是,本申请实施例的加速服务模块120由至少一台服务器组成,每个加速服务模块120为一个服务器组,CDN调度系统中存在至少一个服务器组。It should be noted that the acceleration service module 120 in the embodiment of the present application is composed of at least one server, each acceleration service module 120 is a server group, and there is at least one server group in the CDN scheduling system.
本申请实施例描述的CDN调度系统以及应用场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域技术人员可知,随着CDN调度系统的演变和新应用场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。The CDN scheduling system and application scenarios described in the embodiments of this application are to illustrate the technical solutions of the embodiments of the application more clearly, and do not constitute a limitation to the technical solutions provided in the embodiments of the application. Those skilled in the art know that with the CDN For the evolution of the scheduling system and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
本领域技术人员可以理解的是,图1中示出的CDN调度系统并不构成对本申请实施例的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the CDN scheduling system shown in Figure 1 does not constitute a limitation to the embodiment of the present application, and may include more or less components than those shown in the figure, or combine certain components, or have different Part placement.
基于上述CDN调度系统,下面提出本申请的负载均衡方法的各个实施例。Based on the above CDN scheduling system, various embodiments of the load balancing method of the present application are proposed below.
如图2所示,图2是本申请一个实施例提供的负载均衡方法的流程图,应用于CDN调度系统的DNS模块,在图2的示例中,本申请实施例的负载均衡方法包括但不限于步骤S100、步骤S200、步骤S300和步骤S400。As shown in Figure 2, Figure 2 is a flow chart of a load balancing method provided by an embodiment of the present application, which is applied to the DNS module of the CDN scheduling system. In the example of Figure 2, the load balancing method of the embodiment of the present application includes but does not It is limited to step S100, step S200, step S300 and step S400.
步骤S100,接收由LDNS模块发送的域名解析请求。Step S100, receiving a domain name resolution request sent by the LDNS module.
在一实施例中,LDNS模块能够接收由用户终端发送的域名解析请求,从而根据域名解析请求查找LDNS模块本地是否缓存有对应于该域名解析请求的预缓存解析结果,若LDNS模块本地存在预缓存解析结果,则向用户终端发送该预缓存解析结果所表征的服务地址,以使用户终端能够根据该服务地址与对应于该服务地址的加速服务模块之间建立内容加速服务。若LDNS模块本地不存在预缓存解析结果,则LDNS模块将上述域名解析请求转发至DNS模块。In one embodiment, the LDNS module can receive the domain name resolution request sent by the user terminal, so as to find out whether the LDNS module locally caches the pre-cached resolution result corresponding to the domain name resolution request according to the domain name resolution request, if the LDNS module locally has a pre-cached If the analysis result is obtained, the service address represented by the pre-cached analysis result is sent to the user terminal, so that the user terminal can establish a content acceleration service according to the service address and the acceleration service module corresponding to the service address. If the LDNS module does not have a pre-cached resolution result locally, the LDNS module forwards the domain name resolution request to the DNS module.
步骤S200,根据域名解析请求从加速服务模块中选取多个可用服务模块并确定负载能力参数,负载能力参数用于表征各个可用服务模块之间的负载能力比。Step S200, select a plurality of available service modules from the acceleration service modules according to the domain name resolution request and determine a load capacity parameter, which is used to represent the load capacity ratio among the available service modules.
在一实施例中,DNS模块能够根据由LDNS模块发送的域名解析请求确定域名解析结果,并将该域名解析结果发送至LDNS模块。In one embodiment, the DNS module can determine the domain name resolution result according to the domain name resolution request sent by the LDNS module, and send the domain name resolution result to the LDNS module.
在一实施例中,DNS模块能够获取加速服务模块的实时性能参数,并根据加速服务模块的实时性能参数和权重系数判断加速服务模块的可用性,以便从加速服务模块中选取可用服务模块。In one embodiment, the DNS module can acquire the real-time performance parameters of the acceleration service modules, and judge the availability of the acceleration service modules according to the real-time performance parameters and weight coefficients of the acceleration service modules, so as to select available service modules from the acceleration service modules.
在一实施例中,DNS模块能够确定各个加速服务模块的权重系数,并根据权重系数和预设调度策略从加速服务模块中选取多个可用服务模块。In one embodiment, the DNS module can determine the weight coefficients of each acceleration service module, and select multiple available service modules from the acceleration service modules according to the weight coefficient and a preset scheduling policy.
需要说明的是,本申请实施例的预设调度策略,包括但不限于以下一种或多种影响因素:业务类型、地理位置、容灾要求、IP地址池和域名解析请求类型。It should be noted that the preset scheduling strategy in this embodiment of the present application includes but is not limited to one or more of the following influencing factors: business type, geographical location, disaster recovery requirements, IP address pool, and domain name resolution request type.
在一实施例中,预设调度策略能够根据上述影响因素中的一个或多个影响因素从所有加速服务模块中选取可用服务模块,例如,当选取地理位置作为预设调度策略的影响因素,若发起域名解析请求的用户终端的地理位置与加速服务模块中的一部分位于同一地理空间范围内,则选取此部分的加速服务模块作为可用服务模块,以此保证可用服务模块的响应速度。In an embodiment, the preset scheduling strategy can select available service modules from all accelerated service modules according to one or more of the above-mentioned influencing factors. If the geographic location of the user terminal that initiates the domain name resolution request is within the same geographic space as some of the acceleration service modules, this part of the acceleration service modules is selected as the available service modules, so as to ensure the response speed of the available service modules.
在一实施例中,权重系数用于表征向加速服务模块分配负载的偏好程度,例如,用于提供同样的内容加速服务的两个加速服务模块,若其中一个加速服务模块的权重系数大于另一加速服务模块的权重系数,则在其余影响因素相同的情况下,CDN调度系统优先向权重系数更大的加速服务模块分配负载。In an embodiment, the weight coefficient is used to characterize the preference degree of load distribution to the acceleration service module, for example, two acceleration service modules for providing the same content acceleration service, if the weight coefficient of one acceleration service module is greater than the other If the weight coefficient of the acceleration service module is different, the CDN scheduling system will give priority to allocating load to the acceleration service module with a larger weight coefficient when other influencing factors are the same.
在一实施例中,权重系数由业务引入总量和包括所有加速服务模块的加速服务模块集合所确定,业务引入总量用于表示引入包括该加速服务模块集合的CDN调度系统的所有业务类 型,由于不同的加速服务模块对于不同业务类型的加速性能不一致,因此需要根据业务引入总量和加速服务模块集合具体确定各个加速服务模块的权重系数。In one embodiment, the weight coefficient is determined by the total amount of business introduction and the acceleration service module set including all acceleration service modules, and the total amount of business introduction is used to represent all business types introduced into the CDN scheduling system including the acceleration service module set, Since the acceleration performance of different acceleration service modules for different business types is inconsistent, it is necessary to specifically determine the weight coefficient of each acceleration service module according to the total amount of business introduction and the set of acceleration service modules.
步骤S300,根据域名解析请求和负载能力参数确定域名解析结果,域名解析结果携带有对应于各个可用服务模块的服务地址,且各个可用服务模块对应的服务地址的数量之比对应于负载能力参数。Step S300, determine the domain name resolution result according to the domain name resolution request and the load capacity parameter, the domain name resolution result carries the service address corresponding to each available service module, and the ratio of the number of service addresses corresponding to each available service module corresponds to the load capacity parameter.
由于终端设备是根据域名解析结果携带的服务地址与可用服务模块建立内容加速服务,而域名解析结果所携带的对应于各个可用服务模块的服务地址数量之比对应于负载能力参数所表征的各个可用服务模块的负载能力之比,因此本申请实施例能够均衡内容分发网络中的各个可用服务模块的负载,使得各个可用服务模块的负载与自身的负载能力相匹配。Since the terminal device establishes the content acceleration service based on the service addresses and available service modules carried by the domain name resolution results, the ratio of the number of service addresses corresponding to each available service module carried by the domain name resolution results corresponds to each available service module represented by the load capacity parameter. Therefore, the embodiment of the present application can balance the load of each available service module in the content distribution network, so that the load of each available service module matches its own load capacity.
步骤S400,将域名解析结果发送至LDNS模块,以使LDNS模块能够根据域名解析结果向终端设备发送服务地址。Step S400, sending the domain name resolution result to the LDNS module, so that the LDNS module can send the service address to the terminal device according to the domain name resolution result.
在一实施例中,终端设备能够根据服务地址与对应于该服务地址的可用服务模块建立内容加速服务。In an embodiment, the terminal device can establish the content acceleration service according to the service address and the available service modules corresponding to the service address.
在一实施例中,服务地址是可用服务模块的IP地址。In one embodiment, the service address is an IP address of an available service module.
通过从CDN调度系统的加速服务模块中选取多个可用服务模块并确定可用服务模块的负载能力参数,能够得知各个可用服务模块之间的负载能力之比,此外,域名解析结果由域名解析请求和负载能力参数所共同确定,以使得域名解析结果所携带的对应于各个可用服务模块的服务地址数量之比对应于负载能力参数所表征的各个可用服务模块的负载能力之比;由于终端设备是根据域名解析结果携带的服务地址与可用服务模块建立内容加速服务,而域名解析结果所携带的对应于各个可用服务模块的服务地址数量之比对应于负载能力参数所表征的各个可用服务模块的负载能力之比,因此本申请实施例能够均衡内容分发网络中的各个可用服务模块,也即各个加速服务器组的负载,从而提高内容分发网络的效率。By selecting multiple available service modules from the accelerated service modules of the CDN dispatching system and determining the load capacity parameters of the available service modules, the ratio of the load capacity among the available service modules can be known. In addition, the domain name resolution results are determined by the domain name resolution request jointly determined with the load capacity parameter, so that the ratio of the number of service addresses corresponding to each available service module carried by the domain name resolution result corresponds to the ratio of the load capacity of each available service module represented by the load capacity parameter; since the terminal device is The content acceleration service is established according to the service address carried by the domain name resolution result and the available service modules, and the ratio of the number of service addresses corresponding to each available service module carried by the domain name resolution result corresponds to the load of each available service module represented by the load capacity parameter Therefore, the embodiment of the present application can balance the loads of each available service module in the content delivery network, that is, each acceleration server group, thereby improving the efficiency of the content delivery network.
如图3所示,图3是本申请一个实施例提供的从加速服务模块中选取多个可用服务模块的示例流程图,在图3的示例中,步骤S200包括但不限于步骤S210和步骤S220:As shown in Figure 3, Figure 3 is an example flowchart for selecting multiple available service modules from accelerated service modules provided by an embodiment of the present application. In the example of Figure 3, step S200 includes but is not limited to step S210 and step S220 :
步骤S210,确定各个加速服务模块的权重系数;Step S210, determining the weight coefficient of each acceleration service module;
步骤S220,根据权重系数和预设调度策略从加速服务模块中选取多个可用服务模块。Step S220, selecting a plurality of available service modules from the acceleration service modules according to the weight coefficient and the preset scheduling strategy.
在一实施例中,DNS模块能够获取加速服务模块的实时性能参数,并根据加速服务模块的实时性能参数和权重系数判断加速服务模块的可用性,以便从加速服务模块中选取可用服务模块。In one embodiment, the DNS module can acquire the real-time performance parameters of the acceleration service modules, and judge the availability of the acceleration service modules according to the real-time performance parameters and weight coefficients of the acceleration service modules, so as to select available service modules from the acceleration service modules.
在一实施例中,DNS模块能够确定各个加速服务模块的权重系数,并根据权重系数和预设调度策略从加速服务模块中选取多个可用服务模块。In one embodiment, the DNS module can determine the weight coefficients of each acceleration service module, and select multiple available service modules from the acceleration service modules according to the weight coefficient and a preset scheduling policy.
需要说明的是,本申请实施例的预设调度策略,包括但不限于以下一种或多种影响因素:业务类型、地理位置、容灾要求、IP地址池和域名解析请求类型。It should be noted that the preset scheduling strategy in this embodiment of the present application includes but is not limited to one or more of the following influencing factors: business type, geographical location, disaster recovery requirements, IP address pool, and domain name resolution request type.
在一实施例中,预设调度策略能够根据上述影响因素中的一个或多个影响因素从所有加速服务模块中选取可用服务模块,例如,当选取地理位置作为预设调度策略的影响因素,若发起域名解析请求的用户终端的地理位置与加速服务模块中的一部分位于同一地理空间范围内,则选取此部分的加速服务模块作为可用服务模块,以此保证可用服务模块的响应速度。In an embodiment, the preset scheduling strategy can select available service modules from all accelerated service modules according to one or more of the above-mentioned influencing factors. If the geographic location of the user terminal that initiates the domain name resolution request is within the same geographic space as some of the acceleration service modules, this part of the acceleration service modules is selected as the available service modules, so as to ensure the response speed of the available service modules.
在一实施例中,权重系数用于表征向加速服务模块分配负载的偏好程度,例如,用于提供同样的内容加速服务的两个加速服务模块,若其中一个加速服务模块的权重系数大于另一 加速服务模块的权重系数,则在其余影响因素相同的情况下,CDN调度系统优先向权重系数更大的加速服务模块分配负载。In an embodiment, the weight coefficient is used to characterize the preference degree of load distribution to the acceleration service module, for example, two acceleration service modules for providing the same content acceleration service, if the weight coefficient of one acceleration service module is greater than the other If the weight coefficient of the acceleration service module is different, the CDN scheduling system will give priority to allocating load to the acceleration service module with a larger weight coefficient when other influencing factors are the same.
在一实施例中,权重系数由业务引入总量和包括所有加速服务模块的加速服务模块集合所确定,业务引入总量用于表示引入包括该加速服务模块集合的CDN调度系统的所有业务类型,由于不同的加速服务模块对于不同业务类型的加速性能不一致,因此需要根据业务引入总量和加速服务模块集合具体确定各个加速服务模块的权重系数。In one embodiment, the weight coefficient is determined by the total amount of business introduction and the acceleration service module set including all acceleration service modules, and the total amount of business introduction is used to represent all business types introduced into the CDN scheduling system including the acceleration service module set, Since the acceleration performance of different acceleration service modules for different business types is inconsistent, it is necessary to specifically determine the weight coefficient of each acceleration service module according to the total amount of business introduction and the set of acceleration service modules.
如图4所示,图4是图3中步骤S220的示例流程图,在图4的示例中,步骤S220包括但不限于步骤S221、步骤S222和步骤S223:As shown in Figure 4, Figure 4 is an example flowchart of step S220 in Figure 3, in the example of Figure 4, step S220 includes but not limited to step S221, step S222 and step S223:
步骤S221,根据权重系数和预设调度策略确定分级调度策略;Step S221, determining a hierarchical scheduling strategy according to the weight coefficient and the preset scheduling strategy;
步骤S222,根据分级调度策略从各个加速服务模块中选取多个待用服务模块;Step S222, selecting a plurality of service modules to be used from each acceleration service module according to the hierarchical scheduling strategy;
步骤S223,根据分级调度策略从待用服务模块中选取多个可用服务模块。Step S223, selecting a plurality of available service modules from the service modules to be used according to the hierarchical scheduling strategy.
在一实施例中,分级调度策略用于从加速服务模块中选取待用服务模块,再从待用服务模块中选取可用服务模块,未被选作可用服务模块的待用服务模块可以作为可用服务模块在无法正常工作时的备份,从而提高了稳定性。In one embodiment, the hierarchical scheduling strategy is used to select the service modules to be used from the accelerated service modules, and then select the available service modules from the service modules to be used, and the service modules not selected as available service modules can be used as available services Backup of modules in case they fail to work properly, thus improving stability.
在一实施例中,分级调度策略的影响因素包括但不限于以下一种或多种:业务类型、地理位置、容灾要求、IP地址池和域名解析请求类型。In an embodiment, factors affecting the hierarchical scheduling strategy include but are not limited to one or more of the following: business type, geographical location, disaster recovery requirements, IP address pool, and domain name resolution request type.
在一实施例中,分级调度策略能够根据上述影响因素中的一个或多个影响因素从所有加速服务模块中选取待用服务模块,例如,当选取地理位置作为预设调度策略的影响因素,若发起域名解析请求的用户终端的地理位置与加速服务模块中的一部分位于相同或相邻的地理空间范围内,则选取此部分的加速服务模块作为待用服务模块。In an embodiment, the hierarchical scheduling strategy can select a service module to be used from all accelerated service modules according to one or more of the above-mentioned influencing factors. For example, when the geographic location is selected as the influencing factor of the default scheduling strategy, If the geographic location of the user terminal that initiates the domain name resolution request is within the same or adjacent geographical space as some of the acceleration service modules, then select this part of the acceleration service module as the standby service module.
在一实施例中,分级调度策略能够根据上述影响因素中的一个或多个影响因素从所有待用服务模块中选取可用服务模块,例如,当选取地理位置作为预设调度策略的影响因素,若发起域名解析请求的用户终端的地理位置与加速服务模块中的一部分位于相同或相邻的地理空间范围内,则选取此部分的加速服务模块作为待用服务模块;并且,再选取与发起域名解析请求的用户终端的地理位置位于相同的地理空间范围的待用服务模块作为可用服务模块,因此选取的可用服务模块由于和用户终端的地理位置出于同一地理空间范围,因此在所有加速服务模块中有着最快的相应速度,而未被选为可用服务模块的待用服务模块,其响应速度低于可用服务模块,因此可以作为可用服务模块的备份,从而能够在保证响应速度的情况下提升容灾能力。In an embodiment, the hierarchical scheduling strategy can select an available service module from all service modules to be used according to one or more of the above-mentioned influencing factors. For example, when selecting a geographic location as an influencing factor of the preset scheduling strategy, if The geographic location of the user terminal that initiates the domain name resolution request is located in the same or adjacent geographic space as part of the acceleration service module, then select this part of the acceleration service module as the service module to be used; and, then select and initiate domain name resolution The requested service module whose geographical location is located in the same geographic space as the available service module is used as the available service module. Therefore, the selected available service module is in the same geographic space as the user terminal’s geographical location, so it is among all the acceleration service modules The standby service module that has the fastest response speed but is not selected as the available service module has a lower response speed than the available service module, so it can be used as the backup of the available service module, thereby improving the capacity while ensuring the response speed. Disaster capability.
如图5所示,图5是图4中步骤S223的示例流程图,在图5的示例中,步骤S223还包括但不限于步骤S224、步骤S225和步骤S226:As shown in Figure 5, Figure 5 is an example flowchart of step S223 in Figure 4, in the example of Figure 5, step S223 also includes but not limited to step S224, step S225 and step S226:
步骤S224,根据分级调度策略将待用服务模块分为第一待用模块和第二待用模块;Step S224, divide the standby service module into a first standby module and a second standby module according to the hierarchical scheduling strategy;
步骤S225,将第一待用模块作为可用服务模块;Step S225, using the first standby module as an available service module;
步骤S226,当第一待用模块发生异常,选取第二待用模块替代发生异常的第一待用模块作为可用服务模块。Step S226, when the first standby module is abnormal, select the second standby module to replace the abnormal first standby module as an available service module.
需要说明的是,上述分级调度策略不限于仅将待用服务模块分为两级,例如,待用服务模块还可以分为第一待用模块、第二待用模块和第三待用模块,若第一待用模块异常,而第二待用模块也均出现异常,则可以选取第三待用模块替代发生异常的第一待用模块作为可用服务模块。It should be noted that the above hierarchical scheduling strategy is not limited to only dividing the standby service modules into two levels. For example, the standby service modules can also be divided into a first standby module, a second standby module, and a third standby module. If the first standby module is abnormal and the second standby modules are also abnormal, the third standby module may be selected to replace the abnormal first standby module as an available service module.
如图6所示,图6是本申请一个实施例提供的确定负载能力参数的示例流程图,在图6的示例中,步骤S200还包括但不限于步骤S230和步骤S240:As shown in FIG. 6, FIG. 6 is an example flowchart for determining load capacity parameters provided by an embodiment of the present application. In the example in FIG. 6, step S200 also includes but is not limited to step S230 and step S240:
步骤S230,获取可用服务模块的负载能力上限信息;Step S230, obtaining the upper limit information of the load capacity of the available service modules;
步骤S240,根据负载能力上限信息和权重系数确定负载能力参数。Step S240, determining the load capacity parameter according to the load capacity upper limit information and the weight coefficient.
在一实施例中,负载能力参数是根据可用服务模块的负载能力上限信息和权重系数确定的,负载能力上限信息用于表征可用服务模块所能承受的最大负载,以避免可用服务模块被分配的负载超出该可用服务模块的负载能力,从而提高了CDN调度系统的稳定性。In one embodiment, the load capacity parameter is determined according to the load capacity upper limit information and the weight coefficient of the available service modules, and the load capacity upper limit information is used to characterize the maximum load that the available service modules can bear, so as to prevent the available service modules from being allocated The load exceeds the load capacity of the available service module, thereby improving the stability of the CDN scheduling system.
如图7所示,图7是本申请一个实施例提供的根据域名解析请求和负载能力参数确定域名解析结果的示例流程图,在图7的示例中,步骤S300包括但不限于步骤S310、步骤S320、步骤S330和步骤S340:As shown in Figure 7, Figure 7 is an example flow chart of determining the domain name resolution result according to the domain name resolution request and load capacity parameters provided by an embodiment of the present application. In the example of Figure 7, step S300 includes but is not limited to step S310, step S320, step S330 and step S340:
步骤S310,根据域名解析请求确定地址总数;Step S310, determining the total number of addresses according to the domain name resolution request;
步骤S320,根据负载能力参数和负载能力上限信息确定分配参数,分配参数用于表征各个可用服务模块需负载的地址数之比;Step S320, determining allocation parameters according to the load capacity parameters and load capacity upper limit information, and the allocation parameters are used to represent the ratio of the number of addresses required to be loaded by each available service module;
步骤S330,根据地址总数和分配参数确定各个可用服务模块需负载的地址数目;Step S330, determining the number of addresses to be loaded by each available service module according to the total number of addresses and the allocation parameters;
步骤S340,根据域名解析请求和地址数目确定域名解析结果。Step S340, determine the domain name resolution result according to the domain name resolution request and the number of addresses.
在一实施例中,域名解析结果由域名解析请求和负载能力参数所共同确定,以使得域名解析结果所携带的对应于各个可用服务模块的服务地址数量之比对应于负载能力参数所表征的各个可用服务模块的负载能力之比;由于终端设备是根据域名解析结果携带的服务地址与可用服务模块建立内容加速服务,而域名解析结果所携带的对应于各个可用服务模块的服务地址数量之比对应于负载能力参数所表征的各个可用服务模块的负载能力之比,因此本申请实施例能够均衡内容分发网络中的各个可用服务模块,也即各个加速服务器组的负载,从而提高内容分发网络的效率。In an embodiment, the domain name resolution result is jointly determined by the domain name resolution request and the load capacity parameter, so that the ratio of the number of service addresses corresponding to each available service module carried by the domain name resolution result corresponds to each of the load capacity parameters represented by the load capacity parameter. The ratio of the load capacity of the available service modules; since the terminal device establishes the content acceleration service based on the service address carried by the domain name resolution result and the available service module, the ratio of the number of service addresses corresponding to each available service module carried by the domain name resolution result corresponds to The ratio of the load capacity of each available service module represented by the load capacity parameter, so the embodiment of the present application can balance each available service module in the content distribution network, that is, the load of each acceleration server group, thereby improving the efficiency of the content distribution network .
在一实施例中,分配参数用于表征各个可用服务模块需负载的地址数之比,由于在根据负载能力参数分配各可用服务模块需负载的服务地址数目时,可能出现可用服务模块被分配的负载超出其负载能力上限的情况,因此通过确定分配参数,能够将超出服务模块负载能力上限的部分负载转移至未超过负载能力上限的可用服务模块,从而提高了CDN调度系统的稳定性。In one embodiment, the allocation parameter is used to characterize the ratio of the number of addresses to be loaded by each available service module, because when the number of service addresses to be loaded by each available service module is allocated according to the load capacity parameter, there may be a problem that the available service modules are allocated The load exceeds the upper limit of its load capacity. Therefore, by determining the allocation parameters, the part of the load that exceeds the upper limit of the load capacity of the service module can be transferred to the available service module that does not exceed the upper limit of the load capacity, thereby improving the stability of the CDN scheduling system.
如图8所示,图8是本申请另一实施例提供的负载均衡方法的流程图,应用于CDN调度系统的LDNS模块,在图8的示例中,本申请实施例的负载均衡方法包括但不限于步骤S500和步骤S600。As shown in Figure 8, Figure 8 is a flowchart of a load balancing method provided by another embodiment of the present application, which is applied to the LDNS module of the CDN scheduling system. In the example of Figure 8, the load balancing method of the embodiment of the present application includes but It is not limited to step S500 and step S600.
步骤S500,接收由DNS模块发送的域名解析结果,域名解析结果携带有多个可用服务模块分别对应的服务地址,可用服务模块由DNS模块从多个加速服务模块中选取,且各个可用服务模块对应的服务地址的数量之比与各个服务模块之间的负载能力之比对应;Step S500, receiving the domain name resolution result sent by the DNS module, the domain name resolution result carries service addresses corresponding to multiple available service modules, the available service modules are selected by the DNS module from multiple acceleration service modules, and each available service module corresponds to The ratio of the number of service addresses corresponds to the ratio of the load capacity of each service module;
步骤S600,根据域名解析结果得到服务地址,并将服务地址发送至终端设备,以使终端设备能够根据服务地址与加速服务模块之间建立内容加速服务。Step S600, obtain the service address according to the domain name resolution result, and send the service address to the terminal device, so that the terminal device can establish a content acceleration service according to the service address and the acceleration service module.
由于域名解析结果携带有对应于各个可用服务模块的服务地址,且各个可用服务模块对应的服务地址的数量之比对应于负载能力参数,因此在域名解析结果携带的服务地址分配完成后,各个可用服务模块的终端设备连接数量对应于负载能力参数,从而能够实现各个可用服务模块之间的负载均衡,例如,在有两个可用服务模块,且负载能力参数表征的负载能力 比为3:2,DNS模块发送至LDNS模块的域名解析结果中有500个IP地址的情况下,对应于一个可用服务模块的IP地址有300个,对应于另一个可用服务模块的IP地址有200个,在将域名解析结果中所有的IP地址发送至终端设备,并由终端设备与上述可用服务模块建立连接后,两个服务模块的连接数目之比为3:2,达到了各可用服务模块的连接数目,也即各可用服务模块之间的负载对应于负载能力参数以实现负载均衡的效果。Since the domain name resolution results carry service addresses corresponding to each available service module, and the ratio of the number of service addresses corresponding to each available service module corresponds to the load capacity parameter, after the service addresses carried by the domain name resolution results are allocated, each available The number of terminal device connections of a service module corresponds to the load capacity parameter, so that load balancing between available service modules can be achieved. For example, when there are two available service modules, and the load capacity ratio represented by the load capacity parameter is 3:2, If there are 500 IP addresses in the domain name resolution results sent by the DNS module to the LDNS module, there are 300 IP addresses corresponding to one available service module, and 200 IP addresses corresponding to another available service module. All the IP addresses in the analysis results are sent to the terminal equipment, and after the terminal equipment establishes a connection with the above-mentioned available service modules, the ratio of the number of connections between the two service modules is 3:2, reaching the number of connections of each available service module, and also That is, the load among the available service modules corresponds to the load capacity parameter to achieve the effect of load balancing.
如图9所示,图9是本申请另一实施例提供的负载均衡方法的流程图,在图9的示例中,本申请实施例的负载均衡方法包括但不限于步骤S700、步骤S800和步骤S900。As shown in FIG. 9, FIG. 9 is a flowchart of a load balancing method provided by another embodiment of the present application. In the example of FIG. 9, the load balancing method of the embodiment of the present application includes but is not limited to step S700, step S800 and step S900.
步骤S700,接收由终端设备发送的域名解析请求;Step S700, receiving a domain name resolution request sent by the terminal device;
步骤S800,响应于域名解析请求,查找LDNS模块本地是否存在对应于域名解析请求的预缓存解析结果,预缓存解析结果由LDNS模块将域名解析结果缓存于LDNS模块本地而得到;Step S800, in response to the domain name resolution request, search whether there is a pre-cached resolution result corresponding to the domain name resolution request locally in the LDNS module, and the pre-cached resolution result is obtained by the LDNS module caching the domain name resolution result locally in the LDNS module;
步骤S900,当LDNS模块本地不存在预缓存解析结果,将域名解析请求转发至DNS模块。Step S900, when the LDNS module does not have a pre-cached resolution result locally, forward the domain name resolution request to the DNS module.
在一实施例中,LDNS模块能够接收由用户终端发送的域名解析请求,从而根据域名解析请求查找LDNS模块本地是否缓存有对应于该域名解析请求的预缓存解析结果,若LDNS模块本地存在预缓存解析结果,则向用户终端发送该预缓存解析结果所表征的服务地址,以使用户终端能够根据该服务地址与对应于该服务地址的加速服务模块之间建立内容加速服务。若LDNS模块本地不存在预缓存解析结果,则LDNS模块将上述域名解析请求转发至DNS模块,并从DNS模块获取域名解析结果并缓存该域名解析结果。In one embodiment, the LDNS module can receive the domain name resolution request sent by the user terminal, so as to find out whether the LDNS module locally caches the pre-cached resolution result corresponding to the domain name resolution request according to the domain name resolution request, if the LDNS module locally has a pre-cached If the analysis result is obtained, the service address represented by the pre-cached analysis result is sent to the user terminal, so that the user terminal can establish a content acceleration service according to the service address and the acceleration service module corresponding to the service address. If the LDNS module does not have a pre-cached resolution result locally, the LDNS module forwards the domain name resolution request to the DNS module, obtains the domain name resolution result from the DNS module, and caches the domain name resolution result.
如图10所示,图10是本申请另一实施例提供的负载均衡方法的流程图,在图10的示例中,本申请实施例的负载均衡方法包括但不限于步骤S1000和步骤S1100。As shown in FIG. 10 , FIG. 10 is a flowchart of a load balancing method provided by another embodiment of the present application. In the example of FIG. 10 , the load balancing method of the embodiment of the present application includes but is not limited to step S1000 and step S1100 .
步骤S1000,当LDNS模块本地存在预缓存解析结果,根据预缓存解析结果得到服务地址;Step S1000, when the LDNS module has a pre-cached analysis result locally, obtain the service address according to the pre-cached analysis result;
步骤S1100,将服务地址发送至终端设备,以使终端设备能够根据服务地址与加速服务模块之间建立内容加速服务。Step S1100, sending the service address to the terminal device, so that the terminal device can establish a content acceleration service with the acceleration service module according to the service address.
在一实施例中,LDNS模块将DNS模块发送的域名解析结果缓存,预缓存解析结果即为上述缓存在LDNS模块本地的域名解析结果,在预缓存解析结果的缓存期间内,LDNS模块每次接收到对应于预缓存解析结果的域名解析请求,则根据预缓存解析结果向终端设备发送服务地址,由于预缓存解析结果携带有对应于各个可用服务模块的服务地址,且各个可用服务模块对应的服务地址的数量之比对应于负载能力参数,因此在预缓存解析结果携带的服务地址分配完成后,各个可用服务模块的终端设备连接数量对应于负载能力参数,从而能够实现各个可用服务模块之间的负载均衡。In one embodiment, the LDNS module caches the domain name resolution result sent by the DNS module, and the pre-cache resolution result is the local domain name resolution result cached in the LDNS module. During the cache period of the pre-cache resolution result, the LDNS module receives each time When the domain name resolution request corresponding to the pre-cache resolution result is received, the service address is sent to the terminal device according to the pre-cache resolution result. Since the pre-cache resolution result carries the service address corresponding to each available service module, and the service corresponding to each available service module The ratio of the number of addresses corresponds to the load capacity parameter, so after the service addresses carried by the pre-cache analysis result are allocated, the number of terminal device connections of each available service module corresponds to the load capacity parameter, so that the available service modules can be realized. Load balancing.
另外,参照图11,图11是本申请一个实施例提供的网络设备200的示意图,在图11的示例中,该设备包括:存储器220、处理器210及存储在存储器220上并可在处理器210上运行的计算机程序。In addition, referring to FIG. 11, FIG. 11 is a schematic diagram of a network device 200 provided by an embodiment of the present application. In the example of FIG. 11, the device includes: a memory 220, a processor 210, and a A computer program running on 210.
处理器210和存储器220可以通过总线或者其他方式连接。The processor 210 and the memory 220 may be connected through a bus or in other ways.
存储器220作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序以及非暂态性计算机可执行程序。此外,存储器220可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施方式中,存储器220可选包括相对于处理器210远程设置的远程存储器,这些远程存储器可以通过网络连接至该处理器210。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 220, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory 220 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some implementations, the memory 220 may optionally include remote memories that are remotely located relative to the processor 210, and these remote memories may be connected to the processor 210 through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
实现上述实施例的负载均衡方法所需的非暂态软件程序以及指令存储在存储器220中,当被处理器210执行时,执行上述实施例中的负载均衡方法,例如,执行以上描述的图2至图7或图8至图10中的方法步骤。The non-transitory software programs and instructions required to realize the load balancing method of the above-mentioned embodiment are stored in the memory 220, and when executed by the processor 210, the load balancing method in the above-mentioned embodiment is executed, for example, executing the above-described Figure 2 to the method steps in FIG. 7 or FIG. 8 to FIG. 10 .
此外,本申请的一个实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机可执行指令,该计算机可执行指令被一个处理器或控制器执行,例如,被上述装置实施例或设备实施例中的一个处理器执行,可使得上述处理器执行上述实施例中的负载均衡方法,例如,执行以上描述的图2至图7或图8至图10中的方法步骤。In addition, an embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by a processor or a controller, for example, by the above-mentioned Execution by a processor in the device embodiment or the device embodiment may cause the above processor to execute the load balancing method in the above embodiment, for example, execute the method steps in Fig. 2 to Fig. 7 or Fig. 8 to Fig. 10 described above .
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统可以被实施为软件、固件、硬件及其适当的组合。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。Those skilled in the art can understand that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware and an appropriate combination thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit . Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those of ordinary skill in the art, the term computer storage media includes both volatile and nonvolatile media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. permanent, removable and non-removable media. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, tape, magnetic disk storage or other magnetic storage devices, or can Any other medium used to store desired information and which can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .
以上是对本申请的若干实施进行了具体说明,但本申请并不局限于上述实施方式,熟悉本领域的技术人员在不违背本申请本质的前提下还可做出种种的等同变形或替换,这些等同的变形或替换均包含在本申请权利要求所限定的范围内。The above is a specific description of several implementations of the application, but the application is not limited to the above-mentioned implementations, and those skilled in the art can also make various equivalent deformations or replacements without violating the essence of the application. Equivalent modifications or replacements are all within the scope defined by the claims of the present application.

Claims (11)

  1. 负载均衡方法,应用于CDN调度系统的DNS模块,所述CDN调度系统包括所述DNS模块、LDNS模块和多个加速服务模块;The load balancing method is applied to the DNS module of the CDN scheduling system, and the CDN scheduling system includes the DNS module, the LDNS module and a plurality of acceleration service modules;
    所述方法包括:The methods include:
    接收由所述LDNS模块发送的域名解析请求;receiving a domain name resolution request sent by the LDNS module;
    根据所述域名解析请求从所述加速服务模块中选取多个可用服务模块并确定负载能力参数,所述负载能力参数用于表征各个所述可用服务模块之间的负载能力比;Selecting a plurality of available service modules from the acceleration service modules according to the domain name resolution request and determining a load capacity parameter, the load capacity parameter being used to characterize the load capacity ratio between each of the available service modules;
    根据所述域名解析请求和所述负载能力参数确定域名解析结果,所述域名解析结果携带有对应于各个所述可用服务模块的服务地址,且各个所述可用服务模块对应的所述服务地址的数量之比对应于所述负载能力参数;Determine a domain name resolution result according to the domain name resolution request and the load capacity parameter, the domain name resolution result carries a service address corresponding to each of the available service modules, and each of the available service modules corresponds to the service address of the service address The ratio of the numbers corresponds to said load capacity parameter;
    将所述域名解析结果发送至所述LDNS模块,以使所述LDNS模块能够根据所述域名解析结果向终端设备发送所述服务地址。sending the domain name resolution result to the LDNS module, so that the LDNS module can send the service address to the terminal device according to the domain name resolution result.
  2. 根据权利要求1所述的负载均衡方法,其中,根据所述域名解析请求从所述加速服务模块中选取多个可用服务模块,包括:The load balancing method according to claim 1, wherein selecting a plurality of available service modules from the acceleration service modules according to the domain name resolution request includes:
    确定各个所述加速服务模块的权重系数;Determining the weight coefficients of each of the acceleration service modules;
    根据所述权重系数和预设调度策略从所述加速服务模块中选取多个所述可用服务模块。Selecting a plurality of available service modules from the acceleration service modules according to the weight coefficient and a preset scheduling policy.
  3. 根据权利要求2所述的负载均衡方法,其中,根据所述权重系数和预设调度策略从所述加速服务模块中选取多个所述可用服务模块,包括:The load balancing method according to claim 2, wherein selecting a plurality of available service modules from the acceleration service modules according to the weight coefficient and a preset scheduling strategy includes:
    根据所述权重系数和预设调度策略确定分级调度策略;determining a hierarchical scheduling strategy according to the weight coefficient and a preset scheduling strategy;
    根据所述分级调度策略从各个所述加速服务模块中选取多个待用服务模块;selecting a plurality of service modules to be used from each of the acceleration service modules according to the hierarchical scheduling strategy;
    根据所述分级调度策略从所述待用服务模块中选取多个所述可用服务模块。Selecting multiple available service modules from the standby service modules according to the hierarchical scheduling policy.
  4. 根据权利要求3所述的负载均衡方法,其中,所述根据所述分级调度策略从所述待用服务模块中选取多个所述可用服务模块,包括:The load balancing method according to claim 3, wherein the selecting a plurality of available service modules from the standby service modules according to the hierarchical scheduling strategy includes:
    根据所述分级调度策略将所述待用服务模块分为第一待用模块和第二待用模块;dividing the standby service module into a first standby module and a second standby module according to the hierarchical scheduling policy;
    将所述第一待用模块作为可用服务模块;using the first standby module as an available service module;
    当所述第一待用模块发生异常,选取所述第二待用模块替代发生异常的所述第一待用模块作为可用服务模块。When an abnormality occurs in the first standby module, the second standby module is selected to replace the abnormal first standby module as an available service module.
  5. 根据权利要求2所述的负载均衡方法,其中,所述确定负载能力参数,包括:The load balancing method according to claim 2, wherein said determining load capacity parameters comprises:
    获取所述可用服务模块的负载能力上限信息;Obtain information about the upper limit of the load capacity of the available service modules;
    根据所述负载能力上限信息和所述权重系数确定所述负载能力参数。The load capacity parameter is determined according to the load capacity upper limit information and the weight coefficient.
  6. 根据权利要求5所述的负载均衡方法,其中,所述根据所述域名解析请求和所述负载能力参数确定域名解析结果,包括:The load balancing method according to claim 5, wherein said determining the domain name resolution result according to the domain name resolution request and the load capacity parameters comprises:
    根据所述域名解析请求确定地址总数;determining the total number of addresses according to the domain name resolution request;
    根据所述负载能力参数和所述负载能力上限信息确定分配参数,所述分配参数用于表征各个所述可用服务模块需负载的地址数之比;determining an allocation parameter according to the load capacity parameter and the load capacity upper limit information, where the allocation parameter is used to characterize the ratio of the number of addresses to be loaded by each of the available service modules;
    根据所述地址总数和所述分配参数确定各个所述可用服务模块需负载的地址数目;determining the number of addresses to be loaded by each of the available service modules according to the total number of addresses and the allocation parameters;
    根据所述域名解析请求和所述地址数目确定所述域名解析结果。The domain name resolution result is determined according to the domain name resolution request and the number of addresses.
  7. 负载均衡方法,应用于CDN调度系统的LDNS模块,所述CDN调度系统包括DNS模块、 所述LDNS模块和多个加速服务模块;The load balancing method is applied to the LDNS module of the CDN scheduling system, and the CDN scheduling system includes a DNS module, the LDNS module and a plurality of acceleration service modules;
    所述方法包括:The methods include:
    接收由所述DNS模块发送的域名解析结果,所述域名解析结果携带有多个可用服务模块分别对应的服务地址,所述可用服务模块由所述DNS模块从多个所述加速服务模块中选取,且各个所述可用服务模块对应的所述服务地址的数量之比与各个所述服务模块之间的负载能力之比对应;receiving the domain name resolution result sent by the DNS module, the domain name resolution result carrying service addresses respectively corresponding to a plurality of available service modules, the available service modules are selected by the DNS module from a plurality of the accelerated service modules , and the ratio of the number of service addresses corresponding to each of the available service modules corresponds to the ratio of the load capacity between each of the service modules;
    根据所述域名解析结果得到服务地址,并将所述服务地址发送至终端设备,以使所述终端设备能够根据所述服务地址与所述加速服务模块之间建立内容加速服务。A service address is obtained according to the domain name resolution result, and the service address is sent to the terminal device, so that the terminal device can establish a content acceleration service with the acceleration service module according to the service address.
  8. 根据权利要求7所述的负载均衡方法,还包括:The load balancing method according to claim 7, further comprising:
    接收由所述终端设备发送的域名解析请求;receiving a domain name resolution request sent by the terminal device;
    响应于所述域名解析请求,查找所述LDNS模块本地是否存在对应于所述域名解析请求的预缓存解析结果,所述预缓存解析结果由所述LDNS模块将所述域名解析结果缓存于所述LDNS模块本地而得到;In response to the domain name resolution request, find out whether there is a pre-cache resolution result corresponding to the domain name resolution request locally in the LDNS module, and the LDNS module caches the domain name resolution result in the LDNS module obtained locally;
    当所述LDNS模块本地不存在所述预缓存解析结果,将所述域名解析请求转发至所述DNS模块。When the pre-cached resolution result does not exist locally in the LDNS module, forward the domain name resolution request to the DNS module.
  9. 根据权利要求8所述的负载均衡方法,还包括:The load balancing method according to claim 8, further comprising:
    当所述LDNS模块本地存在所述预缓存解析结果,根据所述预缓存解析结果得到所述服务地址;When the LDNS module has the pre-cache resolution result locally, obtain the service address according to the pre-cache resolution result;
    将所述服务地址发送至所述终端设备,以使所述终端设备能够根据所述服务地址与所述加速服务模块之间建立内容加速服务。Sending the service address to the terminal device, so that the terminal device can establish a content acceleration service with the acceleration service module according to the service address.
  10. 网络设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现如权利要求1至6或权利要求7至9中任意一项所述的负载均衡方法。A network device, comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein, when the processor executes the computer program, the implementation of claims 1 to 6 or claims 7 to 9 Any one of the load balancing methods.
  11. 计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使计算机执行如权利要求1至6或权利要求7至9中任意一项所述的负载均衡方法。A computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to perform the operation described in any one of claims 1 to 6 or claims 7 to 9. The load balancing method described above.
PCT/CN2022/113706 2021-11-18 2022-08-19 Load balancing method and device, and computer-readable storage medium WO2023087820A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111366792.0A CN116137624A (en) 2021-11-18 2021-11-18 Load balancing method, device and computer readable storage medium
CN202111366792.0 2021-11-18

Publications (1)

Publication Number Publication Date
WO2023087820A1 true WO2023087820A1 (en) 2023-05-25

Family

ID=86333175

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/113706 WO2023087820A1 (en) 2021-11-18 2022-08-19 Load balancing method and device, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN116137624A (en)
WO (1) WO2023087820A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007061567A2 (en) * 2005-11-21 2007-05-31 Limelight Networks, Inc. Domain name resolution resource allocation
CN102055818A (en) * 2010-12-30 2011-05-11 北京世纪互联工程技术服务有限公司 Distributed intelligent DNS (domain name server) library system
CN104363313A (en) * 2014-12-02 2015-02-18 网宿科技股份有限公司 Method and system for guaranteeing resource utilization rate of website using content distribution network
CN104836732A (en) * 2015-03-31 2015-08-12 清华大学 Network connection automatic selection method and system
CN112653727A (en) * 2020-12-07 2021-04-13 深圳市高德信通信股份有限公司 Network data load management method based on CDN technology
CN113301074A (en) * 2020-04-26 2021-08-24 阿里巴巴集团控股有限公司 Data request load scheduling method and device, electronic equipment and readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007061567A2 (en) * 2005-11-21 2007-05-31 Limelight Networks, Inc. Domain name resolution resource allocation
CN102055818A (en) * 2010-12-30 2011-05-11 北京世纪互联工程技术服务有限公司 Distributed intelligent DNS (domain name server) library system
CN104363313A (en) * 2014-12-02 2015-02-18 网宿科技股份有限公司 Method and system for guaranteeing resource utilization rate of website using content distribution network
CN104836732A (en) * 2015-03-31 2015-08-12 清华大学 Network connection automatic selection method and system
CN113301074A (en) * 2020-04-26 2021-08-24 阿里巴巴集团控股有限公司 Data request load scheduling method and device, electronic equipment and readable storage medium
CN112653727A (en) * 2020-12-07 2021-04-13 深圳市高德信通信股份有限公司 Network data load management method based on CDN technology

Also Published As

Publication number Publication date
CN116137624A (en) 2023-05-19

Similar Documents

Publication Publication Date Title
US11283715B2 (en) Updating routing information based on client location
US10404790B2 (en) HTTP scheduling system and method of content delivery network
CN110769038B (en) Server scheduling method and device, storage medium and electronic equipment
US20170318078A1 (en) Reputation-based strategy for forwarding and responding to interests over a content centric network
CA2741895C (en) Request routing and updating routing information utilizing client location information
CN111464649B (en) Access request source returning method and device
WO2021042673A1 (en) Dns resolution method, authoritative dns server and dns resolution system
WO2021023018A1 (en) Service scheduling method and apparatus
CN105763628A (en) Data access request processing method and device, edge node server and edge cluster
CN102137014A (en) Resource management method, system and resource manager
CN110830565B (en) Resource downloading method, device, system, electronic equipment and storage medium
US9760370B2 (en) Load balancing using predictable state partitioning
CN114364031A (en) Service providing method, device and storage medium
WO2023087820A1 (en) Load balancing method and device, and computer-readable storage medium
CN114124797B (en) Server routing method and device, electronic equipment and storage medium
CN104994058A (en) Method, device, and system for achieving accelerated access for a router
CN112953984B (en) Data processing method, device, medium and system
CN115277851A (en) Service request processing method and system
WO2021073000A1 (en) Method, plug-in, and device for data scheduling, and scheduling server
CN115017117B (en) Local disk-based container file system online capacity expansion method and system
CN112953985A (en) Request data processing method, device, medium and system
CN113079504A (en) Method, device and system for realizing access of 5G message DM multi-load balancer
EP2474912A1 (en) Data supply device, system, and method, and computer program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22894362

Country of ref document: EP

Kind code of ref document: A1