1 Introduction

Cloud computing [1] and big data [2, 3] are the blistering issues in the modern day. Many researchers have done a lot of research and gained some achievements. Cloud computing is a computing prototype, which serves cloud users by providing computing resources through a network. A cloud contains a parallel and distributed system interconnecting computing resources or virtual computing resources [4]. There are many popular cloud computing environments, such as Amazon EC2 [5] and IBM Smart Cloud [6]. In cloud computing environments, the users of the cloud service consume cloud resources as a service and pay for the service they use. The service is based on the service level agreement (SLA), which specifies the quality of service (QoS) between a service provider and a service consumer [7, 8]. SLA usually includes the service price, with the level of QoS adjusted by the price of the service. The typical pay-per-use model reduces the initial cost of enterprises, thus most of them adopt clouds.

Recently, the rapid development of terminal devices led to certain amount of data surge into the Internet. Petabyte-scale collections of data come from click streams, transaction histories, sensors [9, 10]. These data must be processed quickly, which has become an immense challenge to the computing power of the supercomputer and cloud architecture [11, 12]. Thus, some cloud providers deploy geographically distributed data centers, or take some heterogeneous computer cluster as the nodes of cloud. These new cloud architectures insistently obliged an efficient resource-allocation algorithm [13, 14].

Resource allocation in cloud computing environment is responsible for assigning the available resources to a set of tasks which form the workload. The resource-allocation algorithm contains some protocols and policies that can choose the most suitable resources and improve system performance [15]. Concerning resource-allocation problem, immediate policy and best effort policy [16] are typical in cloud environment. In recent years, some new heuristic algorithms such as deadline-drive [1618] and energy-aware [1921] have been proposed to improve the traditional algorithms, and have made certain progress. The resource-allocation algorithms which executed with virtual machines also have achieved better system efficiency [2224].

However, most algorithms only consider a single factor, either the task execution time or communication traffic [25]. Therefor some multi-objective algorithms [26, 27] are proposed to improve system performance in the distributed systems. These multi-objective algorithms integrate multiple factors such as computing power, workload and storage capacity. Furthermore, these algorithms still have limitations with regard to the dynamical changes of resources.

However, in the process of allocating resources, the node which generates tasks needs to notify all the other nodes and collect their information. Thus, a large number of communication messages burst out in a short time and as results it will increase the communication traffic, complexity and decrease the system performance severely. To solve this problem, we divide tasks and nodes into different levels to reduce the nodes number during the bidding process. In order to assign tasks to different levels, we compute task levels by using the fuzzy pattern recognition method [28, 29]. Fuzzy pattern recognition is based on fuzzy information of an object in accordance with the principle of fuzzy mathematics [30]. The direct fuzzy pattern recognition method uses fuzzy sets to describe pattern type based on the principle of maximum membership degree. It aims at determining the mapping between the pattern and the task. In recent years, this technology is applied to task scheduling and resource allocation [31, 32] in distributed systems [33], grid computing [34] and cloud computing [35]. After using fuzzy pattern recognition it successfully stabilizes the result of task leveling, leading to a robust result. The robustness contributes towards simplifying the subsequent resource-allocation process.

In this paper, we propose a dynamically hierarchical, resource-allocation algorithm (DHRA) to solve the problem of a colossal number of messages generated during resources allocation. DHRA divides tasks into different levels through the method of fuzzy pattern recognition and heaves task information into the corresponding level in the task pool. Thus any nodes with idle ability choose tasks from the corresponding level of the task pool. That is to say only the nodes that are corresponding to the level of target task and having idle ability are able to join the bidding. Then the number of messages is reduced effectively, and communication traffic will also be reduced. Each node in DHRA has independent decision-making ability. The proposed algorithm not only increases system reliability, but also meets large-scale application service demand in cloud computing environment. By analyzing and experimenting with DHRA, the feasibility and effectiveness of DHRA can be proved and communication messages and communication traffic can be reduced.

In Sect. 2, we review the related works. In Sect. 3, we introduce the system framework. In Sect. 4, we describe DHRA algorithm. DHRA contains the level of task, the dynamic mapping between task level and nodes and the bidding process. In Sect. 5, we analyze DHRA and prove that DHRA can reduce the number of messages significantly. In Sect. 6, we prove DHRA can reduce the communication traffic and makespan more effective than MinMin algorithm by related experiments. We reach our final conclusion in Sect. 7.

2 Related work

On the verge of a big data era, the cloud computing system has become one of the most crucial research issues. The large-scale data center has helped relieve this issue to a certain degree. In the meantime, there has also been a considerable amount of research conducted using software approaches, such as resource allocation and task scheduling [1624, 26, 27].

The deadline-drive algorithms are popular. In [16], the authors propose dynamic planning based scheduling algorithm, which supports deadline sensitive leases in Haizea while minimizing the total number of leases rejected by it. They find multiple slots in addition to finding a single slot while scheduling a deadline sensitive lease. It also applies two concepts (swapping and backfilling) in addition to preemption, while rescheduling already accommodated leases to make space for a newly arrived lease. Researchers in [17] present Aneka’s deadline-driven provisioning mechanism. This allocation decision is driven by the application QoS, which is expressed in terms of the deadline for application completion. The deadline-driven policy considers the time left for the deadline and the average execution time of tasks that compose an application to determine the number of resources required. Similarly, in [18], deadline and budget constrained cost-time optimization algorithm is proposed in order to rely on sub tasks with considerations of communications between each other.

The energy-efficient algorithms are also a research hotspot. In [19], Anton et al. propose architectural principles for energy-efficient management in clouds. Further they have proposed energy-efficient resource-allocation policies and scheduling algorithms considering QoS expectations and power usage characteristics of the devices. It improves energy efficiency of the data center, while delivering the negotiated QoS. In [20], two energy-conscious task consolidation heuristics also have been presented. These heuristics assign each task to the resource on which the energy consumption for executing the task is explicitly or implicitly minimized without the performance degradation of the task. Wu et al. [21] propose a green energy-efficient scheduling algorithm using the DVFS technique for cloud computing data centers. The scheduling algorithm searches available servers to create VMs for allocating a job under the requirements of the job and selects the solution that consumes the least energy. These energy scheduling algorithm all efficiently increase resource utilization; hence, they can decrease the energy consumption for executing jobs.

Some researchers try to deal with resource allocation by using virtual machine. Xiao et al. [22] propose that uses virtual technology to allocate data center resources dynamically. They introduce the concept of “skewness” to measure the unevenness in the multi-dimensional resource utilization of a server. Daniel and Odej [23] introduce project Nephele, which explicitly exploits the dynamic resource allocation offered by today’s IaaS clouds for both task scheduling and execution. Particular tasks of a processing job can be assigned to different types of virtual machines, which are automatically instantiated and terminated during the job execution. A new proactive workload management model [24] proposed for virtual resources to inspect the workload behavior of the running virtual machines, and to assert an appropriate scheduling and resource consolidation scheme in order to improve the system efficiency, utilization, and throughput.

Some multi-objective algorithms are proposed. In [26], researchers design a multi-agent based task scheduling mechanism, and schedule tasks according to multiple factors, such as task execution time and communication traffic. In [27], they study the multi-agent mechanism further, and discuss the weight of each factor. These multi-objective scheduling algorithms have better intelligence and stability, while the system efficiency and resource utilization are also improved.

3 System framework

DHRA is a hierarchical algorithm to reduce the number of messages and communication traffic in cloud computing environment. It divides tasks and nodes into different levels and brings out a dynamic mapping between tasks and nodes. Therefore the range of target nodes shrinks from all nodes to the nodes of the corresponding level in DHRA. Then the number of messages is reduced, meaning the reduction of communication traffic.

The system framework consists of: a task pool, nodes and the resource-allocation algorithm named DHRA. The system framework is shown in Fig. 1.

Fig. 1
figure 1

The system framework

As shown in Fig. 1, the upper part is the task pool with different levels, these levels represented by L1, L2, L3 and so on. The lower part is nodes set. Each circle represents a node (such as \(h_1 , h_2 , h_3\)), which might be an independent computer or a cluster. These nodes all can meet the minimum task requirement. The left part of Fig. 1 shows that every node has two task queues. They are Queue_Wait (the queue of tasks to be scheduled) and Queue_Allo (the queue of tasks that has been allocated to the node). The arrows represent corresponding relations between nodes and levels.

The task pool with hierarchy is proposed in our paper. When a new task is generated, the task level is calculated according to the resource requirement (such as computation load, required storage space and required disk space). To search a better target node, information about every task should be recorded by the corresponding level of the task pool. Task information includes TaskID, NodeID, computation load, required storage space, required disk space and life cycle. A record in the task pool is formed by one task information. The format of task information in the task pool is shown in Fig. 2.

Fig. 2
figure 2

The format of task information

Similarly, the nodes adopt the idea of hierarchy. That is, the nodes are also divided into different levels. The level of nodes is decided according to their idle ability (such as idle computing power, idle storage space, idle disk space and work load). Because the idle ability of nodes is always changing, the mapping between tasks and nodes is not static but dynamical.

DHRA publicizes and manages task information of different levels in the task pool. Each node selects tasks whose resource requirement can be met from the corresponding level of the task pool, and sends the bid information to the task owner. DHRA chooses the maximum bidder as the successful node and submits the task to it. The successful node executes the task and returns the result to the task owner.

4 The dynamically hierarchical resource-allocation algorithm

In this section, DHRA algorithm is presented and discussed in detail. The proposed algorithm is based on FastBid algorithm [36] and task level. In this paper the resource-allocation problem is described as follows: \(n\) nodes and \(m\) tasks in cloud computing environment. Nodes set is represented by \(H=\{h_1 ,h_2 ,\ldots ,h_j ,\ldots ,h_n \}\). When \(m\) tasks need to be executed, the set of tasks is defined as \(T=\{t_1 ,t_2 ,\ldots ,t_i ,\ldots ,t_m \}\). Each task must be executed by one node. All nodes bid for target tasks which is in the corresponding level.

For a given task, DHRA calculates the task level. Its owner packages task information into a record and then throws it into the corresponding level of the task pool. Nodes with idle ability read tasks in the corresponding level of the task pool. If the resource requirement of the task can be met, the node will bid for it. For a specific task, only nodes which can meet the resource requirement and in the corresponding level join the bid for it. The successful bidder is selected according to the evaluation value which comprehensively considerate computing power, storage capacity and bandwidth. Then the target task was assigned to the successful node.

The algorithm contains the process of the task owner which is triggered by Queue_Wait and the process of bidders which are periodically start-up for selecting tasks from the corresponding level of task pool. The flow chart of DHRA is shown in Fig. 3.

Fig. 3
figure 3

The flow chart of DHRA

The algorithm includes three main concerns:

  1. 1.

    The level of task.

  2. 2.

    The dynamic mapping of task level and node.

  3. 3.

    The evaluation value of task.

4.1 The level of task

In order to manage high efficiency of the dynamical hierarchical mapping, five levels are defined in the task pool, respectively represented by L1, L2, L3, L4 and L5. Every task belongs to one level. The process of deciding the level of a task is:

  1. (1)

    The indicators of task level:

The indicators of task level are defined as a task information space, which is represented by \(T\) while \(t_i (1\le i\le m)\) represents different task information. In this paper, the information of a task which is considered as indicators to determine task level contains computation load (TC), required storage space (TM) and required disk space (TD). So the task information space is shown as:

$$\begin{aligned} \begin{array}{l} T=\{t_1 ,t_2 ,\ldots ,t_i ,\ldots ,t_m \} \\ \mathrm{TC}=\{\mathrm{tc}_1 ,\mathrm{tc}_2 ,\ldots ,\mathrm{tc}_i ,\ldots ,\mathrm{tc}_m \} \\ \mathrm{TM}=\{\mathrm{tm}_1 ,\mathrm{tm}_2 ,\ldots ,\mathrm{tm}_i ,\ldots ,\mathrm{tm}_m \} \\ \mathrm{TD}=\{\mathrm{td}_1 ,\mathrm{td}_2 ,\ldots ,\mathrm{td}_i ,\ldots ,\mathrm{td}_m \} \\ t_i =\{ {(\mathrm{tc}_i ,\mathrm{tm}_i ,\mathrm{td}_i )|\mathrm{tc}_i \in \mathrm{TC},\mathrm{tm}_i \in \mathrm{TM}, \mathrm{td}_i \in \mathrm{TD},1\le i\le m} \} \\ \end{array}. \end{aligned}$$

According to these indicators, every task belongs to the five fuzzy sets of task levels by a certain degree.

  1. (2)

    Adjusting and conversion of task indicators:

For every task, in order to build the membership function of task level, the three task indicators (i.e.\(\mathrm{tc}_i ,\mathrm{tm}_i ,\mathrm{td}_i\)) need to be normalized and standardized.

In this paper, the linear function of conversion is used to normalize the parameters so that it can obtain the value limited in (0, 1), then denote three parameters (i.e. \(\mathrm{tc}_i \), \(\mathrm{tm}_i \), \(\mathrm{td}_i\)) after conversion them as \(\mathrm{tc}_i \_N\), \(\mathrm{tm}_i \_N\) and \(\mathrm{td}_i \_N\). Using the standard deviation standardization to eliminate the big gap of the indicators value, so that modify these normalized parameters (i.e. \(\mathrm{tc}_i \_N\), \(\mathrm{tm}_i \_N\), \(\mathrm{td}_i \_N\)) and get the standard values \(\mathrm{tc}_i \_S\), \(\mathrm{tm}_i \_S\) and \(\mathrm{td}_i \_S\) respectively.

  1. (3)

    Membership function of task level:

The levels L1, L2, L3, L4 and L5 are a division of task information space, and constitute a group of fuzzy sets of tasks level. The corresponding membership functions are represented by _L1, _L2, _L3, _L4, _L5. \(x\) represents different value of \(\mathrm{tc}_i \_S\), \(\mathrm{tm}_i \_S\) and \(\mathrm{td}_i \_S\), then the membership function of fuzzy task level could be shown as:

$$\begin{aligned} \_\mathrm{L1}= & {} \left\{ {\begin{array}{l} 1;x\ge 0.8 \\ (x-0.6)^{*}5;0.6\le x<0.8 \\ 0;x<0.6 \\ \end{array}} \right. \nonumber \\ \_\mathrm{L2}= & {} \left\{ {\begin{array}{l} 0;x\ge 0.8 \\ (0.8-x)^{*}5;0.6\le x<0.8 \\ (x-0.5)^{*}10;0.5\le x<0.6 \\ 0;x<0.5 \\ \end{array}} \right. \nonumber \\ \_\mathrm{L3}= & {} \left\{ {\begin{array}{l} 0;x\ge 0.6 \\ (0.6-x)^{*}10;0.5\le x<0.6 \\ (x-0.4)^{*}10;0.4\le x<0.5 \\ 0;x<0.4 \\ \end{array}} \right. \nonumber \\ \_\mathrm{L4}= & {} \left\{ {\begin{array}{l} 0;x\ge 0.5 \\ (0.5-x)^{*}10;0.4\le x<0.5 \\ (x-0.2)^{*}5;0.2\le x<0.4 \\ 0;x<0.2 \\ \end{array}} \right. \nonumber \\ \_\mathrm{L5}= & {} \left\{ {\begin{array}{l} 0;x\ge 0.4 \\ (0.4-x)^{*}5;0.2\le x<0.4 \\ 1;0\le x<0.2 \\ \end{array}} \right. . \end{aligned}$$
(1)

The figure of this membership function is shown in Fig. 4.

Fig. 4
figure 4

The membership function of task level

Hence the membership degree of each task indicator to each task levels can be calculated according to the computation load of tasks, required storage space of tasks and required disk space of tasks.

  1. (4)

    Calculation of task level:

\(\mathrm{tc}_i \_S, \,\mathrm{tm}_i \_S\) and \(\mathrm{td}_i \_S\) are introduced into the membership function Eq. (1). Then the membership degrees of computation load, required storage space and required disk space of tasks to every level are obtained, and are represented by \(\_y(\mathrm{tc}_i \_S)\), \(\_y(\mathrm{tm}_i \_S)\) and \(\_y(\mathrm{td}_i \_S)\) respectively while \(y\in (\mathrm{L1,L2,L3,L4,L5})\). Hence the membership degree of each task to every level can be calculated according to Eq. (2).

$$\begin{aligned} \_y(t_i )=x_1 {}^{*}\_y(\mathrm{tc}_i \_S)+x_2 {}^{*}\_y(\mathrm{tm}_i \_S)+x_3 {}^{*}\_y(\mathrm{td}_i \_S);y\in (\mathrm{L1,L2,L3,L4,L5}). \end{aligned}$$
(2)

where \(\_y(t_i )\) represents the membership degree of task \(t_i \) to the task level \(y\). \(x_1 \), \(x_2 \) and \(x_3 \) are the weight of each indicator, while \(x_1 ,x_2 ,x_3 \in (0,1)\) and \(x_1 +x_2 +x_3 =1\).

Hence the task levels can be obtained on the basis of the maximum membership principle. The Equation is shown as Eq. (3)

$$\begin{aligned} \_y^{*}(t_i )=\max \{\_y(t_i )|y\in (\mathrm{L1,L2,L3,L4,L5}),1\le i\le m\}. \end{aligned}$$
(3)

Thus, we consider that level of task \(t_i \) is \(y\), and the degree of membership is \(\_y^{*}(t_i )\).

4.2 The dynamic mapping between task level and node

In this paper a dynamic mapping between task level and node is created. Each node corresponds to one task level at a certain point of time. The corresponding task level of nodes is calculated by using the same method of task level. The indicators of nodes are: the idle computing power \((\mathrm{hc}_j (1\le j\le n))\), the idle memory space \((\mathrm{hm}_j (1\le j\le n))\), and the idle disk space \((\mathrm{hd}_j (1\le j\le n))\). According to this information of node, the corresponding level of nodes can be decided according to the fuzzy pattern recognition. Since the workload of a node may change with the change of system, so the corresponding level of a node are dynamic. The dynamic mapping is constructed between tasks and nodes.

4.3 Get the evaluation value

A node can read all tasks in the corresponding level of the task pool. If it can meet the demand of a task, it needs to calculate an evaluation of itself to join the bidding. Then the task owner chooses the node which the maximum evaluation as the target node.

To achieve better comprehensive evaluation for multi-objective, we use Eq. (4) as the evaluation function to calculate the evaluation value of bidders:

$$\begin{aligned} f_{ij} =y_1 c_{ij} +y_2 /t\_\mathrm{end}_{ij} +y_3 /w_j ,(y_1 +y_2 +y_3 =1). \end{aligned}$$
(4)

\(f_{ij} \) is the evaluation value of task \(t_i \) on node \(h_j \). \(c_{ij} \) represents the inter dependency between task \(t_i \) and node \(h_j\) which is calculated by using Eq. (5). \(t\_\mathrm{end}_{ij} \) represents the earliest completion time of \(t_i \) on \(h_j \), which is calculated by using Eq. (6). \(w_j \) represents the load of \(h_j \) which is calculated by using Eq. (8). \(y_1, y_2 \) and \(y_3 \) are the coefficients of \(c_{ij} \), \(1/t\_\mathrm{end}_{ij} \) and \(1/w_j \).

The definition of the inter dependency \(c_{ij} \) between \(t_i \) and \(h_j \) is:

$$\begin{aligned} c_{ij} =\left\{ {\begin{array}{l} \frac{\sum \nolimits _{j\in T_j } {e_{ij} } }{\sum \nolimits _{l\in T} {e_{il} } };\sum \limits _{l\in T} {e_{il} } \ne 0 \\ 0;\sum \limits _{l\in T} {e_{il} } =0 \\ \end{array}} \right\} (i=1,2,\ldots ,m;j=1,2,\ldots ,n) \end{aligned}$$
(5)

where \(T_j \) is the task set which is allocated to \(h_j ,\sum \nolimits _{j\in T_j } {e_{ij} } \) represents total communication traffic between task \(t_i \) and \(T_j \), and \(\sum \nolimits _{l\in T} {e_{il} } \) represents total communication traffic between task \(t_i \) and all tasks. Allocating tasks to the node which has maximum \(c_{ij} \) can reduce communication traffic effectively.

The earliest completion time \(t\_\mathrm{end}_{ij} \) of task \(t_i \) on node \(h_j \) is:

$$\begin{aligned} t\_\mathrm{end}_{ij} =h\_\mathrm{end}_j +t\_\mathrm{Process}_{ij} +t\_\mathrm{trans}_{ij} \end{aligned}$$
(6)

where \(t\_\mathrm{end}_{ij} \) represents the calculating completion time of all tasks in node \(h_j \) which is calculated by Eq.(7). \(t\_\mathrm{Process}_{ij} \) represents the time of processing task \(t_i \) on node \(h_j \). And \(t\_\mathrm{trans}_{ij} \) represents the time of transferring task \(t_i \) to node \(h_j \).

The calculating completion time of all tasks in a node is represented by \(h\_\mathrm{end}_j \). The length of ready queue is defined as \(\mathrm{Queue}\_\mathrm{Length}_j\). Task execution time of Queue_Allo is defined as \(t\_\mathrm{Process}_k (0\le k\le \mathrm{Queue}\_\mathrm{Length}_j )\). Then the completion time \(h\_\mathrm{end}_j \) of node \(h_j \) is defined as:

$$\begin{aligned} h\_\mathrm{end}_j =\sum _{k=1}^{\mathrm{Queue}\_\mathrm{Length}_j } {t\_{\mathrm{Process}_k} } . \end{aligned}$$
(7)

The load of the node is according to various parameters related to efficiency of the node timely, including network traffic \(S\), CPU utilization \(U\), memory utilization \(M\) and disk utilization \(D\). And then calculate load \(w\) of each node by Eq. (8) according to these parameters.

$$\begin{aligned} w=x_1 S+x_2 U+x_3 M+x_4 D\left( {x_i \ge 0,\sum {x_i } =1} \right) . \end{aligned}$$
(8)

The evaluation of nodes to a task according to \(c_{ij} \), \(t\_\mathrm{end}_{ij} \) and \(w_j \) can be calculated by using Eq. (4) and sends it to the task owner.

5 Analysis

In DHRA, the bidding process can avoid a large number of messages in the process of resources allocation. When allocating resources by using traditional algorithms, if a task is generated, the owner has to collect information of all the other nodes. All the other nodes also have to send their information to the task owner. If a system with a large number of nodes and tasks, extensive messages will be produced in the process of resource allocation. Communication traffic will increase sharply and system performance will certainly decrease. Moreover, with the increasing of nodes, the complexity of resource allocation will also increase. DHRA uses task pool which has different levels to publish tasks. It only needs to send task information to the corresponding level in the task pool. Then any node can select reasonable task from the corresponding level instead of blindly send their resource information. Therefore the number of messages is reduced and communication traffic also decreases.

When there are \(n\) nodes and \(m\) tasks, the set of nodes is defined as \(H=\{h_1 ,h_2 ,\ldots ,h_n \}\) and the set of tasks is defined as \(T=\{t_1 ,t_2 ,\ldots ,t_m \}\).

  1. (1)

    Traditional resource-allocation algorithms

In traditional resource-allocation algorithms, if there is task \(t_i (1\le i\le m)\) on node \(h_j (1\le j\le n)\), \(h_j \) has to notify all other nodes \(h_k (1\le k\le n,k\ne j)\) that task \(t_i \) is generated. Nodes \(h_k (1\le k\le n,k\ne j)\) should send their evaluation information to \(h_j \) after receiving the notification. Then the node \(h_j \) selects the target node among all bidders. Therefore, the number of messages is \(2(n-1)\) for each task. For \(m\) tasks, the whole number of messages is represented by below formula:

$$\begin{aligned} a=2m(n-1). \end{aligned}$$
(9)
  1. (2)

    DHRA

When allocating resources in DHRA, the tasks will be divided into different levels. The set of levels is defined as \(L=\{L_1 ,L_2 ,\ldots ,L_p \}\). The process of selecting the target node has three phases: recording tasks in different levels, selecting one task and bidding.

  1. (1)

    Recording tasks in different levels:

In DHRA, task level is calculated by using Eq. (3) and task information will be packaged into a record and it will be sent to the corresponding level in the task pool. Only a piece of information is produced when there is a new task to be executed is generated. For \(m\) tasks, the number of messages in this phase is:

$$\begin{aligned} b_1 =m. \end{aligned}$$
(10)
  1. (2)

    Selecting one task:

In this phase, all nodes collect their resource information and calculate the corresponding level of the node. Then nodes select one task from the corresponding level in the task pool. If demand of the task can be met, task information will be sent to the node.

For the set of levels \(L=\{L_1 ,L_2 ,\ldots ,L_p \}\), assumed that the number of tasks in level \(L_k\) is \(N_k (1\le k\le p)\). Then the set of tasks in level \(L_k \) is defined as \(T_{L_{k}} (1\le k\le p)\) and the set of nodes in level \(L_k \) is defined as \(H_{L_{k}} (1\le k\le p)\).

The sets of tasks in different levels are:

$$\begin{aligned}&T_{\mathrm{L1}} =\{t_{\mathrm{task}i_1 } ,t_{\mathrm{task}i_2 } ,\ldots ,t_{\mathrm{task}i_{N1} } \},\\&T_{\mathrm{L2}} =\{t_{\mathrm{task}j_1 } ,t_{\mathrm{task}j_2 } ,\ldots ,t_{\mathrm{task}j_{N2} } \},\\&{\ldots }\\&T_{Lp} =\{t_{\mathrm{task}k_1 } ,t_{\mathrm{task}k_2 } ,\ldots ,t_{\mathrm{task}k_{Np} } \}, \end{aligned}$$

\(t_j \in T(1\le j\le m)\) and thus \(T_{Li} (1\le i\le p)\) is a sub-set of \(T\).

The sets of nodes of each level are:

$$\begin{aligned}&H_{\mathrm{L1}} =\{h_{\mathrm{node}i_1 } ,h_{\mathrm{node}i_2 } ,\ldots ,h_{\mathrm{node}i_{M1} } \},\\&H_{\mathrm{L2}} =\{h_{\mathrm{node}j_1 } ,h_{\mathrm{node}j_2 } ,\ldots ,h_{\mathrm{node}j_{M2} } \},\\&{\ldots }\\&H_{Lp} =\{h_{\mathrm{node}k_1 } ,h_{\mathrm{node}k_2 } , \ldots ,h_{\mathrm{node}k_{Mp} } \},\\ \end{aligned}$$

\(h_j \in H(1\le j\le n)\) and thus \(H_{Li} (1\le i\le p)\) is a sub-set of \(H\).

Because the node needs to select one task from the corresponding level, the number of messages in this step is:

$$\begin{aligned} b_2= & {} (h_{\mathrm{node}i_1 } +h_{\mathrm{node}i_2 } +\cdots +h_{\mathrm{node}i_{M1} } )+(h_{\mathrm{node}j_1 } +h_{\mathrm{node}j_2 } +\cdots +h_{\mathrm{node}j_{M2} } )\nonumber \\&+(h_{\mathrm{node}k_1 } +h_{\mathrm{node}k_2 } +\cdots +h_{\mathrm{node}k_{Mp}}). \end{aligned}$$
(11)

And because of:

$$\begin{aligned}&(h_{\mathrm{node}i_1 } +h_{\mathrm{node}i_2 } +\cdots +h_{\mathrm{node}i_{M1} } )+(h_{\mathrm{node}j_1 } +h_{\mathrm{node}j_2 } +\cdots +h_{\mathrm{node}j_{M2} } )\nonumber \\&\quad +(h_{\mathrm{node}k_1 } +h_{\mathrm{node}k_2 } +\cdots +h_{\mathrm{node}k_{Mp} } )=n. \end{aligned}$$
(12)

So according to Eqs. (11) and (12) there is:

$$\begin{aligned} b_2 =n. \end{aligned}$$
(13)

If a node met the demand of one task, task information will be sent to the node. Otherwise no more information needs to be sent. So in this step the number of messages is less than \(b_2 \), which is:

$$\begin{aligned} b_3 \le b_2 . \end{aligned}$$
(14)

So according to Eqs. (13) and (14), there is:

$$\begin{aligned} b_3 \le n. \end{aligned}$$
(15)
  1. (3)

    Bidding:

This phase is accomplished by negotiation algorithm in DHRA. After reading tasks information in the task pool, the node will send bidding information to the owner of the target task. The number of messages in this phase is:

$$\begin{aligned} b_4 \le b_3 . \end{aligned}$$
(16)

So according to Eqs. (15) and (16), there is:

$$\begin{aligned} b_4 \le n. \end{aligned}$$
(17)

So the total number of messages of DHRA is:

$$\begin{aligned} b=b_1 +b_2 +b_3 +b_4 \le m+n+n+n=m+3n. \end{aligned}$$
(18)

The maximum value of \(b\) is defined as \(b_{\max }\), according to Eq. (18), there is:

$$\begin{aligned} b_{\max } =m+3n. \end{aligned}$$
(19)

With the increasing number of m and n, the numbers of messages by using traditional algorithms and DHRA are shown in Table 1.

Table 1 The comparison of the number of messages

Function \(g(m,n)\) is defined as \(g(m,n)=a-b_{\max } =2m(n-1)-(m+3n)\), and there is:

$$\begin{aligned} g(m,n)= & {} 2mn-2m-m-3n=(mn-3m)+(mn-3n) \nonumber \\= & {} m(n-3)+n(m-3). \end{aligned}$$
(20)

When \(n\ge 3\) and \(m\ge 3\), there is \(g(m,n)\ge 0\), which equals to \(2m(n-1)-(m+3n)\ge 0\). So we can draw the conclusion in Eq. (21).

$$\begin{aligned} 2m(n-1)\ge (m+3n),(n\ge 3,m\ge 3). \end{aligned}$$
(21)

According to Eqs. (9) and (21) there is:

$$\begin{aligned} a\ge (m+3n),\quad (n\ge 3,m\ge 3). \end{aligned}$$
(22)

And according to Eqs. (19) and (22) we can draw the conclusion in Eq. (23).

$$\begin{aligned} b\le a. \end{aligned}$$
(23)

From Table 1, we can find that DHRA can save more number of messages compared to the traditional algorithm with the increasing of \(m\) and \(n\). When the number of tasks is small, the number of messages of traditional algorithms and DHRA have the complexity of \(O(n)\). When \(m\) is close to \(n\), the complexity of traditional algorithms is \(O(n^{2})\) and the complexity of DHRA is still \(O(n)\).

So with the increasing number of tasks and nodes, DHRA can reduce the number of messages effectively. Therefore, the communication traffic is also decreased.

Dividing tasks into different levels not only reduces the number of messages and communication traffic, but also reasonable the choice of the target node during allocating resources. For tasks in corresponding level, nodes join only the bidding for tasks whose resource demand can be met. Therefore the idle ability of nodes will be fully used. The problem of nodes with great idle ability being occupied by small tasks can be solved. Besides, if there are some nodes with great idle ability, the tasks with large demand can be processed as early as possible.

6 Experiments and comparisons

In this section, we simulate DHRA by using CloudSim [37], and compare the efficiency of DHRA with MinMin algorithm. In the experiments of the two algorithms, not only the environment but also the dynamical changes of nodes should be same. The results illustrate that DHRA have less makespan and communication traffic than MinMin algorithm.

6.1 Parameter settings

In the simulation experiments, the number of tasks is \(t\) and the number of nodes is \(n\). While \(n=10\), \(n=20\) and \(n=30\), different number of random tasks are generated respectively to compare DHRA and MinMin. When \(n=10\), the number of tasks sets \([30,130]\). When \(n=20\), the number of tasks sets \([50,150]\). When \(n=30\), the number of tasks sets \([100,200]\).

In the experiments, not only the number of tasks and nodes should be same for two algorithms, but also the parameters of tasks and nodes should be same. Thus the parameters of nodes are set as follows: the range of the rating of CPU (which represents the computing power) is [1.8, 4.2 GFlops]. The range of storage space is [600, 1400 M]. The range of disk space is [60, 140 G]. The range of bandwidth is [1800, 4200 Mbps]. The parameters of tasks are set as follows: the range of computation load is [180, 420 GFlop]. The range of traffic with other tasks is [1, 3 M]. The range of required storage space is [18, 42 M]. The range of required disk space is [60, 140 M]. In each experiment, we allocate resources for the same set of tasks using the two algorithms in the same environment.

6.2 Comparison of communication traffic

The set of nodes and the set of tasks are generated randomly according to the scale of parameters above. Firstly, compare DHRA and MinMin in communication traffic through three sets of experiment with different number of nodes and tasks. The communication traffic includes not only the communication traffic between tasks, but also the communication traffic of sending tasks to the target node and the biding message. When \(n=10\), the results of communication traffic of different number of tasks are shown in Fig. 5. When \(n=20\), the results are shown in Fig. 6. When \(n=30\), the results are shown in Fig. 7.

Fig. 5
figure 5

The comparison of communication traffic when \(n=10\)

Fig. 6
figure 6

The comparison of communication traffic when \(n=20\)

Fig. 7
figure 7

The comparison of communication traffic when \(n=30\)

From Figs. 5, 6 and 7 we can see that DHRA has less communication traffic than MinMin when \(n=10\), \(n=20\) and \(n=30\). The reason is that DHRA takes the communication traffic into account in the process of allocation. And in DHRA the negotiation algorithm is multi-level. So the biding relate to only the nodes in corresponding level. The nodes with lack or too more computing power does not send the bid messages, so DHRA has less communication traffic than MinMin.

As shown in Figs. 5, 6 and 7, the difference of communication traffic between DHRA and MinMin increase with the increasing of the number of nodes and tasks. In DHRA, for every task only the nodes with corresponding level join in the bid. Hence with the increasing of the number of nodes and tasks, the communication traffic of DHRA grows slowly. That is to say, with the increasing of nodes and tasks number, DHRA greater advantages in terms of communication traffic of system. This result coincides with the analysis in Sect. 5.

6.3 Comparison of task completion time

After the comparison of communication traffic, we compare task completion time of DHRA with MinMin based on the same set of nodes and tasks. When \(n=10\), the results of makespan of different number of tasks are shown in Fig. 8. When \(n=20\), the results are Fig. 9. When \(n=30\), the results are shown in Fig. 10.

Fig. 8
figure 8

The comparison of makespan when \(n=10\)

Fig. 9
figure 9

The comparison of makespan when \(n=20\)

Fig. 10
figure 10

The comparison of makespan when \(n=30\)

As Figs. 8, 9 and 10, same to the communication traffic, the makespan of DHRA also less than MinMin, and the difference between DHRA and MinMin grow with the number of nodes and tasks. Compare between the three figures, with the increasing number of tasks at the same number of nodes, the makespan of the set of dependent tasks also increase. With the increasing number of nodes, the makespan is not increasing and sometimes is decreasing. So we conclude that DHRA efficiently decreases the communication traffic of cloud computing environment. At the same time, it not only avoid prolong the makespan, but shorten it.

7 Conclusions

In this paper, a dynamically hierarchical resource-allocation algorithm is proposed to solve the problem of extensive messages generated by the increasing of nodes in cloud computing environment. Tasks are divided into different levels based on computation load, required storage space and required disk space through fuzzy pattern recognition, and thrown into the corresponding levels of the task pool. The levels of nodes computed through the same method based on the computing power and workload are dynamically related to the corresponding task pool levels. Thus the bidding process only involves nodes and tasks of the same level and the number of messages can be reduced effectively, which means the reduction of the communication traffic, and the occupancy rates of computing, storage and communication in the system are controlled into reasonable range at the same time, making it more adaptable to the big data environment. In theoretical analysis and simulation experiments, we compared the communication traffic and the task completion time between DHRA and MinMin. The results show that DHRA can reduce message number and communication traffic significantly, with the equal or even fewer tasks completion time compared with MinMin. DHRA is proved to be efficient for resource allocation in cloud computing environment.