CN118055164A - Traffic scheduling method, device and computer readable medium - Google Patents

Traffic scheduling method, device and computer readable medium Download PDF

Info

Publication number
CN118055164A
CN118055164A CN202410192030.0A CN202410192030A CN118055164A CN 118055164 A CN118055164 A CN 118055164A CN 202410192030 A CN202410192030 A CN 202410192030A CN 118055164 A CN118055164 A CN 118055164A
Authority
CN
China
Prior art keywords
address
area
server
target
domain name
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202410192030.0A
Other languages
Chinese (zh)
Inventor
黄茁壮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202410192030.0A priority Critical patent/CN118055164A/en
Publication of CN118055164A publication Critical patent/CN118055164A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a flow scheduling method, a flow scheduling device and a computer readable medium, wherein the method comprises the following steps: acquiring an access request of a user; resolving a target domain name requested to be accessed by an access request according to a user address to obtain a target IP address set corresponding to a region to which the target domain name belongs aiming at the user address; determining a target IP address from the target IP address set; distributing the access request to a server to which the target IP address belongs for processing; each domain name is respectively corresponding to a corresponding IP address set in different areas, specifically, each IP address corresponding to the domain name is mapped to one or more areas according to the number of users in each area and the characteristic parameters of the server to which each IP address corresponding to the domain name belongs, and the formed IP address sets respectively corresponding to the different areas. The application solves the problem of flow scheduling of the server of the content server, realizes reasonable flow scheduling of the server, and can improve the resource utilization rate of the server.

Description

Traffic scheduling method, device and computer readable medium
Technical Field
The present application relates to the field of traffic scheduling technologies, and in particular, to a traffic scheduling method, apparatus, and computer readable medium.
Background
In order to bear the access requests of massive users, a plurality of servers need to be deployed, wherein, how to distribute traffic (i.e. the access requests of users) among different servers so as to realize reasonable traffic scheduling and improve the resource utilization rate of the servers becomes a technical problem to be solved in the field.
Disclosure of Invention
In view of the above, the present application discloses a traffic scheduling method, apparatus and computer readable medium, which are used for solving the traffic scheduling problem of a server, so that the traffic carried by each server is adapted to the characteristic parameters of the server, such as performance, cost, etc., so as to improve the resource utilization rate of the server.
The specific scheme is as follows:
a traffic scheduling method, comprising:
acquiring an access request of a user; the access request comprises a user address of the user and a target domain name for requesting access;
resolving the target domain name according to the user address to obtain a target IP address set corresponding to the target domain name aiming at the area to which the user address belongs;
determining a target IP address from all IP addresses contained in the target IP address set based on a preset traffic scheduling strategy;
Distributing the access request to a server to which the target IP address belongs for processing;
Wherein, each domain name corresponds to a corresponding IP address set for different areas respectively; the method comprises the steps that each IP address corresponding to a domain name is mapped to one or more areas according to the number of users in each area and characteristic parameters of a corresponding server, and the obtained domain names correspond to IP address sets of different areas respectively; the corresponding server comprises a server to which each IP address corresponding to the domain name belongs, and the characteristic parameters of the server are parameters for representing the characteristics of the server.
Optionally, before the obtaining the access request of the user, the method further includes:
Determining each IP address corresponding to the domain name and each area corresponding to the domain name; each IP address corresponding to the domain name is the IP address of each server for providing the content service corresponding to the domain name; each region corresponding to the domain name is each region for providing content service corresponding to the domain name;
And mapping each IP address corresponding to the domain name to one or more areas in each area according to the number of users corresponding to each area and the characteristic parameters corresponding to each server to obtain an IP address set of the domain name corresponding to each area in each area.
Optionally, the mapping each IP address corresponding to the domain name to one or more areas in each area according to the number of users corresponding to each area and the feature parameters corresponding to each server respectively includes:
determining the expected user numbers corresponding to the IP addresses of the servers according to the characteristic parameters corresponding to the servers and the user numbers corresponding to the areas;
And mapping the IP address of each server to one or more areas in each area according to the expected user number corresponding to the IP address of each server and the user number corresponding to each area.
Optionally, the determining, according to the characteristic parameters respectively corresponding to the servers and the number of users respectively corresponding to the areas, the expected number of users respectively corresponding to the IP addresses of the servers includes:
Determining the expected flow ratio among the servers according to the characteristic parameters corresponding to the servers respectively; the characteristic parameters comprise at least one of performance parameters and cost parameters of the server; the expected flow rate ratio is an expected value of the flow rate ratio of each server; the performance parameter is a parameter representing the performance of the server, and the cost parameter is a parameter representing the cost of the server;
and determining the expected number of users corresponding to each server according to the expected flow ratio among the servers and the number of users corresponding to each area.
Optionally, the mapping the IP address of each server to one or more areas in each area according to the number of expected users respectively corresponding to the IP addresses of each server and the number of users respectively corresponding to each area includes:
ordering the areas in descending order according to the number of users corresponding to the areas to obtain an area sequence;
sequentially selecting an untreated region from the region sequence as a current region to be treated;
Determining whether at least one available IP group meeting service conditions exists in the current area to be processed according to the number of users corresponding to the current area to be processed and the current schedulable flow limit corresponding to the IP address of each server; the current corresponding schedulable flow limit of the IP address of each server is the difference value between the expected user number corresponding to the IP address of the server and the current user number to be occupied of the processed area in the area sequence; the available IP group is a combination formed by one or more IP addresses in the IP addresses of the servers;
If the at least one available IP group exists, selecting one available IP group from the at least one available IP group to obtain a target available IP group, mapping each IP address in the target available IP group to the current area to be processed, determining the number of users to be occupied in the current area to be processed in the schedulable flow limit of each IP address in the target available IP group based on the number of users in the current area to be processed, updating the schedulable flow limit of each IP address in the target available IP group based on the determined number of users to be occupied, and returning to the step of sequentially selecting an unprocessed area from the area sequence as the current area to be processed;
And if the at least one available IP group does not exist, backtracking to a previous area corresponding to the current area to be processed in the area sequence, updating the target available IP group of the previous area into any available IP group which is not selected as the target available IP group in each available IP group corresponding to the previous area, and executing IP address mapping processing to the previous area based on the updated target available IP group of the previous area.
Optionally, the service conditions to be met by the available IP group include:
The sum of the schedulable flow limit corresponding to each IP address in the available IP group is not lower than the reference user number corresponding to the current area to be processed; the absolute value of the difference between the reference user number and the user number corresponding to the current area to be processed is smaller than a first preset value;
The schedulable flow limit corresponding to each IP address in the available IP group is not lower than the reference average user number corresponding to the current area to be processed; the absolute value of the difference between the reference average user number and the average user number corresponding to the current area to be processed is smaller than a second preset value, and the average user number is the average number of the user numbers corresponding to the current area to be processed relative to the number of the IP addresses in the available IP group.
Optionally, the determining, based on the number of users corresponding to the current area to be processed, the number of users to be occupied by the current area to be processed at each IP address of the target available IP group includes:
dividing the number of users corresponding to the current area to be processed by the number of IP addresses in the target available IP group to obtain a corresponding division operation result;
and determining the number of users to be occupied by the current area to be processed at each IP address of the target available IP group as the division operation result.
Optionally, the determining, based on a preset traffic scheduling policy, a target IP address from the IP addresses included in the target IP address set includes:
And based on a flow balancing strategy, randomly determining an IP address from all the IP addresses contained in the target IP address set to obtain the target IP address.
A traffic scheduling device, comprising:
The acquisition module is used for acquiring the access request of the user; the access request comprises a user address of the user and a target domain name for requesting access;
the resolving module is used for resolving the target domain name according to the user address to obtain a target IP address set corresponding to the target domain name aiming at the area to which the user address belongs;
the determining module is used for determining a target IP address from all IP addresses contained in the target IP address set based on a preset flow scheduling strategy;
the allocation module is used for allocating the access request to a server to which the target IP address belongs for processing;
Wherein, each domain name corresponds to a corresponding IP address set for different areas respectively; the domain name maps each IP address corresponding to the domain name to one or more areas according to the number of users in each area and the characteristic parameters of the corresponding server, and the formed IP address sets respectively corresponding to the different areas are formed; the corresponding server comprises a server to which each IP address corresponding to the domain name belongs, and the characteristic parameters of the server are parameters for representing the characteristics of the server.
A computer readable medium having stored thereon a computer program comprising instructions for performing a traffic scheduling method according to any of the preceding claims.
In summary, the present application provides a traffic scheduling method, apparatus and computer readable medium. In order to bear the access requests of massive users, the applicant finds that different servers often have differences in performance, cost and the like, and content service parties such as the large website generally provide content services in a plurality of areas.
Therefore, the application solves the problem of flow scheduling of the servers of the content service side such as a large website, and the like, and distributes flow (access request of users) among different servers by considering the difference among the different servers and the number of users in each area corresponding to the domain name of the content service side, thereby realizing reasonable flow scheduling of the servers, and adapting the flow borne by each server to the characteristic parameters such as the respective performance, cost and the like, so as to improve the resource utilization rate of the servers.
Drawings
The above and other features, advantages and aspects of embodiments of the present application will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a schematic diagram of a preprocessing process of a flow scheduling method provided by the application;
Fig. 2 is a schematic diagram of mapping relationship between IP1 and IP2 and each province in an application example provided in the present application;
FIG. 3 is a flow chart of a flow scheduling method provided by the application;
fig. 4 is a block diagram of a flow rate scheduling device according to the present application.
Detailed Description
Embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While the application is susceptible of embodiment in the drawings, it is to be understood that the application may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided to provide a more thorough and complete understanding of the application. It should be understood that the drawings and embodiments of the application are for illustration purposes only and are not intended to limit the scope of the present application.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like herein are merely used for distinguishing between different devices, modules, or units and not for limiting the order or interdependence of the functions performed by such devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those skilled in the art will appreciate that "one or more" is intended to be construed as "one or more" unless the context clearly indicates otherwise.
The embodiment of the application discloses a flow scheduling method, a flow scheduling device and a computer readable medium, which are used for solving the problem of flow scheduling of a server and improving the resource utilization rate of the server.
The traffic scheduling method provided by the embodiment of the application can be realized based on DNS (Domain name System). DNS (Domain NAME SYSTEM ) is a most basic protocol of the internet, and its function is to automatically translate a Domain name (such as www.xxx.com) into a list of IP addresses (one server corresponds to one IP address), such as 1.1.1.1,2.2.2.2,3.3.3.3. When the user needs to use the content service of the content service party, the user only needs to access the domain name of the content service party, and the user does not need to use the IP address. When a domain name has a plurality of servers to provide corresponding content services and a plurality of corresponding IP addresses, a user accesses the domain name and only takes one IP address randomly. For example, for the three IP addresses 1.1.1.1,2.2.2.2,3.3.3.3 described above, if 3 hundred million users use the content service, then on average each IP address corresponds to a server that will assume 1 hundred million users' access requests.
DNS is zone-resolvable, that is, the same domain name can be provided with different lists of IP addresses in different zones. For example www.xxx.com the IP address list in province/city a is 1.1.1.1,2.2.2.2 and the IP address list in province/city B is 3.3.3.3,4.4.4.4,5.5.5.5. Then if there are 2000 tens of thousands of users in province/city, each IP address of province/city assumes 1000 tens of thousands of users 'access requests, and similarly if there are 1500 tens of thousands of users in province/city, each IP address of province/city assumes 500 tens of thousands of users' access requests.
According to the traffic scheduling method disclosed by the embodiment of the application, each IP address corresponding to the domain name is mapped to one or more areas in advance according to the number of users in each area corresponding to the domain name and the characteristic parameters of the server to which each IP address corresponding to the domain name belongs, so that an IP address set corresponding to different areas of the domain name is formed.
Alternatively, referring to fig. 1, the above preprocessing process may be specifically implemented as:
Step 101, determining each IP address corresponding to the domain name and each area corresponding to the domain name.
Wherein, each IP address corresponding to the domain name is the IP address of each server for providing the content service corresponding to the domain name; each region corresponding to the domain name is each region for providing a content service corresponding to the domain name. Specifically, each IP address corresponding to the domain name and each area corresponding to the domain name can be determined according to the actual deployment requirement.
The regions corresponding to the domain name may be, but not limited to, regions of any level such as province, city, district/county, etc., and are not limited, and may be determined according to actual requirements.
And 102, mapping each IP address corresponding to the domain name to one or more areas in each area according to the number of users corresponding to each area and the characteristic parameters corresponding to each server to obtain an IP address set of the domain name corresponding to each area in each area.
Alternatively, step 102 may be specifically implemented as:
11 According to the characteristic parameters respectively corresponding to the servers and the number of users respectively corresponding to the areas, determining the expected number of users respectively corresponding to the IP addresses of the servers.
The expected flow rate ratio between the servers can be determined according to the characteristic parameters respectively corresponding to the servers, and the expected number of users respectively corresponding to the servers can be determined according to the expected flow rate ratio between the servers and the number of users respectively corresponding to the areas.
Further, specifically, the number of users corresponding to each area can be accumulated to obtain the total number of users in each area, and the total number of users and the expected flow ratio of each server are multiplied to obtain the expected number of users corresponding to each server. For example, assume that a domain name corresponds to 3 areas, namely, area 1, area 2, and area 3, and the number of users corresponding to area 1, area 2, and area 3 is 50, 30, and 20, respectively; the area corresponds to an IP address (each IP address represents a server) having IP1 and IP2, and the desired traffic ratio of IP1 and IP2 is: 40%,60%, i.e. IP1 and IP2 represent the desired traffic ratios of the servers respectively: 40%,60%, the number of expected users of the server represented by IP1 is (50+30+20) ×40% =40, and the number of expected users of the server represented by IP2 is (50+30+20) ×60% =60.
Wherein the characteristic parameters of the server may include, but are not limited to, at least one of performance parameters and cost parameters of the server.
The expected flow rate ratio is an expected value of the flow rate ratio of each server; the performance parameter is a parameter characterizing the performance of the server, and the cost parameter is a parameter characterizing the cost of the server.
12 According to the expected number of users respectively corresponding to the IP addresses of the servers and the number of users respectively corresponding to the areas, mapping the IP address of each server to one or more areas in the areas.
Alternatively, this step 12) may be further implemented as:
21 Ordering the areas in descending order according to the number of users to obtain an area sequence;
22 Sequentially selecting an untreated region from the region sequence as a current region to be treated;
23 Determining whether at least one available IP group meeting service conditions exists in the current area to be processed according to the number of users corresponding to the current area to be processed and the current schedulable flow limit corresponding to the IP address of each server; the current corresponding schedulable flow limit of the IP address of each server is the difference value between the expected user number corresponding to the IP address of the server and the current user number to be occupied of the processed area in the area sequence; the available IP group is a combination formed by one or more IP addresses in the IP addresses of the servers;
Optionally, the service condition includes:
Condition one: and the sum of the schedulable flow limit corresponding to each IP address in the available IP group is not lower than the reference user number corresponding to the current area to be processed.
The absolute value of the difference between the reference user number corresponding to the current area to be processed and the user number corresponding to the current area to be processed is smaller than a first preset value;
condition II: and the schedulable flow limit corresponding to each IP address in the available IP group is not lower than the reference average user number corresponding to the current area to be processed.
The absolute value of the difference between the average number of users corresponding to the current area to be processed and the average number of users corresponding to the current area to be processed is smaller than a second preset value, wherein the average number of users corresponding to the current area to be processed is the average number of the numbers of the IP addresses in the available IP group, namely, the division operation result obtained by dividing the number of users corresponding to the current area to be processed by the number of the IP addresses in the available IP group.
The first preset value and the second preset value may be the same or different, and are not limited.
24 If the at least one available IP group exists, selecting one available IP group from the at least one available IP group to obtain a target available IP group, mapping each IP address in the target available IP group to the current area to be processed, determining the number of users of the current area to be processed in the schedulable flow limit of each IP address in the target available IP group based on the number of users of the current area to be processed, updating the schedulable flow limit of each IP address in the target available IP group based on the determined number of users to be occupied, and returning to the step of sequentially selecting an unprocessed area from the area sequence to be used as the current area to be processed until the ending condition is met.
The end condition may be, but is not limited to, completing the processing of all regions in the sequence of regions; or to a certain area in the sequence of areas, it is found that scheduling cannot be performed according to the desired traffic ratio between the individual servers (IP addresses). That is, the satisfaction of any of the above conditions can be regarded as satisfaction of the end condition.
Optionally, specifically, the number of users to be occupied by the current area to be processed in each IP address of the target available IP group may be determined based on an equipartition manner, that is, the number of users corresponding to the current area to be processed is divided by the number of IP addresses contained in the target available IP group, and the result of the division operation is determined as the number of users to be occupied by the current area to be processed in each IP address of the target available IP group.
25 If the at least one available IP group does not exist, backtracking to a previous area corresponding to the current area to be processed in the area sequence, updating the target available IP group of the previous area to any available IP group which is not selected as the target available IP group in the available IP groups corresponding to the previous area, and executing IP address mapping processing to the previous area based on the updated target available IP group of the previous area until the ending condition is met.
An example of an application of the above preprocessing procedure is provided below.
The present example binds the IP addresses of all servers to which a domain name corresponds to the domain name, and subdivides the IP addresses into provincial (regional) dimensions for IP address mapping. By mapping, one IP address (corresponding to a corresponding server) can serve one or more provinces, and one province can use one or more IP addresses.
This example follows two rules:
rule one: the IP addresses in the same province will equally divide the flow of all users in the province;
rule II: the total traffic of the same IP address is the sum of the traffic of all provinces served by the IP address.
In the embodiment of the application, the flow refers to the access request of the user.
This example implements the pretreatment described above, in particular by the following processing steps:
a. firstly, counting the number of users of each province corresponding to the domain name;
b. presetting expected flow ratio of each IP address (essentially representing the expected flow ratio of the server of each IP address) according to the performance, cost and other parameters of the server of each IP address corresponding to the domain name;
c. calculating the total number of users of each province, and calculating the expected number of users of each IP address according to the preset expected flow proportion and the total number of users of each province;
d. Sequencing the provinces from large to small according to the number of users to obtain a province sequence, and sequentially processing each province in the province sequence, wherein the processing process is as follows:
d.1: determining whether at least one available IP group meeting the following service conditions exists in the current province to be processed according to the number of users of the current province to be processed and the schedulable flow limit of each IP address:
the sum of the schedulable flow quota of each IP address in the IP group is larger than the number of users in the province (a certain error is allowed);
The schedulable flow limit of each IP address in the IP group is larger than the division operation result (a certain error is allowed) of the number of provincial users and the number of IP addresses in the IP group.
It will be readily appreciated that the service conditions of the present example are embodied as an alternative form of application of the service conditions described above.
D.2: if at least one available IP group can be determined for the current province to be processed, selecting an available IP group such as a first group as a target available IP group of the current province to be processed, and subtracting the dispatchable flow limit of each IP address in the target available IP group from the dividing operation result of the number of province users and the number of IP addresses in the target available IP group.
That is, the number of users to be occupied (also understood as the traffic amount to be occupied) for each IP address in the target available IP group is the current to-be-processed province: the result of the division operation between the number of the provincial users and the number of the IP addresses in the target available IP group.
D.3: if the available IP group cannot be found for the current to-be-processed province, backtracking to the last province X corresponding to the current to-be-processed province in the province sequence, updating the target available IP group of the province X to other available IP groups in each available IP group of the province X, for example, assuming that the current target available IP group of the province X is the first available IP group in each available IP group of the province X, taking the second available IP group in each available IP group of the province X as the updated target available IP group of the province X, and continuing to execute subsequent processing for the updated target available IP group of the province X. If the first province in the province sequence is traced back finally, and all available IP groups are tried, the flow scheduling cannot be carried out according to the expected flow proportion of each IP address, and therefore the processing procedure can be ended and the return is directly carried out.
The following is further exemplified:
assuming that 3 provinces correspond to a domain name (namely, content services corresponding to the domain name can be provided in 3 provinces), arranging the 3 provinces from large to small according to the number of users to obtain the following province sequence:
province 1:50 users;
Province 2:30 users;
Province 3:20 users;
The total number of users is 100.
And assume that the domain name corresponds to 2 IP addresses in total: IP1, IP2, that is, 2 servers for providing content services for the domain name, according to performance and cost parameters of the two servers, it is determined that the expected traffic ratio of IP1, IP2 is: 40% and 60%.
The number of desired users for each IP address:
IP1: 40;
IP2: 60.
All IP combinations of IP1 and IP 2: group 1: IP1, [ group 2 ]: IP2 and [ group 3: IP1, IP2 ].
On the basis, each province in the province sequence is sequentially processed:
first, province 1 (50 users) is handled, and each IP group is available/unavailable for province 1:
Group 1: IP1 is required to bear 50 users of province 1, which exceeds the expected user number 40 of IP1, so that group 1 is not available for province 1;
Group 2: IP2 is required to bear 50 users of province 1, and is available;
group 3: IP1, IP2 respectively bear 25 users of province 1, available.
So the available IP group corresponding to province 1 is [ group 2: IP2 and [ group 3: IP1, IP 2), from which [ group 2: IP2 is the target available IP group of province 1, and is used for providing service for province 1, which means that IP2 can only bear 10 users (60-50=10) next, that is, after selecting group 2 as the target available IP group of province 1, the schedulable traffic quota of IP2 is changed from 60 to 10, which is easy to understand, and at this time, the schedulable traffic quota of IP1 is 40.
Province 2 (30 users) is then processed, each IP group for province 2 available/unavailable:
group 1: IP1 is required to bear all 30 users of province 2, and is available;
Group 2: IP2 is required to bear all 30 users of province 2, exceeds 10 which can be borne by the IP2, and is not available;
Group 3: IP1, IP2 15 users of province 2 are respectively born by IP1, IP2, beyond 10 affordable by IP2, and are unavailable.
So the available IP set corresponding to province 2 is [ set 1: IP1 is used as the target available IP group of province 2 to serve province 2, which means that IP1 can only bear 10 users (40-30=10) next, and at this time, the schedulable traffic credits of IP1 and IP2 are 10 respectively.
Next, province 3 (20 users) is processed, and each IP group is available/unavailable for province 3:
group 1: IP1 is required to bear all 20 users of province 3, exceeds 10 which can be borne by the user, and is not available;
group 2: IP2 is required to bear all 20 users of province 3, exceeds 10 which can be borne by the user, and is not available;
group 3: IP1, IP2 respectively bear 10 users of province 3, available.
So the available IP group corresponding to province 3 is [ group 3: IP1, IP2, which is the target available IP group for province 3, is used to serve province 3.
Referring to fig. 2, the final mapping relationship between IP1 and IP2 and each province is:
Province 1 (50 users) -IP2, i.e., IP2 serves province 1;
province 2 (30 users) -IP1, i.e., IP1 serves province 2;
Province 3 (20 users) -IP1 and IP2, i.e., IP1 and IP2, simultaneously serve province 3.
Thereby obtaining the IP address sets respectively corresponding to the domain names in different provinces.
Subsequently, support can be provided for domain name resolution and traffic scheduling based on the IP address sets respectively corresponding to different areas (such as different provinces) of the domain name obtained in the preprocessing stage.
In addition, the above-mentioned respective areas may be sorted in descending order of the number of users corresponding to the respective areas, which is a preferable but not necessary sorting method, and in practice, the above-mentioned respective areas may be sorted in ascending order of the number of users corresponding to the respective areas, and in this case, the respective areas in the ascending order sequence need to be processed in an inverse order (i.e., from the tail to the head of the sequence), and in this manner, the respective areas are guaranteed to be processed in order of the number of users corresponding to the respective areas from large to small.
On the basis of the preprocessing, referring to a flow scheduling method flowchart shown in fig. 3, the flow scheduling method disclosed in the embodiment of the application includes:
Step 301, obtaining an access request of a user; the access request includes a user address of the user and a target domain name for which access is requested.
When a user needs to access a content service, such as a video website, the user only needs to access the corresponding domain name, the IP address is not needed, and the access request initiated by the user correspondingly comprises the target domain name to be accessed, and the user address is further included, so that domain name resolution is conveniently performed on the target domain name.
And 302, resolving the target domain name according to the user address to obtain a target IP address set corresponding to the target domain name aiming at the area to which the user address belongs.
Specifically, the IP address set corresponding to the region to which the user address belongs may be determined according to the IP address sets respectively corresponding to the target domain name for different regions (e.g., different provinces), so as to obtain the target IP address set corresponding to the target domain name and matched with the region to which the user address belongs.
Step 303, determining a target IP address from the IP addresses included in the target IP address set based on a preset traffic scheduling policy.
Optionally, the preset traffic scheduling policy is a traffic balancing policy, and specifically, based on the traffic balancing policy, one IP address is randomly selected from the IP addresses included in the target IP address set, and is used as the target IP address, so that the traffic borne by each IP address in the target IP address set is ensured to be relatively balanced as much as possible through a random selection manner.
Step 304, the access request is distributed to a server to which the target IP address belongs for processing;
Wherein, each domain name corresponds to a corresponding IP address set for different areas respectively; the domain name is directed at IP address sets corresponding to different areas respectively, and each IP address corresponding to the domain name is mapped to one or more areas according to the number of users in each area and the characteristic parameters of the corresponding server, so that the obtained IP address sets corresponding to different areas respectively. The corresponding server comprises a server to which each IP address corresponding to the domain name belongs, and the characteristic parameters of the server are parameters for representing the characteristics of the server.
Based on the foregoing steps, the present step may specifically implement the allocation of the access request to the server to which the target IP address belongs for processing by forwarding the access request of the user to the server to which the target IP address belongs.
In order to bear the access requests of massive users, the applicant finds that different servers often have differences in performance, cost and the like, and content service parties such as the large website generally provide content services in a plurality of areas.
Therefore, the application solves the problem of flow scheduling of the servers of the content service side such as a large website, and the like, and distributes flow (access request of users) among different servers by considering the difference among the different servers and the number of users in each area corresponding to the domain name of the content service side, thereby realizing reasonable flow scheduling of the servers, and adapting the flow borne by each server to the characteristic parameters such as the respective performance, cost and the like, so as to improve the resource utilization rate of the servers.
Corresponding to the above-mentioned flow scheduling method, the embodiment of the present application also discloses a flow scheduling device, whose composition structure is shown in fig. 4, including:
an acquisition module 10, configured to acquire an access request of a user; the access request comprises a user address of the user and a target domain name for requesting access;
the resolving module 20 is configured to resolve the target domain name according to the user address, so as to obtain a target IP address set corresponding to the target domain name for the area to which the user address belongs;
A determining module 30, configured to determine a target IP address from the IP addresses included in the target IP address set based on a preset traffic scheduling policy;
a distribution module 40, configured to distribute the access request to a server to which the target IP address belongs for processing;
Wherein, each domain name corresponds to a corresponding IP address set for different areas respectively; the domain name maps each IP address corresponding to the domain name to one or more areas according to the number of users in each area and the characteristic parameters of the corresponding server, and the obtained IP address sets respectively corresponding to the different areas; the corresponding server comprises a server to which each IP address corresponding to the domain name belongs, and the characteristic parameters of the server are parameters for representing the characteristics of the server.
In an alternative embodiment, the apparatus further includes a preprocessing module, configured to, before obtaining the access request of the user, perform the following processing:
Determining each IP address corresponding to the domain name and each area corresponding to the domain name; each IP address corresponding to the domain name is the IP address of each server for providing the content service corresponding to the domain name; each region corresponding to the domain name is each region for providing content service corresponding to the domain name;
And mapping each IP address corresponding to the domain name to one or more areas in each area according to the number of users corresponding to each area and the characteristic parameters corresponding to each server to obtain an IP address set of the domain name corresponding to each area in each area.
In an optional implementation manner, the preprocessing module is specifically configured to, when mapping each IP address corresponding to the domain name to one or more areas in the respective areas according to the number of users corresponding to the respective areas and the feature parameters corresponding to the respective servers, respectively:
determining the expected user numbers corresponding to the IP addresses of the servers according to the characteristic parameters corresponding to the servers and the user numbers corresponding to the areas;
And mapping the IP address of each server to one or more areas in each area according to the expected user number corresponding to the IP address of each server and the user number corresponding to each area.
In an optional implementation manner, the preprocessing module is specifically configured to, when determining, according to the feature parameters respectively corresponding to the servers and the number of users respectively corresponding to the areas, the expected number of users respectively corresponding to the IP addresses of the servers:
Determining the expected flow ratio among the servers according to the characteristic parameters corresponding to the servers respectively; the characteristic parameters comprise at least one of performance parameters and cost parameters of the server; the expected flow rate ratio is an expected value of the flow rate ratio of each server; the performance parameter is a parameter representing the performance of the server, and the cost parameter is a parameter representing the cost of the server;
and determining the expected number of users corresponding to each server according to the expected flow ratio among the servers and the number of users corresponding to each area.
In an optional implementation manner, the preprocessing module is specifically configured to, when mapping the IP address of each server to one or more areas in each area according to the number of expected users corresponding to the IP addresses of each server and the number of users corresponding to each area, respectively:
ordering the areas in descending order according to the number of users corresponding to the areas to obtain an area sequence;
sequentially selecting an untreated region from the region sequence as a current region to be treated;
Determining whether at least one available IP group meeting service conditions exists in the current area to be processed according to the number of users corresponding to the current area to be processed and the current schedulable flow limit corresponding to the IP address of each server; the current corresponding schedulable flow limit of the IP address of each server is the difference value between the expected user number corresponding to the IP address of the server and the current user number to be occupied of the processed area in the area sequence; the available IP group is a combination formed by one or more IP addresses in the IP addresses of the servers;
If the at least one available IP group exists, selecting one available IP group from the at least one available IP group to obtain a target available IP group, mapping each IP address in the target available IP group to the current area to be processed, determining the number of users to be occupied in the schedulable flow limit of each IP address in the target available IP group in the current area to be processed based on the number of users in the current area to be processed, updating the schedulable flow limit of each IP address in the target available IP group based on the determined number of users to be occupied, and returning to the step of sequentially selecting an unprocessed area from the area sequence to be used as the current area to be processed until the ending condition is met;
And if the at least one available IP group does not exist, backtracking to a last area corresponding to the current area to be processed in the area sequence, updating the target available IP group of the last area into any available IP group which is not selected as the target available IP group in the available IP groups corresponding to the last area, and executing IP address mapping processing to the last area based on the updated target available IP group of the last area until the ending condition is met.
In an alternative embodiment, the service condition to be satisfied by the available IP group includes:
The sum of the schedulable flow limit corresponding to each IP address in the available IP group is not lower than the reference user number corresponding to the current area to be processed; the absolute value of the difference between the reference user number and the user number corresponding to the current area to be processed is smaller than a first preset value;
The schedulable flow limit corresponding to each IP address in the available IP group is not lower than the reference average user number corresponding to the current area to be processed; the absolute value of the difference between the reference average user number and the average user number corresponding to the current area to be processed is smaller than a second preset value, and the average user number is the average number of the user numbers corresponding to the current area to be processed relative to the number of the IP addresses in the available IP group.
In an optional implementation manner, the preprocessing module is specifically configured to, when determining, based on the number of users corresponding to the current area to be processed, the number of users to be occupied by the current area to be processed at each IP address of the target available IP group:
Dividing the number of users corresponding to the current area to be processed by the number of IP addresses in the target available IP group to obtain a corresponding division operation result;
and determining the number of users to be occupied by the current area to be processed at each IP address of the target available IP group as the division operation result.
In an alternative embodiment, the determining module 30 is specifically configured to: and based on a flow balancing strategy, randomly determining an IP address from all the IP addresses contained in the target IP address set to obtain the target IP address.
For the flow scheduling device provided by the embodiment of the present application, since the flow scheduling device corresponds to the flow scheduling method provided by the above method embodiment, the description is relatively simple, and the relevant similarities are only required to refer to the description of the above method embodiment, and are not described in detail herein.
The present application also provides a computer readable medium having stored thereon a computer program comprising program code for performing a flow scheduling method as provided by any of the method embodiments above.
In the context of the present application, a computer-readable medium (machine-readable medium) can be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable medium of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be embodied in an electronic device; or may exist alone without being assembled into an electronic device.
It is to be understood that, although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.
While several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the application. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
The above description is only illustrative of the preferred embodiments of the present application and of the principles of the technology employed. It will be appreciated by persons skilled in the art that the scope of the application is not limited to the specific combinations of the features described above, but also covers other embodiments which may be formed by any combination of the features described above or their equivalents without departing from the spirit of the application. Such as the above-mentioned features and the technical features having similar functions (but not limited to) applied for in the present application are replaced with each other.

Claims (10)

1. A traffic scheduling method, comprising:
acquiring an access request of a user; the access request comprises a user address of the user and a target domain name for requesting access;
resolving the target domain name according to the user address to obtain a target IP address set corresponding to the target domain name aiming at the area to which the user address belongs;
determining a target IP address from all IP addresses contained in the target IP address set based on a preset traffic scheduling strategy;
Distributing the access request to a server to which the target IP address belongs for processing;
Wherein, each domain name corresponds to a corresponding IP address set for different areas respectively; the method comprises the steps that each IP address corresponding to a domain name is mapped to one or more areas according to the number of users in each area and characteristic parameters of a corresponding server, and the obtained domain names correspond to IP address sets of different areas respectively; the corresponding server comprises a server to which each IP address corresponding to the domain name belongs, and the characteristic parameters of the server are parameters for representing the characteristics of the server.
2. The traffic scheduling method according to claim 1, further comprising, prior to said obtaining the access request of the user:
Determining each IP address corresponding to the domain name and each area corresponding to the domain name; each IP address corresponding to the domain name is the IP address of each server for providing the content service corresponding to the domain name; each region corresponding to the domain name is each region for providing content service corresponding to the domain name;
And mapping each IP address corresponding to the domain name to one or more areas in each area according to the number of users corresponding to each area and the characteristic parameters corresponding to each server to obtain an IP address set of the domain name corresponding to each area in each area.
3. The traffic scheduling method according to claim 2, wherein mapping each IP address corresponding to the domain name to one or more areas of the respective areas according to the number of users respectively corresponding to the respective areas and the characteristic parameters respectively corresponding to the respective servers includes:
determining the expected user numbers corresponding to the IP addresses of the servers according to the characteristic parameters corresponding to the servers and the user numbers corresponding to the areas;
And mapping the IP address of each server to one or more areas in each area according to the expected user number corresponding to the IP address of each server and the user number corresponding to each area.
4. The traffic scheduling method according to claim 3, wherein determining the expected number of users corresponding to the IP addresses of the servers according to the characteristic parameters corresponding to the servers and the number of users corresponding to the areas, respectively, comprises:
Determining the expected flow ratio among the servers according to the characteristic parameters corresponding to the servers respectively; the characteristic parameters comprise at least one of performance parameters and cost parameters of the server; the expected flow rate ratio is an expected value of the flow rate ratio of each server; the performance parameter is a parameter representing the performance of the server, and the cost parameter is a parameter representing the cost of the server;
and determining the expected number of users corresponding to each server according to the expected flow ratio among the servers and the number of users corresponding to each area.
5. The traffic scheduling method according to claim 3, wherein mapping the IP address of each server to one or more of the respective areas according to the number of desired users respectively corresponding to the IP addresses of the respective servers and the number of users respectively corresponding to the respective areas comprises:
ordering the areas in descending order according to the number of users corresponding to the areas to obtain an area sequence;
sequentially selecting an untreated region from the region sequence as a current region to be treated;
Determining whether at least one available IP group meeting service conditions exists in the current area to be processed according to the number of users corresponding to the current area to be processed and the current schedulable flow limit corresponding to the IP address of each server; the current corresponding schedulable flow limit of the IP address of each server is the difference value between the expected user number corresponding to the IP address of the server and the current user number to be occupied of the processed area in the area sequence; the available IP group is a combination formed by one or more IP addresses in the IP addresses of the servers;
If the at least one available IP group exists, selecting one available IP group from the at least one available IP group to obtain a target available IP group, mapping each IP address in the target available IP group to the current area to be processed, determining the number of users to be occupied in the current area to be processed in the schedulable flow limit of each IP address in the target available IP group based on the number of users in the current area to be processed, updating the schedulable flow limit of each IP address in the target available IP group based on the determined number of users to be occupied, and returning to the step of sequentially selecting an unprocessed area from the area sequence as the current area to be processed;
And if the at least one available IP group does not exist, backtracking to a previous area corresponding to the current area to be processed in the area sequence, updating the target available IP group of the previous area to any available IP group which is not selected as the target available IP group in the available IP groups corresponding to the previous area, and executing IP address mapping processing to the previous area based on the updated target available IP group of the previous area.
6. The traffic scheduling method according to claim 5, wherein the service condition to be satisfied by the available IP group includes:
The sum of the schedulable flow limit corresponding to each IP address in the available IP group is not lower than the reference user number corresponding to the current area to be processed; the absolute value of the difference between the reference user number and the user number corresponding to the current area to be processed is smaller than a first preset value;
The schedulable flow limit corresponding to each IP address in the available IP group is not lower than the reference average user number corresponding to the current area to be processed; the absolute value of the difference between the reference average user number and the average user number corresponding to the current area to be processed is smaller than a second preset value, and the average user number is the average number of the user numbers corresponding to the current area to be processed relative to the number of the IP addresses in the available IP group.
7. The traffic scheduling method according to claim 5, wherein the determining, based on the number of users corresponding to the current area to be processed, the number of users to be occupied by the current area to be processed at each IP address of the target available IP group includes:
dividing the number of users corresponding to the current area to be processed by the number of IP addresses in the target available IP group to obtain a corresponding division operation result;
and determining the number of users to be occupied by the current area to be processed at each IP address of the target available IP group as the division operation result.
8. The traffic scheduling method according to claim 1, wherein determining a target IP address from the IP addresses included in the target IP address set based on a preset traffic scheduling policy includes:
And based on a flow balancing strategy, randomly determining an IP address from all the IP addresses contained in the target IP address set to obtain the target IP address.
9. A traffic scheduling device, comprising:
The acquisition module is used for acquiring the access request of the user; the access request comprises a user address of the user and a target domain name for requesting access;
the resolving module is used for resolving the target domain name according to the user address to obtain a target IP address set corresponding to the target domain name aiming at the area to which the user address belongs;
the determining module is used for determining a target IP address from all IP addresses contained in the target IP address set based on a preset flow scheduling strategy;
the allocation module is used for allocating the access request to a server to which the target IP address belongs for processing;
Wherein, each domain name corresponds to a corresponding IP address set for different areas respectively; the domain name maps each IP address corresponding to the domain name to one or more areas according to the number of users in each area and the characteristic parameters of the corresponding server, and the formed IP address sets respectively corresponding to the different areas are formed; the corresponding server comprises a server to which each IP address corresponding to the domain name belongs, and the characteristic parameters of the server are parameters for representing the characteristics of the server.
10. A computer readable medium, characterized in that it has stored thereon a computer program comprising instructions for performing the traffic scheduling method according to any of claims 1-8.
CN202410192030.0A 2024-02-21 2024-02-21 Traffic scheduling method, device and computer readable medium Pending CN118055164A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410192030.0A CN118055164A (en) 2024-02-21 2024-02-21 Traffic scheduling method, device and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410192030.0A CN118055164A (en) 2024-02-21 2024-02-21 Traffic scheduling method, device and computer readable medium

Publications (1)

Publication Number Publication Date
CN118055164A true CN118055164A (en) 2024-05-17

Family

ID=91049760

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410192030.0A Pending CN118055164A (en) 2024-02-21 2024-02-21 Traffic scheduling method, device and computer readable medium

Country Status (1)

Country Link
CN (1) CN118055164A (en)

Similar Documents

Publication Publication Date Title
CN111541796B (en) CDN access flow scheduling method, device, communication system and storage medium
CN1302418C (en) Registry-integrated internet domain name acquisition system
CN107241319B (en) Distributed network crawler system based on VPN and scheduling method
CN107623751B (en) DNS network system, domain name resolution method and system
CN109547517B (en) Method and device for scheduling bandwidth resources
CN109327550A (en) A kind of distribution method of access request, device, storage medium and computer equipment
CN1269896A (en) Internet caching system
CN103312629A (en) Method, device and system of CDN (content delivery network) flow distribution
CN103391312B (en) Resource offline method for down loading and device
KR19980087398A (en) Dynamic Routing Method and Device in Internet
CN103391299A (en) Load balance method and load balance system
CN102611756B (en) Method and system for sending access request
CN107360117B (en) Data processing method, device and system
DE60121296D1 (en) ASSIGNING A SERVER ADDRESS TO A TERMINAL
CN112333299B (en) Domain name resolution method, configuration method and equipment
CN112738288A (en) DNS domain name resolution method, DNS server, GSLB system and domain name resolution system
CN109618003B (en) Server planning method, server and storage medium
US20070276900A1 (en) Global provisioning of millions of users with deployment units
CN107835262A (en) A kind of streaming media server dynamical load distribution method
CN112182070B (en) Elasticissearch query management system based on cloud computing
CN107896257A (en) Method, apparatus, equipment and the medium of deploying client subsystem function
CN109756584A (en) Domain name analytic method, domain name mapping device and computer readable storage medium
US8316099B2 (en) Directory distributor
CN106533986A (en) Path allocation method and device for reserving bandwidth resources on basis of time period
CN118055164A (en) Traffic scheduling method, device and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination