Multi-task service composition model considering competitive resource constraint in cloud manufacturing

Service composition optimization is one of the core issues of cloud manufacturing research. At present, relevant researches mostly focus on single-task service composition, and there are few reports on the problem of multi-task service composition considering resource competition. However, in the real cloud manufacturing environment, multi-task service composition is common, so how to formulate a robust multi-task service composition model is a meaningful research direction. This paper first proposes a multi-task service composition optimization model considering resource competition constraints (MTSCOM-RCC) in the cloud manufacturing environment to fill the above-mentioned gap. The MTSCOM-RCC model considers the conflicts of interest and time between parallel subtasks and proposes an important service evaluation indicator. Secondly, a two-layer coding method, including task layer and subtask, is proposed based on studying the MTSCOM-RCC’s competition mechanism and characteristics. An improved hybrid genetic artificial bee colony algorithm model is proposed to solve the multi-task model. The model is combined with the global optimization method and task queue optimization method. Experimental results prove that the two-layer task optimization method model is more feasible and effective than the other two solution models.


Introduction
Cloud manufacturing (CMfg) [1] is a new service-oriented model, high-efficiency and low-consumption knowledge networked intelligent manufacturing. It provides high-quality, safe, and reliable services for the entire life cycle through the network, improve resource utilization, and reduces manufacturing costs [2]. Cloud service composition and optimization (CSCO) is one of the core problems of CMfg research. It has the characteristics of multiple optimization goals, large solution space, complexity and dynamic solution process, etc. It is a typical NP-hard problem.
At present, the single-task service composition optimization problem has been extensively studied [3][4][5][6][7]. A few domestic and foreign scholars have researched multi-task problems [8][9][10]. At present, the research method of cloud manufacturing multi-task optimization problem still adopts the mode of selecting and optimizing sub-tasks in the candidate cloud service resources, similar to the single-task research method. In contrast, current methods ignore the limited resources or urgent needs in multi-task service composition optimization. The multi-task service composition optimization problem considering resource competition constraints among multi-task in CMfg is a practical problem that needs to be solved urgently.
This paper proposes a multi-task service composition optimization model considering resource competition constraints (MTSCOM-RCC) in response to the above problems. This model aims to solve the conflict problem when multiple tasks compete for single or multiple cloud services simultaneously 2 by combining the scheduling method. In the model, a two-layer coding method including task layer and sub-task layer is proposed. Simultaneously, a hybrid genetic artificial bee colony algorithm that acts on both the task layer and the sub-task layer is proposed. Besides, to solve MTSCOM-RCC efficiently, this paper proposes a two-layer task optimization method by first optimizing the task layer's solution, searching the sub-task layer locally, and finally realizing the optimization solution of the model.

Problem statement
Cloud manufacturing has the characteristics and advantages of the centralized use of decentralized resources and the decentralized services of centralized resources. In the actual operation and management process, there is a problem of competition caused by multiple tasks requiring a certain service at the same time. How to reasonably allocate competitive services to multiple cloud manufacturing tasks and obtain the optimal manufacturing process is the key point of MTSCOM-RCC. This paper will focus on how to model and solve the problem. Based on the traditional cloud manufacturing service composition optimization process, the multitask service composition optimization model considering resource competition constraints (MTSCOM-RCC) is mainly composed of three steps: task decomposition, service and task matching, and service combination selection and optimization [11]. The optimization process of MTSCOM-RCC is shown in Fig. 1 where i= 1, 2,...,l, where l is the number of tasks. MT i is the i-th task, and each task is decomposed into a series of subtasks ST, which can be expressed as Among them, ST ij represents the j-th subtask into which task i is decomposed; j = 1, 2, ..., n, where n is the number of subtasks that task MT i is decomposed into. To more efficiently select the service combination that meets the task requirements, this paper uses QoS indicator [7], namely completion time (T), product quality (Q), total cost (C), and service level (S), to establish a multi-task competitive resource optimization evaluation index for MTSCOM-RCC.
where l t (x i,j , x i,j-1 ) represents the logistics time from the service x i,j for the subtask ST ij to the service x i,j-1 , for ST i(j-1) . T wij , T sij , and T mij respectively represent the waiting time, preparation time, and processing time in the manufacturing process of the subtask ST ij .
2) Total cost (C): This indicator includes logistics cost C l and processing cost C e . The total cost required for the manufacturing process of a subtask ST ij can be expressed as: where l c (x i,j , x i,j-1 ) represents the logistics cost from the service x i,j for the subtask ST ij to the service x i,j-1 for the task ST i(j-1) . Cmij represents the processing cost of the subtask ST ij manufacturing process.
3) Product quality (Q): This indicator represents the product qualification rate for completing the task. It is provided by the cloud service provider and can be expressed as: 4) Service level (S): This indicator means that the cloud service demander scores the cloud service provider's service level after its demand is completed. The data is summarized and provided by the cloud platform operator and can be expressed as:

Objective functions.
In order to calculate the comprehensive value of each cloud service, each indicator needs to be quantified. The evaluation index is divided into the positive index and negative index. The positivity index means that the larger the index value, the better the comprehensive evaluation. The negative index means that the smaller the value of this index, the better the comprehensive evaluation. Product quality and service level are positive indicators, and completion time and total cost are negative indicators. Considering the generality of tasks, the cloud manufacturing tasks in the MTSCOM-RCC problem in this paper are all sequential structures. The objective function of the MTSCOM-RCC model is: Among them, w T , w Q , w C and w S are the weighting coefficients of T, Q, C and S respectively, and the sum of the four weighting coefficients is 1. This paper adopts the weight coefficient w T =0.1791; w Q ,=0.4647; w C =0.2929; w S =0.0634 in the literature [5] as a reference.

Original Artificial Bee Colony Algorithm
The artificial bee colony algorithm [3] is a typical population-based intelligent algorithm that simulates a natural bee colony's foraging and communication mechanism. The colony is divided into employed bees, following bees, and scout bees. In the MTSCOM-RCC problem, each nectar source represents a candidate solution, and the quality of the nectar source represents the solution's fitness. The algorithm process is as follows. The first is the stage of employed bees, where bees fly randomly to different places to find nectar sources X i ={x i1 , x i2 ,…, x in }, the search formula is defined as: where i=1,2, …, N D , N D is the number of nectar sources (employed bees), j = 1, 2, …, n, n is the individual dimensions of the population; r is a random number from 0 to 1; X max j and X min j is the upper and lower bounds of the value of the j-th element. Then in the following bee stage, the probability expression for the following bee to select a food source is: Where f i is the fitness of the i-th food source, and p i is the probability of the i-th food source being selected by the bee. After choosing a new food source as the direction, following bee's search to generate a new nectar source Where i is the previous food source, k is the selected food source, and φ ij is a random value from -1 to 1.The employed bees also search for areas near the nectar source according to equation (10). Each search will update the nectar location through greedy selection. If a nectar source is not optimized after a certain number of iterations limit, the scout bee discards the nectar source and uses the formula (8) to find a new food source.

Coding method.
The presented MTSCOM-RCC is a typical discrete problem. In order to solve this problem, a two-layer coding method based on tasks and services is proposed to realize the MTSCOM-RCC coding X M = (X task ; X service ). The mathematical expression is as follows: Where X M is the encoding result, X task is the task code, X service is the service code. N is the total number of subtasks. X task represents each element's sequence in corresponds to the manufacturing sequence between subtasks; each element in X service represents the corresponding subtask selected service. As shown in Table 1

Evolution pattern.
The artificial bee colony algorithm is used to solve continuous optimization problems. In contrast, the MTSCOM-RCC problem is a typical discrete problem, and the optimization Eq. (8-10) of the original artificial bee colony algorithm cannot be used directly. Aiming at the characteristics of the conflicts in the MTSCOM-RCC problem subtasks, combining the coding method and the genetic algorithm's mutation method, a hybrid genetic artificial bee colony algorithm is proposed. The example code is used as an explanation. Due to the different constraints of task coding and service coding, the total number of each element in X task will not change during the solution process of task coding; each element in X service during the solution process of service coding is within a reasonable range of the corresponding optional candidate resource set.
For task coding, four evolutionary methods are proposed: constant single point, two-point crossover, single-point insertion, and a segment translation.
1)"constant single point" means that the positions of all subtasks of one task in the two task coding remain unchanged. The remaining tasks the order of the subtask positions is arranged by order of each other's task code.
2)"two-point crossover" refers to the code exchange of two random positions in a task code.
3)"single-point insertion" means that a certain code in a task code is randomly inserted into the code another position in the code; 4)"a segment translation" means that a certain code segment in a task code is randomly moved to another position in the code.
The diagrams of the four evolution patterns are as follows: For service coding, three evolutionary methods are proposed: population crossover, one segment translation, and single point mutation. "Population crossover" means that a certain segment of two service codes crosses into the other's code. "One segment of translation" refers to a certain segment of one service code. The code is randomly inserted into another position in the code. "Single point mutation" means that the code at a certain point in the service code becomes another reasonable coding situation. The diagrams of the three evolution patterns are as follows:

Two-level task optimization method for MTSCOM-RCC
The global optimization method [12] is the most commonly used in solving scheduling problems. The algorithm is directly applied to the two-layer coding, which requires high quality of the initial solution; the task queue optimization method uses the "first in first out" queue rule, which only applies to the task code. It traverses all optional services for each task being scheduled and selects the service with the highest current total service quality.
The global optimization method and the task queue optimization method use the same algorithm to solve the problem. The difference is that the global optimization method uses a two-layer coding method, and the task queue optimization way uses a single-layer coding way. The two-layer task optimization method combines the advantages of the global subtask optimization method and the task queue optimization method: first process the task queue, and after the task queue is solved, the task code obtained is expanded into a two-layer code including task code and service code, and then perform a partial search for service coding optimization.
The solution steps of the two-layer task optimization method are as follows. a) Initialize algorithm parameters. According to formula (8), the task layer code X task is randomly generated.
Employed bee stage: b) For each X task , the corresponding service layer code X service is generated according to the "first in, first out" queue rule. Combine the task layer's coding and the service layer to X M = (X task ; X service ).
c) The domain search is performed, and according to formula (9) and (10), the population crossover method of population is used to optimize the service layer coding. d) Use a segment of translation and single point mutation evolution patterns to optimize the service layer coding, the execution probability is pt_1 and pt_2 respectively.
Following bee stage: e) According to formula (9), the single-point constant evolution pattern is used to optimize the tasklevel coding. f) Optimize the task layer coding according to the three evolutionary modes of two-point crossover, single-point insertion, and a segment translation, and the execution probabilities are ps_1, ps_2, and ps_3, respectively.
Scouting bee stage: g) Check whether each population is still not optimized after limit updates. If yes, discard the current population, and generate a new population according to formula (8).
h) Repeat steps b)~g) until the maximum number of iterations is reached, then go to step i). i) Output optimal solution set.

Experimental data
In order to verify the effectiveness of the MTSCOM-RCC model, experiments of different scales are designed. The number of tasks, the number of subtasks, and the number of services have three scales, including 3, 6, and 9. There are a total of 27 kinds of tests. Each experiment is named in the form of task-subtask-service. For example, test 333 represents an experiment with 3 tasks, 3 subtasks, and 3 optional services. Taking the test 333 example as an example, Table 1 shows the processing time and preparation of each subtask corresponding service. Table 2 shows the processing cost and product quality of each subtask corresponding service, where NA means that this service is not optional. Table 3 shows the logistics time, logistics cost, and service quality between services.  The parameter ranges of all experiments are shown in Table 4. Besides, the population size is 20, the maximum number of iterations is 300, the coding parameters pt_1, pt_2, ps_1, ps_2 and ps_3 of the two-layer task optimization algorithm are 0.5, 0.8, 0.7, 0.4, 0.4, respectively, and the bee colony optimization parameter limit is 40. The test environment uses Matlab R2014a simulation software, intel(R) Core i5-4460, 3.2GHz processor, and 8.00GB of memory. Each experiment carried out 20 groups.

Result analysis
To evaluate the superiority of the two-layer task optimization method, it is compared with the solution results of the global optimization method and the task queue method. The comparison between the average value of the total service quality solution and the solution time is shown in Table 5. The result of solving the MTSCOM-RCC model is to consider the comprehensive quality of service (QoS) result, including completion time, product quality, total cost, and service level, not the timeoptimal result. For scheduling problems, the Gantt chart can intuitively express the scheduling results. Taking test 333 as an example, the three methods' scheduling results are shown in Fig. 5, and the overall results of the solution are shown in Table 6.  10 Based on the above experimental results, it can be seen that the global optimization method can guarantee the optimization direction of the solution. However, the ability to obtain is poor when the number of tasks and services are large. The task queuing method has a better solving ability. Due to the phased steps' traversal to determine the service, a better time solution can be obtained. However, it does not solve the multi-indicator coupling complexity of the MCSO model, which is not universal. Besides, in many test cases of fewer services and more competition, it is easy to fall into the local optimum, and the solution result is unstable. For example, in test 333, the task queue method takes the same time to complete the solution as the other two methods, where both are 19 days. However, due to the determined steps' traversal, service 1 with poor service level is selected multiple times, resulting in the final low quality of service. The two-layer task optimization method can obtain the highest comprehensive service quality solution within an acceptable time, has good adaptability and effectiveness, and provides theoretical and technical support for the research and development of multi-task competitive resource scheduling problems.

Conclusion
The contribution of this paper is summarized as follows.
1) This paper puts forward the problem of multi-task competition resource optimization on the cloud platform, focusing on solving the situation of competition when multiple cloud manufacturing tasks require one or several services simultaneously.
2) The total service quality consisting of time, quality, cost, and service is taken as the optimization target, and a mathematical model of multi-task competitive resource optimization is established.
3) A service composition scheduling model is proposed. Moreover, this paper proposes a two-layer coding method and develops a hybrid genetic artificial bee colony algorithm. Based on the global optimization method and task queue method, a two-layer task optimization method is proposed. 4) Experimental results show that the two-layer task optimization method can effectively solve multitask competing resource scheduling on the cloud platform. Twenty-seven experiments ranging from small to large demonstrate the effectiveness and feasibility of the model and algorithm in this paper.