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

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

Info

Publication number
CN111988388B
CN111988388B CN202010812968.XA CN202010812968A CN111988388B CN 111988388 B CN111988388 B CN 111988388B CN 202010812968 A CN202010812968 A CN 202010812968A CN 111988388 B CN111988388 B CN 111988388B
Authority
CN
China
Prior art keywords
bandwidth
resource consumption
data center
information
flow
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.)
Active
Application number
CN202010812968.XA
Other languages
Chinese (zh)
Other versions
CN111988388A (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

Landscapes

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

Abstract

The disclosure relates to a flow distribution method, a flow distribution device, 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, from the at least two data centers, a data center with the lowest number of generated resource consumptions indicated by the resource consumption information 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, of each data center is respectively determined, so that the data center with the lowest quantity of the generated resource consumption is selected for flow distribution, the consumption of the resource is reduced, and the bandwidth cost is saved.

Description

Flow distribution method, device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of internet, and in particular relates to a method, a device, electronic equipment and a storage medium for flow distribution.
Background
Currently, the external network traffic of each internet enterprise generally adopts bandwidth resources of multiple network outlets to comprehensively provide disaster tolerance, such as cloud services, IDC (Internet Data Center ) and the like of multiple families. The IDCs can be divided into self-built IDCs and managed IDCs, and different IDCs correspond to different network outlets. How to allocate between network outlets corresponding to different IDCs is a problem to be solved.
In the related art, traffic distribution between a plurality of network outlets is mainly achieved by adjusting DNS (Domain Name System, domain name system (service) protocol) or VIP (Virtual IP Address ) based on QOS (Quality of Service, quality of service) detection. I.e. distributing the traffic 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 the bandwidth costs are different due to different resource consumption types of different network outlets and different amounts of resource consumption generated by unit bandwidth, so that when the network quality differences of the plurality of network outlets are smaller, the network outlets with small advantages of network quality but higher bandwidth costs bear more traffic, thereby causing cost waste.
Disclosure of Invention
The present disclosure provides a method, an apparatus, an electronic device, and a storage medium for traffic distribution, by determining the amount of resource consumption generated in a current usage period after being distributed to at least two data centers, so as to select a data center with the lowest amount of generated resource consumption for traffic distribution, so as to save bandwidth cost. The technical scheme of the present 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 the flow to be allocated, wherein the resource consumption bandwidths are used for indicating the bandwidth consumed by resources generated by the data center in the current use period after the flow 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;
selecting, from among the at least two data centers, a data center having the lowest number of generated resource consumptions indicated by the resource consumption information 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.
In an optional implementation manner, the obtaining at least two resource consumption bandwidths according to bandwidth information corresponding to the traffic to be allocated includes:
according to bandwidth information corresponding to the flow to be distributed, obtaining first bandwidth information corresponding to the flow to be distributed in the current use period, wherein the first bandwidth information is used for representing the bandwidth corresponding to the flow 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 the 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 bandwidth information corresponding to the flow to be distributed;
and predicting the flow peak bandwidth corresponding to the flow to be distributed according to a flow prediction model to obtain first bandwidth information corresponding to the flow to be distributed in the current use period, wherein the flow prediction model is a model obtained by training historical flow data after fitting based on flow trend characteristics.
In an optional implementation manner, 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 includes:
determining the resource consumption type corresponding to the data center according to the resource consumption type information of the data center;
according to the resource consumption type, acquiring a first uplink resource consumption bandwidth and a first downlink resource consumption bandwidth from the first bandwidth information;
responding to the first uplink resource consumption bandwidth being 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 responding to the first downlink resource consumption bandwidth being larger than the first uplink resource consumption bandwidth, and taking the first downlink resource consumption bandwidth as the resource consumption bandwidth of the data center.
In an optional implementation manner, 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 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 a current use period;
Determining third bandwidth information of the data center in a current use period according to the first bandwidth information and the second bandwidth information, wherein the third bandwidth information is used for representing the bandwidth corresponding to the flow to be distributed and the current flow after being overlapped;
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 the 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 in a second uplink resource consumption bandwidth and a second downlink resource consumption bandwidth which are acquired 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 a larger value in the third uplink resource consumption bandwidth and the third downlink resource consumption bandwidth obtained from the third bandwidth information;
And obtaining a difference value between the allocated resource consumption bandwidth and the resource consumption bandwidth before 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 includes:
for any data center, acquiring the 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 alternative implementation manner, the acquiring the resource specific gravity information of the data center includes:
acquiring a first quantity which is the minimum value of the quantity of resource consumption generated by the unit bandwidth corresponding to each data center;
and determining the 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 alternative implementation, before the distributing the traffic to be distributed to the target data center, the method further includes:
determining a remaining capacity of the target data center;
In response to the residual capacity of the target data center being 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 quantity of generated resource consumption 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 embodiments of the present disclosure, there is provided an apparatus for traffic distribution, including:
the system comprises an acquisition unit, a control unit and a control unit, wherein the acquisition unit is configured to acquire at least two resource consumption bandwidths according to bandwidth information corresponding to the flow to be allocated, and the resource consumption bandwidths are used for indicating the bandwidth of resource consumption generated by the data center in the current use period after the flow to be allocated is allocated to any data center;
a determining unit configured to perform determining resource consumption information of at least two data centers, respectively, according to the at least two resource consumption bandwidths, the resource consumption information indicating the number of resource consumption generated by the data centers in the current use period;
A selection unit configured to perform selection of, as a target data center, a data center from among the at least two data centers, which has the lowest number of generated resource consumptions indicated by the resource consumption information, according to the resource consumption information of the at least two data centers;
and the distribution unit is configured to perform distribution of the flow to be distributed to the target data center.
In an optional implementation manner, the obtaining unit is further configured to obtain first bandwidth information corresponding to the traffic to be allocated in the current usage period according to bandwidth information corresponding to the traffic to be allocated, where the first bandwidth information is used to represent 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 obtain a traffic peak bandwidth corresponding to the traffic to be allocated according to bandwidth information corresponding to the traffic to be allocated; and predicting the flow peak bandwidth corresponding to the flow to be distributed according to a flow prediction model to obtain first bandwidth information corresponding to the flow to be distributed in the current use period, wherein the flow prediction model is a model obtained by training historical flow data after fitting based on flow 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; according to the resource consumption type, acquiring a first uplink resource consumption bandwidth and a first downlink resource consumption bandwidth from the first bandwidth information; responding to the first uplink resource consumption bandwidth being 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 responding to the first downlink resource consumption bandwidth being larger than the first uplink resource consumption bandwidth, and 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 obtain second bandwidth information in a current charging period according to the existing traffic of the data center, where the second bandwidth information is used to represent a bandwidth corresponding to the existing traffic in a current usage period; determining third bandwidth information of the data center in a current use period according to the first bandwidth information and the second bandwidth information, wherein the third bandwidth information is used for representing the bandwidth corresponding to the flow to be distributed and the current flow after being overlapped; 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 in a second uplink resource consumption bandwidth and a second downlink resource consumption bandwidth which are acquired 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 a larger value in the third uplink resource consumption bandwidth and the third downlink resource consumption bandwidth obtained from the third bandwidth information; and obtaining a difference value between the allocated resource consumption bandwidth and the resource consumption bandwidth before 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 obtaining, for any data center, resource specific gravity 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 number, where the first number is a minimum value of the number of resource consumptions generated by the unit bandwidths corresponding to the data centers; and determining the 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 alternative implementation, the determining unit is further configured to perform determining a remaining capacity of the target data center;
the allocation unit is further configured to perform allocation of a flow rate of a target proportion from the flow rate to be allocated to the target data center according to the remaining capacity in response to the remaining capacity of the target data center being smaller than the capacity required by the flow rate to be allocated, and take the data center of which the number of generated resource consumption indicated by the resource consumption information is second lowest as a new target data center;
the allocation unit is further configured to perform allocation of remaining traffic to be allocated to the new target data center until the traffic to be allocated is completed.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device comprising:
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, which 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 computer program comprising computer program code stored in a computer readable storage medium. The computer program code is read from a computer readable storage medium by a processor of a computer device, which executes the computer program code, causing the computer device to perform the method of flow distribution provided in the various alternative implementations of the first aspect described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
when the flow to be distributed is distributed, after the flow to be distributed is distributed to any data center according to the bandwidth information corresponding to the flow to be distributed, the data center generates the bandwidth of resource consumption in the current use period, namely the resource consumption bandwidth, and the resource consumption information used for indicating the quantity of the resource consumption generated in the current use period by each data center is respectively determined according to the resource consumption bandwidths of at least two data centers, so that the data center with the lowest quantity of the generated resource consumption is selected for flow distribution, 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 disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
Fig. 1 is a schematic diagram illustrating an implementation environment of a method of traffic distribution according to an exemplary embodiment.
Fig. 2 is a flow chart illustrating a method of traffic distribution according to an exemplary embodiment.
Fig. 3 is a flow chart illustrating another method of traffic distribution according to an exemplary embodiment.
Fig. 4 is a flow chart illustrating another method of traffic distribution according to an exemplary embodiment.
Fig. 5 is a block diagram of an apparatus for traffic distribution, according to an example embodiment.
Fig. 6 is a block diagram of a server, according to an example embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of 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 foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
The user information referred to in the present disclosure may be information authorized by the user or sufficiently authorized by each party.
The following presents some terminology that may be involved in embodiments of the present disclosure:
and averaging the bandwidths at regular intervals, acquiring one bandwidth every 95 months, performing descending order on the bandwidths acquired every day, removing the bandwidths ranked at the top 5%, taking the bandwidth with the largest median of the rest bandwidths as the bandwidth corresponding to the current day, and then obtaining the average value of the bandwidths within one month according to the bandwidths corresponding to the current day, wherein the average value is taken as the charging bandwidth, namely the resource consumption bandwidth in the embodiment of the application.
And 95, collecting a bandwidth at regular intervals, performing descending order on the bandwidths collected in one month, removing the bandwidths ranked at the top 5%, and taking the bandwidth with the largest median of the rest bandwidths as the charging bandwidth, namely the resource consumption bandwidth in the embodiment of the application.
And acquiring a bandwidth at regular intervals, arranging the bandwidths acquired in one month in a descending order, and taking the bandwidth with the largest value as a charging bandwidth, namely the resource consumption bandwidth in the embodiment of the application.
Resources, which are resources paid by bandwidth users when providing bandwidth resources for an internet service provider. Such as monetary resources, advertising resources, virtual resources, etc. Optionally, the monetary resource is physical currency or the like.
The embodiment of the disclosure provides a traffic distribution method, which can be applied to traffic distribution of services so as to save bandwidth cost. For example, a service provider providing live services, for example, may typically employ various bandwidth resources for extranet traffic access, such as those provided by internet service providers, e.g., mobile, corporate, telecommunications, and educational networks. A service provider providing live services may be provided with a plurality of data centers, and different data centers may correspond to bandwidth resources provided by different internet service providers, typically one data center corresponds to each internet service provider. When a service provider of the live broadcast service transmits live broadcast data through bandwidth resources provided by an Internet service provider, the DNS and the VIP can be adjusted to select high-quality bandwidth resources, and the live broadcast data is transmitted to a user through a data center corresponding to the high-quality bandwidth resources, so that good live broadcast watching experience is brought to the user. Because the resource consumption types of the bandwidth resources provided by different internet services and the quantity of the resource consumption generated by the unit bandwidth are different, if the quality of the bandwidth resources is only considered, the traffic distribution is carried out on the transmitted live data, namely the data traffic, among a plurality of data centers, and the influence on the bandwidth cost after the traffic distribution is ignored, so that the waste of the bandwidth cost can be caused. For example, for the same traffic, the quality difference of bandwidth resources corresponding to two data centers is not large, but the resource consumption types are different, and if the traffic is distributed to the data centers corresponding to the bandwidth resources with slightly better quality for transmission, the bandwidth cost is higher. By the flow distribution method provided by the embodiment of the disclosure, the flow to be distributed is reasonably distributed, and the resource consumption information after being distributed to different data centers is determined, so that the data center with the lowest quantity of generated resource consumption indicated by the resource consumption information is selected for flow distribution, the consumption of the resource is reduced, and the bandwidth cost is saved. The resource consumption types may include average day 95 month, month 95, month peak, etc.
Fig. 1 is a schematic diagram illustrating an implementation environment of a method of traffic distribution according to an exemplary embodiment. Taking an example in which the electronic device is 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 smart phone, a smart watch, a desktop computer, a laptop computer, an MP3 player, an MP4 player, and a laptop portable computer. The terminal 101 may be installed and run with an application program supporting live viewing, and a user may log in to 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 may further send a live acquisition request to the server 102 to obtain live data returned by the server 102.
The terminal 101 may refer broadly to one of a plurality of terminals, and the present embodiment is illustrated only with the terminal 101. Those skilled in the art will recognize that the number of terminals may be greater or lesser. For example, the number of the terminals may be only several, or the number of the terminals may be tens or hundreds, or more, and the number and the device type of the terminals are not limited in the embodiments of the present disclosure.
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 the live broadcast acquisition request sent by the terminal 101, and return, according to the live broadcast acquisition request, live broadcast data corresponding to the live broadcast acquisition request to the terminal 101 through a data center. The server 102 generates traffic when returning live data to the terminal 101, and occupies bandwidth resources. 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 one billing period is called the traffic peak bandwidth. The number of servers described above may be greater or lesser, and embodiments of the present disclosure are not limited in this regard. 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 of traffic distribution, see fig. 2, applied to an electronic device, according to an exemplary embodiment, the method specifically includes the steps of:
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 the bandwidth consumed by the resources generated by the data center in the current usage period after the traffic to be allocated is allocated to any data center.
In the embodiment of the present disclosure, the traffic to be allocated is a part of traffic or all traffic of the service. The bandwidth information comprises a flow peak bandwidth corresponding to the flow to be distributed, and the flow peak bandwidth refers to the maximum value of the instantaneous flow which can be reached by the flow to be distributed. The current usage period may be a billing period for the bandwidth, and a billing period may be one day, one month, one quarter, one year, etc. Optionally, when the resource is a monetary resource, the resource consumption bandwidth is a bandwidth used when charging in a charging period after the traffic to be allocated is allocated to any data center.
It should be noted that, when the flow to be allocated is assumed by one data center before allocation and assumed by another data center after allocation, a process of allocating the flow to be allocated can also be referred to as a flow scheduling process, that is, the flow to be allocated is scheduled by one data center to another data center, and the corresponding flow to be allocated is referred to as a flow to be scheduled.
In step S202, resource consumption information of at least two data centers is determined according to the at least two resource consumption bandwidths, the resource consumption information being used to indicate the number of resource consumption generated by the data centers in the current usage period.
In the embodiment of the 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 use period can be determined according to the resource consumption bandwidth. Alternatively, when the resource is a monetary resource, the billing bandwidth of the data center may be multiplied by the unit price of the bandwidth, the resulting product being the cost incurred by the data center, the cost incurred by the data center being proportional to the billing bandwidth.
In step S203, a data center having the lowest number of generated resource consumptions indicated by the resource consumption information is selected as a target data center from at least two data centers based on the resource consumption information of the at least two data centers.
In the embodiment of the disclosure, after the resource consumption information corresponding to each data center is determined, the data center with the lowest generated resource consumption indicated by the resource consumption information is selected as the target data center for distributing the traffic, so that the distribution requirement of the traffic to be distributed can be met, and the bandwidth cost can be saved.
In step S204, the flow to be distributed is distributed to a target data center.
According to the scheme provided by the embodiment of the disclosure, when the flow to be allocated is allocated, after the flow to be allocated is allocated to any data center according to the bandwidth information corresponding to the flow to be allocated, the data center generates the bandwidth of resource consumption in the current use period, namely the resource consumption bandwidth, and the resource consumption information used for indicating the number of resource consumption generated in the current use period by each data center is respectively determined according to the resource consumption bandwidths of at least two data centers, so that the data center with the lowest number of generated resource consumption is selected for flow allocation, resource consumption is reduced, and bandwidth cost is saved.
In an optional implementation manner, obtaining at least two resource consumption bandwidths according to bandwidth information corresponding to a flow to be allocated includes:
according to bandwidth information corresponding to the flow to be distributed, obtaining first bandwidth information corresponding to the flow to be distributed in the current use period, wherein the first bandwidth information is used for representing the bandwidth corresponding to the flow 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.
The bandwidth information is used for determining the bandwidth corresponding to the allocated data centers, so that the resource consumption bandwidth corresponding to each data center can be respectively determined from the bandwidth corresponding to the allocated data centers according to the information of different resource consumption types corresponding to different data centers, and the bandwidth cost of each data center after the flow allocation is calculated conveniently.
In an optional implementation manner, according to bandwidth information corresponding to a flow to be allocated, obtaining first bandwidth information corresponding to the flow to be allocated in the current use period includes:
acquiring a flow peak bandwidth corresponding to the flow to be allocated according to bandwidth information corresponding to the flow to be allocated;
and carrying out prediction processing on the flow peak bandwidth corresponding to the flow to be distributed according to a flow prediction model to obtain first bandwidth information corresponding to the flow to be distributed in the current use period, wherein the flow prediction model is a model obtained by training after fitting historical flow data based on flow trend characteristics.
Because the flow trend is relatively fixed, the flow prediction model obtained by fitting and training the historical flow data based on the flow trend features can predict the flow change condition in a service period, thereby reflecting the possible bandwidth value of the flow to be distributed after the distribution and ensuring more accurate subsequent calculation of the bandwidth cost.
In an alternative implementation, 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 the corresponding resource consumption type of the data center according to the resource consumption type information of the data center;
according to the resource consumption type, acquiring a first uplink resource consumption bandwidth and a first downlink resource consumption bandwidth from the first bandwidth information;
responding to the first uplink resource consumption bandwidth being 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 responding to the first downlink resource consumption bandwidth being larger than the first uplink resource consumption bandwidth, and 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 in line with the resource consumption type corresponding to the data center, and further the resource consumption information determined according to the resource consumption bandwidth can also more reflect the cost of the data center.
In an alternative implementation of the present invention,
determining a resource consumption bandwidth of the data center based on the first bandwidth information and the resource consumption type information of the data center, comprising:
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 using period;
determining third bandwidth information of the data center in a current use period according to the first bandwidth information and the second bandwidth information, wherein the third bandwidth information is used for representing the bandwidth corresponding to the flow to be distributed and the current flow after being overlapped;
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 existing flow after superposition 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 alternative 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 the corresponding resource consumption type of 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 in a second uplink resource consumption bandwidth and a second downlink resource consumption bandwidth which are acquired 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 a larger value in the third uplink resource consumption bandwidth and the third downlink resource consumption bandwidth obtained from the third bandwidth information;
and obtaining a difference value between the allocated resource consumption bandwidth and the resource consumption bandwidth before allocation, and taking the difference value as the resource consumption bandwidth of the data center.
The resource consumption bandwidth before distribution and the resource consumption bandwidth after distribution are determined through the second bandwidth information and the third bandwidth information respectively, and the difference value of the resource consumption bandwidths before distribution and after distribution is used as the corresponding resource consumption bandwidth of the data center, so that the data center with small cost change after flow distribution can be determined according to the resource consumption bandwidth.
In an alternative implementation, the determining resource consumption information of at least two data centers according to the at least two resource consumption bandwidths includes:
for any data center, acquiring the resource proportion information of the data center;
and determining the resource consumption information of the data center according to the resource specific gravity 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 influences of the resource proportion and the resource consumption type are comprehensively considered, so that the obtained resource consumption information can reflect the bandwidth cost more.
In an alternative implementation, the obtaining the resource specific gravity information of the data center includes:
acquiring a first quantity which is the minimum value of the quantity of resource consumption generated by the unit bandwidth corresponding to each data center;
and determining the 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.
The first quantity of resource consumption generated by the lowest unit bandwidth corresponding to each data center is determined through the quantity of resource consumption generated by the unit bandwidth, so that the quantity of resource consumption of each data center can be quantified based on the first quantity, and the data center with the lowest cost is convenient to determine.
In an alternative implementation, before the distributing the traffic to be distributed to the target data center, the method further includes:
determining a remaining capacity of the target data center;
responding to the residual capacity of the target data center being smaller than the capacity required by the flow to be distributed, according to the residual capacity, acquiring the flow with a target proportion from the flow to be distributed, distributing the flow to the target data center, and taking the data center with the second lowest quantity of generated resource consumption 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.
The capacity of the data centers is considered, so that the flow to be distributed is split 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 the bandwidth cost can be saved to the greatest extent.
The foregoing fig. 2 illustrates only a basic flow of the present disclosure, and the scheme provided in the present disclosure is further described below based on a specific implementation, and fig. 3 is a flowchart illustrating another method of flow allocation according to an exemplary embodiment. Taking an 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 comprises:
In step S301, the server obtains, according to bandwidth information corresponding to the 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 disclosure, the data center includes a plurality of computer devices, and due to different processing capacities of the computer devices, damage to the computer devices may occur, or a part of the computer devices are not available due to equipment upgrade, etc., at this time, traffic carried by the data center needs to be partially or completely distributed to other data centers. The server may use the traffic to be allocated as traffic to be allocated. The server can determine the bandwidth which is possibly generated by the flow to be allocated after allocation in the current use period according to the bandwidth information of the flow to be allocated. Alternatively, when the resource is a monetary resource, the current usage period may be a billing period, one billing period may be one day, one month, one quarter, etc., which is not limited by the embodiments of the present disclosure. The bandwidth included in the first bandwidth information is a bandwidth used for charging, the server may determine a 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, through a traffic prediction model, a traffic peak bandwidth corresponding to the traffic to be allocated, so as to determine the first bandwidth information. Correspondingly, the step of obtaining, 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 can obtain the flow peak bandwidth corresponding to the flow to be allocated according to the bandwidth information corresponding to the flow to be allocated. The server can input the flow peak bandwidth corresponding to the flow to be distributed into a flow prediction model, and predict the flow peak bandwidth corresponding to the flow to be distributed according to the flow prediction model to obtain the first bandwidth information of the flow to be distributed in the current use period, wherein the flow prediction model is a model obtained by training after fitting historical flow data based on user characteristics of the Internet, namely flow trend characteristics. Alternatively, the output of the flow prediction model may be in the form of a flow trend graph that includes bandwidth over a period of use. Because the behavior of the internet users has a certain rule, such as more users accessing the internet in rest time of noon, evening, holidays and the like, and fewer users in early morning, the bandwidth resources occupied by the traffic flow every day are relatively fixed, the overall appearance is that the traffic flow is high in noon and evening, the traffic flow is low in early morning, and the traffic flow of the holiday rises obviously, so that the trend of flow increase and decrease is also relatively fixed. Therefore, the server carries out fitting on historical flow data based on flow trend characteristics and then trains a flow prediction model, so that the flow trend in one charging period can be accurately predicted, a flow trend graph is formed, the prediction of bandwidth cost can be carried out based on the bandwidth in the flow trend graph, and the accuracy of prediction is improved.
In step S302, for any data center, the server determines a 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, according to the resource consumption type information of each data center, the resource consumption type of each data center can be determined, 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 bandwidths determined by different charging types are different. The server may execute the subsequent step of determining the 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 invoked is invoked. Alternatively, the charging type may be a day 95 month average, month 95, month peak, etc., which is not limited by the embodiments of the present disclosure.
For example, taking the charging mode corresponding to the data center as the month 95 as an example, one charging period is one month. Month 95 refers to billing according to 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 within one month. The 8640 effective bandwidths are arranged in descending order, and the effective bandwidths of the first 5% are removed, namely 8640×5% =432, and the effective bandwidths in the 433 th order are charging bandwidths. When determining the charging bandwidth, the server performs descending order sorting on the bandwidths included in the first bandwidth information, removes the first 5% of the bandwidths, and takes the bandwidth with the largest value in the rest bandwidths as the charging bandwidth.
In an optional implementation manner, bandwidths included in the first bandwidth information may be classified into two types, that is, an uplink bandwidth and a downlink bandwidth, when the number of resource consumption is calculated, the calculation is performed according to a high bandwidth value, and accordingly, 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 can 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 the first uplink resource consumption bandwidth and the first downlink resource consumption bandwidth from the first bandwidth information according to the resource consumption type. Responsive to the first uplink resource consumption bandwidth being greater than the first downlink resource consumption bandwidth, the server may take the first uplink resource consumption bandwidth as a 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 use the first downlink resource consumption bandwidth as a resource consumption bandwidth for the data center. The server can determine the first uplink resource consumption bandwidth according to the uplink bandwidth included in the first bandwidth information and the resource consumption type; the server may determine the first downlink resource consumption bandwidth according to the downlink bandwidth included in the first bandwidth information and the resource consumption type, which is not described herein. 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 in line with the resource consumption type corresponding to the data center, and the resource consumption information determined by the further server according to the resource consumption bandwidth can also more reflect the cost of the data center.
In step S303, the server determines, according to the at least two resource consumption bandwidths, resource consumption information corresponding to the at least two data centers, where the resource consumption information is used to indicate the number of resource consumption generated by the data centers in the current usage period.
In the embodiment of the disclosure, for any data center, the server may obtain the resource allocation 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 allocation information corresponding to the data center. Optionally, when the resource is a currency resource, the resource consumption bandwidth is a charging bandwidth, the resource specific gravity information is used for indicating a price coefficient of the data center, the 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, the server may determine the resource specific gravity information of the other data center using the amount of resource consumption generated by the unit bandwidth corresponding to one data center as a reference. Correspondingly, the step of obtaining the resource specific gravity information of the data center by the server may be: the server may obtain a first number, where the first number is a minimum value of the number of resource consumptions generated by the unit bandwidths corresponding to the data centers, and determine, according to the second number of resource consumptions generated by the unit bandwidths corresponding to the data centers and the first number, resource specific gravity information corresponding to the data centers. Alternatively, when the resource is a monetary resource, the amount of resource consumption per unit bandwidth may be expressed as a bandwidth unit price, the first amount may be expressed as a target bandwidth unit price, and the resource allocation information may be expressed as price information. The server may obtain a target bandwidth unit price, which is a minimum value of the bandwidth unit price corresponding to each data center. 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 price information of the data center. The price coefficient indicated by the price information of the data center with the smallest bandwidth unit price is 1. Since the bandwidth unit price corresponding to each data center is quantized by the resource specific gravity information, the server can quantize the cost of each data center based on the resource specific gravity information, thereby facilitating the determination of the data center with the lowest cost.
For example, if the bandwidth unit price corresponding to the data center a is 10 ten thousand yuan per Gbps (exchange bandwidth), the bandwidth unit price corresponding to the data center B is 12 ten thousand yuan per Gbps, and the bandwidth unit price corresponding to the data center C is 13 ten thousand yuan per Gbps, the server sets 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 coefficient indicated by the price information of the data center B is 1.2 and the price coefficient indicated by the price information of the data center C is 1.3.
In step S304, the server selects, as the target data center, the data center from among the at least two data centers, which has the lowest number of generated resource consumptions indicated by the resource consumption information, based on the resource consumption information of the at least two data centers.
In the embodiment of the present disclosure, the server may sort the at least two data centers in ascending order according to the number of generated resource consumptions indicated by the resource consumption information, and use the data center with the lowest number of generated resource consumptions indicated by the resource consumption information, which is the first bit, as the target data center.
In step S305, the server distributes traffic to be distributed to the target data center.
In the embodiment of the disclosure, the server may directly distribute the flow to be distributed to the target data center, or may determine a new target data center again after distributing a part of the flow to be distributed to the target 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. Accordingly, after determining the target data center, the server may further determine a remaining capacity of the target data center, and in response to the remaining capacity of the target data center being not less than a capacity required by the traffic to be allocated, the server may allocate the traffic to be allocated to the target data center. In response to the remaining capacity of the target data center being smaller than the capacity required by the traffic to be allocated, the server may acquire a traffic of a target proportion from the traffic to be allocated and allocate the traffic to the target data center, and then use the data center with the second lowest number of generated resource consumption indicated by the resource consumption information as a new target data center. The server may distribute the remaining traffic to be distributed to the new target data center until the traffic to be distributed is completed.
According to the scheme provided by the embodiment of the disclosure, when the flow to be allocated is allocated, after the flow to be allocated is allocated to any data center according to the bandwidth information corresponding to the flow to be allocated, the data center generates the bandwidth of resource consumption in the current use period, namely the resource consumption bandwidth, and the resource consumption information used for indicating the number of resource consumption generated in the current use period by each data center is respectively determined according to the resource consumption bandwidths of at least two data centers, so that the data center with the lowest number of generated resource consumption is selected for flow allocation, resource consumption is reduced, and bandwidth cost is saved.
The foregoing example shown in fig. 3 is an alternative manner of flow distribution method provided by the example of the present disclosure, and another alternative implementation is described below, and fig. 4 is a flowchart illustrating another flow distribution method according to an exemplary embodiment. The electronic device is provided as a server, the at least two data centers currently carrying traffic as an example, the method comprising:
in step S401, the server obtains, according to bandwidth information corresponding to the flow to be allocated, first bandwidth information corresponding to the flow to be allocated in a current usage period, where the first bandwidth information is used to indicate a plurality of bandwidths corresponding to the flow to be allocated after allocation.
In the embodiment of the present disclosure, this step may refer to the above step S301, which is not described herein.
In step S402, for any data center, the server obtains, according to the existing traffic of the data center, second bandwidth information in the current usage period, 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 flow trend of the existing flow based on the existing flow of the data center, so as to obtain the bandwidth generated in the current use period and the bandwidth possibly generated by the existing flow. The second bandwidth information may be in the form of a traffic profile including the bandwidth that the existing traffic has generated during the current usage period and the bandwidth predicted to be generated. The server may predict a flow trend of the existing flow by fitting the flow trend feature and the historical flow curve data, which is not limited by 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 use, where the third bandwidth information is used to represent a bandwidth corresponding to the to-be-allocated traffic and the existing traffic after being overlapped.
In this embodiment of the present application, the server may superimpose the bandwidth included in the first bandwidth information and the bandwidth included in the second bandwidth information, and when in superimposition, the server may sum the bandwidths at the same time point, and use the superimposed bandwidth obtained by summation as the bandwidth corresponding to the time point after being allocated, so as to obtain third bandwidth information.
For example, the current charging period is 1 month, corresponding to 8640 time points, and the traffic to be allocated is allocated in the 0:00 early morning of No. 21, then the first bandwidth information includes 2880 bandwidths, corresponding to 2880 time points, the second bandwidth information includes 8640 bandwidths, corresponding to 8640 time points, wherein 5760 bandwidths are actual bandwidths of the existing traffic, and 2880 bandwidths are bandwidths predicted for the existing traffic. The server correspondingly sums 2880 predicted bandwidths and 2880 bandwidths included in the first bandwidth information according to the time points to obtain 2880 overlapped bandwidths. The 5760 bandwidths and 2880 superimposed bandwidths are taken as third bandwidth information.
In step S404, the server determines a 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 the embodiment of the present disclosure, for the data center, the server may acquire the resource consumption type information of the data center, and determine the resource consumption type corresponding to the data center. And then the server can determine the pre-allocation resource consumption bandwidth corresponding to 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 in the second uplink resource consumption bandwidth and the 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, an allocated resource consumption bandwidth corresponding to the data center, where the allocated resource consumption bandwidth is a larger value of a third uplink resource consumption bandwidth and a third downlink resource consumption bandwidth obtained from the third bandwidth information. The server may obtain the 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 distribution and the resource consumption bandwidth after distribution are determined through the second bandwidth information and the third bandwidth information respectively, and the difference value of the resource consumption bandwidths before distribution and after distribution is used as the corresponding resource consumption bandwidth of the data center, so that the data center with small change of the resource consumption bandwidth after flow distribution can be determined according to the resource consumption bandwidth.
For example, taking a resource as a monetary resource as an example, the resource consumption type is a billing type, and the resource consumption bandwidth is a billing bandwidth. The data center B and the data center C both adopt charging types of month 95 for charging, the server acquires a second uplink charging bandwidth of 1000Gbps from second bandwidth information corresponding to the data center B, and the second downlink charging bandwidth of 500Gbps, and the charging bandwidth before distribution is 1000Gbps; the server acquires a third uplink charging bandwidth of 1100Gbps and a third downlink bandwidth of 1500Gbps from third bandwidth information corresponding to the data center B, and the charging bandwidth after allocation is 1500Gbps. The resource consumption bandwidth corresponding to the data center B is 500Gbps. 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 allocation is 1000Gbps; the server acquires a third uplink charging bandwidth of 600Gbps and a third downlink bandwidth of 2000Gbps from third bandwidth information corresponding to the data center C, and the charging bandwidth after allocation is 2000Gbps. The charging bandwidth corresponding to the data center C is 1000Gbps.
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 the step S302, which is not described herein again.
In step S405, the server determines resource consumption information of at least two data centers according to at least two resource consumption bandwidths, respectively, where the resource consumption information is used to indicate the number of resource consumption generated by the data centers in the current usage period.
In the embodiment of the present disclosure, this step may refer to the above step S303, which is not described herein.
In step S406, the server selects, as the target data center, the data center from among the at least two data centers, which has the lowest number of generated resource consumptions indicated by the resource consumption information, based on the resource consumption information of the at least two data centers.
In the embodiment of the present disclosure, this step may refer to the above step S304, which is not described herein.
In step S407, the server distributes the traffic to be distributed to the target data center.
In the embodiment of the present disclosure, this step may refer to the above step S305, which is not described herein.
According to the scheme provided by the embodiment of the disclosure, when the flow to be allocated is allocated, after the flow to be allocated is allocated to any data center according to the bandwidth information corresponding to the flow to be allocated, the data center generates the bandwidth of resource consumption in the current use period, namely the resource consumption bandwidth, and the resource consumption information used for indicating the number of resource consumption generated in the current use period by each data center is respectively determined according to the resource consumption bandwidths of at least two data centers, so that the data center with the lowest number of generated resource consumption is selected for flow allocation, resource consumption is reduced, and bandwidth cost is saved.
Any combination of the above-mentioned optional solutions may be adopted to form an optional embodiment of the present disclosure, which is not described herein in detail.
Fig. 5 is a block diagram of an apparatus for traffic distribution, according to an example embodiment. Referring to fig. 5, the apparatus includes: an acquisition unit 501, a determination unit 502, a selection unit 503, and an allocation unit 504.
An obtaining unit 501, configured to obtain at least two resource consumption bandwidths according to bandwidth information corresponding to the traffic to be allocated, where the resource consumption bandwidths are used to indicate the bandwidth consumed by the data center in the 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 indicating the number of resource consumption generated by the data centers in a current usage period;
a selection unit 503 configured to perform resource consumption information according to the at least two data centers, selecting, as a target data center, a data center from among the at least two data centers, which has the lowest number of generated resource consumption indicated by the resource consumption information;
An allocation unit 504 configured to perform allocation of traffic to be allocated to the target data center.
According to the device provided by the embodiment of the disclosure, when the flow to be allocated is allocated, the obtaining unit obtains the bandwidth consumed by resources, namely the bandwidth consumed by the resources, generated by the data center in the current use period after the flow to be allocated is allocated to any data center according to the bandwidth information corresponding to the flow to be allocated, and the determining unit determines the resource consumption information used by each data center for indicating the number of the resource consumption generated in the current use period according to the bandwidth consumed by the resources of at least two data centers, so that the data center with the lowest number of the resource consumption generated by the selecting unit and the allocating unit is selected to perform flow allocation, thereby reducing the consumption of the resources and saving the bandwidth cost.
In an optional implementation manner, the obtaining unit 501 is further configured to obtain, according to bandwidth information corresponding to the 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 represent 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 obtain a traffic peak bandwidth corresponding to the traffic to be allocated according to bandwidth information corresponding to the traffic to be allocated; and carrying out prediction processing on the flow peak bandwidth corresponding to the flow to be distributed according to a flow prediction model, so as to obtain first bandwidth information corresponding to the flow to be distributed in the current use period, wherein the flow prediction model is a model obtained by training after fitting historical flow data based on flow 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; according to the resource consumption type, acquiring a first uplink resource consumption bandwidth and a first downlink resource consumption bandwidth from the first bandwidth information; responding to the first uplink resource consumption bandwidth being 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 greater 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 obtain, according to the existing traffic of the data center, second bandwidth information in the current charging period, where the second bandwidth information is used to represent a bandwidth corresponding to the existing traffic in the 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 the bandwidth corresponding to the flow to be distributed and the current flow after being overlapped; 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 the 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 in the second uplink resource consumption bandwidth and the second downlink resource consumption bandwidth acquired 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 a larger value in the third uplink resource consumption bandwidth and the third downlink resource consumption bandwidth obtained from the third bandwidth information; and obtaining the difference value between the resource consumption bandwidth after the distribution and the resource consumption bandwidth before the distribution, and taking the difference value as the resource consumption bandwidth of the data center.
In an alternative implementation, the determining unit 502 is further configured to perform obtaining, for any data center, resource allocation information of the data center; and determining the resource consumption information of the data center according to the resource allocation information and the resource consumption bandwidth of the data center.
In an alternative implementation, the determining unit 502 is further configured to perform obtaining a first number, where the first number is a minimum value of the number of resource consumptions generated by the unit bandwidths corresponding to the data centers; and determining the resource proportion information corresponding to the data center according to the second quantity and the first quantity of the 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 a remaining capacity of the target data center;
the allocation unit 504 is further configured to perform allocation of the flow rate of the target proportion from the flow rate to be allocated to the target data center according to the remaining capacity in response to the remaining capacity of the target data center being smaller than the capacity required by the flow rate to be allocated, and to use the data center of which the number of generated resource consumption indicated by the resource consumption information is second lowest as a new target data center;
The allocation unit 504 is further configured to perform allocation of the remaining traffic to be allocated to the new target data center until the traffic to be allocated is completed.
It should be noted that, in the flow distribution device provided in the foregoing embodiment, only the division of the functional units is used for illustration, and in practical application, the foregoing functional distribution may be completed 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 complete all or part of the functions described above. In addition, the flow distribution device provided in the above embodiment and the flow distribution method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which is not repeated here.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
When the electronic device is provided as a server, as shown in 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 according to configuration or performance, and may include one or more processors (Central Processing Units, CPU) 601 and one or more memories 602, and storage media included in the memories 602 may be a ROM603 and a Random Access Memory (RAM) 604. Wherein the memory 602 stores at least one program code that is loaded and executed by the processor 601 to implement the method for flow distribution provided by the above-described method embodiments. Of course, the server may also have a wired or wireless network interface 605, an input/output interface 606, etc. for inputting/outputting, and the server 600 may also include other components for implementing the functions of the device, which will not be described herein.
In an exemplary embodiment, a storage medium is also provided, comprising program code, such as a memory 602 comprising program code, which is 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, a ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
In an exemplary embodiment, a computer program product or a computer program is also provided, which computer program product or computer program comprises computer program code, which computer program code is stored in a computer readable storage medium. The computer program code is read from a computer readable storage medium by a processor of a computer device or an electronic device, which executes the computer program code, causing the computer device or the electronic device to perform the method of flow distribution 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 adaptations, uses, or adaptations of the disclosure following the general 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 is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (18)

1. A method of traffic distribution, the method comprising:
according to bandwidth information corresponding to the flow to be distributed, obtaining first bandwidth information corresponding to the flow to be distributed in a current use period, wherein the first bandwidth information is used for representing the bandwidth corresponding to the flow 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, wherein the resource consumption bandwidth is used for indicating the bandwidth of resource consumption generated by the data center in the current use period after the flow to be distributed is distributed to any data center;
respectively determining resource consumption information of at least two data centers according to 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;
Selecting, from among the at least two data centers, a data center having the lowest number of generated resource consumptions indicated by the resource consumption information 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.
2. The method for traffic distribution according to claim 1, wherein the obtaining, according to the bandwidth information corresponding to the traffic to be distributed, the first bandwidth information corresponding to the traffic to be distributed 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 flow peak bandwidth corresponding to the flow to be distributed according to a flow prediction model to obtain first bandwidth information corresponding to the flow to be distributed in the current use period, wherein the flow prediction model is a model obtained by training historical flow data after fitting based on flow trend characteristics.
3. The method of traffic distribution according to claim 1, 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 includes:
Determining the resource consumption type corresponding to the data center according to the resource consumption type information of the data center;
according to the resource consumption type, acquiring a first uplink resource consumption bandwidth and a first downlink resource consumption bandwidth from the first bandwidth information;
responding to the first uplink resource consumption bandwidth being 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 responding to the first downlink resource consumption bandwidth being larger than the first uplink resource consumption bandwidth, and taking the first downlink resource consumption bandwidth as the resource consumption bandwidth of the data center.
4. The method of traffic distribution according to claim 1, 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 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 a current use period;
determining third bandwidth information of the data center in a current use period according to the first bandwidth information and the second bandwidth information, wherein the third bandwidth information is used for representing the bandwidth corresponding to the flow to be distributed and the current flow after being overlapped;
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.
5. The method according to claim 4, 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 includes:
determining the 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 in a second uplink resource consumption bandwidth and a second downlink resource consumption bandwidth which are acquired 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 a larger value in the third uplink resource consumption bandwidth and the third downlink resource consumption bandwidth obtained from the third bandwidth information;
And obtaining a difference value between the allocated resource consumption bandwidth and the resource consumption bandwidth before allocation, and taking the difference value as the resource consumption bandwidth of the data center.
6. The method for traffic distribution according to claim 1, wherein determining resource consumption information of at least two data centers according to at least two resource consumption bandwidths, respectively, comprises:
for any data center, acquiring the 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.
7. The method for traffic distribution according to claim 6, wherein the acquiring the resource specific gravity information of the data center includes:
acquiring a first quantity which is the minimum value of the quantity of resource consumption generated by the unit bandwidth corresponding to each data center;
and determining the 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.
8. The method of traffic distribution according to claim 1, wherein prior to said distributing said traffic to be distributed to said target data center, said method further comprises:
Determining a remaining capacity of the target data center;
in response to the residual capacity of the target data center being 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 quantity of generated resource consumption 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.
9. An apparatus for flow distribution, the apparatus comprising:
the device comprises an acquisition unit, a control unit and a control unit, wherein the acquisition unit is configured to acquire first bandwidth information corresponding to the flow to be distributed in a current use period according to bandwidth information corresponding to the flow to be distributed, and the first bandwidth information is used for representing the bandwidth corresponding to the flow 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, wherein the resource consumption bandwidth is used for indicating the bandwidth of resource consumption generated by the data center in the current use period after the flow to be distributed is distributed to any data center;
A determining unit configured to perform determining resource consumption information of at least two data centers, respectively, according to at least two resource consumption bandwidths, the resource consumption information indicating the number of resource consumption generated by a data center in the current use period;
a selection unit configured to perform selection of, as a target data center, a data center from among the at least two data centers, which has the lowest number of generated resource consumptions indicated by the resource consumption information, according to the resource consumption information of the at least two data centers;
and the distribution unit is configured to perform distribution of the flow to be distributed to the target data center.
10. The apparatus for traffic distribution according to claim 9, wherein the obtaining unit is further configured to perform obtaining a traffic peak bandwidth corresponding to the traffic to be distributed according to bandwidth information corresponding to the traffic to be distributed; and predicting the flow peak bandwidth corresponding to the flow to be distributed according to a flow prediction model to obtain first bandwidth information corresponding to the flow to be distributed in the current use period, wherein the flow prediction model is a model obtained by training historical flow data after fitting based on flow trend characteristics.
11. The apparatus for traffic distribution according to claim 9, wherein the obtaining unit is further configured to perform determining a resource consumption type corresponding to the data center according to the resource consumption type information of the data center; according to the resource consumption type, acquiring a first uplink resource consumption bandwidth and a first downlink resource consumption bandwidth from the first bandwidth information; responding to the first uplink resource consumption bandwidth being 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 responding to the first downlink resource consumption bandwidth being larger than the first uplink resource consumption bandwidth, and taking the first downlink resource consumption bandwidth as the resource consumption bandwidth of the data center.
12. The apparatus for traffic distribution according to claim 9, wherein the obtaining unit is further configured to perform obtaining second bandwidth information in a current charging period according to an existing traffic of the data center, the second bandwidth information being used to represent a bandwidth corresponding to the existing traffic in a current usage period; determining third bandwidth information of the data center in a current use period according to the first bandwidth information and the second bandwidth information, wherein the third bandwidth information is used for representing the bandwidth corresponding to the flow to be distributed and the current flow after being overlapped; 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.
13. The apparatus for traffic distribution according to claim 12, wherein the obtaining unit is further configured to perform 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 in a second uplink resource consumption bandwidth and a second downlink resource consumption bandwidth which are acquired 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 a larger value in the third uplink resource consumption bandwidth and the third downlink resource consumption bandwidth obtained from the third bandwidth information; and obtaining a difference value between the allocated resource consumption bandwidth and the resource consumption bandwidth before allocation, and taking the difference value as the resource consumption bandwidth of the data center.
14. The apparatus for traffic distribution according to claim 9, wherein the determining unit is further configured to perform, for any one data center, acquiring resource specific gravity 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.
15. The apparatus according to claim 14, wherein the determining unit is further configured to perform obtaining a first number, the first number being a minimum value of a number of resource consumptions generated per unit bandwidth corresponding to each data center; and determining the 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.
16. The apparatus for traffic distribution according to claim 9, wherein the determining unit is further configured to perform determining a remaining capacity of the target data center;
the allocation unit is further configured to perform allocation of a flow rate of a target proportion from the flow rate to be allocated to the target data center according to the remaining capacity in response to the remaining capacity of the target data center being smaller than the capacity required by the flow rate to be allocated, and take the data center of which the number of generated resource consumption indicated by the resource consumption information is second lowest as a new target data center;
the allocation unit is further configured to perform allocation of remaining traffic to be allocated to the new target data center until the traffic to be allocated is completed.
17. An electronic device, the electronic device comprising:
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 8.
18. 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 flow distribution according to any of claims 1 to 8.
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 CN111988388A (en) 2020-11-24
CN111988388B true 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)

Families Citing this family (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
CN115065648B (en) * 2022-08-05 2022-12-09 南京大学 Multi-outlet traffic scheduling method and system of cloud network platform

Family Cites Families (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
JP5413420B2 (en) * 2011-08-08 2014-02-12 株式会社デンソー Rotating machine control device
CN104144183B (en) * 2013-05-08 2018-11-02 株式会社日立制作所 The management method of data center systems and data center systems
CN103825838B (en) * 2014-02-24 2017-11-10 上海交通大学 A kind of data center removes bandwidth fragmentation stream scheduling method
US9923839B2 (en) * 2015-11-25 2018-03-20 International Business Machines Corporation Configuring resources to exploit elastic network capability
CN105471759B (en) * 2016-01-11 2018-06-01 北京百度网讯科技有限公司 The network traffics dispatching method and device of data center
CN106155785B (en) * 2016-06-23 2018-01-12 中国人民解放军国防科学技术大学 A kind of data migration method across data center's cloud computing system
CN107395733B (en) * 2017-07-31 2020-08-04 上海交通大学 Geographic distribution interactive service cloud resource collaborative optimization method
CN108055596B (en) * 2017-12-26 2020-06-30 北京奇艺世纪科技有限公司 Method and system for guaranteeing specific user flow
CN108712493A (en) * 2018-05-18 2018-10-26 苏州大学 Social user data distributed storage method and system between cross-region cloud data center

Also Published As

Publication number Publication date
CN111988388A (en) 2020-11-24

Similar Documents

Publication Publication Date Title
CN109547517B (en) Method and device for scheduling bandwidth resources
WO2019024445A1 (en) Collaborative optimization method for geographic distribution interactive service cloud resource
CN111988388B (en) Flow distribution method, device, electronic equipment and storage medium
CN111447577B (en) Quota management method and device
CN110138883B (en) Hybrid cloud resource allocation method and device
CN109151512A (en) The method and device of content is obtained in CDN network
CN110839069B (en) Node data deployment method, node data deployment system and medium
CN112311590B (en) Cloud service lease optimization method, device, equipment and medium
CN111078369A (en) Virtual machine distribution method and device under cloud computer and server
CN104202305B (en) A kind of trans-coding treatment method, device and server
CN110149377A (en) A kind of video service node resource allocation methods, system, device and storage medium
US20200236169A1 (en) Cloud platform or cloud provider selection
CN112395075A (en) Resource processing method and device and resource scheduling system
CN108241535B (en) Resource management method and device and server equipment
CN113079062B (en) Resource adjusting method and device, computer equipment and storage medium
CN107846614B (en) Video traffic scheduling method and device and electronic equipment
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
CN110096352A (en) Process management method, device and computer readable storage medium
JP2022521665A (en) Transportation method and equipment
CN114219468A (en) Micro-service charging method and device based on private container cloud and related components
CN112073223B (en) System and method for managing and controlling operation of cloud computing terminal and cloud server
KR101719724B1 (en) Resource management system and method, and method for deciding resource price by the same system
CN103179641A (en) Method for terminal to select networks and terminal

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