Multi-heuristic scheduling methods for workflow in credit cloud

In the credit cloud, credit services are sold to applications for credit computing, credit fusion and credit risk estimates. Plenty of services with different performance for the same task may have different execution time and charged by various ways. The users have specific requirements for the workflow completion time or cost. Hence, to meet the user’s satisfaction is an important challenge. In this paper, we propose heuristic scheduling methods for credit workflow with total cost minimization, and the deadline should be satisfied. The problem can be divided into two sub-problems, task-mode mapping and task tabling on renting service instances. For the task-mode mapping problem, a recursive heuristic method is constructed to select appropriate service for each task of the workflow. Then another heuristic algorithm based is established to get a final schema with deadline constraint. We discussed the service instance rented in shareable manner and compared with un-shareable manner. Three renting strategies are discussed in detail. Experimental results show the effectiveness and efficiency of the proposed algorithm.

the workflow applications can be executed on cloud platforms, such as Google cloud and Amazon EC2.
In the cloud environment, the IaaS center usually provides three resource renting manners to users, reserved, on-demand and spot [10]. Many types of virtual machines provide different levels of services with various prices. Usually, resource with high computing and storage performance has higher rental costs; thus, the shorter the execution time, the higher the service costs [11]. And the cloud services are usually priced in intervals, such as Amazon EC2, IBM cloud. In such cases, the free slots of rented service instances can be shared among the tasks of the same workflow to decrease the total renting cost. In PaaS or SaaS platforms, different kinds of platforms and software are encapsulated into services and sold to customers. All of these resources provided by clouds are called cloud services. Once the cloud services are charged by intervals and can be shared among tasks are called shareable services, and otherwise, they are termed as unshareable services. Many recent works study on un-shareable service selection for workflow tasks [10,12,13]. In these papers, heuristic and meta-heuristic methods are used to select services for the workflow tasks with cost minimization. However, to the users, they care more about the total cost of the service rented since the resource is concerned to be unlimited in the cloud environment. When services are priced in interval based models [14][15][16], the free time of the rented services can be shared among the tasks to reduce the renting cost. Elastic resource provisioning is discussed based on the interval-based charging models, and more realistic factors, such as VM setup time and data transferring time, are concerned. Heuristic method is proposed to solve this practical problem [17][18][19].
In the cloud service environment, such as vehicle network cloud or Internet of things cloud, some scholars have studied the optimization of resource services such as network transmission performance [20], network rate [21], transmission efficiency [22,23], optimization of joint pricing and power allocation [24] and achieved some results. These studies provide a technical reference for the transmission of credit cloud services on distributed heterogeneous platforms. The credit services are provided in PaaS platform for users to rent. Usually, the credit services provide two renting manners, single renting which is charged on demand according to the length of the lease, and entire renting which is charged by quantity or reserved time intervals with certain discount. With the explosion of credit information and the growth of credit applications, the cloud credit service pricing strategies become more and more worth discussing. Consider the workflow under credit cloud, an efficient scheduling method is necessary for higher resource utilization and cheaper renting cost based on shareable service instances.
In this paper, we discuss the credit service workflow scheduling problems, where users can rent scalable credit services, and the goal is cost minimization of the rented services. The credit services can be obtained on-demand with different costs. Service instances can be shared among the tasks to reduce cost. That is the rented time intervals can be utilized by other tasks, which choose the same service. Finally, the total cost is minimized and the deadline should be satisfied. A recursive method based on the workflow structure is proposed to solve the task-mode mapping problem, which is used to select appropriate service for each task in the workflow. Then an optimal mode assignment schema is obtained. Then a problem-specific heuristic algorithm is constructed to table the tasks to proper time slot of the existing service instances to reduce the cost, and the deadline should be satisfied. In the experimental tests, three renting manners are discussed in detail, single renting manner, entire renting manner, single and entire renting hybrid manner. Different from the two renting manners mentioned before, the hybrid manner considers the services can be rented by the combination of on-demand and reserved time-intervals. The service shareable renting mode is compared with the un-shareable mode. The results show the effectiveness and efficiency of the proposed algorithm.

User workflow applications
A workflow application can be described by an Task-on-Node (AON) directed graph G = (V, A), where V is the set of task nodes {v o , v 1 , v 2 , . . . , v n , v n+1 } and arc set A represents the finish-start zero-lag precedence relations. Any (v i , v j ) ∈ A indicates task v i be the immediate predecessor of task v j ; in other words, task v j cannot start before task v i has finished. Task v 0 and task v n+1 are dummy tasks, representing the starting and the finishing of the application, respectively. Let Dpre j , Dsucc j denote the set of immediate predecessors, immediate successors of task j, respectively. Dpree j and Dsucc j represent the number of immediate predecessors and successors, respectively. Let st j be the starting time of task j, and ft j be the finishing time of task v j . The deadline of the workflow is δ , that is the finishing time of task v n+1 should satisfy ft n+1 ≤ δ.

Cloud service
Various types of services (such as credit computing, credit transferring, credit estimation, crediting data, infrastructures and software) are provided by the credit cloud providers. The workflow should rent proper service instances to execute the tasks. Let S = (S 1 , S 2 , · · · , S w ) be the service set of the system. Each type of the services is charged by time intervals, single renting, entire renting or hybrid renting. The on-demand single renting price per unit price i , entire renting time interval Rinterval i , and the discount disc i of the entire renting of each service are already known. Users send the workflow applications to the cloud center; the Workflow Scheduler should adopt efficient scheduling algorithms to map different services to the tasks with distinct execution time and cost.
There are several candidate services which can perform task v j . That is, each task v j has several execution modes. Let M j be the candidate service mode set of v j , , where S k means the selected service, and d k j is the execution time of the kth mode of v j . The cost of the current mode c k j can be obtained by d k j × price k .

A workflow example
A workflow example is demonstrated in Fig. 1. The candidate modes are shown beside the tasks. The price list of the cloud services of the system is presented in Table 1. Three renting manners, single renting, entire renting and hybrid renting, are illustrated in detail.
There are three execution modes for v 1 to carry out credit computing. If the on-demand single renting manner is adopted, the execution time and cost of v 1 is as follows. In the first mode, service S 4 is selected. The execution time is 5, and it costs 35. The second mode needs 8 time units with service S 2 , and it costs 32. And the last mode needs 10 time units, it costs 30 for service S 1 . Undoubtedly, the service S 4 provides the best computing power with higher renting cost. If the entire renting manner is selected, it just needs only one lease of service S 1 since ⌈10/10⌉ = 1 , and the cost of v 1 is 24. Considering task v 5 and service S 6 is chosen, it costs 9 × 11 = 99 on single renting manner for 11 time units, while it should pay ⌈11/8⌉ × 8 × 9 × 0.95 = 136.8 for the entire renting manner. However, if the hybrid renting manner is adopted, it just need ⌊11/8⌋ × 8 × 9 × 0.95 + 11%8 × 9 = 95.4 . Compared with single renting, the reduction of the cost is 3.64%. The cost has been reduced by 30.3% comparing with entire renting. Hence, it is necessary to choose proper renting manner for each task in order to reduce the total cost of the workflow. Furthermore, if the rented service instance can be shared among the tasks which select the same service, the free slots  of the time intervals can be utilized to reduce the total renting cost of the workflow. The scheduling strategy under sharable service instances will be discussed in detail in Sect. 3.

The considered scheduling problem
Given the deadline of the workflow δ , the service set of the system S = (S 1 , S 2 , · · · , S w ) and the their pricing model, the objective of the workflow scheduling algorithm is to select appropriate number and type of service instances making a balance between execution time and renting cost. The considered problem mainly contains two sub-problems: mode assignment and task sequencing. The mode assignment tries to assign an appropriate mode to each task. The task sequencing tries to obtain an optimal schema to minimize the total renting cost, while the service instances can be shared by the tasks which choose the same service.

A heuristic method for service selection of the workflow
As mentioned above, the first sub-problem of the considered workflow scheduling problem is mode assignment. Each task has several selective services with different execution time and cost. For a workflow with n + 2 tasks, there may be n i=0 |M i | service mode selection schemas. With a given deadline, some of them are feasible solutions, and the others are unfeasible solutions. We propose a heuristic method for obtaining an optical solution Mode = (M * 1 , M * 2 , · · · , M * n ) satisfying the deadline with less cost. The main idea of the heuristic method is described as follows. Firstly, select the service with shortest execution time for each task. Obviously, the mode selection schema can meet the deadline, and the resulting cost is most expensive. Then, the schema is optimized recursively by adjusting the service mode of some tasks with less cost, while the deadline is still satisfied.
In the service pool of each task, the service mode of each task is ranked in ascending order of the execution time, and the descending order of the cost. That is, d k+1 For a give mode selection schema, the kth mode is selected for task i , the earliest start time and finish time can be obtained by est i = max With the given deadline δ , the latest start time and finish time is obtained by lft i = min , a service mode M k+1 i can be reselected for task i for cheaper cost. There may be several tasks can be adjusted their service modes in set . In each recursive, the most appropriate task is selected to choice a cheaper service, which is defined by the reduction of cost in per unit of time . Furthermore, the degree centrality of the node in the workflow is considered, since the smaller the degree of the selected task, the smaller of the influence on other nodes. τ ′ i = τ i /(|Dsucc i | + |Dpre i |) is computed for each task i ∈ . Algorithm is described below.

An example of the scheduling strategies
Traditional service scheduling problems discuss the service renting in non-shareable manner. However, the cloud services mostly can be shared between the tasks during the renting interval to decreased the total renting cost, since Minimizing service renting cost is more important to the cloud users rather than the system performance of service providers.
As described in the second section, if we can schedule the tasks who choose the same service to the same service instance, and entire rent the service with time intervals, the renting cost can get a discount. However, it is time consuming to test every time point to confirm whether there are two tasks can share the renting interval. Since the cloud service is thought to be unlimited and available anytime, the workflow can be run when submitted. The earliest start time of each task is obtained based on the structure through forward scheduling. Then, we will give the renting strategy to schedule the tasks efficiently.
A workflow with 12 tasks is shown in Fig. 2, and the deadline is set to 30. Based on the forwarding scheduling, the schema of the workflow is obtained as Fig. 5, where the service instances are un-shareable. To improve the scheduling efficiency, the renting starting point and finishing point are decided whether the service instance can be shared among the tasks.
The considered workflow has four paths as shown in Fig. 3, and the critical path is 1-4-5-8. The completion time of the workflow is 27. It is finished 3 units before the deadline. That is, the workflow has 3 slack time units. So we can delay the tasks in path-3 (3,9) to share the existing Service4 instance1. Task 5 also can be delayed to share the renting interval of Service2. Task 9 should be retabled to share the existing Service3 instance1. It is sure that once two tasks on the same path selected the same service, they should rent the service in time interval manner, such as task 1 and 4.
The final schedule of the workflow is shown in Fig. 4. As we can see tasks numbered in 3,5,6,7,8,9 are delayed to start, but the completion time of the workflow still satisfies the deadline. 6 instances should be rented to execute the workflow. It is necessary to mention that entire rent the server instance in time intervals or on-demand single rent should be decided which way is cost-efficient. For example, task v 8 need   8 time units to finish by S 1 , renting in per unit charged manner should be chosen for energy conservation. Task v 5 rents S 2 instance1 in one interval and shared 5 units slot to v 10 . In this case, task v 10 still need 1 unit time. Then the renting method mentioned above is adopted to reduce the cost.

Heuristic scheduling method proposed for optimizing the cost under shareable instances
Given the deadline δ , the selected modes for each task Mode = (M * 1 , M * 2 , · · · , M * n ) obtained by HSI, the proposed heuristic scheduling method is used to schedule the tasks sequentially satisficing the precedence constraints, and the services can be shared on the same time interval to reduce the cost.
According to the mode assignment schema, each task has selected a service, and the execution time is fixed. The earliest start time est i and finish time eft i of the task i is computed by the forwarding scheduling, and the latest start time lst i and finish time lft i is obtained by the backward scheduling. For each type of service k in the service set S = (S 1 , S 2 , · · · , S w ) , we construct a set of tasks which has select service k , and the tasks are ordered in the nondescending earliest start time, ℜ k = {a 1 , a 2 , · · · , a m } . The proposed heuristic scheduling method is tried to reschedule the tasks in ℜ k to appropriate start time sharing the renting interval of the service to reduce the total cost.
In order to describe our heuristic scheduling method under shareable instances in detail, we give a mathematical description of some variables. First, the number of existing instances of service S k is defined as NIns k . Then, we define two sets, TInterval t k and TSlot t k , to record the renting time intervals and the remaining time slots of the existing instance tth of service S k . The rth renting interval in set TInterval t k can be described as [st T r , ft T r ] , where st TI r and ft TI r separately represent the starting time and finishing time of the renting interval. The sth slot in set TSlot t k can be described as [st s , ft s ] , where st TS s and ft TS s separately represent the starting time and finishing time of the slot. The tasks in ℜ k tries to schedule in optimal start time sharing the existing service instance. The task will rent a new service instance when all the existing remaining time intervals cannot satisfy its time constraints. The final total cost of the workflow is computed based on the service instance renting time intervals recorded in TInterval ins k , and the hybrid renting manner is adopted.

Experimental and results
The above algorithms were coded in Java and plenty of workflow instances with various different size were executed on a personal computer with Core(TM) i5-5200U CPU 2.  [25]. The topology complexity of the workflow is measured by OS (order strength), and OS is set to 0.1 in this paper.

Parameter setting
In our experiments, the total number of service type is set to 10. The price of service w in per unit is generated by convex function, and the service set S = (S 1 , S 2 , · · · , S 10 ) of the system is sorted in ascending order of the price. The entire renting time period for each service is set to 10 units, and the discount of this renting mode is set to 0.8. Each task of the workflow can rent the service in three manners: single renting charged by ondemand units, entire renting charged by time intervals with discount, hybrid renting of the above two modes. The candidate service mode M i of task i is uniformly distributed in the interval [2, 10] as described in [26]. M i services are selected sequentially from S = (S 1 , S 2 , · · · , S 10 ) . The duration d k i of the current selected service k is generated randomly by [26] in the interval [3,120] 2, 3, 4, 5, 6, 7, 8, 9, 10} , Minest n+1 is the critical path of the current workflow in which the tasks select the service mode with shortest execution time, and Maxest n+1 is the critical path of the workflow where the tasks select the cheapest service mode.

Computational results
In the following experiments, the service mode assignment schema is optimized by the first algorithm HIS proposed in this paper. Based on the resulting mode = (m * 0 , m * 1 , · · · , m * n+1 ) , the critical path length the workflow is obtained by. Then, Scost defines the total cost by the single renting manner under the optimal mode assignment schema. Also, the total cost Icost is computed with the entire renting manner. The cost of the hybrid renting manner is recorded in Hcost . It is important to mention that in the above three workflow scheduling manners, the service instances are un-shareable among the tasks. The shareable service instances renting time intervals are obtained by the second proposed algorithm HSSI, and the optimal cost Ocost is computed by the hybrid renting manner.
The results on 7 different scale workflows are shown in Table 2. 10 different deadlines are performed on each workflow, and the average costs of Scost , Icost , Hcost , Ocost are compared. Since entire renting manner can get a discard of service, Icost is superior to Scost in general. The hybrid manner combines time interval renting and single renting based on the execution time can reduce the total cost more. The optimized Ocost under shareable service instance has better performance on all test cases. Specifically, on the workflow case with 30 tasks, the average Scost is 7626, and the average Ocost is 6218. On the workflow case with 270 tasks, the average Scost is 47198, and the average Ocost is 38397. We define ARPD = (Cost A − Cost Opt )/Cost Opt × 100% to measure the performance of the algorithm. Cost A represents the total cost of the workflow under the current renting manner. Cost Opt is the optimal solution among the four renting manner. The results are shown in Table 3. As we can see, the maximal deviation from our proposed algorithm is 23.35% on the workflow with 210 tasks, and the average deviation of Hcost is 1.37%. The proposed algorithm can always obtain the optimal cost.
Finally, the deadline influence on the workflow is shown in Fig. 5. With the increase of deadline factor, the better the performance of our algorithm. The reason is that a larger deadline results in more candidate cheaper services for the tasks, and the total cost is decreased. Our algorithm can get better performance.

Discussion
In this paper, we propose two heuristic algorithms to minimize the renting cost of the credit cloud service workflows meeting the deadline of the user's. Algorithm 1 is constructed to obtain an optimal mode assignment schema for the workflow. Based on the optimal mode assignment schema, Algorithm 2 tries to schedule the tasks sharing the existing renting time intervals among the tasks which choice the same service, and reduces the total cost. Experimental tests are compared on the three renting manner, single renting, entire renting, and hybrid renting under the un-shareable service instances, which is adopted in most of the existing researches. On the contrary, our algorithm takes advantage of the shareable service renting intervals, and computes the total renting cost in hybrid manner. The results show our method is efficient on solving these problems.
Abbreviations DAG: Directed Acyclic Graphs; AON: Task-on-Node; HIS: Heuristic method for initial solution; HSSI: Heuristic Scheduling method under Shareable Instances.