# Multitask Oriented Virtual Resource Integration and Optimal Scheduling in Cloud Manufacturing

Authors: Zhen Cheng; Dechen Zhan; Xibin Zhao; Hai Wan
Journal: Journal of Applied Mathematics
 (2014)

---

## Abstract

To deal with the problem of resource integration and optimal scheduling in cloud manufacturing, based on the analyzation of the existing literatures, multitask oriented virtual resource integration and optimal scheduling problem is presented from the perspective of global optimization based on the consideration of sharing and correlation among virtual resources. The correlation models of virtual resources in a task and among tasks are established. According to the correlation model and characteristics of resource sharing, the formulation in which resource time-sharing scheduling strategy is employed is put forward, and then the formulation is simplified to solve the problem easily. The genetic algorithm based on the real number matrix encoding is proposed. And crossover and mutation operation rules are designed for the real number matrix. Meanwhile, the evaluation function with the punishment mechanism and the selection strategy with pressure factor are adopted so as to approach the optimal solution more quickly. The experimental results show that the proposed model and method are feasible and effective both in situation of enough resources and limited resources in case of a large number of tasks.


---

## Body

## 1. Introduction

Cloud manufacturing is a typical model of service-oriented manufacturing [1]; its core idea is to form the pool of cloud manufacturing resource based on the virtualization for manufacturing resources and servitization for manufacturing capacity through the integration of new technologies such as cloud computing and IoT and then provide various manufacturing services which can be obtained anytime, used on demand, safe and reliable, of high-quality, and of low-cost for the full life-cycle manufacturing process, and finally to achieve customers, manufacturers, and providers value added jointly [2, 3].In cloud manufacturing service system, based on cloud manufacturing service platform, manufacturing enterprises can integrate a large number of personalized requirements to form clustering requirements and can form a dynamic entity named cloud enterprise [4] according to dynamic configuration of clustering requirements and integration of virtual manufacturing resources from the pool of cloud manufacturing resources. The cloud enterprise can provide products or services on demand and finally can satisfy personalized requirements through the optimal scheduling of virtual resources and the mapping of virtual resources and real resources.After receiving customers’ requirements, cloud manufacturing enterprise usually fulfills through several steps: (1) task classification; (2) task decomposition; (3) resource allocation; (4) resource optimal scheduling; (5) task execution and services feedback evaluation. A large number of existing literatures are based on single task [5–8]; however, tasks are received continuously in reality. If the method for single task problem is used to solve multitask problem, there would be some following shortages that the scheduling result makes every single task optimized but might not be the best in global view.(1) If multiple tasks are scheduled one by one adopting the existing single task oriented scheduling method simply, we should sort tasks using typical strategy (e.g., first-come-first-service, task priority marked, etc.) firstly and then configure optimal schedule resources for each task in turn. This makes the optimization goal that the configuration and optimal scheduling of resources only meet the current task each time. The problem is that if the key resources can meet lots of tasks, but only used in the priority task, this will lead to the optimization for multiple tasks from a global perspective that cannot be achieved. Even though the literature [9] optimized the problem from the global view, it did not consider the relationship of resources which would be emphasized in this paper.(2) Only the exclusivity of resources is considered, and the sharing of resources is not taken into account in a scheduling process. The exclusivity of resources means that if a resource is occupied or used, it cannot be used by other tasks at the same time. In the related literatures of service computing and/or cloud computing [9, 10], the exclusivity of resources means that a resource is used only once in a scheduling process, no matter how many tasks are in a scheduling process. And also the exclusivity of resources is a typical characteristic of resources scheduling in service computing and/or cloud computing environment, because the unit of time for a scheduling is usually seconds or even milliseconds, microseconds [11, 12]. However, in cloud manufacturing environment, the unit of time for resources scheduling is usually days or weeks, so in order to enhance the resources utilization, resources should be considered to reuse in other tasks when resources are free in a multiple tasks scheduling process. In this paper, we call the time division sharing of resources.(3) The optimal scheduling did not consider the correlation of resources. Resource scheduling, service selection, discovery, and composition in the literatures are based on the features of resources and/or services [13–15]. However, in fact, there are correlations among resources, particularly resources were used in tasks. Normally, for example, two consecutive subtasks in a task performed by resources of the same provider should be more efficient than different providers. Here, the same provider is the correlation of resources.In cloud manufacturing environment, tasks may be continuous, but, in this paper, we put time into segments and handle all tasks in a time slot just like planning in manufacturing enterprises. And then we could optimally schedule virtual resources at the beginning of a time slot, fully considering the correlation and sharing of resources, to break through the limitation of local optimization and to achieve the overall optimization for multiple tasks.


## 2. Problem Formulation

Just like service composition and optimal scheduling for single task, every single task of multiple tasks for optimal scheduling in cloud manufacturing also should go through decomposition, production of candidate resource sets, selection of resources, and selection of execution path. From the perspective of the execution path of subtasks and candidate resource sets, tasks will be divided into 3 categories in this paper.(1)
Different types of tasks: the execution path of subtasks and corresponding candidate resource sets are totally different. For example, tasks from logistics enterprises and tasks from manufacturing enterprises are different types.
(2)
Same type of tasks: the execution path of subtasks and corresponding candidate resource sets are totally the same. For example, multiple tasks from a certain type of product manufacturing enterprises are the same type.
(3)
Mixed types of tasks: the execution path of subtasks and corresponding candidate resource sets are partly the same. For example, multiple tasks from different types of product manufacturing enterprises are mixed types. All the tasks have different manufacturing processes but require the same cutting process.Virtual resources integration and optimal scheduling for different types of tasks could adopt the method of traditional single task execution because of totally different candidate resource sets and execution paths. And for mixed types of tasks, we will study it in the future because of its complexity. So in this paper, we will focus on the same type of tasks and study virtual resource integration and optimal scheduling.


### 2.1. Motivating Example

Before introducing the problem, an example of manufacturing process of C70E open wagon in CNR is presented to illustrate the problems that are addressed in this paper. The task of manufacturing process for C70E open wagon, denoted byTa(deliverTime, price), has five subtasks such as wheel processing, hook lock processing, body processing, assembling, painting, experiment, and delivery. Assuming the candidate set of virtual resources (VRS) for each process has three candidate virtual resources (VR), as shown in Figure 1, the first number of the candidate resource denotes the processing days and the second number denotes the cost. For example, the first number “5” of virtual resource V
R
1
1
(
5,700
) indicates the processing days and the second number “700” indicates the cost.Figure 1
Manufacturing process of C70E open wagon.When a cloud manufacturing enterprise received 3 tasks:{
T
a
1
(
30,5000
)
,
T
a
2
(
25,8000
)
,
T
a
3
(
15,10000
)
}, we can get an optimal execution path of resource integration {
P
1
,
P
2
,
P
3
} to maximize profit Max
⁡
⁡
∑
i
=
1
3
Profit
(
P
i
), using traditional heuristic method without considering the sharing and correlation of resources. However, when the cloud manufacturing enterprise receives the fourth task T
a
4
(
20,9000
) at the same time, the tasks could not be fully scheduled without considering the sharing of resources. The general method is that we could select 3 tasks {
T
a
2
,
T
a
3
,
T
a
4
} from the 4 tasks to maximize profit. But if we consider the sharing of resources, the cloud manufacturing enterprise could fully schedule the 4 tasks before the deadline of each task. The following is a feasible solution (maybe not the best solution):
(1)
P
1
〈
〈
V
R
3
1
,
V
R
3
2
,
V
R
3
3
〉
,
V
R
3
4
,
V
R
3
5
,
V
R
3
6
〉
P
2
〈
〈
V
R
2
1
,
V
R
2
2
,
V
R
2
3
〉
,
V
R
2
4
,
V
R
2
5
,
V
R
2
6
〉
P
3
〈
〈
V
R
1
1
,
V
R
1
2
,
V
R
1
3
〉
,
V
R
1
4
,
V
R
1
5
,
V
R
1
6
〉
P
4
〈
t
wait
4
,
〈
V
R
1
1
,
V
R
1
2
,
V
R
1
3
〉
,
V
R
1
4
,
V
R
1
5
,
V
R
1
6
〉
,
where t
wait
4
=
MAX
⁡
(
V
R
1
1
,
V
R
1
2
,
V
R
1
3
)
=
6. The performance period of tasks is shown in Figure 2.Figure 2
Multitask performance period.The feasible solution is that we just delayed starting the fourth taskT
a
4 6 days (t
wait
4
=
6). The feasible solution is typically considering the time division sharing of resources (V
R
1
1
,
V
R
1
2
,
V
R
1
3
,
V
R
1
4
,
V
R
1
5
,
V
R
1
6). Obviously, the feasible solution could be further optimized.On the other hand, there is correlation among resources from the manufacturing and service perspective. In this paper, we divided the correlation of resources into two categories.(1)
The correlation of resources in a task: we take the first taskT
a
1, for example, if the selected resources of the last three subtasks belong to the same provider (
V
R
3
4
·
provider
=
V
R
3
5
·
provider
=
V
R
3
6
·
provider
), the cost of V
R
3
4
,
V
R
3
5
,
V
R
3
6 will be lower than the default cost. If all of them have 10% off, the cost of execution path P
1 will decrease from 2000 to 1940.
(2)
The correlation of resources among tasks: we take the feasible solution, for example, the resourcesV
R
1
1
,
V
R
1
2
,
V
R
1
3
,
V
R
1
4
,
V
R
1
5
,
V
R
1
6 are used twice, and then the cost will be reduced per use. Assume that all of them have 5% off and the cost of path P
3 will be reduced 150, the same as P
4. Finally, the cost of solution will be reduced by 300 than without correlation among tasks.So, the sharing and correlation of resources are fully considered to realize virtual resource integration and optimal scheduling for multitask in this paper.


### 2.2. Problem Formulation

#### 2.2.1. Resource Correlation Modelling

For the correlation in a task, we use ontology to describe virtual resources firstly. The virtual resource model can be defined as a 3-tuple:VR(TRAS, CRAS, OAS), whereTRAS denotes time related attributes of virtual resources, for example, capacity and resource provider.CRAS denotes cost related attributes of virtual resources, for example, resource provider and the location of corresponding resources.OAS denotes the other attributes, for example, the size of corresponding resources. In this paper, we realize virtual resources integration and optimal scheduling for multitask from two aspects: time and cost. For the other attributes such as the reliability of virtual resources, we could also handle using the proposed method.Secondly, we can model the correlation of resources based on the virtual resource model. We take the cost of virtual resourcesC(VR) as an example to model the correlation of resources in a task, and the same as the time of virtual resourcesT(VR):
(2)
C
(
V
R
)
=
{
default
:
Value
0
;
g
1
(
V
R
S
¯
.
selected
.
C
R
A
)
:
Value
1
;
g
2
(
V
R
S
¯
.
selected
.
C
R
A
)
:
Value
2
;
…
}
,
where Value
0 denotes the default value without considering the correlation and V
R
S
¯ denotes the other candidate virtual resource sets in which the virtual resource V
R is not included. C
R
A denotes the cost related attributes; the Boolean function g is the correlation function of resources. Therefore, g
1
(
V
R
S
¯
·
selected
·
C
R
A
)
:
Value
1 denotes that if the C
R
A of the selected resource in the V
R
S
¯ makes the Boolean function g
1 true, the value of the C
(
V
R
) will be Value
1. Obviously, the Boolean function g has recursive operations; we only use NOT and AND operations as follows:
(3)
g
i
(
)
=
g
j
(
)
¯
,
i
≠
j
;
g
i
(
)
=
g
j
(
)
&&
g
k
(
)
,
i
≠
j
≠
k
.For the OR and XOR operations, we can use NOT and AND operations to realize. And NOT operation is prior to AND operation. If there are multiple correlation functions to meet at the same time, the value of theC
(
V
R
) will be selected as the minimized value because the smaller the cost is the better. For other cases, such as reliability, it is the bigger the better.Therefore, in this paper, the calculation model for time and cost based on resource correlation in a task is as follows:(4)
T
(
V
R
)
=
Min
⁡
{
Value
0
,
Value
i
}
,
where
g
i
(
)
=
true
.
(5)
C
(
V
R
)
=
Min
⁡
{
Value
0
,
Value
i
}
,
where
g
i
(
)
=
true
;We will take a detailed example to illustrate the correlation of resources in a task. We still take the cost ofV
R
3
4 in the feasible solution P
1 as an example to model the correlation. Firstly, we build the ontology description model of V
R
3
4 as follows: V
R
3
4
(
{
⋯
}
,
{
C
N
R
,
Q
i
Q
i
H
a
e
r
,
…
}
,
{
⋯
}
), where the first set isTRAS, and the third set isOAS. The second set is the value ofCRAS; that is to say the provider of V
R
3
4 isCNR, and the location isQiQiHaer. Then, we can build the cost calculation model C
(
V
R
3
4
) as follows:
(6)
C
(
V
R
3
4
)
=
{
default
:
300
;
V
R
S
5
.
selected
.
provider
=
C
N
R
:
285
;
V
R
S
5
.
selected
.
provider
=
C
N
R
&
&
V
R
S
6
.
selected
.
provider
=
C
N
R
:
270
;
V
R
S
5
.
selected
.
location
=
Q
i
Q
i
H
a
e
r
:
295
…
}
.In the above model, the default cost of usingV
R
3
4 is 300. If the provider of the selected resources of V
R
S
5 corresponding to the fifth subtask is alsoCNR, the cost of using V
R
3
4 will be 285. And further, if the provider of the sixth subtask is alsoCNR, the cost of using V
R
3
4 will be 270. If the location of the selected resources of V
R
S
5 corresponding to the fifth subtask isQiQiHaer, the cost of using V
R
3
4 will be 295. Obviously, if the provider of the fifth subtask is the same as the sixth subtask and also is theCNR, the second and the third correlation functions in the above model are met at the same time. According to the features of cost, the minimized value 270 (the third correlation function) will be selected.For the correlation among tasks, we also take the cost of virtual resourcesC
(
V
R
) as an example to model the correlation of resources among tasks, and the same as the time of virtual resources T
(
V
R
):
(7)
C
(
V
R
)
=
{
default
:
defaultValue
;
Value
2
correlationFunc
1
(
DefaultValue
)
:
Value
1
;
correlationFunc
2
(
DefaultValue
)
:
Value
2
;
…
}
,
where DefaultValue is calculated by formula (5). correlationFunc
1
(
DefaultValue
)
:
Value
1 denotes that if the selected resources in a scheduling process satisfy the correlation function correlationFunc
1, the value of the C
(
V
R
) will be Value
1. For example, the cost per use may be reduced according to the increased times of use. And then, we can simply define the correlationFunc
1 as follows:
(8)
correlationFunc
1
=
DefaultValue
*
Dec
(
V
R
)
Num
(
V
R
)
-
1
,
where Num
(
V
R
) is the times of using V
R and Dec
(
V
R
) denotes cost decay rate.Again, in this paper, the calculation model for time and cost based on resource correlation among tasks is as follows:(9)
T
(
V
R
)
=
Min
⁡
⁡
{
Value
0
,
Value
i
}
,
C
(
V
R
)
=
Min
⁡
⁡
{
Value
0
,
Value
i
}
.


#### 2.2.2. Problem Formulation

Taking account of all the above features, we give the problem description as follows.LetT
a
=
{
T
a
1
,
T
a
2
,
…
,
T
a
n
} denote the same type of tasks which the cloud manufacturing enterprise receives within a period of time. Each task has corresponding bid price {
Price
1
,
Price
2
,
…
,
Price
n
}. Let {
T
1
,
T
2
,
…
,
T
n
} denote the number of days to delivery date for each task. And each task can be decomposed to J subtasks. Let P
=
{
P
1
,
P
2
,
…
,
P
m
} be a feasible solution. Each subtask can be executed by a resource of the corresponding candidate resource set V
R
S
j
i. And there are J
K resources {

V
R
j
i
1
,
V
R
j
i
2
,
…
,
V
R
j
i
K
} in each candidate resource set V
R
S
j
i. Then the feasible solution should be under the following constraints:
(10)
m
≤
n
(11)
T
(
P
i
)
≤
T
(
T
a
(
P
i
)
)
(12)
if
V
R
j
i
K
[
t
1
,
t
2
]
∈
P
i
,
V
R
j
i
K
[
t
1
,
t
2
]
∉
⋃
P
p
,
a
a
a
a
a
a
i
i
≠
p
;
1
≤
p
≤
m
.The constraint (10) means that some tasks may be not executed. In constraint (11), T
a
(
P
i
) denotes the task corresponding to the feasible solution P
i. And constraint (11) means that all the executed tasks must be finished before delivery date. Constraints (12) mean that the exclusivity and sharing are considered for each selected resource. If the V
R
j
i
K was used by P
i in the period of [
t
1
,
t
2
], it cannot be used in any other P
p
(
i
≠
p
) at the same time, but it can be used in any other period.How to evaluate the feasible solution? From the perspective of cloud manufacturing enterprise, the following objects should be considered.(i)
The more the profit the better:(13)
MAX
⁡
∑
i
=
1
m
Profit
(
P
i
)
,
where Profit
(
P
i
)
=
Price
(
T
a
(
P
i
)
)
-
C
(
P
i
).
(ii)
The bigger the number of tasks that can be executed the better:(14)
MAX
⁡
(
m
)
.The above two objects are not necessarily linear relations. For an extreme example, the profit of a task may be more than all the other tasks in an enterprise. In reality, it is also meaningful. For example, a start-up cloud manufacturing enterprise may reduce some profits to get more customers, then get more market share, and finally get more profits.


### 2.3. Model Analysis

Obviously, the problem of multitask oriented virtual resource integration and optimal scheduling in cloud manufacturing belongs to the multiobjective optimization problem. Such problems can usually be solved by Pareto optimal method and can also be transformed to single objective to solve by weighting method. In this paper, we transform the multiple objectives to single objective as follows by linear weighting method:(15)
MAX
⁡
(
α
*
∑
i
=
1
m
Profit
(
P
i
)
+
β
*
m
)
,
where α and β are the corresponding weighted parameters to control the relative significance of each objective, and α
+
β
=
1. The values will be given according to the target of the optimization.In order to reduce the number of variables in the model and obtain more convenience to solve the problem, we normalize and handle theProfit
(
P
i
) as follows:
(16)
Profit
(
P
i
)
¯
=
Profit
(
P
i
)
-
Min
⁡
(
Profit
(
P
i
)
)
Max
⁡
(
Profit
(
P
i
)
)
-
Min
⁡
(
Profit
(
P
i
)
)
.The variablesX
=
(
x
1
,
x
2
,
…
,
x
n
) are given, where x
i is Boolean value. If the value of x
i is 1, the task T
a
i will be executed. Otherwise, the task T
a
i will not be executed. And then (15) can be transformed as follows:
(17)
MAX
(
α
*
∑
i
=
1
n
(
Profit
(
T
a
i
)
¯
*
x
i
)
+
β
*
∑
i
=
1
n
x
i
)
.Therefore, (11) can be transformed as follows:
(18)
T
(
P
i
)
*
x
i
≤
T
i
*
x
i
.In order to simplify (12), it is assumed that we will schedule tasks in the future period T and divide T into several equal parts. Therefore, in any period t
∈
T, we will give the Boolean variable y
(
i
,
j
,
k
,
t
)
·
y
(
i
,
j
,
k
,
t
) which denotes that if the kth virtual resource in the candidate resource set V
R
S
j
i is selected to execute the task T
a
i in the period t, the variable y
(
i
,
j
,
k
,
t
) will be true. Otherwise, the variable y
(
i
,
j
,
k
,
t
) will be false. And then (12) will be transformed as follows:
(19)
∑
i
=
1
n
y
(
i
,
j
,
k
,
t
)
≤
1
,
∀
t
∈
T
,
j
,
k
fixed
.Meanwhile, the variabley
(
i
,
j
,
k
,
t
) should satisfy the following constraint to ensure that a subtask is only executed by a resource in the period t:
(20)
∑
k
=
1
J
k
y
(
i
,
j
,
k
,
t
)
≤
1
,
∀
t
∈
T
,
i
,
j
fixed
.Therefore, the mathematical formulations for multitask oriented virtual resource integration and optimal scheduling in cloud manufacturing are as follows: (17) subject to (18), (19), (20), and (21). Consider that
(21)
x
i
∈
{
0,1
}
,
1
≤
i
≤
n
.Apparently, the above problem belongs to NP-hard problem.


## 2.1. Motivating Example

Before introducing the problem, an example of manufacturing process of C70E open wagon in CNR is presented to illustrate the problems that are addressed in this paper. The task of manufacturing process for C70E open wagon, denoted byTa(deliverTime, price), has five subtasks such as wheel processing, hook lock processing, body processing, assembling, painting, experiment, and delivery. Assuming the candidate set of virtual resources (VRS) for each process has three candidate virtual resources (VR), as shown in Figure 1, the first number of the candidate resource denotes the processing days and the second number denotes the cost. For example, the first number “5” of virtual resource V
R
1
1
(
5,700
) indicates the processing days and the second number “700” indicates the cost.Figure 1
Manufacturing process of C70E open wagon.When a cloud manufacturing enterprise received 3 tasks:{
T
a
1
(
30,5000
)
,
T
a
2
(
25,8000
)
,
T
a
3
(
15,10000
)
}, we can get an optimal execution path of resource integration {
P
1
,
P
2
,
P
3
} to maximize profit Max
⁡
⁡
∑
i
=
1
3
Profit
(
P
i
), using traditional heuristic method without considering the sharing and correlation of resources. However, when the cloud manufacturing enterprise receives the fourth task T
a
4
(
20,9000
) at the same time, the tasks could not be fully scheduled without considering the sharing of resources. The general method is that we could select 3 tasks {
T
a
2
,
T
a
3
,
T
a
4
} from the 4 tasks to maximize profit. But if we consider the sharing of resources, the cloud manufacturing enterprise could fully schedule the 4 tasks before the deadline of each task. The following is a feasible solution (maybe not the best solution):
(1)
P
1
〈
〈
V
R
3
1
,
V
R
3
2
,
V
R
3
3
〉
,
V
R
3
4
,
V
R
3
5
,
V
R
3
6
〉
P
2
〈
〈
V
R
2
1
,
V
R
2
2
,
V
R
2
3
〉
,
V
R
2
4
,
V
R
2
5
,
V
R
2
6
〉
P
3
〈
〈
V
R
1
1
,
V
R
1
2
,
V
R
1
3
〉
,
V
R
1
4
,
V
R
1
5
,
V
R
1
6
〉
P
4
〈
t
wait
4
,
〈
V
R
1
1
,
V
R
1
2
,
V
R
1
3
〉
,
V
R
1
4
,
V
R
1
5
,
V
R
1
6
〉
,
where t
wait
4
=
MAX
⁡
(
V
R
1
1
,
V
R
1
2
,
V
R
1
3
)
=
6. The performance period of tasks is shown in Figure 2.Figure 2
Multitask performance period.The feasible solution is that we just delayed starting the fourth taskT
a
4 6 days (t
wait
4
=
6). The feasible solution is typically considering the time division sharing of resources (V
R
1
1
,
V
R
1
2
,
V
R
1
3
,
V
R
1
4
,
V
R
1
5
,
V
R
1
6). Obviously, the feasible solution could be further optimized.On the other hand, there is correlation among resources from the manufacturing and service perspective. In this paper, we divided the correlation of resources into two categories.(1)
The correlation of resources in a task: we take the first taskT
a
1, for example, if the selected resources of the last three subtasks belong to the same provider (
V
R
3
4
·
provider
=
V
R
3
5
·
provider
=
V
R
3
6
·
provider
), the cost of V
R
3
4
,
V
R
3
5
,
V
R
3
6 will be lower than the default cost. If all of them have 10% off, the cost of execution path P
1 will decrease from 2000 to 1940.
(2)
The correlation of resources among tasks: we take the feasible solution, for example, the resourcesV
R
1
1
,
V
R
1
2
,
V
R
1
3
,
V
R
1
4
,
V
R
1
5
,
V
R
1
6 are used twice, and then the cost will be reduced per use. Assume that all of them have 5% off and the cost of path P
3 will be reduced 150, the same as P
4. Finally, the cost of solution will be reduced by 300 than without correlation among tasks.So, the sharing and correlation of resources are fully considered to realize virtual resource integration and optimal scheduling for multitask in this paper.


## 2.2. Problem Formulation

### 2.2.1. Resource Correlation Modelling

For the correlation in a task, we use ontology to describe virtual resources firstly. The virtual resource model can be defined as a 3-tuple:VR(TRAS, CRAS, OAS), whereTRAS denotes time related attributes of virtual resources, for example, capacity and resource provider.CRAS denotes cost related attributes of virtual resources, for example, resource provider and the location of corresponding resources.OAS denotes the other attributes, for example, the size of corresponding resources. In this paper, we realize virtual resources integration and optimal scheduling for multitask from two aspects: time and cost. For the other attributes such as the reliability of virtual resources, we could also handle using the proposed method.Secondly, we can model the correlation of resources based on the virtual resource model. We take the cost of virtual resourcesC(VR) as an example to model the correlation of resources in a task, and the same as the time of virtual resourcesT(VR):
(2)
C
(
V
R
)
=
{
default
:
Value
0
;
g
1
(
V
R
S
¯
.
selected
.
C
R
A
)
:
Value
1
;
g
2
(
V
R
S
¯
.
selected
.
C
R
A
)
:
Value
2
;
…
}
,
where Value
0 denotes the default value without considering the correlation and V
R
S
¯ denotes the other candidate virtual resource sets in which the virtual resource V
R is not included. C
R
A denotes the cost related attributes; the Boolean function g is the correlation function of resources. Therefore, g
1
(
V
R
S
¯
·
selected
·
C
R
A
)
:
Value
1 denotes that if the C
R
A of the selected resource in the V
R
S
¯ makes the Boolean function g
1 true, the value of the C
(
V
R
) will be Value
1. Obviously, the Boolean function g has recursive operations; we only use NOT and AND operations as follows:
(3)
g
i
(
)
=
g
j
(
)
¯
,
i
≠
j
;
g
i
(
)
=
g
j
(
)
&&
g
k
(
)
,
i
≠
j
≠
k
.For the OR and XOR operations, we can use NOT and AND operations to realize. And NOT operation is prior to AND operation. If there are multiple correlation functions to meet at the same time, the value of theC
(
V
R
) will be selected as the minimized value because the smaller the cost is the better. For other cases, such as reliability, it is the bigger the better.Therefore, in this paper, the calculation model for time and cost based on resource correlation in a task is as follows:(4)
T
(
V
R
)
=
Min
⁡
{
Value
0
,
Value
i
}
,
where
g
i
(
)
=
true
.
(5)
C
(
V
R
)
=
Min
⁡
{
Value
0
,
Value
i
}
,
where
g
i
(
)
=
true
;We will take a detailed example to illustrate the correlation of resources in a task. We still take the cost ofV
R
3
4 in the feasible solution P
1 as an example to model the correlation. Firstly, we build the ontology description model of V
R
3
4 as follows: V
R
3
4
(
{
⋯
}
,
{
C
N
R
,
Q
i
Q
i
H
a
e
r
,
…
}
,
{
⋯
}
), where the first set isTRAS, and the third set isOAS. The second set is the value ofCRAS; that is to say the provider of V
R
3
4 isCNR, and the location isQiQiHaer. Then, we can build the cost calculation model C
(
V
R
3
4
) as follows:
(6)
C
(
V
R
3
4
)
=
{
default
:
300
;
V
R
S
5
.
selected
.
provider
=
C
N
R
:
285
;
V
R
S
5
.
selected
.
provider
=
C
N
R
&
&
V
R
S
6
.
selected
.
provider
=
C
N
R
:
270
;
V
R
S
5
.
selected
.
location
=
Q
i
Q
i
H
a
e
r
:
295
…
}
.In the above model, the default cost of usingV
R
3
4 is 300. If the provider of the selected resources of V
R
S
5 corresponding to the fifth subtask is alsoCNR, the cost of using V
R
3
4 will be 285. And further, if the provider of the sixth subtask is alsoCNR, the cost of using V
R
3
4 will be 270. If the location of the selected resources of V
R
S
5 corresponding to the fifth subtask isQiQiHaer, the cost of using V
R
3
4 will be 295. Obviously, if the provider of the fifth subtask is the same as the sixth subtask and also is theCNR, the second and the third correlation functions in the above model are met at the same time. According to the features of cost, the minimized value 270 (the third correlation function) will be selected.For the correlation among tasks, we also take the cost of virtual resourcesC
(
V
R
) as an example to model the correlation of resources among tasks, and the same as the time of virtual resources T
(
V
R
):
(7)
C
(
V
R
)
=
{
default
:
defaultValue
;
Value
2
correlationFunc
1
(
DefaultValue
)
:
Value
1
;
correlationFunc
2
(
DefaultValue
)
:
Value
2
;
…
}
,
where DefaultValue is calculated by formula (5). correlationFunc
1
(
DefaultValue
)
:
Value
1 denotes that if the selected resources in a scheduling process satisfy the correlation function correlationFunc
1, the value of the C
(
V
R
) will be Value
1. For example, the cost per use may be reduced according to the increased times of use. And then, we can simply define the correlationFunc
1 as follows:
(8)
correlationFunc
1
=
DefaultValue
*
Dec
(
V
R
)
Num
(
V
R
)
-
1
,
where Num
(
V
R
) is the times of using V
R and Dec
(
V
R
) denotes cost decay rate.Again, in this paper, the calculation model for time and cost based on resource correlation among tasks is as follows:(9)
T
(
V
R
)
=
Min
⁡
⁡
{
Value
0
,
Value
i
}
,
C
(
V
R
)
=
Min
⁡
⁡
{
Value
0
,
Value
i
}
.


### 2.2.2. Problem Formulation

Taking account of all the above features, we give the problem description as follows.LetT
a
=
{
T
a
1
,
T
a
2
,
…
,
T
a
n
} denote the same type of tasks which the cloud manufacturing enterprise receives within a period of time. Each task has corresponding bid price {
Price
1
,
Price
2
,
…
,
Price
n
}. Let {
T
1
,
T
2
,
…
,
T
n
} denote the number of days to delivery date for each task. And each task can be decomposed to J subtasks. Let P
=
{
P
1
,
P
2
,
…
,
P
m
} be a feasible solution. Each subtask can be executed by a resource of the corresponding candidate resource set V
R
S
j
i. And there are J
K resources {

V
R
j
i
1
,
V
R
j
i
2
,
…
,
V
R
j
i
K
} in each candidate resource set V
R
S
j
i. Then the feasible solution should be under the following constraints:
(10)
m
≤
n
(11)
T
(
P
i
)
≤
T
(
T
a
(
P
i
)
)
(12)
if
V
R
j
i
K
[
t
1
,
t
2
]
∈
P
i
,
V
R
j
i
K
[
t
1
,
t
2
]
∉
⋃
P
p
,
a
a
a
a
a
a
i
i
≠
p
;
1
≤
p
≤
m
.The constraint (10) means that some tasks may be not executed. In constraint (11), T
a
(
P
i
) denotes the task corresponding to the feasible solution P
i. And constraint (11) means that all the executed tasks must be finished before delivery date. Constraints (12) mean that the exclusivity and sharing are considered for each selected resource. If the V
R
j
i
K was used by P
i in the period of [
t
1
,
t
2
], it cannot be used in any other P
p
(
i
≠
p
) at the same time, but it can be used in any other period.How to evaluate the feasible solution? From the perspective of cloud manufacturing enterprise, the following objects should be considered.(i)
The more the profit the better:(13)
MAX
⁡
∑
i
=
1
m
Profit
(
P
i
)
,
where Profit
(
P
i
)
=
Price
(
T
a
(
P
i
)
)
-
C
(
P
i
).
(ii)
The bigger the number of tasks that can be executed the better:(14)
MAX
⁡
(
m
)
.The above two objects are not necessarily linear relations. For an extreme example, the profit of a task may be more than all the other tasks in an enterprise. In reality, it is also meaningful. For example, a start-up cloud manufacturing enterprise may reduce some profits to get more customers, then get more market share, and finally get more profits.


## 2.2.1. Resource Correlation Modelling

For the correlation in a task, we use ontology to describe virtual resources firstly. The virtual resource model can be defined as a 3-tuple:VR(TRAS, CRAS, OAS), whereTRAS denotes time related attributes of virtual resources, for example, capacity and resource provider.CRAS denotes cost related attributes of virtual resources, for example, resource provider and the location of corresponding resources.OAS denotes the other attributes, for example, the size of corresponding resources. In this paper, we realize virtual resources integration and optimal scheduling for multitask from two aspects: time and cost. For the other attributes such as the reliability of virtual resources, we could also handle using the proposed method.Secondly, we can model the correlation of resources based on the virtual resource model. We take the cost of virtual resourcesC(VR) as an example to model the correlation of resources in a task, and the same as the time of virtual resourcesT(VR):
(2)
C
(
V
R
)
=
{
default
:
Value
0
;
g
1
(
V
R
S
¯
.
selected
.
C
R
A
)
:
Value
1
;
g
2
(
V
R
S
¯
.
selected
.
C
R
A
)
:
Value
2
;
…
}
,
where Value
0 denotes the default value without considering the correlation and V
R
S
¯ denotes the other candidate virtual resource sets in which the virtual resource V
R is not included. C
R
A denotes the cost related attributes; the Boolean function g is the correlation function of resources. Therefore, g
1
(
V
R
S
¯
·
selected
·
C
R
A
)
:
Value
1 denotes that if the C
R
A of the selected resource in the V
R
S
¯ makes the Boolean function g
1 true, the value of the C
(
V
R
) will be Value
1. Obviously, the Boolean function g has recursive operations; we only use NOT and AND operations as follows:
(3)
g
i
(
)
=
g
j
(
)
¯
,
i
≠
j
;
g
i
(
)
=
g
j
(
)
&&
g
k
(
)
,
i
≠
j
≠
k
.For the OR and XOR operations, we can use NOT and AND operations to realize. And NOT operation is prior to AND operation. If there are multiple correlation functions to meet at the same time, the value of theC
(
V
R
) will be selected as the minimized value because the smaller the cost is the better. For other cases, such as reliability, it is the bigger the better.Therefore, in this paper, the calculation model for time and cost based on resource correlation in a task is as follows:(4)
T
(
V
R
)
=
Min
⁡
{
Value
0
,
Value
i
}
,
where
g
i
(
)
=
true
.
(5)
C
(
V
R
)
=
Min
⁡
{
Value
0
,
Value
i
}
,
where
g
i
(
)
=
true
;We will take a detailed example to illustrate the correlation of resources in a task. We still take the cost ofV
R
3
4 in the feasible solution P
1 as an example to model the correlation. Firstly, we build the ontology description model of V
R
3
4 as follows: V
R
3
4
(
{
⋯
}
,
{
C
N
R
,
Q
i
Q
i
H
a
e
r
,
…
}
,
{
⋯
}
), where the first set isTRAS, and the third set isOAS. The second set is the value ofCRAS; that is to say the provider of V
R
3
4 isCNR, and the location isQiQiHaer. Then, we can build the cost calculation model C
(
V
R
3
4
) as follows:
(6)
C
(
V
R
3
4
)
=
{
default
:
300
;
V
R
S
5
.
selected
.
provider
=
C
N
R
:
285
;
V
R
S
5
.
selected
.
provider
=
C
N
R
&
&
V
R
S
6
.
selected
.
provider
=
C
N
R
:
270
;
V
R
S
5
.
selected
.
location
=
Q
i
Q
i
H
a
e
r
:
295
…
}
.In the above model, the default cost of usingV
R
3
4 is 300. If the provider of the selected resources of V
R
S
5 corresponding to the fifth subtask is alsoCNR, the cost of using V
R
3
4 will be 285. And further, if the provider of the sixth subtask is alsoCNR, the cost of using V
R
3
4 will be 270. If the location of the selected resources of V
R
S
5 corresponding to the fifth subtask isQiQiHaer, the cost of using V
R
3
4 will be 295. Obviously, if the provider of the fifth subtask is the same as the sixth subtask and also is theCNR, the second and the third correlation functions in the above model are met at the same time. According to the features of cost, the minimized value 270 (the third correlation function) will be selected.For the correlation among tasks, we also take the cost of virtual resourcesC
(
V
R
) as an example to model the correlation of resources among tasks, and the same as the time of virtual resources T
(
V
R
):
(7)
C
(
V
R
)
=
{
default
:
defaultValue
;
Value
2
correlationFunc
1
(
DefaultValue
)
:
Value
1
;
correlationFunc
2
(
DefaultValue
)
:
Value
2
;
…
}
,
where DefaultValue is calculated by formula (5). correlationFunc
1
(
DefaultValue
)
:
Value
1 denotes that if the selected resources in a scheduling process satisfy the correlation function correlationFunc
1, the value of the C
(
V
R
) will be Value
1. For example, the cost per use may be reduced according to the increased times of use. And then, we can simply define the correlationFunc
1 as follows:
(8)
correlationFunc
1
=
DefaultValue
*
Dec
(
V
R
)
Num
(
V
R
)
-
1
,
where Num
(
V
R
) is the times of using V
R and Dec
(
V
R
) denotes cost decay rate.Again, in this paper, the calculation model for time and cost based on resource correlation among tasks is as follows:(9)
T
(
V
R
)
=
Min
⁡
⁡
{
Value
0
,
Value
i
}
,
C
(
V
R
)
=
Min
⁡
⁡
{
Value
0
,
Value
i
}
.


## 2.2.2. Problem Formulation

Taking account of all the above features, we give the problem description as follows.LetT
a
=
{
T
a
1
,
T
a
2
,
…
,
T
a
n
} denote the same type of tasks which the cloud manufacturing enterprise receives within a period of time. Each task has corresponding bid price {
Price
1
,
Price
2
,
…
,
Price
n
}. Let {
T
1
,
T
2
,
…
,
T
n
} denote the number of days to delivery date for each task. And each task can be decomposed to J subtasks. Let P
=
{
P
1
,
P
2
,
…
,
P
m
} be a feasible solution. Each subtask can be executed by a resource of the corresponding candidate resource set V
R
S
j
i. And there are J
K resources {

V
R
j
i
1
,
V
R
j
i
2
,
…
,
V
R
j
i
K
} in each candidate resource set V
R
S
j
i. Then the feasible solution should be under the following constraints:
(10)
m
≤
n
(11)
T
(
P
i
)
≤
T
(
T
a
(
P
i
)
)
(12)
if
V
R
j
i
K
[
t
1
,
t
2
]
∈
P
i
,
V
R
j
i
K
[
t
1
,
t
2
]
∉
⋃
P
p
,
a
a
a
a
a
a
i
i
≠
p
;
1
≤
p
≤
m
.The constraint (10) means that some tasks may be not executed. In constraint (11), T
a
(
P
i
) denotes the task corresponding to the feasible solution P
i. And constraint (11) means that all the executed tasks must be finished before delivery date. Constraints (12) mean that the exclusivity and sharing are considered for each selected resource. If the V
R
j
i
K was used by P
i in the period of [
t
1
,
t
2
], it cannot be used in any other P
p
(
i
≠
p
) at the same time, but it can be used in any other period.How to evaluate the feasible solution? From the perspective of cloud manufacturing enterprise, the following objects should be considered.(i)
The more the profit the better:(13)
MAX
⁡
∑
i
=
1
m
Profit
(
P
i
)
,
where Profit
(
P
i
)
=
Price
(
T
a
(
P
i
)
)
-
C
(
P
i
).
(ii)
The bigger the number of tasks that can be executed the better:(14)
MAX
⁡
(
m
)
.The above two objects are not necessarily linear relations. For an extreme example, the profit of a task may be more than all the other tasks in an enterprise. In reality, it is also meaningful. For example, a start-up cloud manufacturing enterprise may reduce some profits to get more customers, then get more market share, and finally get more profits.


## 2.3. Model Analysis

Obviously, the problem of multitask oriented virtual resource integration and optimal scheduling in cloud manufacturing belongs to the multiobjective optimization problem. Such problems can usually be solved by Pareto optimal method and can also be transformed to single objective to solve by weighting method. In this paper, we transform the multiple objectives to single objective as follows by linear weighting method:(15)
MAX
⁡
(
α
*
∑
i
=
1
m
Profit
(
P
i
)
+
β
*
m
)
,
where α and β are the corresponding weighted parameters to control the relative significance of each objective, and α
+
β
=
1. The values will be given according to the target of the optimization.In order to reduce the number of variables in the model and obtain more convenience to solve the problem, we normalize and handle theProfit
(
P
i
) as follows:
(16)
Profit
(
P
i
)
¯
=
Profit
(
P
i
)
-
Min
⁡
(
Profit
(
P
i
)
)
Max
⁡
(
Profit
(
P
i
)
)
-
Min
⁡
(
Profit
(
P
i
)
)
.The variablesX
=
(
x
1
,
x
2
,
…
,
x
n
) are given, where x
i is Boolean value. If the value of x
i is 1, the task T
a
i will be executed. Otherwise, the task T
a
i will not be executed. And then (15) can be transformed as follows:
(17)
MAX
(
α
*
∑
i
=
1
n
(
Profit
(
T
a
i
)
¯
*
x
i
)
+
β
*
∑
i
=
1
n
x
i
)
.Therefore, (11) can be transformed as follows:
(18)
T
(
P
i
)
*
x
i
≤
T
i
*
x
i
.In order to simplify (12), it is assumed that we will schedule tasks in the future period T and divide T into several equal parts. Therefore, in any period t
∈
T, we will give the Boolean variable y
(
i
,
j
,
k
,
t
)
·
y
(
i
,
j
,
k
,
t
) which denotes that if the kth virtual resource in the candidate resource set V
R
S
j
i is selected to execute the task T
a
i in the period t, the variable y
(
i
,
j
,
k
,
t
) will be true. Otherwise, the variable y
(
i
,
j
,
k
,
t
) will be false. And then (12) will be transformed as follows:
(19)
∑
i
=
1
n
y
(
i
,
j
,
k
,
t
)
≤
1
,
∀
t
∈
T
,
j
,
k
fixed
.Meanwhile, the variabley
(
i
,
j
,
k
,
t
) should satisfy the following constraint to ensure that a subtask is only executed by a resource in the period t:
(20)
∑
k
=
1
J
k
y
(
i
,
j
,
k
,
t
)
≤
1
,
∀
t
∈
T
,
i
,
j
fixed
.Therefore, the mathematical formulations for multitask oriented virtual resource integration and optimal scheduling in cloud manufacturing are as follows: (17) subject to (18), (19), (20), and (21). Consider that
(21)
x
i
∈
{
0,1
}
,
1
≤
i
≤
n
.Apparently, the above problem belongs to NP-hard problem.


## 3. Virtual Resource Integration and Optimal Scheduling

GA is a population-based stochastic optimization technique inspired by the mechanism of natural selection and evolution. According to the code of solution space and the operation of the decision variables for the problem, GA can get the proximate optimal solution quickly by guided search in the total solution space. Therefore, GA is usually used to solve the problem of composition and optimal scheduling under the complex constraints.In this paper, we adopt GA based on the real number matrix code to solve the problem of multitask oriented virtual resource integration and optimal scheduling in cloud manufacturing.


### 3.1. Chromosomal Representation

The solution is coded as the following real number matrix:(22)
A
=
[
a
111
a
121
…
a
1
J
1
…
a
11
T
a
12
T
…
a
1
J
T
a
211
a
221
…
a
2
J
1
…
a
21
T
a
22
T
…
a
2
J
T
…
…
…
…
…
…
…
…
…
a
n
11
a
n
21
…
a
n
J
1
…
a
n
1
T
a
n
2
T
…
a
n
J
T
]
.Each row of matrixA denotes a task. The columns in matrix A are divided into T parts, each part indicates a period t, and, in each part, there are J columns which denote J subtasks in each task. Therefore, there are T
×
J columns in the matrix A, and the subscript meanings of the element a
i
j
t in the matrix A are as follows:i: the identification of the ith task;
j: the jth subtask of the task;
t: the tth period.The value of the matrix elementa
i
j
t is an integer from [
0
,
J
k
]. It means that the a
i
j
tth virtual resource in the jth candidate resource set is selected to execute the task T
a
i in the period t where a
i
j
t
≠
0. Otherwise, the jth subtask of the task T
a
i in the period t will not be executed.The matrix is related to the variables as follows.(i)
If the values of theith row in the matrix are all 0, the ith task T
a
i will not be executed, and then the variable x
i equals 0. Otherwise, the value of the variable x
i is 1.
(ii)
Ifa
i
j
t
≠
0 in the period t, the variable y
(
i
,
j
,
a
i
j
t
,
t
) equals 1, and then the values of all the other rows in the jth column of the tth part cannot equal a
i
j
t which is expressed as y
(
i
′
,
j
,
a
i
j
t
,
t
)
=
0, where i
′
≠
i. Obviously, the constraint (19) is satisfied.
(iii)
Ifa
i
j
t
≠
0 in the period t, the variable y
(
i
,
j
,
a
i
j
t
,
t
) equals 1, and then for the same i and j, y
(
i
,
j
,
k
,
t
)
=
0, where k
≠
a
i
j
t and k
∈
[
0
,
J
k
]. Obviously, the constraint (20) is satisfied.


### 3.2. Initial Population

Each individual in the initial population is generated randomly column by column as follows so as to ensure the individual randomness and avoid the local optimization.(i)
In the period oft
=
0, we used the following method to generate the first column value. If the number of tasks is less than the number of virtual resources in the corresponding candidate resources set, that is, n
≤
J
k, we will randomly select n values from [
0
,
J
k
] to form a random sequence as the first column. Otherwise, we will select all of the J
k values and n
-
J
k zeros to form a random sequence as the first column. After that the value of all the other J
-
1 columns in the period of t
=
0 will be zero according to the rule that any task can be transformed to the sequence process [13].
(ii)
In the period oft
>
0, we firstly see the corresponding column of the period t
-
1. If the jth subtask is not finished in the period t
-
1, then a
i
j
t
=
a
i
j
(
t
-
1
). If the subtask is finished, then a
i
j
t
=
0 and a
i
(
j
+
1
)
t
≠
0 at the same time. The value of the a
i
(
j
+
1
)
t should be randomly picked from the remaining numbers after being finished by a
i
(
j
+
1
)
t
=
a
i
(
j
+
1
)
(
t
-
1
).


### 3.3. Crossover and Mutation

Because of the real number encoding of the solution, the traditional crossover and mutation operators of the Boolean value cannot be simply used in this paper. We design the crossover and mutation operators as follows.(1) Row-Based Crossover. We will firstly generate ann-dimension Boolean type column vector V
C. We will swap the ith row of the two parent matrices if V
C
i
=
1, do nothing if V
C
i
=
0, and finally generate the new two matrices. The constraints may not be satisfied, that there may be the same nonzero number in the same column after row-based crossover operating. Therefore, we must run the following fixed program to make the new two matrices satisfy the constraints. See Algorithm 1.Algorithm 1:
(1) For 1 toT
×
J // looped by columns
(2)For 1 to n //checked by rows
(3)If a
i
j
t
=
0, jump to Step  2;
(4)Else
IfV
C
i
=
0, jump to Step  2;
Else
If not existed the same non-zero number, jump to
Step  2;
Else
Randomly  selected a number from the difference
set between the[
0
,
J
k
] set and the current column
value set to replay. If the difference sets isØ, then
seta
i
j
t
=
0;
(5)For End
(6) For End(2) Column-Based Crossover. Similar to the row-based crossover, we will firstly generate aT
×
J-dimension Boolean type row vector V
C. We will swap the j
tth row of the two parent matrixes if V
C
j
t
=
1, do nothing if V
C
j
t
=
0, and finally generate the new two matrixes. Obviously, the new two matrixes also satisfy the constraints.(3) Block-Based Crossover. Block-based crossover is operated for the unit of block corresponding to the period oft. Therefore, we will generate a T-dimension Boolean type row vector V
C. We will swap the tth block of the two parent matrixes if V
C
t
=
1, do nothing if V
C
t
=
0, and finally generate the new two matrices. Obviously, similar to the column-based crossover, the new two matrices also satisfy the constraints.(4) Row-Based Mutation. Firstly, we give the mutation rules. We will change the value as follows if the value is not zero and do not change the value if the value is zero:(23)
a
i
j
t
=
J
k
-
a
i
j
t
+
1
.For the row-based mutation, we will firstly generate at-dimension Boolean type column vector V
C. We will change all of nonzero number according to the above rule in the ith row of the parent matrix if V
C
i
=
1, do nothing if V
C
i
=
0, and finally generate the new matrix. The constraints may not be satisfied that there may be the same nonzero number in the same column after row-based mutation operating. Therefore, we must run the above fixed program to make the new matrix satisfy the constraints.(5) Column-Based Mutation. Similar to the row-based mutation, We will firstly generate aT
×
J-dimension Boolean type row vector V
C. We will change all of nonzero number according to the above rule in the j
tth row of the parent matrix if V
C
j
t
=
1, do nothing if V
C
j
t
=
0, and finally generate the new matrix. Obviously, the new matrices also satisfy the constraints.(6) Block-Based Mutation. Similar to the block-based crossover, block-based mutation is also operated for the unit of block corresponding to the period oft. Therefore, we will generate a T-dimension Boolean type row vector V
C. We will change all of nonzero numbers according to the above rule in the tth block of the parent matrix if V
C
t
=
1, do nothing if V
C
t
=
0, and finally generate the new matrix. The constraints may not be satisfied that there may be the same nonzero number in the same column after block-based mutation operating. Therefore, we must run the above fixed program to make the new matrix satisfy the constraints.


### 3.4. Fitness Function and Selection Strategy

Based on the objective function, the fitness function will be given in this paper as follows:(24)
F
=
(
α
*
∑
i
=
1
n
(
Profit
(
T
a
i
)
¯
*
x
i
)
+
β
*
∑
i
=
1
n
x
i
)
.So as to select the new generation population, the penalty function forT
a
i will be given as follows:
(25)
p
u
i
=
{
1
,
satisfied
(
18
)
μ
*
(

1

-
T
i
*
x
i
-
T
(
P
i
)
*
x
i
Max
⁡
(
T
i
)

)
,
notsatisfied
(
18
)
,
where μ denotes penalty factor. If the constraint (18) is satisfied in the task T
a
i, the penalty will not be carried out; that is to say the value of p
u
i is 1. Otherwise, the penalty will be carried out, and if x
i
=
1, the value of the |
T
i
-
T
(
P
i
)
| is bigger, and the penalty factor μ is also bigger. Therefore, we can give the penalty function for the feasible solution as follows:
(26)
P
u
=
∏
i
=
1
n
p
u
i
.Based on the above function, the final fitness function in this paper is given as follows:(27)
F
F
=
F
*
P
u
.Apparently, we should reduce the number of the executed tasks or adjust the execution time or sequence of tasks if the constraint (18) is not satisfied in the feasible solution.Traditional direct proportion selected strategy is adopted in this paper to generate offspring. In addition, we give the pressure factor for the fitness function so as to approach the optimal solution quickly.For the individuals in the population whose size is S
i
z
e, the fitness value is F
F
s, and the selection probability is
(28)
ρ
s
=
F
F
s
-
χ
*
Min
⁡
(
F
F
)
∑
s
=
1
S
i
z
e
(
F
F
s
-
χ
*
Min
⁡
(
F
F
)
)
,
where χ denotes pressure factor, and the value range is [
0,1
).


## 3.1. Chromosomal Representation

The solution is coded as the following real number matrix:(22)
A
=
[
a
111
a
121
…
a
1
J
1
…
a
11
T
a
12
T
…
a
1
J
T
a
211
a
221
…
a
2
J
1
…
a
21
T
a
22
T
…
a
2
J
T
…
…
…
…
…
…
…
…
…
a
n
11
a
n
21
…
a
n
J
1
…
a
n
1
T
a
n
2
T
…
a
n
J
T
]
.Each row of matrixA denotes a task. The columns in matrix A are divided into T parts, each part indicates a period t, and, in each part, there are J columns which denote J subtasks in each task. Therefore, there are T
×
J columns in the matrix A, and the subscript meanings of the element a
i
j
t in the matrix A are as follows:i: the identification of the ith task;
j: the jth subtask of the task;
t: the tth period.The value of the matrix elementa
i
j
t is an integer from [
0
,
J
k
]. It means that the a
i
j
tth virtual resource in the jth candidate resource set is selected to execute the task T
a
i in the period t where a
i
j
t
≠
0. Otherwise, the jth subtask of the task T
a
i in the period t will not be executed.The matrix is related to the variables as follows.(i)
If the values of theith row in the matrix are all 0, the ith task T
a
i will not be executed, and then the variable x
i equals 0. Otherwise, the value of the variable x
i is 1.
(ii)
Ifa
i
j
t
≠
0 in the period t, the variable y
(
i
,
j
,
a
i
j
t
,
t
) equals 1, and then the values of all the other rows in the jth column of the tth part cannot equal a
i
j
t which is expressed as y
(
i
′
,
j
,
a
i
j
t
,
t
)
=
0, where i
′
≠
i. Obviously, the constraint (19) is satisfied.
(iii)
Ifa
i
j
t
≠
0 in the period t, the variable y
(
i
,
j
,
a
i
j
t
,
t
) equals 1, and then for the same i and j, y
(
i
,
j
,
k
,
t
)
=
0, where k
≠
a
i
j
t and k
∈
[
0
,
J
k
]. Obviously, the constraint (20) is satisfied.


## 3.2. Initial Population

Each individual in the initial population is generated randomly column by column as follows so as to ensure the individual randomness and avoid the local optimization.(i)
In the period oft
=
0, we used the following method to generate the first column value. If the number of tasks is less than the number of virtual resources in the corresponding candidate resources set, that is, n
≤
J
k, we will randomly select n values from [
0
,
J
k
] to form a random sequence as the first column. Otherwise, we will select all of the J
k values and n
-
J
k zeros to form a random sequence as the first column. After that the value of all the other J
-
1 columns in the period of t
=
0 will be zero according to the rule that any task can be transformed to the sequence process [13].
(ii)
In the period oft
>
0, we firstly see the corresponding column of the period t
-
1. If the jth subtask is not finished in the period t
-
1, then a
i
j
t
=
a
i
j
(
t
-
1
). If the subtask is finished, then a
i
j
t
=
0 and a
i
(
j
+
1
)
t
≠
0 at the same time. The value of the a
i
(
j
+
1
)
t should be randomly picked from the remaining numbers after being finished by a
i
(
j
+
1
)
t
=
a
i
(
j
+
1
)
(
t
-
1
).


## 3.3. Crossover and Mutation

Because of the real number encoding of the solution, the traditional crossover and mutation operators of the Boolean value cannot be simply used in this paper. We design the crossover and mutation operators as follows.(1) Row-Based Crossover. We will firstly generate ann-dimension Boolean type column vector V
C. We will swap the ith row of the two parent matrices if V
C
i
=
1, do nothing if V
C
i
=
0, and finally generate the new two matrices. The constraints may not be satisfied, that there may be the same nonzero number in the same column after row-based crossover operating. Therefore, we must run the following fixed program to make the new two matrices satisfy the constraints. See Algorithm 1.Algorithm 1:
(1) For 1 toT
×
J // looped by columns
(2)For 1 to n //checked by rows
(3)If a
i
j
t
=
0, jump to Step  2;
(4)Else
IfV
C
i
=
0, jump to Step  2;
Else
If not existed the same non-zero number, jump to
Step  2;
Else
Randomly  selected a number from the difference
set between the[
0
,
J
k
] set and the current column
value set to replay. If the difference sets isØ, then
seta
i
j
t
=
0;
(5)For End
(6) For End(2) Column-Based Crossover. Similar to the row-based crossover, we will firstly generate aT
×
J-dimension Boolean type row vector V
C. We will swap the j
tth row of the two parent matrixes if V
C
j
t
=
1, do nothing if V
C
j
t
=
0, and finally generate the new two matrixes. Obviously, the new two matrixes also satisfy the constraints.(3) Block-Based Crossover. Block-based crossover is operated for the unit of block corresponding to the period oft. Therefore, we will generate a T-dimension Boolean type row vector V
C. We will swap the tth block of the two parent matrixes if V
C
t
=
1, do nothing if V
C
t
=
0, and finally generate the new two matrices. Obviously, similar to the column-based crossover, the new two matrices also satisfy the constraints.(4) Row-Based Mutation. Firstly, we give the mutation rules. We will change the value as follows if the value is not zero and do not change the value if the value is zero:(23)
a
i
j
t
=
J
k
-
a
i
j
t
+
1
.For the row-based mutation, we will firstly generate at-dimension Boolean type column vector V
C. We will change all of nonzero number according to the above rule in the ith row of the parent matrix if V
C
i
=
1, do nothing if V
C
i
=
0, and finally generate the new matrix. The constraints may not be satisfied that there may be the same nonzero number in the same column after row-based mutation operating. Therefore, we must run the above fixed program to make the new matrix satisfy the constraints.(5) Column-Based Mutation. Similar to the row-based mutation, We will firstly generate aT
×
J-dimension Boolean type row vector V
C. We will change all of nonzero number according to the above rule in the j
tth row of the parent matrix if V
C
j
t
=
1, do nothing if V
C
j
t
=
0, and finally generate the new matrix. Obviously, the new matrices also satisfy the constraints.(6) Block-Based Mutation. Similar to the block-based crossover, block-based mutation is also operated for the unit of block corresponding to the period oft. Therefore, we will generate a T-dimension Boolean type row vector V
C. We will change all of nonzero numbers according to the above rule in the tth block of the parent matrix if V
C
t
=
1, do nothing if V
C
t
=
0, and finally generate the new matrix. The constraints may not be satisfied that there may be the same nonzero number in the same column after block-based mutation operating. Therefore, we must run the above fixed program to make the new matrix satisfy the constraints.


## 3.4. Fitness Function and Selection Strategy

Based on the objective function, the fitness function will be given in this paper as follows:(24)
F
=
(
α
*
∑
i
=
1
n
(
Profit
(
T
a
i
)
¯
*
x
i
)
+
β
*
∑
i
=
1
n
x
i
)
.So as to select the new generation population, the penalty function forT
a
i will be given as follows:
(25)
p
u
i
=
{
1
,
satisfied
(
18
)
μ
*
(

1

-
T
i
*
x
i
-
T
(
P
i
)
*
x
i
Max
⁡
(
T
i
)

)
,
notsatisfied
(
18
)
,
where μ denotes penalty factor. If the constraint (18) is satisfied in the task T
a
i, the penalty will not be carried out; that is to say the value of p
u
i is 1. Otherwise, the penalty will be carried out, and if x
i
=
1, the value of the |
T
i
-
T
(
P
i
)
| is bigger, and the penalty factor μ is also bigger. Therefore, we can give the penalty function for the feasible solution as follows:
(26)
P
u
=
∏
i
=
1
n
p
u
i
.Based on the above function, the final fitness function in this paper is given as follows:(27)
F
F
=
F
*
P
u
.Apparently, we should reduce the number of the executed tasks or adjust the execution time or sequence of tasks if the constraint (18) is not satisfied in the feasible solution.Traditional direct proportion selected strategy is adopted in this paper to generate offspring. In addition, we give the pressure factor for the fitness function so as to approach the optimal solution quickly.For the individuals in the population whose size is S
i
z
e, the fitness value is F
F
s, and the selection probability is
(28)
ρ
s
=
F
F
s
-
χ
*
Min
⁡
(
F
F
)
∑
s
=
1
S
i
z
e
(
F
F
s
-
χ
*
Min
⁡
(
F
F
)
)
,
where χ denotes pressure factor, and the value range is [
0,1
).


## 4. Experiments and Discussion

These experiments are performed based on the above example (described in Section2.1) to test the effectiveness of the proposed method. We will perform the experiments with the conditions of enough resources and limited resources.


### 4.1. Experiments and Discussion with Enough Resources

We will evaluate the results affected by the correlation of resources with enough resources. The experiments are performed in the following 3 situations:(i)
the correlations are not taken into account E1;
(ii)
only the correlations in a task are taken into account E2;
(iii)
both the correlations in a task and among tasks are taken into account E3.The parameters of the model are given as follows: the population sizeS
i
z
e
=
100, max generation is 100, the probability of crossover is 0.9, the probability of mutation is 0.05, the pressure factor χ
=
0.9, the penalty factor μ
=
0.01, and α
=
0.5 and β
=
0.5. And the percent of correlation resources in a task is 30%; the percent of correlation resources among tasks is 40%.The results of the experiments are shown in Figure3.Figure 3
Results of the experiments with enough resources.In Figure3, the y-coordinate denotes the total profits of all executed tasks. The x-coordinate denotes the number of tasks. With the number of tasks increased, the number of resources in corresponding candidate resources set is also increased to ensure that there are enough resources to execute all the tasks, but the percent of the correlation in a task and among tasks will not be changed.As we can see in Figure3, the total profit discrepancy in 3 situations is not bigger if the number of tasks is small (the number is less than 100). The reason is that the influence of the correlation of resources used in tasks is very small. But along with the increased number of tasks, the advantages of E2 and E3 which take correlations into account are huge, and the profits of E2 and E3 are much more than E1 for the same number of tasks, and the gap will be bigger and bigger. That is because the correlations both in a task and among tasks are considered, and the cost of selected resource will be lower than the default value. Therefore, it can be concluded that the proposed method that considered the correlations of resources has better performance than without considering the correlations.


### 4.2. Experiments and Discussion with Limited Resources

We will evaluate the results affected by the sharing of resources with limited resources. The experiments are performed in the following 2 situations:(i)
the sharing is not taken into account E4;
(ii)
the sharing is taken into account E5.The parameters of the model are given as follows: the population sizeS
i
z
e
=
200, max generation is 200, the probability of crossover is 0.95, the probability of mutation is 0.03, the pressure factor χ
=
0.99, the penalty factor μ
=
0.01, and α
=
0.5 and β
=
0.5. And the percent of correlation resources in a task is 30%; the percent of correlation resources among tasks is 40%. The number of resources in each candidate resources set is fixed to 16, and the number of the given tasks varies from 2 to 30 which is an increment of 2.The results of the experiments are shown in Figure4.Figure 4
Results of the experiments with limited resources.In Figure4, the y-coordinate denotes the total profits of the executed tasks. The x-coordinate denotes the number of given tasks. The number beside lines denotes the number of the executed tasks.As we can see in Figure4, the total profit and the number of executed tasks in E4 are the same as E5 if the number of tasks is less than 16. The reason is that all of the tasks could be executed without considering the sharing of resources. But along with the increased number of tasks, the number of tasks will not increase and keep 16 without considering the sharing of resources. But all the tasks can be executed with considering the sharing of resources until the number of given tasks is 28, and the profits are much more than without considering the sharing of resources. That is because the sharing of resources is considered. Therefore, it can be concluded that the proposed method that considered the sharing of resources has better performance than without considering the sharing and can solve the problem better for multitask oriented virtual resource integration and optimal scheduling which resources are limited.


## 4.1. Experiments and Discussion with Enough Resources

We will evaluate the results affected by the correlation of resources with enough resources. The experiments are performed in the following 3 situations:(i)
the correlations are not taken into account E1;
(ii)
only the correlations in a task are taken into account E2;
(iii)
both the correlations in a task and among tasks are taken into account E3.The parameters of the model are given as follows: the population sizeS
i
z
e
=
100, max generation is 100, the probability of crossover is 0.9, the probability of mutation is 0.05, the pressure factor χ
=
0.9, the penalty factor μ
=
0.01, and α
=
0.5 and β
=
0.5. And the percent of correlation resources in a task is 30%; the percent of correlation resources among tasks is 40%.The results of the experiments are shown in Figure3.Figure 3
Results of the experiments with enough resources.In Figure3, the y-coordinate denotes the total profits of all executed tasks. The x-coordinate denotes the number of tasks. With the number of tasks increased, the number of resources in corresponding candidate resources set is also increased to ensure that there are enough resources to execute all the tasks, but the percent of the correlation in a task and among tasks will not be changed.As we can see in Figure3, the total profit discrepancy in 3 situations is not bigger if the number of tasks is small (the number is less than 100). The reason is that the influence of the correlation of resources used in tasks is very small. But along with the increased number of tasks, the advantages of E2 and E3 which take correlations into account are huge, and the profits of E2 and E3 are much more than E1 for the same number of tasks, and the gap will be bigger and bigger. That is because the correlations both in a task and among tasks are considered, and the cost of selected resource will be lower than the default value. Therefore, it can be concluded that the proposed method that considered the correlations of resources has better performance than without considering the correlations.


## 4.2. Experiments and Discussion with Limited Resources

We will evaluate the results affected by the sharing of resources with limited resources. The experiments are performed in the following 2 situations:(i)
the sharing is not taken into account E4;
(ii)
the sharing is taken into account E5.The parameters of the model are given as follows: the population sizeS
i
z
e
=
200, max generation is 200, the probability of crossover is 0.95, the probability of mutation is 0.03, the pressure factor χ
=
0.99, the penalty factor μ
=
0.01, and α
=
0.5 and β
=
0.5. And the percent of correlation resources in a task is 30%; the percent of correlation resources among tasks is 40%. The number of resources in each candidate resources set is fixed to 16, and the number of the given tasks varies from 2 to 30 which is an increment of 2.The results of the experiments are shown in Figure4.Figure 4
Results of the experiments with limited resources.In Figure4, the y-coordinate denotes the total profits of the executed tasks. The x-coordinate denotes the number of given tasks. The number beside lines denotes the number of the executed tasks.As we can see in Figure4, the total profit and the number of executed tasks in E4 are the same as E5 if the number of tasks is less than 16. The reason is that all of the tasks could be executed without considering the sharing of resources. But along with the increased number of tasks, the number of tasks will not increase and keep 16 without considering the sharing of resources. But all the tasks can be executed with considering the sharing of resources until the number of given tasks is 28, and the profits are much more than without considering the sharing of resources. That is because the sharing of resources is considered. Therefore, it can be concluded that the proposed method that considered the sharing of resources has better performance than without considering the sharing and can solve the problem better for multitask oriented virtual resource integration and optimal scheduling which resources are limited.


## 5. Conclusions and Future Works

In this paper, the correlation and sharing of resources are both considered during multitask oriented virtual resources integration and optimal scheduling in cloud manufacturing, and the correlation and sharing models are presented. The problem is proposed and formulized, and GA based on the real number matrix code is employed to solve the problem. The experimental results show that the proposed methods are more effective and efficient for the problem.Only the cost and time of Qos are considered in this paper; actually, there are many other factors to be considered such as reliability and trust. In the algorithm, there are a lot of invalid solutions in the solution space. In the future, we should avoid the invalid solutions during the process of algorithm or reduce the solution space by optimizing the code of solution to make the algorithm more effective. In addition, only one cloud manufacturing enterprise is considered; in the future, we should solve the problem for multienterprises.



---

*Source: 369350-2014-05-04.xml*