CN111988388A - Flow distribution method and device, electronic equipment and storage medium - Google Patents

Flow distribution method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111988388A
CN111988388A CN202010812968.XA CN202010812968A CN111988388A CN 111988388 A CN111988388 A CN 111988388A CN 202010812968 A CN202010812968 A CN 202010812968A CN 111988388 A CN111988388 A CN 111988388A
Authority
CN
China
Prior art keywords
bandwidth
resource consumption
data center
information
traffic
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.)
Granted
Application number
CN202010812968.XA
Other languages
Chinese (zh)
Other versions
CN111988388B (en
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 Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information 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 Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202010812968.XA priority Critical patent/CN111988388B/en
Publication of CN111988388A publication Critical patent/CN111988388A/en
Application granted granted Critical
Publication of CN111988388B publication Critical patent/CN111988388B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/101Server selection for load balancing based on network conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/147Network analysis or design for predicting network behaviour

Abstract

The disclosure relates to a method and a device for flow distribution, electronic equipment and a storage medium, and belongs to the technical field of internet. The method comprises the following steps: acquiring at least two resource consumption bandwidths according to bandwidth information corresponding to the flow to be allocated; respectively determining resource consumption information of at least two data centers according to at least two resource consumption bandwidths; selecting a data center with the lowest generated resource consumption quantity indicated by the resource consumption information from the at least two data centers as a target data center according to the resource consumption information of the at least two data centers; and distributing the flow to be distributed to the target data center. According to the technical scheme, the resource consumption information which is used for indicating the quantity of the resource consumption generated in the current use period by each data center is respectively determined, so that the data center with the lowest quantity of the generated resource consumption is selected for carrying out flow distribution, the resource consumption is reduced, and the bandwidth cost is saved.

Description

Flow distribution method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a method and an apparatus for allocating traffic, an electronic device, and a storage medium.
Background
Currently, the external network traffic of each Internet enterprise generally uses bandwidth resources of multiple network outlets to comprehensively provide disaster recovery capability, such as using multiple cloud services, IDC (Internet Data Center), and the like. The IDCs can be divided into self-built IDCs and managed IDCs, and different IDCs correspond to different network outlets. How to distribute among network outlets corresponding to different IDCs is a problem to be solved.
In the related art, the DNS (Domain Name System) or the VIP (Virtual IP Address) is mainly adjusted based on QOS (Quality of Service) detection to implement traffic distribution between multiple network outlets. That is, the traffic is distributed to the network outlet with better network quality, so as to ensure that the user has better use experience.
However, the above allocation scheme mainly considers the situation of network quality, and since the resource consumption types of different network outlets and the number of resource consumption generated by a unit bandwidth are different, bandwidth costs are different, when the network quality difference of a plurality of network outlets is small, a network outlet with a small network quality but a high bandwidth cost carries more traffic, thereby causing cost waste.
Disclosure of Invention
The present disclosure provides a traffic allocation method, an apparatus, an electronic device, and a storage medium, which select a data center with the lowest amount of generated resource consumption for traffic allocation by determining the amount of resource consumption generated in a current usage period after being allocated to at least two data centers, so as to save bandwidth cost. The technical scheme of the disclosure is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided a method comprising:
acquiring at least two resource consumption bandwidths according to bandwidth information corresponding to traffic to be allocated, wherein the resource consumption bandwidths are used for indicating that the data center generates resource consumption bandwidth in the current service cycle after the traffic to be allocated is allocated to any data center;
respectively determining resource consumption information of at least two data centers according to the at least two resource consumption bandwidths, wherein the resource consumption information is used for indicating the quantity of resource consumption generated by the data centers in the current use period;
according to the resource consumption information of the at least two data centers, selecting the data center with the lowest generated resource consumption quantity indicated by the resource consumption information from the at least two data centers as a target data center;
and distributing the flow to be distributed to the target data center.
In an optional implementation manner, the obtaining, according to bandwidth information corresponding to traffic to be allocated, at least two resource consumption bandwidths includes:
acquiring first bandwidth information corresponding to the traffic to be distributed in the current use period according to the bandwidth information corresponding to the traffic to be distributed, wherein the first bandwidth information is used for representing the bandwidth corresponding to the traffic to be distributed after distribution;
for any data center, determining the resource consumption bandwidth of the data center based on the first bandwidth information and the resource consumption type information of the data center.
In an optional implementation manner, the obtaining, according to bandwidth information corresponding to traffic to be allocated, first bandwidth information corresponding to the traffic to be allocated in the current usage period includes:
acquiring a flow peak bandwidth corresponding to a flow to be distributed according to bandwidth information corresponding to the flow to be distributed;
and predicting the traffic peak bandwidth corresponding to the traffic to be distributed according to a traffic prediction model to obtain first bandwidth information corresponding to the traffic to be distributed in the current use period, wherein the traffic prediction model is obtained by training historical traffic data after fitting based on traffic trend characteristics.
In an optional implementation manner, the determining resource consumption bandwidth of the data center based on the first bandwidth information and the resource consumption type information of the data center includes:
determining a resource consumption type corresponding to the data center according to the resource consumption type information of the data center;
acquiring a first uplink resource consumption bandwidth and a first downlink resource consumption bandwidth from the first bandwidth information according to the resource consumption type;
in response to the first uplink resource consumption bandwidth being greater than the first downlink resource consumption bandwidth, taking the first uplink resource consumption bandwidth as a resource consumption bandwidth of the data center;
and in response to the first downlink resource consumption bandwidth being larger than the first uplink resource consumption bandwidth, taking the first downlink resource consumption bandwidth as the resource consumption bandwidth of the data center.
In an optional implementation manner, the determining resource consumption bandwidth of the data center based on the first bandwidth information and the resource consumption type information of the data center includes:
acquiring second bandwidth information in a current charging period according to the existing flow of the data center, wherein the second bandwidth information is used for representing the bandwidth corresponding to the existing flow in the current service period;
determining third bandwidth information of the data center in the current use period according to the first bandwidth information and the second bandwidth information, wherein the third bandwidth information is used for representing a bandwidth corresponding to the superposed flow to be allocated and the current flow;
and determining the resource consumption bandwidth of the data center according to the second bandwidth information, the third bandwidth information and the resource consumption type information of the data center.
In an optional implementation manner, the determining the resource consumption bandwidth of the data center according to the second bandwidth information, the third bandwidth information, and the resource consumption type information of the data center includes:
determining a resource consumption type corresponding to the data center according to the resource consumption type information of the data center;
determining a pre-allocation resource consumption bandwidth of the data center according to the resource consumption type and the second bandwidth information, wherein the pre-allocation resource consumption bandwidth is a larger value of a second uplink resource consumption bandwidth and a second downlink resource consumption bandwidth obtained from the second bandwidth information;
determining the allocated resource consumption bandwidth of the data center according to the resource consumption type and the third bandwidth information, wherein the allocated resource consumption bandwidth is the larger value of a third uplink resource consumption bandwidth and a third downlink resource consumption bandwidth obtained from the third bandwidth information;
and acquiring a difference value between the resource consumption bandwidth after the allocation and the resource consumption bandwidth before the allocation, and taking the difference value as the resource consumption bandwidth of the data center.
In an optional implementation manner, the determining resource consumption information of at least two data centers according to the at least two resource consumption bandwidths respectively includes:
for any data center, acquiring resource proportion information of the data center;
and determining the resource consumption information of the data center according to the resource proportion information and the resource consumption bandwidth of the data center.
In an optional implementation manner, the acquiring resource proportion information of the data center includes:
acquiring a first quantity, wherein the first quantity is the minimum value of the quantity of resource consumption generated by unit bandwidth corresponding to each data center;
and determining resource proportion information corresponding to the data center according to the second quantity of resource consumption generated by the unit bandwidth corresponding to the data center and the first quantity.
In an optional implementation manner, before distributing the traffic to be distributed to a target data center, the method further includes:
determining a remaining capacity of the target data center;
responding to that the residual capacity of the target data center is smaller than the capacity required by the flow to be distributed, acquiring the flow with a target proportion from the flow to be distributed according to the residual capacity, distributing the flow to the target data center, and taking the data center with the second lowest generated resource consumption number indicated by the resource consumption information as a new target data center;
and distributing the rest flow to be distributed to the new target data center until the flow to be distributed is distributed.
According to a second aspect of the embodiments of the present disclosure, there is provided a device for allocating traffic, including:
the acquisition unit is configured to acquire at least two resource consumption bandwidths according to bandwidth information corresponding to traffic to be allocated, wherein the resource consumption bandwidths are used for indicating that after the traffic to be allocated is allocated to any data center, the data center generates resource consumption bandwidth in a current service cycle;
a determining unit configured to perform determining resource consumption information of at least two data centers according to the at least two resource consumption bandwidths, wherein the resource consumption information is used for indicating the amount of resource consumption generated by the data centers in the current usage period;
a selecting unit configured to perform selecting, from the at least two data centers, a data center with the lowest amount of generated resource consumption indicated by the resource consumption information as a target data center according to the resource consumption information of the at least two data centers;
a distribution unit configured to perform distribution of the traffic to be distributed to the target data center.
In an optional implementation manner, the obtaining unit is further configured to perform obtaining, according to bandwidth information corresponding to traffic to be allocated, first bandwidth information corresponding to the traffic to be allocated in the current usage period, where the first bandwidth information is used to indicate a bandwidth corresponding to the traffic to be allocated after allocation; for any data center, determining the resource consumption bandwidth of the data center based on the first bandwidth information and the resource consumption type information of the data center.
In an optional implementation manner, the obtaining unit is further configured to perform obtaining, according to bandwidth information corresponding to traffic to be allocated, traffic peak bandwidth corresponding to the traffic to be allocated; and predicting the traffic peak bandwidth corresponding to the traffic to be distributed according to a traffic prediction model to obtain first bandwidth information corresponding to the traffic to be distributed in the current use period, wherein the traffic prediction model is obtained by training historical traffic data after fitting based on traffic trend characteristics.
In an optional implementation manner, the obtaining unit is further configured to determine a resource consumption type corresponding to the data center according to the resource consumption type information of the data center; acquiring a first uplink resource consumption bandwidth and a first downlink resource consumption bandwidth from the first bandwidth information according to the resource consumption type; in response to the first uplink resource consumption bandwidth being greater than the first downlink resource consumption bandwidth, taking the first uplink resource consumption bandwidth as a resource consumption bandwidth of the data center; and in response to the first downlink resource consumption bandwidth being larger than the first uplink resource consumption bandwidth, taking the first downlink resource consumption bandwidth as the resource consumption bandwidth of the data center.
In an optional implementation manner, the obtaining unit is further configured to perform obtaining, according to an existing traffic of the data center, second bandwidth information in a current charging period, where the second bandwidth information is used to indicate a bandwidth corresponding to the existing traffic in a current usage period; determining third bandwidth information of the data center in the current use period according to the first bandwidth information and the second bandwidth information, wherein the third bandwidth information is used for representing a bandwidth corresponding to the superposed flow to be allocated and the current flow; and determining the resource consumption bandwidth of the data center according to the second bandwidth information, the third bandwidth information and the resource consumption type information of the data center.
In an optional implementation manner, the obtaining unit is further configured to determine a resource consumption type corresponding to the data center according to the resource consumption type information of the data center; determining a pre-allocation resource consumption bandwidth of the data center according to the resource consumption type and the second bandwidth information, wherein the pre-allocation resource consumption bandwidth is a larger value of a second uplink resource consumption bandwidth and a second downlink resource consumption bandwidth obtained from the second bandwidth information; determining the allocated resource consumption bandwidth of the data center according to the resource consumption type and the third bandwidth information, wherein the allocated resource consumption bandwidth is the larger value of a third uplink resource consumption bandwidth and a third downlink resource consumption bandwidth obtained from the third bandwidth information; and acquiring a difference value between the resource consumption bandwidth after the allocation and the resource consumption bandwidth before the allocation, and taking the difference value as the resource consumption bandwidth of the data center.
In an optional implementation manner, the determining unit is further configured to perform, for any data center, acquiring resource proportion information of the data center; and determining the resource consumption information of the data center according to the resource proportion information and the resource consumption bandwidth of the data center.
In an optional implementation manner, the determining unit is further configured to perform obtaining a first quantity, where the first quantity is a minimum value of quantities of resource consumption generated by a unit bandwidth corresponding to each data center; and determining resource proportion information corresponding to the data center according to the second quantity of resource consumption generated by the unit bandwidth corresponding to the data center and the first quantity.
In an optional implementation manner, the determining unit is further configured to perform determining a remaining capacity of the target data center;
the allocation unit is further configured to execute, in response to the remaining capacity of the target data center being smaller than the capacity required for the traffic to be allocated, acquiring, according to the remaining capacity, traffic of a target proportion from the traffic to be allocated to the target data center, and regarding, as a new target data center, a data center with the second lowest generated resource consumption indicated by the resource consumption information;
the distribution unit is further configured to distribute the remaining traffic to be distributed to the new target data center until the traffic to be distributed is distributed.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
one or more processors;
a memory for storing the processor executable program code;
wherein the processor is configured to execute the program code to implement the method of traffic distribution described above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium, wherein program code, when executed by a processor of an electronic device, enables the electronic device to perform the above-described method of traffic distribution.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product or a computer program comprising computer program code stored in a computer readable storage medium. The processor of the computer device reads the computer program code from the computer readable storage medium, and the processor executes the computer program code, so that the computer device performs the method for flow allocation provided in the various alternative implementations of the first aspect.
The technical scheme provided by the embodiment of the disclosure at least has the following beneficial effects:
when the traffic to be allocated is allocated, after the traffic to be allocated is allocated to any data center according to the bandwidth information corresponding to the traffic to be allocated, the data center generates a bandwidth for resource consumption in a current usage period, that is, a resource consumption bandwidth, and according to the resource consumption bandwidths of at least two data centers, resource consumption information, which is used for indicating the amount of resource consumption generated in the current usage period, of each data center is respectively determined, so that the data center with the lowest amount of generated resource consumption is selected for traffic allocation, the resource consumption is reduced, and the bandwidth cost is saved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is a schematic diagram of an implementation environment of a method for traffic distribution according to an example embodiment.
Fig. 2 is a flow chart illustrating a method of traffic distribution in accordance with an example embodiment.
Fig. 3 is a flow chart illustrating another method of traffic distribution in accordance with an example embodiment.
Fig. 4 is a flow chart illustrating another method of traffic distribution in accordance with an example embodiment.
Fig. 5 is a block diagram illustrating an apparatus for traffic distribution in accordance with an exemplary embodiment.
FIG. 6 is a block diagram illustrating a server in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the following claims
The user information to which the present disclosure relates may be information authorized by the user or sufficiently authorized by each party.
The following is a description of terms to which embodiments of the disclosure may relate:
the bandwidth is averaged every 95 months, one bandwidth is collected at regular intervals, the bandwidths collected every day are arranged in a descending order, the bandwidths ranked at the top 5% are removed, the bandwidth with the largest median value in the residual bandwidths is taken as the bandwidth corresponding to the current day, and then the average bandwidth value in one month is obtained according to the bandwidth corresponding to the current day and is taken as the charging bandwidth, namely the resource consumption bandwidth in the embodiment of the application.
And in month 95, acquiring a bandwidth at regular intervals, sorting the bandwidths acquired in a month in a descending order, removing the bandwidths ranked at the top 5%, and taking the bandwidth with the largest median of the remaining bandwidths as a charging bandwidth, namely the resource consumption bandwidth in the embodiment of the application.
And a monthly peak value, wherein a bandwidth is acquired at regular intervals, the bandwidths acquired in a month are arranged in a descending order, and the bandwidth with the maximum value is used as a charging bandwidth, namely the resource consumption bandwidth in the embodiment of the application.
And the resource is a resource which is required by a bandwidth user when the Internet service provider provides the bandwidth resource. Such as monetary resources, advertising resources, and virtual resources. Optionally, the money resources are physical money, electronic money, virtual money, and the like.
The embodiment of the disclosure provides a traffic distribution method, which can be applied to the distribution of traffic of a service to save bandwidth cost. For example, taking a service provider providing live broadcast service as an example, the external network traffic access of the service provider usually employs a variety of bandwidth resources, such as bandwidth resources provided by internet service providers such as mobile, internet, telecommunication, and educational networks. A service provider providing live broadcast services may be provided with a plurality of data centers, different data centers may correspond to bandwidth resources provided by different internet service providers, and generally one data center corresponds to one internet service provider. When a service provider of live broadcast service sends live broadcast data through bandwidth resources provided by an internet service provider, the service provider can select high-quality bandwidth resources by adjusting the DNS and the VIP, and send the live broadcast data to a user through a data center corresponding to the high-quality bandwidth resources, so that good live broadcast viewing experience is brought to the user. Because the resource consumption types of bandwidth resources provided by different internet services and the quantity of resource consumption generated by unit bandwidth are different, if the flow distribution is performed on the transmitted live broadcast data, namely data flow, among a plurality of data centers only by considering the quality of the bandwidth resources, the influence on the bandwidth cost after the flow distribution is ignored, and the waste of the bandwidth cost may be caused. For example, for the same traffic, the quality of the bandwidth resources corresponding to two data centers is not much different, but the resource consumption types are different, and if the traffic is allocated to the data center corresponding to the bandwidth resource with a slightly better quality to be transmitted, the bandwidth cost is higher. By the traffic distribution method provided by the embodiment of the disclosure, traffic to be distributed is reasonably distributed, and resource consumption information distributed to different data centers is determined, so that the data center with the lowest resource consumption amount indicated by the resource consumption information is selected for traffic distribution, so that resource consumption is reduced, and bandwidth cost is saved. The resource consumption type may include a daily 95-month average, a monthly 95, a monthly peak, and the like.
Fig. 1 is a schematic diagram of an implementation environment of a method for traffic distribution according to an example embodiment. Taking the electronic device as an example provided as a server, referring to fig. 1, the implementation environment specifically includes: a terminal 101 and a server 102.
The terminal 101 may be at least one of a smartphone, a smartwatch, a desktop computer, a laptop computer, an MP3 player, an MP4 player, a laptop portable computer, and the like. An application program supporting live broadcasting can be installed and run on the terminal 101, and a user can log in the application program through the terminal 101 to obtain a service provided by the application program. The terminal 101 may be connected to the server 102 through a wireless network or a wired network, and further may send a live broadcast obtaining request to the server 102 to obtain live broadcast data returned by the service 102.
The terminal 101 may be generally referred to as one of a plurality of terminals, and the embodiment is only illustrated by the terminal 101. Those skilled in the art will appreciate that the number of terminals described above may be greater or fewer. For example, the number of the terminals may be only a few, or the number of the terminals may be several tens or hundreds, or more, and the number of the terminals and the type of the device are not limited in the embodiments of the present disclosure.
The server 102 may be at least one of a server, a plurality of servers, a cloud computing platform, and a virtualization center. The server 102 may be connected to the terminal 101 and other terminals through a wireless network or a wired network, and the server 102 may receive a live broadcast acquisition request sent by the terminal 101, and return live broadcast data corresponding to the live broadcast acquisition request to the terminal 101 through a data center according to the live broadcast acquisition request. When the server 102 returns live data to the terminal 101, traffic is generated and bandwidth resources are occupied. At the same time, the more terminals the server 102 returns live data, the more traffic is generated, the more bandwidth resources are occupied, and the highest bandwidth occupied in a charging period is called traffic peak bandwidth. The number of the servers can be more or less, and the embodiment of the disclosure does not limit this. Of course, the server 102 may also include other functional servers to provide more comprehensive and diverse services.
Fig. 2 is a flowchart illustrating a method for allocating traffic according to an exemplary embodiment, and referring to fig. 2, when applied to an electronic device, the method includes the following specific steps:
in step S201, at least two resource consumption bandwidths are obtained according to bandwidth information corresponding to the traffic to be allocated, where the resource consumption bandwidths are used to indicate that, after the traffic to be allocated is allocated to any data center, the data center generates a bandwidth consumed by resources in a current usage period.
In the embodiment of the present disclosure, the traffic to be allocated is a part of traffic or all traffic of a service. The bandwidth information includes a traffic peak bandwidth corresponding to the traffic to be allocated, where the traffic peak bandwidth refers to a maximum value of instantaneous traffic that can be reached by the traffic to be allocated. The current usage period may be a charging period of the bandwidth, and one charging period may be one day, one month, one quarter, one year, and the like. Optionally, when the resource is a currency resource, the resource consumption bandwidth is a bandwidth used when the traffic to be allocated is allocated to any data center and charging is performed in a charging period.
It should be noted that, when traffic to be allocated is assumed by one data center before allocation and assumed by another data center after allocation, a process of allocating the traffic to be allocated may also be referred to as a traffic scheduling process, that is, traffic to be allocated is scheduled from one data center to another data center, and corresponding traffic to be allocated is referred to as traffic to be scheduled.
In step S202, resource consumption information of at least two data centers is respectively determined according to the at least two resource consumption bandwidths, where the resource consumption information is used to indicate the amount of resource consumption generated by the data centers in the current usage period.
In the embodiment of the present disclosure, for any data center, after obtaining the resource consumption bandwidth of the data center, the amount of resource consumption generated by the data center in the current usage period may be determined according to the resource consumption bandwidth. Optionally, when the resource is a monetary resource, the charging bandwidth of the data center may be multiplied by the unit price of the bandwidth, and the obtained product is the charge generated by the data center, and the charge generated by the data center is proportional to the charging bandwidth.
In step S203, a data center with the lowest amount of generated resource consumption indicated by the resource consumption information is selected as a target data center from at least two data centers according to the resource consumption information of the at least two data centers.
In the embodiment of the present disclosure, after the resource consumption information corresponding to each data center is determined, the data center with the lowest amount of generated resource consumption indicated by the resource consumption information is selected as the target data center for allocating traffic, which not only can satisfy the allocation requirement of the traffic to be allocated, but also can save the bandwidth cost.
In step S204, the traffic to be distributed is distributed to the target data center.
According to the scheme provided by the embodiment of the disclosure, when the traffic to be allocated is allocated, after the traffic to be allocated is allocated to any data center according to the bandwidth information corresponding to the traffic to be allocated, the data center generates the bandwidth of resource consumption in the current usage period, that is, the resource consumption bandwidth, and according to the resource consumption bandwidths of at least two data centers, the resource consumption information of each data center for indicating the amount of resource consumption generated in the current usage period is respectively determined, so that the data center with the lowest amount of generated resource consumption is selected for allocating the traffic, the resource consumption is reduced, and the bandwidth cost is saved.
In an optional implementation manner, acquiring at least two resource consumption bandwidths according to bandwidth information corresponding to traffic to be allocated includes:
acquiring first bandwidth information corresponding to the traffic to be allocated in the current service period according to the bandwidth information corresponding to the traffic to be allocated, wherein the first bandwidth information is used for indicating the bandwidth corresponding to the traffic to be allocated after the traffic to be allocated is allocated;
for any data center, determining the resource consumption bandwidth of the data center based on the first bandwidth information and the resource consumption type information of the data center.
The corresponding allocated bandwidth is determined through the bandwidth information, so that the resource consumption bandwidth corresponding to each data center can be respectively determined from the allocated corresponding bandwidth according to different resource consumption type information corresponding to different data centers, and the bandwidth cost of each data center after flow allocation is convenient to calculate subsequently.
In an optional implementation manner, obtaining, according to bandwidth information corresponding to a traffic to be allocated, first bandwidth information corresponding to the traffic to be allocated in the current usage period includes:
acquiring a flow peak bandwidth corresponding to the flow to be distributed according to the bandwidth information corresponding to the flow to be distributed;
and predicting the traffic peak bandwidth corresponding to the traffic to be distributed according to a traffic prediction model to obtain first bandwidth information corresponding to the traffic to be distributed in the current service period, wherein the traffic prediction model is obtained by training historical traffic data after fitting based on traffic trend characteristics.
Because the flow trend is relatively fixed, the flow prediction model obtained by performing fitting training on historical flow data based on the flow trend characteristics can predict the flow change condition in a service cycle, so that the bandwidth value of the flow to be distributed which is possibly generated after distribution is reflected, and the subsequent bandwidth cost calculation is more accurate.
In an optional implementation manner, determining the resource consumption bandwidth of the data center based on the first bandwidth information and the resource consumption type information of the data center includes:
determining a resource consumption type corresponding to the data center according to the resource consumption type information of the data center;
acquiring a first uplink resource consumption bandwidth and a first downlink resource consumption bandwidth from the first bandwidth information according to the resource consumption type;
in response to the first uplink resource consumption bandwidth being greater than the first downlink resource consumption bandwidth, taking the first uplink resource consumption bandwidth as the resource consumption bandwidth of the data center;
and in response to the first downlink resource consumption bandwidth being larger than the first uplink resource consumption bandwidth, taking the first downlink resource consumption bandwidth as the resource consumption bandwidth of the data center.
Because the higher bandwidth value in the uplink resource consumption bandwidth and the downlink resource consumption bandwidth is used as the resource consumption bandwidth, the resource consumption bandwidth is more consistent with the resource consumption type corresponding to the data center, and further the resource consumption information determined according to the resource consumption bandwidth can reflect the cost of the data center.
In an alternative implementation form of the present invention,
determining the resource consumption bandwidth of the data center based on the first bandwidth information and the resource consumption type information of the data center, including:
acquiring second bandwidth information in a current charging period according to the existing flow of the data center, wherein the second bandwidth information is used for indicating the bandwidth corresponding to the existing flow in the current service period;
determining third bandwidth information of the data center in the current use period according to the first bandwidth information and the second bandwidth information, wherein the third bandwidth information is used for representing a bandwidth corresponding to the superposed flow to be allocated and the current flow;
and determining the resource consumption bandwidth of the data center according to the second bandwidth information, the third bandwidth information and the resource consumption type information of the data center.
Because the data center receiving the flow to be distributed has the existing flow, the bandwidth corresponding to the flow to be distributed and the overlapped existing flow is determined by predicting the existing flow, so that the determined resource consumption bandwidth can represent the cost change of the data center before and after distribution.
In an optional implementation manner, the determining the resource consumption bandwidth of the data center according to the second bandwidth information, the third bandwidth information, and the resource consumption type information of the data center includes:
determining a resource consumption type corresponding to the data center according to the resource consumption type information of the data center;
determining a pre-allocation resource consumption bandwidth of the data center according to the resource consumption type and the second bandwidth information, wherein the pre-allocation resource consumption bandwidth is a larger value of a second uplink resource consumption bandwidth and a second downlink resource consumption bandwidth obtained from the second bandwidth information;
determining the allocated resource consumption bandwidth of the data center according to the resource consumption type and the third bandwidth information, wherein the allocated resource consumption bandwidth is the larger value of the third uplink resource consumption bandwidth and the third downlink resource consumption bandwidth acquired from the third bandwidth information;
and acquiring a difference value between the resource consumption bandwidth after the allocation and the resource consumption bandwidth before the allocation, and taking the difference value as the resource consumption bandwidth of the data center.
The resource consumption bandwidth before allocation and the resource consumption bandwidth after allocation are determined respectively through the second bandwidth information and the third bandwidth information, and the difference value of the resource consumption bandwidth before allocation and the resource consumption bandwidth after allocation is used as the resource consumption bandwidth corresponding to the data center, so that the data center with small cost change after flow allocation can be determined according to the resource consumption bandwidth.
In an optional implementation manner, the determining resource consumption information of at least two data centers according to the at least two resource consumption bandwidths respectively includes:
for any data center, acquiring resource proportion information of the data center;
and determining the resource consumption information of the data center according to the resource proportion information and the resource consumption bandwidth of the data center.
The resource consumption information corresponding to the data center is determined through the resource proportion information and the resource consumption bandwidth, and the influence of the resource proportion and the resource consumption type is comprehensively considered, so that the obtained resource consumption information can reflect the bandwidth cost better.
In an optional implementation manner, the acquiring resource proportion information of the data center includes:
acquiring a first quantity, wherein the first quantity is the minimum value of the quantity of resource consumption generated by unit bandwidth corresponding to each data center;
and determining resource proportion information corresponding to the data center according to the second quantity of resource consumption generated by the unit bandwidth corresponding to the data center and the first quantity.
The first quantity of the lowest resource consumption generated by the unit bandwidth corresponding to each data center is determined by the quantity of the resource consumption generated by the unit bandwidth, so that the quantity of the resource consumption of each data center can be quantified based on the first quantity, and the data center with the lowest cost can be conveniently determined.
In an optional implementation manner, before distributing the traffic to be distributed to the target data center, the method further includes:
determining the remaining capacity of the target data center;
responding to the fact that the residual capacity of the target data center is smaller than the capacity required by the flow to be distributed, obtaining the flow with a target proportion from the flow to be distributed according to the residual capacity, distributing the flow to the target data center, and taking the data center with the second lowest generated resource consumption number indicated by the resource consumption information as a new target data center;
and distributing the rest flow to be distributed to the new target data center until the flow to be distributed is distributed.
Due to the fact that the capacity of the data centers is considered, the flow to be distributed is divided into a plurality of parts according to the resource consumption information of each data center and then distributed to at least two data centers, and therefore the bandwidth cost can be saved to the maximum degree.
Fig. 2 is a basic flow chart of the present disclosure, and the scheme provided by the present disclosure is further explained below based on a specific implementation manner, and fig. 3 is a flow chart of another method for allocating traffic according to an exemplary embodiment. Taking the example that the electronic device is provided as a server, and at least two data centers receiving traffic to be distributed do not currently carry traffic, referring to fig. 3, the method includes:
in step S301, the server obtains, according to bandwidth information corresponding to traffic to be allocated, first bandwidth information corresponding to the traffic to be allocated in a current usage period, where the first bandwidth information is used to indicate a plurality of bandwidths corresponding to the traffic to be allocated after allocation.
In the embodiment of the present disclosure, a data center includes a plurality of computer devices, and due to different processing capabilities of the computer devices, damage to the computer devices may occur, or a part of the computer devices may not be available due to a need to upgrade the devices, and at this time, a part or all of traffic carried by the data center needs to be distributed to other data centers. The server can take the traffic needing to be distributed as the traffic to be distributed. The server may determine, according to the bandwidth information of the traffic to be allocated, a bandwidth that may be generated by the traffic to be allocated after allocation in the current usage period. Optionally, when the resource is a currency resource, the current usage period may be a charging period, and one charging period may be one day, one month, one quarter, and the like, which is not limited in this disclosure. The bandwidth included in the first bandwidth information is a bandwidth used for charging, the server may determine the charging type of each data center according to the resource consumption type information of each data center, that is, the charging type information, and the server determines the resource consumption bandwidth, that is, the charging bandwidth according to the charging type, and the manner of determining the resource consumption bandwidth may refer to step S302 described below.
In an optional implementation manner, the server may predict a traffic peak bandwidth corresponding to the traffic to be allocated through a traffic prediction model to determine the first bandwidth information. Correspondingly, the step of acquiring, by the server, the first bandwidth information corresponding to the traffic to be allocated in the current usage period according to the bandwidth information corresponding to the traffic to be allocated may be: the server may obtain a traffic peak bandwidth corresponding to the traffic to be allocated according to the bandwidth information corresponding to the traffic to be allocated. The server may input a traffic peak bandwidth corresponding to the traffic to be allocated into a traffic prediction model, and perform prediction processing on the traffic peak bandwidth corresponding to the traffic to be allocated according to the traffic prediction model to obtain first bandwidth information of the traffic to be allocated in a current usage period, where the traffic prediction model is a model obtained by training historical traffic data after fitting based on internet user characteristics, that is, traffic trend characteristics. Optionally, the output of the traffic prediction model may be in the form of a traffic trend graph that includes bandwidth over a period of use. Because the behaviors of internet users have certain rules, the number of users accessing the internet is large in rest time such as noon, evening and holiday, and the number of users accessing the internet is small in the early morning, so that the bandwidth resources occupied by service traffic are relatively fixed, the general expression is that the service traffic is high in the noon and evening, the service traffic is low in the early morning, the service traffic is obviously increased in the holiday, and the trend of increasing and decreasing the traffic is relatively fixed. Therefore, the server can accurately predict the traffic trend in a charging period based on the traffic trend characteristic and a traffic prediction model obtained by training after fitting the historical traffic data, and a traffic trend graph is formed, so that the bandwidth cost can be predicted based on the bandwidth in the traffic trend graph, and the prediction accuracy is improved.
In step S302, for any data center, the server determines the resource consumption bandwidth of the data center based on the first bandwidth information and the resource consumption type information of the data center.
In the embodiment of the disclosure, the resource consumption type of each data center can be determined according to the resource consumption type information of each data center, and the resource consumption types of different data centers can be the same or different. Optionally, when the resource is a monetary resource, the resource consumption type is a charging type, the server may obtain the charging type of each of the at least two data centers, and for any data center, the server may determine the resource consumption bandwidth from the first bandwidth information according to the charging type of the data center. Wherein, the resource consumption bandwidth determined by different charging types is different. The server may perform a subsequent step of determining resource consumption information corresponding to the data center based on the resource consumption bandwidth, and further determine to which data center the traffic to be called is called. Optionally, the charging type may be a daily 95-month average, a monthly 95, a monthly peak, and the like, which is not limited in this disclosure.
For example, taking the charging mode corresponding to the data center as month 95 as an example, one charging period is one month. Month 95 refers to billing at 95% peak bandwidth. If one effective bandwidth is acquired every 5 minutes, 12 effective bandwidths are acquired every hour, and 8640 effective bandwidths are acquired in one month. The 8640 effective bandwidths are sorted in descending order, and the first 5% of the effective bandwidths are removed, that is, 8640 × 5% — 432, and then the effective bandwidths at 433 in sequence are the charging bandwidths. And when determining the charging bandwidth, the server performs descending sorting on the bandwidths included in the first bandwidth information, removes the first 5% of the bandwidths, and takes the bandwidth with the largest median value in the remaining bandwidths as the charging bandwidth.
In an optional implementation manner, the bandwidth included in the first bandwidth information may be divided into an uplink bandwidth and a downlink bandwidth, the calculating is performed according to the bandwidth value when the amount of resource consumption is calculated, and correspondingly, the step of determining, by the server, the resource consumption bandwidth corresponding to the data center according to the first bandwidth information and the resource consumption type information corresponding to the data center may be: for any data center, the server may determine the resource consumption type corresponding to the data center according to the resource consumption type information of the data center. The server may obtain, according to the resource consumption type, a first uplink resource consumption bandwidth and a first downlink resource consumption bandwidth from the first bandwidth information. In response to the first uplink resource consumption bandwidth being greater than the first downlink resource consumption bandwidth, the server may use the first uplink resource consumption bandwidth as the resource consumption bandwidth of the data center; in response to the first downlink resource consumption bandwidth being greater than the first uplink resource consumption bandwidth, the server may treat the first downlink resource consumption bandwidth as the resource consumption bandwidth of the data center. The server may determine, according to the uplink bandwidth included in the first bandwidth information, the first uplink resource consumption bandwidth according to the resource consumption type; the server may determine, according to the downlink bandwidth included in the first bandwidth information, the first downlink resource consumption bandwidth according to the resource consumption type, which is not described herein again. Because the higher bandwidth value in the uplink bandwidth and the downlink bandwidth is used as the resource consumption bandwidth, the resource consumption bandwidth is more consistent with the resource consumption type corresponding to the data center, and the resource consumption information determined by the server according to the resource consumption bandwidth can reflect the cost of the data center.
In step S303, the server determines resource consumption information corresponding to at least two data centers according to at least two resource consumption bandwidths, where the resource consumption information is used to indicate the amount of resource consumption generated by the data centers in the current usage period.
In the embodiment of the present disclosure, for any data center, the server may obtain resource proportion information corresponding to the data center, and the server may determine the resource consumption information of the data center according to the resource consumption bandwidth corresponding to the data center and the resource proportion information corresponding to the data center. Optionally, when the resource is a currency resource, the resource consumption bandwidth is a charging bandwidth, the resource proportion information is used to indicate a price coefficient of the data center, a product of the charging bandwidth and the price coefficient is the normalized resource consumption quantity, and the product is used as the resource consumption information corresponding to the data center.
In an alternative implementation manner, the server may use the amount of resource consumption generated by the unit bandwidth corresponding to one data center as a reference to determine the resource proportion information of other data centers. Correspondingly, the step of acquiring the resource proportion information of the data center by the server may be: the server may obtain a first quantity, where the first quantity is a minimum value of quantities of resource consumption generated by a unit bandwidth corresponding to each data center, and determine resource proportion information corresponding to the data center according to a second quantity of resource consumption generated by the unit bandwidth corresponding to the data center and the first quantity. Optionally, when the resource is a monetary resource, the amount of resource consumption generated per bandwidth unit may be represented as a bandwidth unit price, the first amount may be represented as a target bandwidth unit price, and the resource proportion information may be represented as price information. The server may obtain a target bandwidth unit price, where the target bandwidth unit price is a minimum value of the bandwidth unit prices corresponding to the data centers. The server may obtain a ratio of the bandwidth unit price corresponding to the data center to the target bandwidth unit price, and use the ratio as a price coefficient indicated by the price information of the data center. The price factor indicated by the price information of the data center with the smallest price of the bandwidth is 1. Because the bandwidth unit price corresponding to each data center is quantized and represented by the resource proportion information, the server can quantize the cost of each data center based on the resource proportion information, and the data center with the lowest cost is convenient to determine.
For example, if the bandwidth unit price corresponding to the data center a is 10 ten thousand bits per Gbps (exchange bandwidth) per month, the bandwidth unit price corresponding to the data center B is 12 ten thousand bits per Gbps per month, and the bandwidth unit price corresponding to the data center C is 13 ten thousand bits per Gbps per month, the server takes the bandwidth unit price corresponding to the data center a as the target bandwidth unit price, and the price coefficient indicated by the price information of the data center a is 1. The price factor indicated by the price information of data center B is 1.2 and the price factor indicated by the price information of data center C is 1.3.
In step S304, the server selects, from the at least two data centers, a data center with the lowest amount of generated resource consumption indicated by the resource consumption information as a target data center according to the resource consumption information of the at least two data centers.
In this disclosure, the server may sort the at least two data centers in ascending order according to the amount of generated resource consumption indicated by the resource consumption information, and use the data center with the first order, that is, the data center with the lowest amount of generated resource consumption indicated by the resource consumption information, as the target data center.
In step S305, the server allocates the traffic to be allocated to the target data center.
In the embodiment of the present disclosure, the server may directly allocate the traffic to be allocated to the target data center, or may determine a new target data center again after allocating part of the traffic to be allocated to the target data center according to the capacity of each data center.
In an alternative implementation, each data center has a certain capacity, and the server may allocate the traffic to be allocated to at least one data center according to the remaining capacity of the data center. Correspondingly, after determining the target data center, the server may further determine the remaining capacity of the target data center, and in response to that the remaining capacity of the target data center is not less than the capacity required by the traffic to be distributed, the server may distribute the traffic to be distributed to the target data center. In response to the remaining capacity of the target data center being smaller than the capacity required for the traffic to be distributed, the server may obtain a target proportion of traffic from the traffic to be distributed to the target data center, and then take the data center with the second lowest generated resource consumption indicated by the resource consumption information as a new target data center. The server may allocate the remaining traffic to be allocated to the new target data center until the traffic to be allocated is allocated.
According to the scheme provided by the embodiment of the disclosure, when the traffic to be allocated is allocated, after the traffic to be allocated is allocated to any data center according to the bandwidth information corresponding to the traffic to be allocated, the data center generates the bandwidth of resource consumption in the current usage period, that is, the resource consumption bandwidth, and according to the resource consumption bandwidths of at least two data centers, the resource consumption information of each data center for indicating the amount of resource consumption generated in the current usage period is respectively determined, so that the data center with the lowest amount of generated resource consumption is selected for allocating the traffic, the resource consumption is reduced, and the bandwidth cost is saved.
The embodiment shown in fig. 3 is an alternative manner of the traffic distribution method provided in the embodiment of the present disclosure, another alternative implementation is explained below, and fig. 4 is a flowchart of another traffic distribution method according to an exemplary embodiment. The electronic device is provided as a server, and the at least two data centers currently carry traffic, for example, the method includes:
in step S401, the server obtains, according to bandwidth information corresponding to traffic to be allocated, first bandwidth information corresponding to the traffic to be allocated in a current usage period, where the first bandwidth information is used to indicate a plurality of bandwidths corresponding to the traffic to be allocated after allocation.
In the embodiment of the present disclosure, the step may refer to the step S301, which is not described herein again.
In step S402, for any data center, the server obtains second bandwidth information in the current usage period according to the existing traffic of the data center, where the second bandwidth information is used to indicate a bandwidth corresponding to the existing traffic in the current usage period.
In the embodiment of the disclosure, the server may predict the traffic trend of the existing traffic based on the existing traffic of the data center, and obtain the bandwidth that has been generated in the current usage period and the bandwidth that may be generated by the existing traffic. The second bandwidth information may be in the form of a traffic graph including bandwidth that the existing traffic has generated and bandwidth that is predicted to be generated during the current usage period. The server may predict the traffic trend of the existing traffic by fitting the traffic trend characteristics and the historical traffic curve data, which is not limited in the embodiments of the present disclosure.
In step S403, the server determines, according to the first bandwidth information and the second bandwidth information, third bandwidth information corresponding to the data center in the current charging usage, where the third bandwidth information is used to indicate a bandwidth corresponding to the superimposed flow to be allocated and the existing flow.
In this embodiment of the application, the server may superimpose the bandwidth included in the first bandwidth information and the bandwidth included in the second bandwidth information, and during the superimposing, the server may sum the bandwidths at the same time point, and use the superimposed bandwidth obtained by the summing as the bandwidth corresponding to the time point after the allocation, thereby obtaining the third bandwidth information.
For example, if the current charging period is 1 month, 8640 time points are corresponded, and traffic to be allocated is allocated at 0:00 am # 21, the first bandwidth information includes 2880 bandwidths and 2880 time points, the second bandwidth information includes 8640 bandwidths and 8640 time points, where 5760 bandwidths are actual bandwidths of the existing traffic and 2880 bandwidths are bandwidths predicted from the existing traffic. And the server sums the 2880 predicted bandwidths and the 2880 bandwidths included in the first bandwidth information according to the time point corresponding to obtain 2880 superposed bandwidths. The 5760 bandwidths and 2880 superimposed bandwidths are used as the third bandwidth information.
In step S404, the server determines the resource consumption bandwidth corresponding to the data center according to the second bandwidth information, the third bandwidth information and the resource consumption type information of the data center.
In this embodiment of the present disclosure, for the data center, the server may obtain resource consumption type information of the data center, and determine a resource consumption type corresponding to the data center. Then, the server may determine, according to the resource consumption type and the second bandwidth information, a pre-allocation resource consumption bandwidth corresponding to the data center, where the pre-allocation resource consumption bandwidth is a larger value of a second uplink resource consumption bandwidth and a second downlink resource consumption bandwidth obtained from the second bandwidth information. The server may further determine, according to the resource consumption type and the third bandwidth information, a resource consumption bandwidth after allocation corresponding to the data center, where the resource consumption bandwidth after allocation is a larger value of a third uplink resource consumption bandwidth and a third downlink resource consumption bandwidth acquired from the third bandwidth information. The server may obtain a difference between the allocated resource consumption bandwidth and the resource consumption bandwidth before allocation, and use the difference as the resource consumption bandwidth corresponding to the data center. The resource consumption bandwidth before allocation and the resource consumption bandwidth after allocation are determined respectively through the second bandwidth information and the third bandwidth information, and the difference value of the resource consumption bandwidth before allocation and the resource consumption bandwidth after allocation is used as the resource consumption bandwidth corresponding to the data center, so that the data center with small resource consumption bandwidth change after flow allocation can be determined according to the resource consumption bandwidth.
For example, taking the resource as a currency resource, the resource consumption type is a charging type, and the resource consumption bandwidth is a charging bandwidth. The data center B and the data center C adopt a charging type of monthly 95, the server obtains a second uplink charging bandwidth of 1000Gbps and a second downlink charging bandwidth of 500Gbps from second bandwidth information corresponding to the data center B, and the charging bandwidth before distribution is 1000 Gbps; the server acquires a third uplink charging bandwidth of 1100Gbps, a third downlink bandwidth of 1500Gbps and a distributed charging bandwidth of 1500Gbps from third bandwidth information corresponding to the data center B. The resource consumption bandwidth corresponding to the data center B is 500 Gbps. Similarly, the server acquires a second uplink charging bandwidth of 500Gbps and a second downlink charging bandwidth of 1000Gbps from second bandwidth information corresponding to the data center C, and the charging bandwidth before distribution is 1000 Gbps; the server obtains a third uplink charging bandwidth of 600Gbps, a third downlink bandwidth of 2000Gbps from third bandwidth information corresponding to the data center C, and the charging bandwidth after distribution is 2000 Gbps. The charging bandwidth corresponding to the data center C is 1000 Gbps.
It should be noted that the manner of obtaining the second uplink resource consumption bandwidth, the second downlink resource consumption bandwidth, the third uplink resource consumption bandwidth, and the third downlink resource consumption bandwidth is similar to the step of obtaining the first uplink resource consumption bandwidth and the second uplink resource consumption bandwidth from the first bandwidth information by the server in step S302, and details are not repeated here.
In step S405, the server determines resource consumption information of the at least two data centers according to at least two resource consumption bandwidths, where the resource consumption information is used to indicate the amount of resource consumption generated by the data centers in the current usage period.
In the embodiment of the present disclosure, the step may refer to the step S303, which is not described herein again.
In step S406, the server selects, from the at least two data centers, a data center with the lowest amount of generated resource consumption indicated by the resource consumption information as a target data center according to the resource consumption information of the at least two data centers.
In the embodiment of the present disclosure, the step may refer to the step S304, which is not described herein again.
In step S407, the server allocates the traffic to be allocated to the target data center.
In the embodiment of the present disclosure, the step may refer to the step S305, which is not described herein again.
According to the scheme provided by the embodiment of the disclosure, when the traffic to be allocated is allocated, after the traffic to be allocated is allocated to any data center according to the bandwidth information corresponding to the traffic to be allocated, the data center generates the bandwidth of resource consumption in the current usage period, that is, the resource consumption bandwidth, and according to the resource consumption bandwidths of at least two data centers, the resource consumption information of each data center for indicating the amount of resource consumption generated in the current usage period is respectively determined, so that the data center with the lowest amount of generated resource consumption is selected for allocating the traffic, the resource consumption is reduced, and the bandwidth cost is saved.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
Fig. 5 is a block diagram illustrating an apparatus for traffic distribution in accordance with an exemplary embodiment. Referring to fig. 5, the apparatus includes: an acquisition unit 501, a determination unit 502, a selection unit 503, and an assignment unit 504.
The acquiring unit 501 is configured to acquire at least two resource consumption bandwidths according to bandwidth information corresponding to traffic to be allocated, where the resource consumption bandwidths are used to indicate that a data center generates a bandwidth consumed by resources in a current usage period after the traffic to be allocated is allocated to any data center;
a determining unit 502 configured to perform determining resource consumption information of at least two data centers according to at least two resource consumption bandwidths, respectively, the resource consumption information being used for indicating the amount of resource consumption generated by the data centers in the current usage period;
a selecting unit 503 configured to perform selecting, from the at least two data centers, a data center with the lowest amount of generated resource consumption indicated by the resource consumption information as a target data center according to the resource consumption information of the at least two data centers;
an assigning unit 504 configured to perform assigning the traffic to be assigned to the target data center.
According to the device provided by the embodiment of the disclosure, when the traffic to be allocated is allocated, the acquiring unit acquires the bandwidth, which is generated by the data center in the current usage period after the traffic to be allocated is allocated to any data center according to the bandwidth information corresponding to the traffic to be allocated, that is, the resource consumption bandwidth, and the determining unit determines the resource consumption information, which is used by each data center to indicate the amount of resource consumption generated in the current usage period, according to the resource consumption bandwidths of at least two data centers, so that the data center with the lowest amount of resource consumption is selected by the selecting unit and the allocating unit to perform traffic allocation, thereby reducing the resource consumption and saving the bandwidth cost.
In an optional implementation manner, the obtaining unit 501 is further configured to perform obtaining, according to bandwidth information corresponding to traffic to be allocated, first bandwidth information corresponding to the traffic to be allocated in a current usage period, where the first bandwidth information is used to indicate a bandwidth corresponding to the traffic to be allocated after allocation; for any data center, determining the resource consumption bandwidth of the data center based on the first bandwidth information and the resource consumption type information of the data center.
In an optional implementation manner, the obtaining unit 501 is further configured to perform obtaining, according to bandwidth information corresponding to traffic to be allocated, traffic peak bandwidth corresponding to the traffic to be allocated; and predicting the traffic peak bandwidth corresponding to the traffic to be distributed according to a traffic prediction model to obtain first bandwidth information corresponding to the traffic to be distributed in the current use period, wherein the traffic prediction model is obtained by training historical traffic data after fitting based on traffic trend characteristics.
In an optional implementation manner, the obtaining unit 501 is further configured to determine a resource consumption type corresponding to the data center according to the resource consumption type information of the data center; acquiring a first uplink resource consumption bandwidth and a first downlink resource consumption bandwidth from the first bandwidth information according to the resource consumption type; responding to the fact that the first uplink resource consumption bandwidth is larger than the first downlink resource consumption bandwidth, and taking the first uplink resource consumption bandwidth as the resource consumption bandwidth of the data center; and in response to the first downlink resource consumption bandwidth being larger than the first uplink resource consumption bandwidth, taking the first downlink resource consumption bandwidth as the resource consumption bandwidth of the data center.
In an optional implementation manner, the obtaining unit 501 is further configured to perform obtaining, according to an existing traffic of a data center, second bandwidth information in a current charging period, where the second bandwidth information is used to indicate a bandwidth corresponding to the existing traffic in a current usage period; determining third bandwidth information of the data center in the current use period according to the first bandwidth information and the second bandwidth information, wherein the third bandwidth information is used for representing a bandwidth corresponding to the superposed flow to be distributed and the current flow; and determining the resource consumption bandwidth of the data center according to the second bandwidth information, the third bandwidth information and the resource consumption type information of the data center.
In an optional implementation manner, the obtaining unit 501 is further configured to determine a resource consumption type corresponding to the data center according to the resource consumption type information of the data center; determining a pre-allocation resource consumption bandwidth of the data center according to the resource consumption type and the second bandwidth information, wherein the pre-allocation resource consumption bandwidth is a larger value of a second uplink resource consumption bandwidth and a second downlink resource consumption bandwidth obtained from the second bandwidth information; determining the allocated resource consumption bandwidth of the data center according to the resource consumption type and the third bandwidth information, wherein the allocated resource consumption bandwidth is the larger value of the third uplink resource consumption bandwidth and the third downlink resource consumption bandwidth acquired from the third bandwidth information; and acquiring a difference value between the resource consumption bandwidth after distribution and the resource consumption bandwidth before distribution, and taking the difference value as the resource consumption bandwidth of the data center.
In an optional implementation manner, the determining unit 502 is further configured to perform, for any data center, acquiring resource proportion information of the data center; and determining the resource consumption information of the data center according to the resource proportion information and the resource consumption bandwidth of the data center.
In an optional implementation manner, the determining unit 502 is further configured to perform obtaining a first quantity, where the first quantity is a minimum value of quantities of resource consumption generated by a unit bandwidth corresponding to each data center; and determining resource proportion information corresponding to the data center according to the second quantity and the first quantity of resource consumption generated by the unit bandwidth corresponding to the data center.
In an alternative implementation, the determining unit 502 is further configured to perform determining the remaining capacity of the target data center;
the allocating unit 504 is further configured to perform, in response to the remaining capacity of the target data center being smaller than the capacity required for the traffic to be allocated, acquiring, according to the remaining capacity, a traffic allocation of a target proportion from the traffic to be allocated to the target data center, and regarding, as a new target data center, a data center with a second lowest number of generated resource consumptions indicated by the resource consumption information;
the allocating unit 504 is further configured to perform allocating the remaining traffic to be allocated to the new target data center until the traffic to be allocated is allocated.
It should be noted that, when the traffic distribution apparatus provided in the foregoing embodiment performs traffic distribution, only the division of each functional unit is illustrated, and in practical applications, the function distribution may be performed by different functional units according to needs, that is, the internal structure of the electronic device is divided into different functional units, so as to perform all or part of the functions described above. In addition, the flow distribution device and the flow distribution method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments and are not described herein again.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
When the electronic device is provided as a server, see fig. 6, fig. 6 is a block diagram of a server 600 according to an exemplary embodiment, where the server 600 may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 601 and one or more memories 602, and the storage media contained in the memories 602 may be a ROM603 and a Random Access Memory (RAM) 604. Wherein, at least one program code is stored in the memory 602, and the at least one program code is loaded and executed by the processor 601 to implement the method for allocating traffic provided by the above-mentioned method embodiments. Certainly, the server may further have a wired or wireless network interface 605, an input/output interface 606, and other components to facilitate input and output, and the server 600 may further include other components for implementing the functions of the device, which is not described herein again.
In an exemplary embodiment, there is also provided a storage medium comprising program code, such as a memory 602 comprising program code, executable by the processor 601 of the server 600 to perform the above-described method. Alternatively, the storage medium may be a non-transitory computer readable storage medium, for example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product or a computer program is also provided, which comprises computer program code, which is stored in a computer-readable storage medium. The processor of the computer device or electronic device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, causing the computer device or electronic device to perform the method of flow allocation provided in the various alternative implementations described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method of traffic distribution, the method comprising:
acquiring at least two resource consumption bandwidths according to bandwidth information corresponding to traffic to be allocated, wherein the resource consumption bandwidths are used for indicating that the data center generates resource consumption bandwidth in the current service cycle after the traffic to be allocated is allocated to any data center;
respectively determining resource consumption information of at least two data centers according to the at least two resource consumption bandwidths, wherein the resource consumption information is used for indicating the quantity of resource consumption generated by the data centers in the current use period;
according to the resource consumption information of the at least two data centers, selecting the data center with the lowest generated resource consumption quantity indicated by the resource consumption information from the at least two data centers as a target data center;
and distributing the flow to be distributed to the target data center.
2. The method for allocating traffic according to claim 1, wherein the obtaining at least two resource consumption bandwidths according to the bandwidth information corresponding to the traffic to be allocated includes:
acquiring first bandwidth information corresponding to the traffic to be distributed in the current use period according to the bandwidth information corresponding to the traffic to be distributed, wherein the first bandwidth information is used for representing the bandwidth corresponding to the traffic to be distributed after distribution;
for any data center, determining the resource consumption bandwidth of the data center based on the first bandwidth information and the resource consumption type information of the data center.
3. The method for allocating traffic according to claim 2, wherein the obtaining, according to bandwidth information corresponding to traffic to be allocated, first bandwidth information corresponding to the traffic to be allocated in the current usage period includes:
acquiring a flow peak bandwidth corresponding to a flow to be distributed according to bandwidth information corresponding to the flow to be distributed;
and predicting the traffic peak bandwidth corresponding to the traffic to be distributed according to a traffic prediction model to obtain first bandwidth information corresponding to the traffic to be distributed in the current use period, wherein the traffic prediction model is obtained by training historical traffic data after fitting based on traffic trend characteristics.
4. The method of traffic allocation according to claim 2, wherein the determining the resource consumption bandwidth of the data center based on the first bandwidth information and the resource consumption type information of the data center comprises:
determining a resource consumption type corresponding to the data center according to the resource consumption type information of the data center;
acquiring a first uplink resource consumption bandwidth and a first downlink resource consumption bandwidth from the first bandwidth information according to the resource consumption type;
in response to the first uplink resource consumption bandwidth being greater than the first downlink resource consumption bandwidth, taking the first uplink resource consumption bandwidth as a resource consumption bandwidth of the data center;
and in response to the first downlink resource consumption bandwidth being larger than the first uplink resource consumption bandwidth, taking the first downlink resource consumption bandwidth as the resource consumption bandwidth of the data center.
5. The method of traffic allocation according to claim 2, wherein the determining the resource consumption bandwidth of the data center based on the first bandwidth information and the resource consumption type information of the data center comprises:
acquiring second bandwidth information in a current charging period according to the existing flow of the data center, wherein the second bandwidth information is used for representing the bandwidth corresponding to the existing flow in the current service period;
determining third bandwidth information of the data center in the current use period according to the first bandwidth information and the second bandwidth information, wherein the third bandwidth information is used for representing a bandwidth corresponding to the superposed flow to be allocated and the current flow;
and determining the resource consumption bandwidth of the data center according to the second bandwidth information, the third bandwidth information and the resource consumption type information of the data center.
6. The method of traffic allocation according to claim 5, wherein the determining the resource consumption bandwidth of the data center according to the second bandwidth information, the third bandwidth information and the resource consumption type information of the data center comprises:
determining a resource consumption type corresponding to the data center according to the resource consumption type information of the data center;
determining a pre-allocation resource consumption bandwidth of the data center according to the resource consumption type and the second bandwidth information, wherein the pre-allocation resource consumption bandwidth is a larger value of a second uplink resource consumption bandwidth and a second downlink resource consumption bandwidth obtained from the second bandwidth information;
determining the allocated resource consumption bandwidth of the data center according to the resource consumption type and the third bandwidth information, wherein the allocated resource consumption bandwidth is the larger value of a third uplink resource consumption bandwidth and a third downlink resource consumption bandwidth obtained from the third bandwidth information;
and acquiring a difference value between the resource consumption bandwidth after the allocation and the resource consumption bandwidth before the allocation, and taking the difference value as the resource consumption bandwidth of the data center.
7. The method of traffic allocation according to claim 1, wherein the determining resource consumption information of at least two data centers according to the at least two resource consumption bandwidths comprises:
for any data center, acquiring resource proportion information of the data center;
and determining the resource consumption information of the data center according to the resource proportion information and the resource consumption bandwidth of the data center.
8. An apparatus for flow distribution, the apparatus comprising:
the acquisition unit is configured to acquire at least two resource consumption bandwidths according to bandwidth information corresponding to traffic to be allocated, wherein the resource consumption bandwidths are used for indicating that after the traffic to be allocated is allocated to any data center, the data center generates resource consumption bandwidth in a current service cycle;
a determining unit configured to perform determining resource consumption information of at least two data centers according to the at least two resource consumption bandwidths, wherein the resource consumption information is used for indicating the amount of resource consumption generated by the data centers in the current usage period;
a selecting unit configured to perform selecting, from the at least two data centers, a data center with the lowest amount of generated resource consumption indicated by the resource consumption information as a target data center according to the resource consumption information of the at least two data centers;
a distribution unit configured to perform distribution of the traffic to be distributed to the target data center.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a memory for storing the processor executable program code;
wherein the processor is configured to execute the program code to implement the method of traffic distribution according to any of claims 1 to 7.
10. A storage medium, characterized in that program code in the storage medium, when executed by a processor of an electronic device, enables the electronic device to perform the method of traffic distribution according to any of claims 1 to 7.
CN202010812968.XA 2020-08-13 2020-08-13 Flow distribution method, device, electronic equipment and storage medium Active CN111988388B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010812968.XA CN111988388B (en) 2020-08-13 2020-08-13 Flow distribution method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010812968.XA CN111988388B (en) 2020-08-13 2020-08-13 Flow distribution method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111988388A true CN111988388A (en) 2020-11-24
CN111988388B CN111988388B (en) 2023-05-16

Family

ID=73435407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010812968.XA Active CN111988388B (en) 2020-08-13 2020-08-13 Flow distribution method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111988388B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114785794A (en) * 2022-03-29 2022-07-22 北京字节跳动网络技术有限公司 Resource allocation method, device, equipment, medium, program product and system
CN115065648A (en) * 2022-08-05 2022-09-16 南京大学 Multi-outlet traffic scheduling method and system of cloud network platform

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070198383A1 (en) * 2006-02-23 2007-08-23 Dow James B Method and apparatus for data center analysis and planning
US20130038256A1 (en) * 2011-08-08 2013-02-14 Denso Corporation Rotary machine control apparatus
CN103825838A (en) * 2014-02-24 2014-05-28 上海交通大学 Method for flow dispatch for removing bandwidth fragmentization from data center
CN104144183A (en) * 2013-05-08 2014-11-12 株式会社日立制作所 Data center system and management method for data center system
CN105471759A (en) * 2016-01-11 2016-04-06 北京百度网讯科技有限公司 Network traffic scheduling method and apparatus for data centers
CN106155785A (en) * 2016-06-23 2016-11-23 中国人民解放军国防科学技术大学 A kind of data migration method across data center's cloud computing system
US20170149688A1 (en) * 2015-11-25 2017-05-25 International Business Machines Corporation Configuring resources to exploit elastic network capability
CN107395733A (en) * 2017-07-31 2017-11-24 上海交通大学 Geographical distribution interactive service cloud resource cooperative optimization method
CN108055596A (en) * 2017-12-26 2018-05-18 北京奇艺世纪科技有限公司 A kind of specific user's flow ensuring method and system
CN108712493A (en) * 2018-05-18 2018-10-26 苏州大学 Social user data distributed storage method and system between cross-region cloud data center

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070198383A1 (en) * 2006-02-23 2007-08-23 Dow James B Method and apparatus for data center analysis and planning
US20130038256A1 (en) * 2011-08-08 2013-02-14 Denso Corporation Rotary machine control apparatus
CN104144183A (en) * 2013-05-08 2014-11-12 株式会社日立制作所 Data center system and management method for data center system
CN103825838A (en) * 2014-02-24 2014-05-28 上海交通大学 Method for flow dispatch for removing bandwidth fragmentization from data center
US20170149688A1 (en) * 2015-11-25 2017-05-25 International Business Machines Corporation Configuring resources to exploit elastic network capability
CN105471759A (en) * 2016-01-11 2016-04-06 北京百度网讯科技有限公司 Network traffic scheduling method and apparatus for data centers
CN106155785A (en) * 2016-06-23 2016-11-23 中国人民解放军国防科学技术大学 A kind of data migration method across data center's cloud computing system
CN107395733A (en) * 2017-07-31 2017-11-24 上海交通大学 Geographical distribution interactive service cloud resource cooperative optimization method
CN108055596A (en) * 2017-12-26 2018-05-18 北京奇艺世纪科技有限公司 A kind of specific user's flow ensuring method and system
CN108712493A (en) * 2018-05-18 2018-10-26 苏州大学 Social user data distributed storage method and system between cross-region cloud data center

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘焕淋等: "频谱效率优先的任播路由冲突感知的弹性光网络资源重配置", 《电子与信息学报》 *
陶小旖: ""数据中心流量调度与请求分配的关键技术研究"", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114785794A (en) * 2022-03-29 2022-07-22 北京字节跳动网络技术有限公司 Resource allocation method, device, equipment, medium, program product and system
CN115065648A (en) * 2022-08-05 2022-09-16 南京大学 Multi-outlet traffic scheduling method and system of cloud network platform
CN115065648B (en) * 2022-08-05 2022-12-09 南京大学 Multi-outlet traffic scheduling method and system of cloud network platform

Also Published As

Publication number Publication date
CN111988388B (en) 2023-05-16

Similar Documents

Publication Publication Date Title
CN104796422A (en) Online customer service staff equilibrium assignment method and online customer service staff equilibrium assignment device
CN110858161A (en) Resource allocation method, device, system, equipment and medium
CN107295090B (en) Resource scheduling method and device
US11496413B2 (en) Allocating cloud computing resources in a cloud computing environment based on user predictability
CN110138883B (en) Hybrid cloud resource allocation method and device
CN111988388B (en) Flow distribution method, device, electronic equipment and storage medium
CN111078369B (en) Virtual machine distribution method and device under cloud computer and server
CN110839069B (en) Node data deployment method, node data deployment system and medium
CN111131841A (en) Live indirect access method and device, electronic equipment and storage medium
CN112887228A (en) Cloud resource management method and device, electronic equipment and computer readable storage medium
CN110149377A (en) A kind of video service node resource allocation methods, system, device and storage medium
CN107733805A (en) Business load dispatching method and device
CN111966556A (en) Performance pressure measurement method and device, server and computer readable storage medium
CN108241535B (en) Resource management method and device and server equipment
CN112395075A (en) Resource processing method and device and resource scheduling system
CN108076443B (en) Flow distribution method in online charging system and online charging system
CN114844791B (en) Cloud service automatic management and distribution method and system based on big data and storage medium
CN116546028A (en) Service request processing method and device, storage medium and electronic equipment
CN114219468A (en) Micro-service charging method and device based on private container cloud and related components
CN110096352A (en) Process management method, device and computer readable storage medium
CN106936733B (en) Bandwidth resource allocation method and device
CN110708374B (en) Distribution method and distribution device of edge nodes and readable storage medium
CN103179641A (en) Method for terminal to select networks and terminal
CN113157586A (en) Financial market unit test case generation method and device
CN113271335A (en) System for managing and controlling operation of cloud computing terminal and cloud server

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
GR01 Patent grant
GR01 Patent grant