Resource scheduling of workflow multi-instance migration based on the shuffled leapfrog algorithm

: Purpose: When the workflow changed, resource scheduling optimization in the process of the current running instance migration has become a hot issue in current workflow flexible research; purpose of the article is to investigate the resource scheduling problem of workflow multi-instance migration. Design/methodology/approach: The time and cost relationships between activities and resources in workflow instance migration process are analyzed and a resource scheduling optimization model in the process of workflow instance migration is set up; Research is performed on resource scheduling optimization in workflow multi-instance migration, leapfrog algorithm is adopted to obtain the optimal resource scheduling scheme. An example is given to verify the validity of the model and the algorithm. Findings: Under the constraints of resource cost and quantity, an optimal resource scheduling scheme for workflow migration is found, ensuring a minimal running time and optimal cost. Originality/value: A mathematical model for resource scheduling of workflow multi-instance migration is built and the shuffled leapfrog algorithm is designed to solve the model.


Introduction
The sustainable development of business enterprise is threatened by the contention between rapidly-increasing business volume and limited enterprise resources. As the core technology of process modeling and management, workflow technology is of key importance for improving information level, production and operations management, operation efficiency, response ability to the external environment change and market competitiveness of manufacturing enterprises (Xu, 2014). Workflow resource scheduling is the primary concern of workflow management systems. To determine how resources can be most appropriately used to execute workflow instances, thereby improving the execution efficiency of business processes has been the primary focus.
Due to increasing market competitiveness and the complex and ever-changing demands of enterprise, uncertainty and variability have become significant features of business enterprise (Feifan & Xuanxi, 2006). Workflow instance migration can effectively solve the problem of workflow dynamic change. As the workflow changes, the running instance will choose an appropriate migration strategy (direct migration, rollback migration, or no migration) according to the very status (Gao, Xu, Wang, Li, Yang & Liu, 2013). During the process of workflow migration, the workflow process model will change; the resources relevant to the original process model will also change, such as resource rebuilding or canceling, which makes the resource scheduling optimization in the workflow migration process very important. How to migrate currently running instances and schedule resources during instance migration process has become widely debated issue in workflow flexibility research.
Aiming to resolve the grid workflow scheduling problem, Sucha Smanchat et al. proposed a scheduling algorithm for a multi-parameter sweep workflow instance based on resource competition (Smanchat, Indrawan & Ling, 2011). Rizos Sakellariou et al. considered resource allocation problems to be a single activity instance of the workflow and set the earliest completion time for a certain activity instance as the goal of their resource scheduling method (Sakellariou, Zbao, Tsiakkouri & Dikaiako, 2007). R. Buyya analyzed the relationship between the overall deadline of a workflow instance and the load of an activity instance in order to estimate the deadline for each activity's running time. The workflow instance resource scheduling problem has been developed into multiple scheduling problems (Yu, Buyya & Tham, 2005 when the process was running, the fuzzy information from the relevant environment was analyzed (Shengwen & Junfang, 2010). This model was successful in the optimal resource scheduling of workflow instances, but the weights of the resources and self-adaption were not considered. Zhang Lijun solved the problem of dynamic task allocation using sub-processes; although the design and execution of the sub-processes were given in this method, it paid less attention to resource task scheduling (Lijun, Jun & Tao, 2009). Liu Subo established a resource-task allocation model, and designed a process-scheduling decision system based on workflow management, resolving the problems arising from resource optimization scheduling and exception handling (Subo, Jianchong & Haizhu, 2011). Deng Tieqing et al. studied the personal worklist scheduling problem in an environment of dynamic execution of workflow instances, and proposed a personal worklist resource scheduling algorithm based on a genetic algorithm; this method studied resource scheduling of multiple activity instances in a single process, but not in resources scheduling of multiple process instances (Deng, Ren & Liu, 2012).
Yang Mingshun et al. established a workflow multi-instance resource optimization model based on queuing theory and used the simulated annealing intelligent algorithm to solve the model (Yang, Han, Gao & Liu, 2012). This model solved the resource optimization problem with the constraints of resource cost and state as the instances were running, but the resolution lacked the consideration of resource competition and its advantages and disadvantages.

Workflow Instance Migration Process Analysis
The workflow instance migration process primarily includes modeling of dynamic change of workflow, workflow instance migration, and resource scheduling optimization.
(1) Modeling of dynamic change of workflow refers to build a new or composite workflow process model of the changed workflow process based on the original workflow model. Firstly, it is required to analyze the change style of the workflow, then the new/composite workflow process models corresponding to the original ones are built, finally the structures of the newly built models are verified to determine whether any conflict or error exists. Only no conflict or error existing in the workflow structure, the new model is reasonable, and the instances run in the original model can migrate.
(2) When changes occur in the workflow, based on the built new/composite workflow process model, instances run in the old workflow model are required to migrate in real time. The steps of the instance migrating includes identifying the workflow regions, sequencing the workflow regions and selecting the migrating strategies. The workflow regions identifying includes identifying the regions of the current nodes running and the dynamic changing regions. Then using the workflow regions sequencing rules, the current running regions and all changing regions are sequenced. Finally, based on the sequencing results, the appropriate migrating strategies are selected to finish migrating of the current running instances.
(3) It is well-known that the successful running of the workflow instances cannot do with appropriate resources, especially in the process of workflow instances migration. Only with the supports of appropriate resources, can the instances migrating be successfully realized. The purpose of workflow resource scheduling is to allocate the right activities to the right activities in right time with right sequence to ensure the every activity of the workflow instances can be executed by the appropriate resource in right time, thus the whole business process can be finished successfully. The resource scheduling results will directly affect the work efficiency, flexibility and service quality of the workflow management system.
The framework of the workflow instance migration process is shown in Figure 1. The resource scheduling includes task allocation and task sequencing. Task allocation refers to allocate the appropriate resources to the work items, which is the core problem of workflow resource scheduling. While task sequencing refers to priority ordering of the multi tasks allocated to a same resource.
In the workflow instance migration process, due to uncertain factors such as resource changes and resource release, the dynamic resource scheduling optimization should be applied to the migration instance so that the workflow system can achieve global optimization of resource utilization. By analyzing the relationship between the activities and resources in the workflow instance migration process, certain factors, including the shortest overall activity execution time, the minimum overall activity lag time, the minimum number of activities lagged and the minimum costs that the resource consumed were used as the optimization goals to establish the mathematical model of workflow resource scheduling optimization.

Resource Scheduling Parameters
(1) Activity i's lag time (Δti) represents the time difference between the expected activity completion time and the actual completion time. (1) where tei is the expected completion time of activity i and tfi is the actual completion time of the activity. The expected completion time of activity i is the time expected to meet the time requirements or obtain certain time performance. The expected completion time could be set by users or generated by the system.
(2) Activity i's actual completion time (tfi) represents activity i's actual starting time plus its execution time. (2) where tsi is the starting time, tij is the time resource j spends executing activity i.
(3) The execution time (tij) of resource j, or the time resource j spends executing activity i, represents the ratio of the workload of activity i to the executive ability of resource j. (3) where Wi is the workload of activity i, Aij is resource j's ability to execute the activity, and  is a correction coefficient.
(4) The consumption cost (Cij) of resource j in the execution of activity i represents the average consumption cost of resource j per unit of time multiplied by the activity i's running time. (4) where cj is the average consumption cost of resource j per unit of time, and tij is the time that resource j spends executing the activity.
(5) The available time of resource j (trj) includes the current time, the idle time of resource i, and the execution time already allocated to resource j.
where tvj is the idle time of resource j, tc is the current time, is the overall execution time already allocated to resource j, and l is the number of tasks already been allocated to resource j.
(6) In case one resource serves several activities, virtual resources need to be introduced in order to obtain an optimal resolution of the activity and the resource sorting problem.
Assuming that resource j needs to participate in β executing activities, β-1 virtual resources of resource j need to be added. The physical and virtual resources are expressed as j.k (k = 0, …, s -1). Then, equation (5) could be modified as the following: Where tpjq is the allocated time that resource j spends executing activity q.
(7) The actual starting time of the activity depends on the available time of the resource.
Where trj.k is the available time of resource j.k, and j.k is the resource that executes activity i.
The start time of an activity refers to the moment that the instance activity i begins to be executed with some resources and can be represented with tbi.
Free time of a resource refers to a moment after which the resource j will not participant in execution of any activity and can be represented with tvj. Available time of a resource refers to the moment that the resource j can participant in the execution of a new activity and can be represented with tvj.
When an activity needs multi resources to be executed, which means a teamwork. Multi resource execution styles are required to be taken into account. There are mainly four styles: different time and place, same time and place, same time and different place, different time and same place. In the process of workflow instance running, only the time factor of resource executing is considered, thus in the paper the style of same time and place of the resource teamwork is mainly considered.
where (wt )h is the modified coefficient of the demanding time that resource member h of team wt  spends executing activity i, is the workload executed by resource (wt  )h, and is the ability of resource (wt  )h to complete activity i.
(9) The available time ( ) of team wt  depends on the available time of the last available resource in the team.
Where |wt  | refers to the number of resource contained in wt  , (wt  )h refers to resource h that is involved in team wt  of activity i.
(10) The matrix elements of lag matrix a, with dimensions m  1, are the set of the presently demanded resource scheduling activities; the values of these elements are expressed as the following: For any activity, when the lag time ti < 0, yielding a value of element ai = 1 in the lag matrix, the implementation of the activity lags. Otherwise, when ai = 0, activity i is executed normally.
(11) The cost Ci(wt ) needed for team wt  's execution of activity i depends on the execution time of each resource member.
Where is the modified coefficient of the demanded time for the execution of activity i by resource member h of team wt  , is the workload executed by resource member h, is the ability of resource member h to complete activity i, and is the running cost per unit of the execution of activity i by the resource member.

Modeling
In a workflow management system, the workflow instance wfk(k=1,...,p) is running, p is the total number of currently running workflow instances. At a certain moment, the active node i(i=1,...,m) is to be performed and m is the total number of activities to be performed, the resource j(j=1,...,n) is available that can be allocated and n is the total number of resources available. R represents a resource set, Ri  R represents the resource set that could be allocated to task i, and cj represents the execution cost of resource j per unit of time.
In order to select the appropriate resource ri(ri=1,...,n) for the execution of activity i, thereby ensuring the shortest total activity execution time, the shortest total activity lag time, the fewest lag activities, and the lowest total resource consumption cost, the following formulas were derived: The shortest total activity execution time is (12) The shortest total activity lag time is (13) The fewest lag activities is (14) The lowest total resource consumption cost is where wi is the importance of the current activity in the running instance wfk.

Leapfrog Algorithm
Shufflered leapfrog algorithm (SFLA) belongs to a class of heuristic swarm intelligence optimization algorithms which triggers a heuristic search for an optimal solution using a certain mathematical function (Peng-jun & San-yang, 2009). The algorithm combines the advantages of both Memetic algorithm and particle swarm optimization algorithm; some of the advantages include relatively simple concept, relatively few parameters, strong global optimization capability, high computing speed and robustness (Zhu & Zhang, 2014). Leapfrog algorithm has been successfully applied to some technology fields, such as multi-objective optimization technology, traffic control, cluster analysis, and some combinatorial optimization problems.
In the leapfrog algorithm, the population is composed of many "frogs" with the same structure, each representing a particular solution. The total population is divided into many sub populations called memeplexes. Different sub-populations (memeplexes) can be thought of as collections of "frogs" with different cultures; as such, these memplexes are executed in accordance with certain local search strategies. In each sub-population (memeplex), each "frog" has its own ideas, but is also affected by the others in its community. After a certain memeplex evolution and jumping process, the cultural ideas of the various sub-populations become mixed during computation; the local search and jumping are executed until the convergence criteria are met.
Based on the principle of the leapfrog algorithm, the detailed steps can be stated as the following.
Step 1: Initializing parameters. Selecting the appropriate number m of memeplex and frog number n of every memeplex, then the number of the population is F = m  n.
Step 2: Initializing population. F frogs X(1 ) , X(2),...,X(F) are generated randomly in the feasible region , let d be a dimension variable, the frog i can be represented as X(i) = Xi 1 , Xi 2 ,...,Xi d  x(i) and the fitness function is f(i) = F(X(i)).
Step 3: Sequencing frogs. The F frogs are ordered according the fitness values and storage with, the best frog Xg = U(1) is recorded.
Step 4: Grouping the frogs and storing in different memeplex. Dividing U into m memeplex, Y1, Y2,…, Ym, there are n frogs in every memeplex. The frogs are allocated according to the formula Step 5: Evolving of memeplex. In a memeplex, every forg will be affected by the others and will evolve through the memeplex, the frog will leap toward the targeting positon.
Step 6: Leaping and moving. The frogs will leap and move among the memeplex, after certain Memeplex evolutions are executed in every memeplex, the frog groups Y1, Y2,…, Ym are merged into U and reordering is carried out, the best frog Pg of the whole population is updated.
Step 7: Judging the algorithm termination condition. If the iteration meets the termination condition, the iteration end and the best frog is output, otherwise executing step 4 again. Figure 2 is a workflow process model of the mold processing of a domestic mold manufacturing enterprise; the definition of each active node is shown in Table 1.

Illustrative Example
In order to respond quickly to market demands and improve enterprise productivity, the original business process was optimized, and two changes were made to the original workflow process model; the compound workflow model was obtained as shown in Figure 3.   Suppose a set of migration nodes of the multiple instances is Ai = {a1,a2,a3,a4,a5,a6,a7,a8,a9,a14,a15,a16}. Table 2 shows the relationships between the allocated active nodes and the time-related resources available for the current scheduling time. In order to facilitate expression and calculation, each of the time parameters in the Table 2 was converted to a relative time scale, and the current scheduling time was set to 0.
The expected time tei of activity i was used to denote the expected completion time of each activity, and the time resource j spent executing activity i was obtained in accordance with the preference of the resources, the resource capacity and workload of the activity.
The cost that resource j spent executing activity i per unit of time is shown in Table 3. The cost of resource execution per unit of time was determined by the properties of the resource itself.
In order to develop the optimization mathematical model for scheduling described in section 2.3, the optimal resource scheduling results were solved using the designed leapfrog algorithm. First, the parameters were initialized; the number of frog populations was set to 40, the ethnic memeplex number was set to 5, the number of frogs in each memeplex was set to 8, and the maximum number of iterations was set to 250. Next, the C# programming language was used to write the algorithm program. The process used to solve the scheduling problem is shown in Figure 4, and the fitness value curve of the possible solutions for each generation is shown in Figure 5. The scheduling result (S ) is equal to {r2,r5,r1,r (1) 11,r7,r6,r9,r21,r18,r13,r14,r12,r (2) 11}, the total activity lag time is equal to f2({ S3}) = 14, the number of lag activities is equal to f3({S3}) = 3, and the consumption cost is equal to f4({S3}) = 152.0, where r (1) 1 1 and r (2) 11 represent the execution of active nodes a4 and a17 by resource r11, and the order of execution is a4, a17.

Conclusion
In this paper, the resource scheduling optimization of workflow instance migration was analyzed. In order to investigate the resource scheduling problem of workflow multi-instance migration, time and cost relationships of activities and resources were analyzed. Certain factors, including the shortest overall activity execution time, minimum overall activity lag time, minimum number of lag activities, and minimum resource consumption cost were used to establish a workflow resource scheduling optimization mathematical model for workflow instance migration. A leapfrog algorithm was implemented to solve the optimal resource scheduling problem. Specific examples were listed to validate the proposed mathematical resource scheduling model and designed algorithm. The results showed that, under the constraints of resource cost and quantity, an optimal resource scheduling scheme for workflow migration can be found, ensuring a minimal running time and optimal cost. On the other hand, only the same-time working style of multi resources executing workflow activity is considered, case of activity executed with other working style should be further studied. Also, only resource scheduling of multi instance migration in a single workflow model is considered, resource scheduling optimization of multi instance migration in multi workflow models should be further studied.