CN107155215B - Distribution method and device of application home service cluster - Google Patents

Distribution method and device of application home service cluster Download PDF

Info

Publication number
CN107155215B
CN107155215B CN201610119120.2A CN201610119120A CN107155215B CN 107155215 B CN107155215 B CN 107155215B CN 201610119120 A CN201610119120 A CN 201610119120A CN 107155215 B CN107155215 B CN 107155215B
Authority
CN
China
Prior art keywords
applications
application
distribution
service cluster
result
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
CN201610119120.2A
Other languages
Chinese (zh)
Other versions
CN107155215A (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610119120.2A priority Critical patent/CN107155215B/en
Priority to TW106104645A priority patent/TWI740895B/en
Priority to PCT/CN2017/074172 priority patent/WO2017148296A1/en
Publication of CN107155215A publication Critical patent/CN107155215A/en
Application granted granted Critical
Publication of CN107155215B publication Critical patent/CN107155215B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/04Wireless resource allocation
    • H04W72/044Wireless resource allocation based on the type of the allocated resource
    • H04W72/0453Resources in frequency domain, e.g. a carrier in FDMA
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/02Processing of mobility data, e.g. registration information at HLR [Home Location Register] or VLR [Visitor Location Register]; Transfer of mobility data, e.g. between HLR, VLR or external networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/04Wireless resource allocation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/50Allocation or scheduling criteria for wireless resources
    • H04W72/52Allocation or scheduling criteria for wireless resources based on load
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/50Allocation or scheduling criteria for wireless resources
    • H04W72/56Allocation or scheduling criteria for wireless resources based on priority criteria

Abstract

The application provides a method and a device for distributing an application home service cluster. The method comprises the following steps: distributing the plurality of applications to a plurality of service clusters to obtain an initial distribution result; replacing the service cluster to which the application belongs for multiple times to obtain a plurality of newly-added distribution results; calculating the resource consumption of the initial distribution result and the newly added distribution result to the service cluster respectively; and selecting the allocation result with the minimum resource consumption as the optimal allocation result. The method and the device improve the distribution efficiency of the application home service cluster, and simultaneously ensure that the obtained distribution scheme can effectively save the resource consumption cost of the service cluster.

Description

Distribution method and device of application home service cluster
Technical Field
The present application relates to the field of data processing technologies, and in particular, to an allocation method and an allocation apparatus for an application home service cluster.
Background
In a typical distributed system, in order to facilitate management of storage and computation, it is preferable to isolate data and tasks in the form of applications, which are distributed as a whole to a cluster of several independent computers interconnected by a network. Different applications on the same cluster have independent storage spaces, but share the computing power of the cluster.
In the distributed system with the architecture, the consumption is mainly one-time purchase cost of the clusters and cumulative bandwidth consumption cost generated by cross-cluster communication among the clusters. The cross-cluster communication is mainly caused by mutual access of data among applications in different clusters, so that the distribution optimization requirement of the application attribution service cluster is generated, and the acquisition cost and the bandwidth consumption cost of the cluster can be reduced to the maximum extent while the constraint conditions of calculation, storage and the like are met.
At present, in the distribution method of the application home service cluster, the distribution is mainly performed by depending on experience of a user, but the method needs to consume a large amount of manpower, material resources and time, and the problem of low distribution efficiency is caused. Moreover, the allocation scheme may not be the optimal scheme, resulting in a waste of cost.
In addition, new applications and applications with expired offline parts are continuously added to the distributed system, the cluster also performs processing such as capacity expansion and machine scrapping, the applications and the cluster are in a dynamic change process, the distribution scheme also needs to be checked to determine whether the distribution scheme is suitable for the current distributed system for the dynamically changed distributed system, and when the distribution scheme is not suitable for the current distributed system, the distribution scheme needs to be determined again. Therefore, the current distribution method may need to be manually re-distributed for many times, which increases the consumption of manpower, material resources and time and further reduces the distribution efficiency.
Disclosure of Invention
In view of the above problems, embodiments of the present application are proposed to provide an allocation method for an application home service cluster and an allocation apparatus for an application home service cluster, which overcome or at least partially solve the above problems.
In order to solve the above problem, the present application discloses a method for allocating an application home service cluster, including:
distributing the plurality of applications to a plurality of service clusters to obtain an initial distribution result;
replacing the service cluster to which the application belongs for multiple times to obtain a plurality of newly-added distribution results;
calculating the resource consumption of the initial distribution result and the newly added distribution result to the service cluster respectively;
and selecting the allocation result with the minimum resource consumption as the optimal allocation result.
Preferably, the allocating the plurality of applications to the plurality of service clusters is:
performing application distribution on each service cluster according to the sequence until all applications are distributed to a certain service cluster; and for the service cluster which is ranked later, performing application allocation in the remaining applications after the service cluster which is ranked earlier is allocated.
Preferably, before said allocating the plurality of applications to the plurality of service clusters, the method further comprises:
and sequencing the service clusters according to at least one load performance of the service clusters.
Preferably, before the allocating the applications for the service clusters according to the ordering, the method further includes:
calculating an association weight between any two applications;
the performing application distribution for each service cluster according to the ranking comprises:
and selecting two target applications with the largest association weight from the plurality of currently selectable applications, selecting a plurality of association applications with the top-ranked association weights of one of the target applications, and distributing the association applications to the service cluster.
Preferably, the allocating applications for each service cluster according to the ranking further includes:
if at least one application is not allocated to the service cluster, sequencing the unallocated applications according to the required resource consumption;
and randomly distributing the unallocated applications to a certain service cluster one by one according to the sequence.
Preferably, before said allocating the plurality of applications to the plurality of service clusters, the method further comprises:
and constructing a node network graph comprising a plurality of applications by taking the applications as nodes and two applications with data exchange as adjacent nodes, wherein the association weight is an edge weight of an edge connecting the two applications.
Preferably, the selecting the two target applications with the largest association weight includes:
and searching a target edge with the maximum edge weight in the node network graph.
Preferably, the selecting a plurality of associated applications with an associated weight ranking with one of the target applications comprises:
in the subgraph containing the target edge, performing breadth-first search by taking two target nodes of the target edge as starting points;
and selecting the most relevant nodes from the searched relevant nodes according to the condition that the edge weight of the relevant nodes and the target node is from large to small and the load performance of the service cluster is not exceeded.
Preferably, after the service cluster to which the application belongs is replaced for multiple times and multiple new allocation results are obtained, the method further includes:
and determining that the replaced newly-added distribution result does not exceed the load performance of each service cluster.
Preferably, the changing the service cluster to which the application belongs for multiple times, and obtaining multiple newly added allocation results includes:
and respectively randomly selecting one application from the two randomly selected service clusters for exchange until a plurality of newly added distribution results are obtained.
Preferably, the changing the service cluster to which the application belongs for multiple times and obtaining multiple new allocation results further includes:
sequentially selecting two distribution results according to the currently obtained distribution result, randomly selecting two applications from the two distribution results, and exchanging service clusters to which the selected two applications belong to obtain a plurality of newly added distribution results;
and/or randomly selecting an application and modifying the service cluster to which the selected application belongs to obtain a plurality of newly added distribution results.
Preferably, in the two randomly selected service clusters, one application is randomly selected to be exchanged respectively until a plurality of new allocation results are obtained, and the method further includes:
and screening a plurality of allocation results with resource consumption ranked from small to large.
Preferably, the calculating the resource consumption of the service cluster by each of the initial allocation result and the newly added allocation result includes:
calculating the cluster acquisition cost required by the initial distribution result and the newly added distribution result respectively;
and/or calculating the bandwidth consumption cost of each application cross cluster in the initial distribution result and the newly added distribution result; and adding the bandwidth consumption cost of each application to obtain the total bandwidth consumption cost of the initial distribution result and the newly added distribution result.
Preferably, the selecting the allocation result with the minimum resource consumption as the optimal allocation result comprises:
and aiming at the current obtained newly added distribution result, if the resource consumption of the current obtained newly added distribution result is less than the resource consumption of the initial distribution result, taking the current obtained newly added distribution result as the current optimal distribution result, and comparing the current optimal distribution result with the next newly added distribution result until the optimal distribution result is obtained.
The present application further provides an allocation apparatus for an application home service cluster, including:
the application initial distribution module is used for distributing a plurality of applications to a plurality of service clusters to obtain an initial distribution result;
the application multi-time replacement module is used for replacing the service cluster to which the application belongs for multiple times to obtain a plurality of newly-added distribution results;
a resource consumption calculating module, configured to calculate resource consumption of the service cluster by the initial allocation result and the newly added allocation result;
and the optimal distribution result selection module is used for selecting the distribution result with the minimum resource consumption as the optimal distribution result.
Preferably, the application initial allocation module is specifically configured to:
performing application distribution on each service cluster according to the sequence until all applications are distributed to a certain service cluster; and for the service cluster which is ranked later, performing application allocation in the remaining applications after the service cluster which is ranked earlier is allocated.
Preferably, the apparatus further comprises:
and the service cluster sequencing module is used for sequencing the service clusters according to at least one load performance of the service clusters.
Preferably, the apparatus further comprises:
the association weight calculation module is used for calculating the association weight between any two applications;
the application initial allocation module comprises:
and the associated application distribution submodule is used for selecting two target applications with the largest associated weight from the currently selectable multiple applications, selecting multiple associated applications with the associated weight of one of the target applications ranked in the top order, and distributing the multiple associated applications to the service cluster.
Preferably, the apparatus further comprises:
the application sequencing module is used for sequencing the unallocated applications according to the required resource consumption amount if at least one application is not allocated to the service cluster;
and the unassigned application random allocation module is used for randomly allocating the unassigned applications to a certain service cluster one by one according to the sequence.
Preferably, the apparatus further comprises:
and the node network graph constructing module is used for constructing a node network graph comprising a plurality of applications by taking the applications as nodes and two applications with data exchange as adjacent nodes, and the associated weight is an edge weight connecting edges of the two applications.
Preferably, the associated application allocation sub-module includes:
and the target edge searching subunit is used for searching the target edge with the maximum edge weight in the node network graph.
Preferably, the associated application allocation sub-module includes:
the breadth-first searching subunit is used for performing breadth-first searching by taking two target nodes of the target edge as starting points in the subgraph containing the target edge;
and the associated node selecting subunit is used for selecting the most associated nodes from the searched associated nodes according to the edge weights of the target nodes from large to small under the condition that the load performance of the service cluster is not exceeded.
Preferably, the apparatus further comprises:
and the newly-added distribution result determining module is used for determining that the replaced newly-added distribution result does not exceed the load performance of each service cluster.
Preferably, the applying a multiple replacement module comprises:
and the application switching submodule is used for randomly selecting one application from the two randomly selected service clusters respectively to carry out switching until a plurality of newly-added distribution results are obtained.
Preferably, the applying a multiple replacement module comprises:
a service cluster interaction submodule for selecting two distribution results in turn according to the currently obtained distribution result, randomly selecting two applications from the two distribution results, and exchanging the service cluster to which the selected two applications belong to obtain a plurality of new distribution results
And the service cluster modification submodule is used for randomly selecting an application and modifying the service cluster to which the selected application belongs to obtain a plurality of newly added distribution results.
Preferably, the apparatus further comprises:
and the distribution result screening module is used for screening a plurality of distribution results with resource consumption ranked from small to large.
Preferably, the resource consumption calculation module includes:
a cluster acquisition cost calculation submodule, configured to calculate a cluster acquisition cost required by each of the initial allocation result and the newly added allocation result;
a bandwidth consumption cost calculation submodule, configured to calculate bandwidth consumption costs of each application cross-cluster in the initial allocation result and the newly added allocation result; and adding the bandwidth consumption cost of each application to obtain the total bandwidth consumption cost of the initial distribution result and the newly added distribution result.
Preferably, the optimal distribution result selecting module includes:
and the distribution result comparison submodule is used for taking the currently obtained newly-increased distribution result as the current optimal distribution result and comparing the currently obtained newly-increased distribution result with the next newly-increased distribution result until the optimal distribution result is obtained if the resource consumption of the currently obtained newly-increased distribution result is less than the resource consumption of the initial distribution result aiming at the currently obtained newly-increased distribution result.
The embodiment of the application has the following advantages:
according to the embodiment of the application, the service cluster to which the application belongs is replaced for multiple times based on the initial allocation result so as to obtain multiple newly-added allocation results, and the optimal allocation result is determined by calculating and comparing the resource consumption of the service cluster by the multiple newly-added allocation results, so that the allocation efficiency of the service cluster to which the application belongs is improved, and the resource consumption cost of the service cluster can be effectively saved by the obtained allocation scheme.
Moreover, the embodiment of the application can automatically determine the optimal distribution result aiming at the dynamically changing distributed system, does not need to manually distribute for multiple times, and further improves the distribution efficiency of the application attribution service cluster.
Drawings
Fig. 1 is a flowchart illustrating a first step of an application home service cluster allocation method according to a first embodiment of the present application;
fig. 2 is a flowchart illustrating steps of a second embodiment of an application home service cluster allocation method according to the present application;
fig. 3 is a block diagram illustrating a first embodiment of an allocation apparatus for applying a home service cluster according to the present application;
fig. 4 is a block diagram illustrating a second embodiment of an allocation apparatus for applying a home service cluster according to the present application;
FIG. 5 is a schematic diagram of a node-based network graph according to the present application;
fig. 6 is a schematic diagram of an allocation result of an application home service cluster according to the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description.
Referring to fig. 1, a flowchart illustrating a first step of an application home service cluster allocation method according to an embodiment of the present application is shown, which may specifically include the following steps:
step 101, allocating a plurality of applications to a plurality of service clusters to obtain an initial allocation result.
The above-mentioned application may be a set of data and programs for logically separating data and calculations of different attributes into units isolated from each other. An application may also be understood as the concept of a data instance in a relational database. A distributed system may have multiple service clusters. The service cluster is a computer group or a server group consisting of a plurality of mutually independent computers which are interconnected through a network. A service cluster provides storage and computing capabilities in an integrated manner. Different service clusters can carry out communication tasks such as data interaction and the like in a network transmission mode.
In a specific implementation of the embodiment of the present application, a plurality of applications may be first allocated to a plurality of service clusters, so as to obtain an initial allocation result. The initial allocation manner may be various, for example, random allocation may be performed, or the plurality of service clusters may be sorted according to the load performance of the service clusters, and the applications may be allocated according to the sorting.
And 102, replacing the service cluster to which the application belongs for multiple times to obtain multiple newly-added distribution results.
For the initial allocation result, the service cluster to which the application belongs may be changed multiple times. Each replacement will produce a new dispensing result, and multiple new dispensing results can be obtained after multiple replacements. The replacement can be carried out randomly or according to a certain rule. For example, for the service cluster numbers, the numbers are replaced according to the order of the numbers, and the embodiment of the present application does not limit the replacement manner.
The service cluster to which the application belongs may be replaced randomly in various manners, for example, two service clusters may be randomly selected from the service clusters, one application may be randomly selected, and the service clusters may be exchanged and allocated to the other selected service cluster; alternatively, two applications may be randomly selected from any two service clusters, and the service clusters to which the two applications belong may be exchanged. Those skilled in the art can change the service cluster to which the application belongs in various ways according to actual needs to obtain multiple allocation results.
As a preferred example of the embodiment of the present application, after the step 102, the method may further include:
and determining that the replaced newly-added distribution result does not exceed the load performance of each service cluster.
The candidate allocation result as the optimal allocation result needs to meet the load performance of the service cluster to ensure that the allocation result can be implemented. Therefore, after the service cluster to which the application belongs is replaced, it is necessary to determine that the load performance of each service cluster still satisfies the allocation result in the replaced allocation result.
Step 103, calculating the resource consumption of the initial allocation result and the newly added allocation result to the service cluster respectively.
It should be noted that the service clusters have different purchase costs, maximum storage amounts and total core numbers of the CPU according to the number of computers included in the service clusters, and each service cluster also has a certain exit bandwidth; each application allocated in the service cluster needs a certain storage space, and data interaction may also need to be performed between the applications, that is, a certain data exchange amount exists. Data interaction across clusters needs to consume a certain egress bandwidth of the cluster, resulting in egress bandwidth cost. Thus, different application allocation schemes may result in different cluster acquisition costs and bandwidth consumption costs. Furthermore, according to the maximum storage capacity of the cluster and the total number of cores of the CPU, the applications that can be stored and run by each cluster are also subject to distribution limitation by certain constraint conditions. Assuming that there are N service clusters and M applications in the system, the M applications need to be allocated to N ' (N ' ≦ N) service clusters, and the optimal allocation result may be the total purchase cost of the N ' clusters + the bandwidth consumption cost across the clusters. In practical applications, the optimal allocation result may be defined by those skilled in the art according to practical situations, for example, only the minimum total purchase cost of the cluster is used as the optimal allocation result, or the minimum total purchase cost + the minimum maintenance cost of the cluster is used as the optimal allocation result.
The resource consumption of a service cluster may include the cluster acquisition cost and/or bandwidth consumption cost, as well as the cost of other configuration clusters and operation clusters.
The resource consumption of the service cluster by each of the initial allocation result and the plurality of newly added allocation results may be calculated to further compare the resource consumption of each allocation result.
And 104, selecting the distribution result with the minimum resource consumption as the optimal distribution result.
After obtaining a plurality of candidate allocation results and calculating the respective resource consumption amounts, the allocation result with the minimum resource consumption amount can be selected as the optimal allocation result. In practical application, after a new allocation result is obtained, the new allocation result may be compared with the initial allocation result, and if the resource consumption of the new allocation result is less than the resource consumption of the initial allocation result, the new allocation result is used as the optimal allocation result. Or further acquiring the next newly added distribution result, comparing the next newly added distribution result with the previous newly added distribution result, and repeating the acquisition and comparison of the newly added distribution results for multiple times until the optimal distribution result is obtained. After a certain number of times of comparison with the newly added distribution result, the distribution result with the minimum resource consumption can be used as the optimal distribution result.
According to the embodiment of the application, the service cluster to which the application belongs is replaced for multiple times based on the initial allocation result so as to obtain multiple newly-added allocation results, and the optimal allocation result is determined by calculating and comparing the resource consumption of the service cluster by the multiple newly-added allocation results, so that the allocation efficiency of the service cluster to which the application belongs is improved, and the resource consumption cost of the service cluster can be effectively saved by the obtained allocation scheme.
Moreover, the embodiment of the application can automatically determine the optimal distribution result aiming at the dynamically changing distributed system, does not need to manually distribute for multiple times, and further improves the distribution efficiency of the application attribution service cluster.
Referring to fig. 2, a flowchart illustrating steps of a second embodiment of an application home service cluster allocation method according to the present application is shown, which may specifically include the following steps:
step 201, according to at least one load performance of the service cluster, ordering the plurality of service clusters.
The load performance may include at least one of a maximum storage capacity of each service cluster, a total core number of CPUs, and an exit average bandwidth cost among the service clusters. Load performance may also include a processing capability indicator for other service clusters. The plurality of service clusters may be ordered according to load performance of the service clusters. The specific sorting manner may be various, for example, sorting according to different load performances, or setting a weight for a load performance, and sorting according to a comprehensive weight of a plurality of load performances of the service cluster. The sorting may be in ascending order or in descending order. One skilled in the art can sort the load performance according to the actual situation, and the embodiment of the present application does not limit this.
Step 202, performing application distribution on each service cluster according to the sequence until all applications are distributed to a certain service cluster; and for the service clusters which are ranked later, performing application allocation in the remaining applications which are ranked before the service clusters are allocated, and obtaining an initial allocation result.
After determining the ranking of the service clusters, application allocation may be performed according to the ranking. During allocation, the applications can be preferentially allocated to the service clusters ranked at the top, and the rest of the applications are allocated to the service clusters ranked at the back after the service clusters ranked at the top are allocated.
In practical applications, the allocation may have a certain constraint condition, for example, the total data amount of the applications that can be allocated by the service cluster does not exceed 90% of the maximum storage amount of the service cluster; or, the memory and CPU consumption of the application in the service cluster at any point in time does not exceed 80% of its maximum processing capacity; or, a single application is not respectively assigned to different service clusters, but must be completely assigned to the same service cluster; combinations of the above constraints may also be employed. Of course, those skilled in the art can set various constraints or combinations of constraints according to actual situations, and the embodiments of the present application do not limit the specific contents of the constraints and the combination manner of the constraints.
The application distribution processing is performed on each service cluster, and the application distribution processing can be performed in a circulating mode until all the applications are distributed to a certain application, and an initial distribution result is finally obtained. Or until the constraint cannot be satisfied any more.
As a preferred example of the embodiment of the present application, before the performing application allocation for each service cluster according to the ranking, the method may further include:
an association weight between any two applications is calculated.
The allocating the applications for the service clusters according to the ordering may include:
and selecting two target applications with the largest association weight from the plurality of currently selectable applications, selecting a plurality of association applications with the top-ranked association weights of one of the target applications, and distributing the association applications to the service cluster.
The amount of data exchange between any two applications can be calculated as an association weight between the applications. After the association weights among all the applications are calculated, two applications with the largest association weights can be selected as target applications. Based on the two selected target applications, other associated applications with higher associated weights with any one target application can be continuously selected and distributed to the service cluster to which the target application belongs.
Because the egress bandwidth of the service cluster may not be occupied when data is exchanged between applications in the same service cluster, applications with a large data exchange amount therebetween may be allocated to the same service cluster as much as possible, so as to reduce the data exchange amount between the service clusters and reduce the bandwidth occupation of the service clusters.
As a preferred example of the embodiment of the present application, the performing application allocation for each service cluster according to the ranking further includes:
if at least one application is not allocated to the service cluster, sequencing the unallocated applications according to the required resource consumption; and randomly distributing the unallocated applications to a certain service cluster one by one according to the sequence.
For the remaining unallocated applications, the unallocated applications may be sorted in a descending order according to the resource consumption amount required by the unallocated applications, and the unallocated applications may be randomly allocated to one service cluster which can accommodate the application one by one according to the sorting. Wherein the random assignment may be repeated several times until the application is assigned to a service cluster that can accommodate the application. The required resource consumption may be at least one or a combination of multiple resource consumption, such as acquisition cost, bandwidth occupation, storage space required by the application, and memory required to be occupied by the application during operation.
As a preferred example of the embodiment of the present application, before the step 202, the method may further include:
and constructing a node network graph comprising a plurality of applications by taking the applications as nodes and two applications with data exchange as adjacent nodes, wherein the association weight is an edge weight of an edge connecting the two applications.
From the perspective of the graph, the initial assignment result can be obtained by means of a graph algorithm based on the application of the composition graph model. Specifically, the node network graph including a plurality of applications may be constructed by using an application as a node of the graph, using any two applications having data exchange as adjacent nodes, and using an associated weight representing an amount of data exchange between the applications as an edge weight of an edge of the two application nodes.
As a preferred example of the embodiment of the present application, the selecting two target applications with the largest association weights includes:
and searching a target edge with the maximum edge weight in the node network graph.
The edge weights of two nodes in the node network graph represent the association weight between two applications, and the selection of two target applications with the maximum association weight can be realized by searching the target edge with the maximum edge weight in the node network graph, wherein the two nodes connected with the searched target edge are the two target applications with the maximum association weight.
As a preferred example of the embodiment of the present application, the selecting a plurality of associated applications with the top-ranked associated weights of one of the target applications may include:
and a substep S11 of performing breadth-first search in the subgraph including the target edge, with two target nodes of the target edge as starting points.
And a substep S12, selecting the most relevant nodes from the searched relevant nodes according to the edge weight of the target node from large to small, under the condition that the load performance of the service cluster is not exceeded.
Nodes including the target edge may form a sub-graph, and a Breadth First Search (BFS) may be performed with the target node as a starting point. Breadth-first search is a graph search algorithm, which is distinguished from depth-first search in that, starting with a node, nodes are traversed along the width of the graph, and search computation is not terminated until all nodes in the graph have been visited.
From the plurality of relevant nodes obtained by searching, the relevant nodes with the largest number can be selected according to the order of the edge weights of the relevant nodes and the target nodes from large to small under the condition of meeting the load performance of the service cluster, namely, a plurality of relevant applications with the highest relevant weight ranking to any one target application are selected.
In order to facilitate those skilled in the art to understand the embodiment of the present application, fig. 5 shows a schematic diagram of constructing a node-based network graph according to the present application. As can be seen from the figure, the applications are taken as nodes, and the association weight between the applications is taken as the edge weight of the nodes. Firstly, an unallocated target edge with the maximum edge weight is found, and simultaneously, target applications corresponding to two nodes connected by the target edge need to meet certain constraint conditions. In a subgraph containing a target edge, breadth-first search is carried out by taking a target node as a starting point, other nodes adjacent to the target node are continuously expanded according to the order of edge weights from large to small, and the other nodes in the subgraph are added into a graph block formed by the target node and a plurality of associated nodes until all the nodes in the subgraph are associated or a constraint condition cannot be met. Nodes 1, 2, 3 and 4 in fig. 5 form one graph, and nodes 5, 6 and 9 and nodes 7 and 8, respectively, form additional graphs. That is, application 1, application 2, application 3, and application 4 are assigned to one service cluster, and application 5, application 6, and application 9, and application 7 and application 8 are assigned to the other two service clusters, respectively. Correspondingly, fig. 6 is a schematic diagram illustrating an allocation result of an application home service cluster according to the present application. As shown in fig. 6, the above 9 applications are respectively assigned to the service cluster a, the service cluster B, and the service cluster C.
The method has the advantages that the node network graph based on the edge weight association of each node is constructed by using the association weights between the applications, so that the problems that the data exchange quantity between the applications distributed to the same service cluster is large as much as possible and the data exchange quantity between the service clusters is small as much as possible can be converted into the problems that the edge weights between a plurality of applications in a graph block are large as much as possible and the edge weights between the graph blocks are small as much as possible. By using the target node to expand breadth-first search and performing expansion association according to the edge weight sequence of other nodes, the sum of the edge weights among a plurality of nodes in the graph block is enabled to be as large as possible, and the sum of the edge weights among the graph blocks is enabled to be as small as possible. That is, the amount of data exchange between applications of the same service cluster is as large as possible, and the amount of data exchange between service clusters is as small as possible.
And 203, replacing the service cluster to which the application belongs for multiple times to obtain multiple newly-added distribution results.
As a first preferred example of the embodiment of the present application, the step 203 may include:
and a substep S21, in the two service clusters selected randomly, respectively selecting one application at random for switching until a plurality of new distribution results are obtained.
For a plurality of service clusters in the initial allocation result, two service clusters can be randomly selected from the service clusters, one application is randomly selected respectively, and the application is exchanged and allocated to the other selected service cluster, so that a new allocation result can be obtained. The exchange may be repeated multiple times to obtain multiple new assignments. The specific number of newly added allocation results can be set by those skilled in the art according to practical situations. As a preferred example of the embodiment of the present application, after the sub-step S21, the method may further include: and screening a plurality of allocation results with resource consumption ranked from small to large.
Specifically, for a plurality of newly added allocation results obtained currently, the allocation results may be sorted from small to large according to the resource consumption amount thereof, and a plurality of allocation results with the top sorting may be screened out.
As a second preferred example of the embodiment of the present application, the step 203 may include: and a substep S22, sequentially selecting two distribution results according to the currently obtained distribution result, randomly selecting two applications from the two distribution results, and exchanging the service clusters to which the two selected applications belong to obtain a plurality of new distribution results.
For a plurality of currently obtained allocation results, two allocation results can be sequentially selected from the currently obtained allocation results, two applications are respectively selected from the selected allocation results, and the service clusters to which the two selected applications belong are exchanged, so that a new allocation result is generated. The exchange may be repeated multiple times to obtain multiple new assignments.
As a third preferred example of the embodiment of the present application, the step 203 may include:
and a substep S23, randomly selecting an application and modifying the service cluster to which the selected application belongs to obtain a plurality of new distribution results.
In any service cluster, one application can be randomly selected, and the selected application is distributed to other service clusters to obtain a newly-added distribution result. Similarly, the random selection and redistribution of the application to other service clusters may be repeated multiple times to obtain multiple newly added distribution results.
And 204, calculating the resource consumption of the initial allocation result and the newly added allocation result to the service cluster respectively.
As a preferred example of the embodiment of the present application, the step 204 may include:
and a substep S31, calculating respective cluster acquisition costs required by the initial allocation result and the newly added allocation result.
The cluster acquisition cost required by each allocation result can be calculated according to the initial allocation result and the newly added allocation result.
And/or, the substep S32, calculating the bandwidth consumption cost of each application across the clusters in the initial allocation result and the newly added allocation result; and adding the bandwidth consumption cost of each application to obtain the total bandwidth consumption cost of the initial distribution result and the newly added distribution result.
The bandwidth consumption cost of the service cluster for the data interaction between the applications in each distribution result when the data is crossed with the cluster can be calculated according to the initial distribution result and a plurality of newly added distribution results. And summing the bandwidth consumption cost of each application to respectively obtain the total bandwidth consumption cost of each distribution result.
In practical applications, the sub-step S21 and the step S204 may use a simulated annealing algorithm (SA) to obtain new allocation results, and calculate resource consumption of each new allocation result for the service cluster, so as to finally obtain an optimal allocation result. The simulated annealing algorithm is a general probabilistic algorithm, and is generally used for calculating the optimal result in a larger search space.
Specifically, the concept of the initial solution state S in the simulated annealing algorithm can be used to represent the initial assignment result, i.e., the starting point of the iterative computation; s' may represent a newly added allocation result. And randomly replacing the service cluster to which the application belongs to each time to obtain a new distribution result, namely generating a new solution S', and accumulating the iteration times once. Calculating an increment of the resource consumption amount by a calculation formula Δ t ═ C (S') -C (S); wherein, c(s) is an evaluation function of the resource consumption representing the allocation result, and Δ t' is the resource consumption increment obtained by the iterative computation.
When Δ t 'is less than 0, i.e. the resource consumption of the newly added allocation result is less than the previous allocation result, S' may be accepted as the new current solution. And repeating the step of randomly replacing the service cluster to which the application belongs to obtain a new allocation result so as to perform iterative calculation on the resource consumption increment of the new allocation result, and if a termination condition is met, terminating the iterative calculation and taking the current solution as an optimal solution, namely an optimal allocation result. The termination condition may be that none of the N successive new solutions is accepted, that the newly added result cannot satisfy the constraint condition, or that enough accepted current solutions are obtained, and that the number of the current solutions should be as large as possible to ensure that the optimal solution can be obtained subsequently. Of course, the number of the current solutions can be set by those skilled in the art according to actual situations.
In practical applications, the sub-steps S22, S23 and step 204 may use a Genetic Algorithm (GA) to achieve a process of obtaining new allocation results and calculating resource consumption of each new allocation result for the service cluster, so as to finally obtain an optimal allocation result. The genetic algorithm is a random search method which is evolved by the evolution law of the biological world for reference.
Specifically, each application may be used as a chromosome to be encoded, where M applications are numbered from 0 to M, and N service clusters are numbered from 0 to N, to obtain an M-dimensional chromosome vector, where each dimension represents an application, and a corresponding value is [0, N ], which indicates a cluster index currently allocated by the application, that is, a service cluster number to which the application belongs.
The evolution algebra T may be set to 0, the maximum evolution algebra T may be set, and a set of M individuals may be randomly generated as the initial population P (0), i.e., the initial assignment result. And calculating the fitness in the initial population P (0), wherein the fitness can be obtained by calculating the reciprocal of the resource consumption required by the distribution result. The greater the resource consumption required for the allocation result, the lower the fitness, and vice versa.
In practical application, the evaluation function and the fitness are both representing modes of resource consumption needed by the allocation result, and a person skilled in the art can optionally select the evaluation function according to actual conditions, for example, when a new allocation result is obtained by using a genetic algorithm, the resource consumption needed by the allocation result can be represented by the evaluation function; when the simulated annealing algorithm is used for obtaining a new allocation result, the resource consumption amount required by the allocation result can also be represented by fitness.
In the substep S22, in the specific process of obtaining the new distribution result by using the genetic algorithm framework, the crossover operation may be performed on the chromosomes, and the crossover operator is applied to the population. Specifically, two chromosomes can be randomly selected from the chromosomes of the initial population P (0), and values are mutually exchanged on the premise that the constraint condition is satisfied, that is, the service clusters to which the two applications belong are exchanged to obtain a newly added distribution result.
Alternatively, in the specific process of obtaining the new assignment by using the genetic algorithm framework in the substep S23, mutation operation may be performed on the chromosome, and the mutation operator may be applied to the population, that is, the gene values at some loci of the individual strings in the population are changed. Specifically, a chromosome may be randomly selected from the chromosomes of the initial population P (0), and the index value may be modified on the premise that the constraint condition is satisfied, that is, an application may be randomly selected and the service cluster to which the selected application belongs may be modified, so as to obtain a new allocation result.
In the specific process of calculating the resource consumption by using the genetic algorithm framework, the fitness of the population P (t +1) can be calculated in the step 204, i.e., the evolution from the population P (t) to the next generation population P (t +1) after the crossover operation and/or the mutation operation. And when the evolution algebra T is accumulated to the maximum evolution algebra T, terminating the iterative computation, and taking the population with the maximum fitness in the evolution process as an optimal solution, namely an optimal distribution result.
Because each step of cross operation and mutation operation can check whether the evolution meets the constraint condition, the whole evolution process can obtain effective distribution results, and the rationality of the evolution is ensured.
It should be noted that the execution sequence of the sub-steps S21-S23 is only an example, and in practical applications, the new allocation results can be obtained by combining the above-mentioned one or more manners in different orders. For example, the sub-step S21 is performed first, the sub-step S23 is performed, and the sub-step S22 is performed last.
It should be noted that, in practical application, the optimal allocation result can be obtained by combining the simulated annealing algorithm and the genetic algorithm. For example, a large number of allocation results can be obtained by using a simulated annealing algorithm, and then the optimization direction of the allocation results is controlled by using a genetic algorithm so as to approach the optimal allocation results; or the variant operation in the genetic algorithm can be used to obtain a plurality of newly-added distribution results, then the simulated annealing algorithm is used to obtain a large number of distribution results based on the obtained distribution results, and finally the cross operation in the genetic algorithm is used to obtain the optimal distribution result.
When the optimal allocation result is obtained by combining the simulated annealing algorithm and the genetic algorithm, the resource consumption amount correspondingly calculated by the two algorithms can be the consumption of the same kind of resources or can be different. For example, the simulated annealing algorithm calculates the amount of resource consumption for the consumption of the cluster acquisition cost, while the genetic algorithm calculates the consumption of the bandwidth cost.
In addition, in addition to using genetic algorithm to obtain the optimal distribution result, other algorithms, such as ant colony algorithm, particle swarm algorithm, etc., may be adopted by those skilled in the art to obtain the optimal distribution result.
Step 205, regarding the newly added allocation result obtained currently, if the resource consumption of the newly added allocation result obtained currently is less than the resource consumption of the initial allocation result, taking the newly added allocation result obtained currently as the current optimal allocation result, and comparing the current optimal allocation result with the next newly added allocation result until the optimal allocation result is obtained.
For a plurality of newly added allocation results obtained currently, the resource consumption of the newly added allocation result obtained currently may be compared with the resource consumption of the initial allocation result. And if the resource consumption of the currently obtained newly-added distribution result is less than that of the initial distribution result, taking the currently obtained newly-added distribution result as the current optimal distribution result, and otherwise, continuously comparing the resource consumption of the next newly-added distribution result with that of the initial distribution result. And aiming at the current optimal distribution result, comparing the current optimal distribution result with the next newly-added distribution result, repeatedly comparing and determining the current optimal distribution result until the distribution result with the minimum resource consumption is obtained and the distribution result is used as the optimal distribution result. Or counting the occurrence times of the comparison result of the cluster acquisition cost of the newly added distribution result greater than the resource consumption of the initial distribution result, and taking the distribution result with the minimum resource consumption in the candidate distribution result as the optimal distribution result when the occurrence times exceed the preset times.
According to the embodiment of the application, the initial distribution result is obtained through the node network diagram, and the optimal distribution result is further obtained through a simulated annealing algorithm and/or a genetic algorithm, so that the distribution efficiency of the application home service cluster is improved. Moreover, the obtained distribution scheme is closer to the optimal scheme, and the cost of deployment and operation of the distributed system is saved.
Moreover, the embodiment of the application can automatically determine the optimal distribution result aiming at the dynamically changing distributed system, does not need to manually distribute for multiple times, and further improves the distribution efficiency of the application attribution service cluster.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the embodiments. Further, those skilled in the art will also appreciate that the embodiments described in the specification are presently preferred and that no particular act is required of the embodiments of the application.
Referring to fig. 3, a block diagram of a first embodiment of an allocation apparatus for applying a home service cluster according to the present application is shown, which may specifically include the following modules:
an application initial allocation module 301, configured to allocate multiple applications to multiple service clusters, and obtain an initial allocation result.
And an application multi-time replacement module 302, configured to replace the service cluster to which the application belongs for multiple times, so as to obtain multiple newly added allocation results.
A resource consumption calculating module 303, configured to calculate resource consumption of the service cluster by the initial allocation result and the newly added allocation result.
And an optimal allocation result selecting module 304, configured to select an allocation result with the smallest resource consumption as an optimal allocation result.
According to the embodiment of the application, the service cluster to which the application belongs is replaced for multiple times based on the initial allocation result so as to obtain multiple newly-added allocation results, and the optimal allocation result is determined by calculating and comparing the resource consumption of the service cluster by the multiple newly-added allocation results, so that the allocation efficiency of the service cluster to which the application belongs is improved, and the resource consumption cost of the service cluster can be effectively saved by the obtained allocation scheme.
Moreover, the embodiment of the application can automatically determine the optimal distribution result aiming at the dynamically changing distributed system, does not need to manually distribute for multiple times, and further improves the distribution efficiency of the application attribution service cluster.
Referring to fig. 4, a block diagram of a second embodiment of an allocation apparatus for applying a home service cluster according to the present application is shown, and the second embodiment of the present application may specifically include the following modules:
a service cluster sorting module 401, configured to sort, according to at least one load performance of the service cluster, the plurality of service clusters.
A node network graph constructing module 402, configured to construct a node network graph including multiple applications, with the application as a node and two applications with data exchange as neighboring nodes, where the association weight is an edge weight connecting edges of the two applications.
An application initial allocation module 403, configured to allocate multiple applications to multiple service clusters, and obtain an initial allocation result.
And an application multi-replacement module 404, configured to replace the service cluster to which the application belongs for multiple times, so as to obtain multiple newly added allocation results.
A resource consumption calculating module 405, configured to calculate resource consumption of the service cluster by the initial allocation result and the newly added allocation result.
And an optimal allocation result selecting module 406, configured to select an allocation result with the smallest resource consumption as an optimal allocation result.
As a preferred example of the embodiment of the present application, the application initial allocation module 403 may specifically be configured to:
performing application distribution on each service cluster according to the sequence until all applications are distributed to a certain service cluster; and for the service cluster which is ranked later, performing application allocation in the remaining applications after the service cluster which is ranked earlier is allocated.
As a preferred example of the embodiment of the present application, the apparatus may further include:
and the association weight calculation module is used for calculating the association weight between any two applications.
The application initial allocation module 403 may include:
and the associated application distribution submodule is used for selecting two target applications with the largest associated weight from the currently selectable multiple applications, selecting multiple associated applications with the associated weight of one of the target applications ranked in the top order, and distributing the multiple associated applications to the service cluster.
As a preferred example of the embodiment of the present application, the apparatus may further include:
and the application sequencing module is used for sequencing the unallocated applications according to the required resource consumption amount if at least one application is not allocated to the service cluster.
And the unassigned application random allocation module is used for randomly allocating the unassigned applications to a certain service cluster one by one according to the sequence.
As a first preferred example of the embodiment of the present application, the associated application allocation sub-module may include:
and the target edge searching subunit is used for searching the target edge with the maximum edge weight in the node network graph.
As a second preferred example of the embodiment of the present application, the associated application allocation sub-module may include:
and the breadth-first searching subunit is used for performing breadth-first searching by taking two target nodes of the target edge as starting points in the subgraph containing the target edge.
And the associated node selecting subunit is used for selecting the most associated nodes from the searched associated nodes according to the edge weights of the target nodes from large to small under the condition that the load performance of the service cluster is not exceeded.
As a preferred example of the embodiment of the present application, the apparatus may further include:
and the newly-added distribution result determining module is used for determining that the replaced newly-added distribution result does not exceed the load performance of each service cluster.
As a preferred example of the embodiment of the present application, the module 404 for applying multiple replacement may include:
and the application switching submodule is used for randomly selecting one application from the two randomly selected service clusters respectively to carry out switching until a plurality of newly-added distribution results are obtained.
As a preferred example of the embodiment of the present application, the module 404 for applying multiple replacement may include:
and the service cluster interaction submodule is used for sequentially selecting two distribution results according to the currently obtained distribution result, randomly selecting two applications from the two distribution results, and exchanging the service cluster to which the selected two applications belong to obtain a plurality of newly added distribution results.
And the service cluster modification submodule is used for randomly selecting an application and modifying the service cluster to which the selected application belongs to obtain a plurality of newly added distribution results.
As a preferred example of the embodiment of the present application, the apparatus may further include:
and the distribution result screening module is used for screening a plurality of distribution results with resource consumption ranked from small to large.
As a preferred example of the embodiment of the present application, the resource consumption calculating module 405 may include:
and the cluster acquisition cost calculation submodule is used for calculating the cluster acquisition cost required by the initial distribution result and the newly added distribution result.
A bandwidth consumption cost calculation submodule, configured to calculate bandwidth consumption costs of each application cross-cluster in the initial allocation result and the newly added allocation result; and adding the bandwidth consumption cost of each application to obtain the total bandwidth consumption cost of the initial distribution result and the newly added distribution result.
As a preferred example of the embodiment of the present application, the optimal allocation result selecting module 406 may include:
and the distribution result comparison submodule is used for taking the currently obtained newly-increased distribution result as the current optimal distribution result and comparing the currently obtained newly-increased distribution result with the next newly-increased distribution result until the optimal distribution result is obtained if the resource consumption of the currently obtained newly-increased distribution result is less than the resource consumption of the initial distribution result aiming at the currently obtained newly-increased distribution result.
According to the embodiment of the application, the initial distribution result is obtained through the node network diagram, and the optimal distribution result is further obtained through a simulated annealing algorithm and/or a genetic algorithm, so that the distribution efficiency of the application home service cluster is improved. Moreover, the obtained distribution scheme is closer to the optimal scheme, and the cost of deployment and operation of the distributed system is saved.
Moreover, the embodiment of the application can automatically determine the optimal distribution result aiming at the dynamically changing distributed system, does not need to manually distribute for multiple times, and further improves the distribution efficiency of the application attribution service cluster.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one of skill in the art, embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
In a typical configuration, the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory. The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium. Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (fransitory media), such as modulated data signals and carrier waves.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the true scope of the embodiments of the application.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The foregoing describes in detail an application home service cluster allocation method and an application home service cluster allocation apparatus provided by the present application, and a specific example is applied in the present application to explain the principle and implementation manner of the present application, and the description of the foregoing embodiments is only used to help understand the method and core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (24)

1. A method for distributing application home service cluster is characterized by comprising the following steps:
distributing the plurality of applications to a plurality of service clusters to obtain an initial distribution result;
replacing the service cluster to which the application belongs for multiple times to obtain a plurality of newly-added distribution results;
calculating the resource consumption of the initial distribution result and the newly added distribution result to the service cluster respectively;
selecting the distribution result with the minimum resource consumption as the optimal distribution result;
wherein the allocating the plurality of applications to the plurality of service clusters is:
performing application distribution on each service cluster according to the sequence until all applications are distributed to a certain service cluster; the method comprises the steps that for a service cluster which is ranked later, application distribution is carried out in the remaining applications which are ranked earlier and distributed;
before the allocating the applications for the service clusters according to the ordering, the method further includes:
calculating an association weight between any two applications;
the performing application distribution for each service cluster according to the ranking comprises:
and selecting two target applications with the largest association weight from the plurality of currently selectable applications, selecting a plurality of association applications with the top-ranked association weights of one of the target applications, and distributing the association applications to the service cluster.
2. The method of claim 1, wherein prior to said allocating the plurality of applications to the plurality of service clusters, the method further comprises:
and sequencing the service clusters according to at least one load performance of the service clusters.
3. The method of claim 1, wherein the assigning applications for service clusters in an order further comprises:
if at least one application is not allocated to the service cluster, sequencing the unallocated applications according to the required resource consumption;
and randomly distributing the unallocated applications to a certain service cluster one by one according to the sequence.
4. The method of claim 1, wherein prior to said allocating the plurality of applications to the plurality of service clusters, the method further comprises:
and constructing a node network graph comprising a plurality of applications by taking the applications as nodes and two applications with data exchange as adjacent nodes, wherein the association weight is an edge weight of an edge connecting the two applications.
5. The method of claim 4, wherein selecting the two target applications with the highest association weight comprises:
and searching a target edge with the maximum edge weight in the node network graph.
6. The method of claim 4, wherein selecting a plurality of top-ranked associated applications with associated weights for one of the target applications comprises:
in the subgraph containing the target edge, performing breadth-first search by taking two target nodes of the target edge as starting points;
and selecting the most relevant nodes from the searched relevant nodes according to the condition that the edge weight of the relevant nodes and the target node is from large to small and the load performance of the service cluster is not exceeded.
7. The method of claim 1, wherein after obtaining a plurality of new allocation results after the replacing the service cluster to which the application belongs for the plurality of times, the method further comprises:
and determining that the replaced newly-added distribution result does not exceed the load performance of each service cluster.
8. The method of claim 1, wherein the replacing the service cluster to which the application belongs for the plurality of times, and obtaining a plurality of new allocation results comprises:
and respectively randomly selecting one application from the two randomly selected service clusters for exchange until a plurality of newly added distribution results are obtained.
9. The method of claim 8, wherein the changing the service cluster to which the application belongs for the plurality of times and obtaining a plurality of new allocation results further comprises:
sequentially selecting two distribution results according to the currently obtained distribution result, randomly selecting two applications from the two distribution results, and exchanging service clusters to which the selected two applications belong to obtain a plurality of newly added distribution results;
and/or randomly selecting an application and modifying the service cluster to which the selected application belongs to obtain a plurality of newly added distribution results.
10. The method of claim 9, wherein in the two randomly selected service clusters, one application is randomly selected to be exchanged until a plurality of new allocation results are obtained, and the method further comprises:
and screening a plurality of allocation results with resource consumption ranked from small to large.
11. The method of claim 9, wherein the calculating the resource consumption of each of the initial allocation result and the new allocation result for the service cluster comprises:
calculating the cluster acquisition cost required by the initial distribution result and the newly added distribution result respectively;
and/or calculating the bandwidth consumption cost of each application cross cluster in the initial distribution result and the newly added distribution result; and adding the bandwidth consumption cost of each application to obtain the total bandwidth consumption cost of the initial distribution result and the newly added distribution result.
12. The method of claim 1, wherein selecting the allocation result with the smallest resource consumption as the optimal allocation result comprises:
and aiming at the current obtained newly added distribution result, if the resource consumption of the current obtained newly added distribution result is less than the resource consumption of the initial distribution result, taking the current obtained newly added distribution result as the current optimal distribution result, and comparing the current optimal distribution result with the next newly added distribution result until the optimal distribution result is obtained.
13. An apparatus for distributing an application home service cluster, comprising:
the application initial distribution module is used for distributing a plurality of applications to a plurality of service clusters to obtain an initial distribution result;
the application multi-time replacement module is used for replacing the service cluster to which the application belongs for multiple times to obtain a plurality of newly-added distribution results;
a resource consumption calculating module, configured to calculate resource consumption of the service cluster by the initial allocation result and the newly added allocation result;
the optimal distribution result selection module is used for selecting a distribution result with the minimum resource consumption as an optimal distribution result; wherein the application initial allocation module is specifically configured to:
performing application distribution on each service cluster according to the sequence until all applications are distributed to a certain service cluster; the method comprises the steps that for a service cluster which is ranked later, application distribution is carried out in the remaining applications which are ranked earlier and distributed;
wherein the apparatus further comprises:
the association weight calculation module is used for calculating the association weight between any two applications;
the application initial allocation module comprises:
and the associated application distribution submodule is used for selecting two target applications with the largest associated weight from the currently selectable multiple applications, selecting multiple associated applications with the associated weight of one of the target applications ranked in the top order, and distributing the multiple associated applications to the service cluster.
14. The apparatus of claim 13, further comprising:
and the service cluster sequencing module is used for sequencing the service clusters according to at least one load performance of the service clusters.
15. The apparatus of claim 13, further comprising:
the application sequencing module is used for sequencing the unallocated applications according to the required resource consumption amount if at least one application is not allocated to the service cluster;
and the unassigned application random allocation module is used for randomly allocating the unassigned applications to a certain service cluster one by one according to the sequence.
16. The apparatus of claim 13, further comprising:
and the node network graph constructing module is used for constructing a node network graph comprising a plurality of applications by taking the applications as nodes and two applications with data exchange as adjacent nodes, and the associated weight is an edge weight connecting edges of the two applications.
17. The apparatus of claim 16, wherein the associated application allocation sub-module comprises:
and the target edge searching subunit is used for searching the target edge with the maximum edge weight in the node network graph.
18. The apparatus of claim 16, wherein the associated application allocation sub-module comprises:
the breadth-first searching subunit is used for performing breadth-first searching by taking two target nodes of the target edge as starting points in the subgraph containing the target edge;
and the associated node selecting subunit is used for selecting the most associated nodes from the searched associated nodes according to the edge weights of the target nodes from large to small under the condition that the load performance of the service cluster is not exceeded.
19. The apparatus of claim 13, further comprising:
and the newly-added distribution result determining module is used for determining that the replaced newly-added distribution result does not exceed the load performance of each service cluster.
20. The apparatus of claim 13, wherein the applying a multiple replacement module comprises:
and the application switching submodule is used for randomly selecting one application from the two randomly selected service clusters respectively to carry out switching until a plurality of newly-added distribution results are obtained.
21. The apparatus of claim 20, wherein the applying a multiple replacement module comprises:
a service cluster interaction submodule for selecting two distribution results in turn according to the currently obtained distribution result, randomly selecting two applications from the two distribution results, and exchanging the service cluster to which the selected two applications belong to obtain a plurality of new distribution results
And the service cluster modification submodule is used for randomly selecting an application and modifying the service cluster to which the selected application belongs to obtain a plurality of newly added distribution results.
22. The apparatus of claim 21, further comprising:
and the distribution result screening module is used for screening a plurality of distribution results with resource consumption ranked from small to large.
23. The apparatus of claim 21, wherein the resource consumption calculation module comprises:
a cluster acquisition cost calculation submodule, configured to calculate a cluster acquisition cost required by each of the initial allocation result and the newly added allocation result;
a bandwidth consumption cost calculation submodule, configured to calculate bandwidth consumption costs of each application cross-cluster in the initial allocation result and the newly added allocation result; and adding the bandwidth consumption cost of each application to obtain the total bandwidth consumption cost of the initial distribution result and the newly added distribution result.
24. The apparatus of claim 13, wherein the optimal allocation result selecting module comprises:
and the distribution result comparison submodule is used for taking the currently obtained newly-increased distribution result as the current optimal distribution result and comparing the currently obtained newly-increased distribution result with the next newly-increased distribution result until the optimal distribution result is obtained if the resource consumption of the currently obtained newly-increased distribution result is less than the resource consumption of the initial distribution result aiming at the currently obtained newly-increased distribution result.
CN201610119120.2A 2016-03-02 2016-03-02 Distribution method and device of application home service cluster Active CN107155215B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201610119120.2A CN107155215B (en) 2016-03-02 2016-03-02 Distribution method and device of application home service cluster
TW106104645A TWI740895B (en) 2016-03-02 2017-02-13 Distribution method and device for application attribution service cluster
PCT/CN2017/074172 WO2017148296A1 (en) 2016-03-02 2017-02-20 Method of assigning application to assigned service cluster and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610119120.2A CN107155215B (en) 2016-03-02 2016-03-02 Distribution method and device of application home service cluster

Publications (2)

Publication Number Publication Date
CN107155215A CN107155215A (en) 2017-09-12
CN107155215B true CN107155215B (en) 2020-07-21

Family

ID=59742499

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610119120.2A Active CN107155215B (en) 2016-03-02 2016-03-02 Distribution method and device of application home service cluster

Country Status (3)

Country Link
CN (1) CN107155215B (en)
TW (1) TWI740895B (en)
WO (1) WO2017148296A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115134369B (en) * 2021-03-26 2024-01-19 北京金山云网络技术有限公司 CDN node distribution method and device, electronic equipment and storage medium
CN114466022B (en) * 2021-12-31 2023-07-21 苏州浪潮智能科技有限公司 Method, device and medium for obtaining server seed nodes in cluster

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120072250A (en) * 2010-12-23 2012-07-03 한국전자통신연구원 Dynamic load_balancing system and method thereof
US9537973B2 (en) * 2012-11-01 2017-01-03 Microsoft Technology Licensing, Llc CDN load balancing in the cloud
CN103327072B (en) * 2013-05-22 2016-12-28 中国科学院微电子研究所 A kind of method of cluster load balance and system thereof
US9836330B2 (en) * 2013-07-16 2017-12-05 Hitachi, Ltd. Virtual resource management tool for cloud computing service
CN103491151A (en) * 2013-09-13 2014-01-01 中安消技术有限公司 Method and device for dispatching cloud computing resources and cloud computing platform
CN103473140A (en) * 2013-10-09 2013-12-25 浪潮(北京)电子信息产业有限公司 Cluster distribution method of life science applications, and software setup method and device applied of life science applications
KR20150044113A (en) * 2013-10-16 2015-04-24 한국전자통신연구원 Apparatus and method for allocating multi task
CN104461740B (en) * 2014-12-12 2018-03-20 国家电网公司 A kind of cross-domain PC cluster resource polymerization and the method for distribution
CN105208133B (en) * 2015-10-20 2018-05-25 上海斐讯数据通信技术有限公司 A kind of server, load equalizer and server load balancing method and system

Also Published As

Publication number Publication date
CN107155215A (en) 2017-09-12
TWI740895B (en) 2021-10-01
TW201734831A (en) 2017-10-01
WO2017148296A1 (en) 2017-09-08

Similar Documents

Publication Publication Date Title
CN105446979B (en) Data digging method and node
Yang et al. A multi-objective task scheduling method for fog computing in cyber-physical-social services
US10474504B2 (en) Distributed node intra-group task scheduling method and system
Talbi et al. Multi‐objective optimization using metaheuristics: non‐standard algorithms
CN108664330B (en) cloud resource allocation method based on variable neighborhood search strategy
CN86101057A (en) Be used for method of allocating resources and equipment effectively
Ayoubi et al. An autonomous IoT service placement methodology in fog computing
Idrissi et al. A new approach for a better load balancing and a better distribution of resources in cloud computing
CN106202092A (en) The method and system that data process
Wei et al. Research on cloud design resources scheduling based on genetic algorithm
Yin et al. An improved genetic algorithm for task scheduling in cloud computing
CN111176840A (en) Distributed task allocation optimization method and device, storage medium and electronic device
CN116501711A (en) Computing power network task scheduling method based on 'memory computing separation' architecture
CN116662010A (en) Dynamic resource allocation method and system based on distributed system environment
CN107155215B (en) Distribution method and device of application home service cluster
Shukla et al. FAT-ETO: Fuzzy-AHP-TOPSIS-Based efficient task offloading algorithm for scientific workflows in heterogeneous fog–cloud environment
Keerthika et al. A multiconstrained grid scheduling algorithm with load balancing and fault tolerance
Mekki et al. Vehicular fog resource allocation scheme: A multi-objective optimization based approach
CN116708446B (en) Network performance comprehensive weight decision-based computing network scheduling service method and system
CN112465371B (en) Resource data distribution method, device and equipment
CN117290090A (en) Node cooperative resource allocation method, device, equipment and storage medium
CN115421885B (en) Distributed multi-target cloud task scheduling method and device and cloud service system
Sundararajan et al. A constrained genetic algorithm for rebalancing of services in cloud data centers
Song et al. An adaptive differential evolution algorithm with DBSCAN for the integrated slab allocation problem in steel industry
CN113157431B (en) Computing task copy distribution method for edge network application environment

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