1 Introduction

With the in-depth applications of cloud computing [1], Internet of Things [2], artificial intelligence, and other new-generation information technologies in the manufacturing industry, many manufacturing enterprises are undergoing significant changes in operating models, manufacturing approaches, and service methods. In this context, mass customization and networked collaboration-based manufacturing has become a mainstream trend. Cloud manufacturing [3], a service-oriented intelligent manufacturing model integrating the above technologies, is gaining widespread attention from various discrete manufacturing enterprises, especially the large number of small and medium-sized enterprises. In the cloud model, some businesses can register their redundant manufacturing resources and service capabilities on the cloud service platform to conveniently provide various specialized manufacturing services, such as machine tool leasing, networked outsourcing processing, and remote equipment maintenance. Other enterprises, that lack manufacturing resources and capabilities, can inexpensively subscribe to these manufacturing services through the cloud platform to solve production challenges and enhance their overall competitiveness [4, 5]. Cloud manufacturing model breaks down the distance limitation and information gap between manufacturing enterprises, and enables them to carry out all kinds of web-based collaboration manufacturing services anytime, anywhere, and on-demand, which can promote the transformation of traditional manufacturing enterprises from production-oriented manufacturing to service-oriented manufacturing, and increase the core value of the entire manufacturing industry chain.

In cloud manufacturing environment, personalized manufacturing requirements from users or enterprises are often characterized by complexity, diversity, and ambiguity, which are often difficult to be met by a single, simple cloud service. Therefore, for the complex customized manufacturing tasks submitted by service requestors, the cloud platform needs to invoke decomposition tools to separate tasks into a series of fine-grained sub-tasks according to corresponding manufacturing processes, and select optimal cloud manufacturing resources and services to execute these sub-tasks to meet corresponding manufacturing requirements [6]. As one of key enabling technologies to improve the utilization and added value of manufacturing resources in cloud, manufacturing service combination plays an important role in the cloud manufacturing tasks implementation. In recent years, much research on manufacturing service combination methodologies has been carried out by domestic and international academics. In terms of the evaluation for the manufacturing service portfolio optimization, in addition to traditional metrics such as time, cost, and quality [7,8,9,10], Zhou et al. [11] considered combinability among manufacturing services and the reputation of service providers. Li and Yang et al. [12, 13] enriched the indicator system with delivery time, delay time, and energy consumption of manufacturing services from the perspective of sustainable manufacturing perspective, making the chosen services more relevant to real manufacturing situations. Although most of the above findings focus on a multidimensional evaluation of the cloud services supported by manufacturing resources, and calculate the overall operational quality of each manufacturing service through constructing quantitative mathematical models. However, the matching degree between cloud services and manufacturing tasks, as well as the collaboration degree among cloud services have not been considered, which makes it difficult for the selected cloud service combination to complete manufacturing tasks efficiently in cloud manufacturing environment. In addition, the evaluation models constructed above take into account the interests of manufacturing service requestors, but do not weigh their interests from the perspective of manufacturing resource providers. As a result, the cooperation between the supply and demand sides is not sustainable, which restricts the effective operation and long-term development of the cloud service platform. In light of the aforementioned, a matching-collaboration degree-based optimization method of cloud manufacturing service composition is proposed to address the above issues in this paper, and the main contributions of this paper are as follows:

  1. 1.

    The concepts of service matching degree (Sm) and service collaboration degree (CS) are proposed, and an evaluation metric system of cloud manufacturing service composition, including service time (St), service cost (Sc), service reliability (Sr), Sm, and CS, is established.

  2. 2.

    A double-constraint composition optimization model for cloud manufacturing services is designed in which the interests of both manufacturing service requesters and manufacturing resource providers are considered comprehensively.

  3. 3.

    An improved ant colony algorithm (IACO) for cloud manufacturing service composition is proposed, and an application example is given to verify the effectiveness of the proposed method.

The remainder of this paper is organized as follows: The related work on cloud manufacturing service composition is introduced in Section 2. Section 3 presents the evaluation metric system of cloud service composition including service matching degree and composition synergy degree, and a double-constraint composition optimization model is constructed. An improved ant colony algorithm is designed in Section 4. Section 5 discusses an application case to verify the feasibility and effectiveness of the proposed method. The conclusion section includes the research summary of this paper and future works.

2 Related work

The purpose of service composition optimization is to assess the efficiency and quality of collaboration among multiple services by constructing a comprehensive evaluation system, so as to ensure that manufacturing requirements are fully met. In cloud manufacturing, kinds of massive, geographically dispersed, and heterogeneous manufacturing resources and capabilities are registered as web services with different quality properties. Therefore, it is challenging to perform complex manufacturing tasks in a multi-service collaborative manner, which makes service composition evaluation and selection extremely significant and has been extensively studied by multinational researchers.

2.1 Cloud service composition

Service composition in cloud manufacturing is an NP-hard problem with multiple decision-making objectives, which is solved simplistically by using some heuristic algorithms, such as genetic algorithm [14,15,16], artificial bee colony algorithm [17], particle swarm optimization algorithm [18], ant colony optimization algorithm [19], and chaos algorithm [20]. Many academics have also proposed hybrid algorithms to improve the problem solution by exploiting the advantages of the abovementioned algorithms. Wang et al. [21] proposed a novel simplex-based bee-colony hybrid algorithm, using a simplex method along with a chaotic global optimal guidance strategy, to solve the composition constraint model of manufacturing services. To achieve the quality-aware cloud manufacturing service composition, Jin et al. [22] proposed a new hybrid teaching-based optimization method, which combined the advantages of uniform mutation, adaptive flower pollination, and a teaching-based optimization algorithm. Gavvala et al. [23] proposed a whale optimization algorithm with eagle strategy (ESWOA) to ensure the proper balance among cloud services with differing quality features in collaborative operations. Zhu et al. [24] constructed a multi-batch subtasks parallel composition scheme of manufacturing cloud services, and designed an improved hybrid differential evolution and teaching-based optimization method to enable the combined manufacturing service stable, reliable, and efficient. Bouzary et al. [25] proposed a hybrid approach based on a gray wolf optimizer and genetic algorithm to select and composite available manufacturing resources into an integrated cloud service, which could meet individual manufacturing requirements from users while keeping up the optimal quality of service.

2.2 Cloud service optimization selection

It has been a considerable challenge to select the optimal combination of services from numerous candidate manufacturing services in cloud manufacturing. To address the multi-objective manufacturing service optimal-selection problem, Tao et al. [26] described the correlations among manufacturing services, and proposed an approach based on the principles of particle swarm optimization (PSO). Yi et al. [8] proposed an improved fast non-dominated ranking genetic algorithm with an elite strategy, which used the optimal decision method combining hierarchical analysis and entropy value theory to comprehensively evaluate all manufacturing service compositions. Chattopadhyay et al. [27] studied the multi-constrained QoS-aware cloud service selection problem, which was addressed by the proposed optimal approach based on Pareto front construction. Yin et al. [28] proposed a non-dominated sorting genetic algorithm (NSGA) III-based optimization method for composition selection of cloud manufacturing services, and the conducted experiment showed that NSGA-III achieved the optimal solution more efficiently compared to other methods. Bi et al. [29] proposed a preference-based NSGA-III method to solve the service optimization selection problem in cloud manufacturing. Compared with the traditional preference-based multi-objective algorithms, the proposed method directly distributed the preference reference points on the NSGA-III hyperplane according to the preference weights of QoS properties provided by users and facilitated the search for optimal solutions. In addition, Yuan et al. [10] designed an evaluation method based on gray correlation analysis for the optimization selection of various manufacturing services. Liang et al. [30] proposed a deep reinforcement learning algorithm for the cloud service optimization problem, and experimental results showed that the presented method outperformed the deep reinforcement network and Q-learning algorithm. Liu et al. [31] discussed an adaptive service combination optimization problem, which was solved by the combined reinforcement learning and deep learning approach.

Nevertheless, the above findings pay little attention to the matching degree between cloud services and manufacturing tasks, as well as the synergy degree among different cloud services. Meanwhile, most studies regard only the interests of manufacturing service requestors, but neglect the interests of manufacturing resource providers, which reduces the operational effectiveness of cloud services. For this reason, this paper establishes a double-constraint composition optimization model that is solved by using the improved ant colony algorithm (IACO).

3 Mathematical model of cloud service composition

3.1 Problem description

The operation of the submitted complex manufacturing tasks in the cloud platform can be divided into three main phases, including manufacturing task fragmentation, manufacturing subtask matching, and service composition optimization, as shown in Fig. 1. At the manufacturing task fragmentation stage, the cloud service platform first analyzes the manufacturing task T submitted by requesters, and based on the manufacturing process knowledge invokes task resolution tools to divide the task into manufacturing subtasks with process relevance, which can be expressed as \(T=\{S{T}_{1},S{T}_{2},\dots ,S{T}_{i},\dots ,S{T}_{N}\}\), where \(S{T}_{i}\) represents i-th manufacturing subtask. The decomposed subtasks will perform matching operations with various cloud services published by providers in the manufacturing subtask matching phase. For the manufacturing subtask \(S{T}_{i}\), a set of candidate services can be matched in the cloud resource pool, denoted as \({S}_{i}=\{{S}_{i}^{1},{S}_{i}^{2},\dots ,{S}_{i}^{j},\dots ,{S}_{i}^{M}\}\), where \({S}_{i}^{j}\) is the j-th candidate service for the manufacturing subtask \(S{T}_{i}\) and M is the number of candidate services for \(S{T}_{i}\). In the service composition optimization stage, the most qualified manufacturing service \({S}_{i}^{j}\) will be selected from each candidate service set \({S}_{i}\) to perform the manufacturing subtask \(S{T}_{i}\) based on the established evaluation criteria, which consist of QoS attributes of each candidate manufacturing service, including service time, service cost and service reliability, noted as \(QoS=\{{q}_{1},{q}_{2},\dots ,{q}_{r}\}\), where r is the number of QoS attributes.

Fig. 1
figure 1

Cloud service composition optimization scheme

3.2 Evaluation metric system for cloud service composition

Traditional composition evaluation methods of cloud manufacturing services only consider factors that describe the capability and quality of individual services [32, 33], with regard to service time, service cost, reliability of service operation, and so on, without accounting for matching degree between cloud services and manufacturing tasks, as well as collaboration degree among cloud services. Therefore, this paper establishes a novel cloud service composition evaluation system, which is described as follows:

3.2.1 Service time

In cloud manufacturing, the execution of manufacturing tasks involves the delivery and processing of workpieces. Thereby, service time represents the total time required for the best candidate services which takes the least time to complete the manufacturing subtasks, including service execution time and logistics time. The service time (St) is expressed by the formula (1).

$$St=\sum_{i=1}^{N}{\mathrm{min}}\left[mt\left({x}_{ij}\right)+lt\left({x}_{\left(i-1\right)j},{x}_{ij}\right)\right]$$
(1)

where \({x}_{ij}\) indicates the candidate service \(C{S}_{i}^{j}\) from the candidate service set \({S}_{i}\), \(mt\left({x}_{ij}\right)\) is the execution time of the j-th candidate service for manufacturing subtask \(S{T}_{i}\), and \(lt\left({x}_{\left(i-1\right)j},{x}_{ij}\right)\) means the transport time of workpieces being machined between \({x}_{\left(i-1\right)j}\) and \({x}_{ij}\).

3.2.2 Service cost

Service cost is defined as the sum of the minimum manufacturing and logistics costs required to satisfy manufacturing subtasks for the best manufacturing service selected from the candidate set, which is calculated by the formula (2).

$$Sc=\sum_{i=1}^{N}{\mathrm{min}}\left[mc\left({x}_{ij}\right)+lc\left({x}_{\left(i-1\right)j},{x}_{ij}\right)\right]$$
(2)

where \(mc\left({x}_{ij}\right)\) denotes the manufacturing cost of the service \({x}_{ij}\) to complete the subtask \(S{T}_{i}\), and \(lc\left({x}_{\left(i-1\right)j},{x}_{ij}\right)\) notes the material delivery cost between the subtask \({x}_{\left(i-1\right)j}\) and \({x}_{ij}\) when the j-th candidate service is selected.

3.2.3 Service reliability

Service reliability (Sr) means the ability of all best candidate manufacturing services to correctly complete manufacturing task T under specific constraints, which can be obtained by the cloud platform based on historical operation records of the selected services and is expressed as the formula (3).

$$Sr=\prod\limits_{i=1}^{N}{\mathrm{max}}\;r({x}_{ij})$$
(3)

where \(r({x}_{ij})\) is the reliability of the candidate manufacturing service \({x}_{ij}\) to accomplish the subtask \(S{T}_{i}\).

3.2.4 Service matching degree

Service matching is a measurement of the quality level of the results produced by candidate services carrying out the assigned manufacturing subtasks in cloud manufacturing, which is related to service activity, service history, and service delivery rate. Service activity refers to the number of times that manufacturing services are selected to satisfy the requirements of manufacturing subtasks over a period. There is a positive correlation between service activity and service matching degree, the higher the activity level, the better the execution ability of the services, and the higher the matching degree between the services and the subtasks. For the i-th subtask, the activity of its j-th candidate service (\(S{a}_{ij}\)) is expressed as the formula (4).

$$S{a}_{ij}=o\left({x}_{ij}\right)/O\left(x\right)$$
(4)

where \(o\left({x}_{ij}\right)\) represents times the service \({x}_{ij}\) has been invoked, and \(O\left(x\right)\) denotes the total number of times all services have been invoked in the same period.

Service history means the track record of the selected service in performing various manufacturing tasks, including service experience, knowledge, and service evaluation from users. Therefore, service history (\(S{h}_{ij}\)) is calculated by the formula (5).

$$S{h}_{ij}={\omega }_{1}T{o}_{ij}+{w}_{2}{K}_{ij}+{w}_{3}{E}_{ij}$$
(5)

where \(T{o}_{ij}\) is the effective uptime percentage of the service \({x}_{ij}\) in cloud, \({K}_{ij}\) refers to the proportion of process knowledge held by the service \({x}_{ij}\) to the knowledge of similar services in the whole platform, \({E}_{ij}\) is a triangular fuzzy number, which denotes the service satisfaction rating graded by users, \({\omega }_{1}\), \({\omega }_{2}\), and \({\omega }_{3}\) are their weights, and \({\omega }_{1}+{w}_{2}+{w}_{3}=1\). Obviously, the richer the experience and knowledge of the selected service and the higher the service evaluation, the higher the matching degree of the service.

Service delivery (\(S{d}_{ij}\)) is the ratio of the number of manufacturing tasks successfully performed by the service to the times the service was invoked, which is expressed by the formula (6).

$$S{d}_{ij}={o}_{d}\left({x}_{ij}\right)/o\left({x}_{ij}\right)$$
(6)

Therefore, the matching degree of j-th candidate service (\(S{m}_{ij}\)) can be represented as the formula (7). Here \({\lambda }_{1}\), \({\lambda }_{2}\), and \({\lambda }_{3}\) are weights, and \({\lambda }_{1}+{\lambda }_{2}+{\lambda }_{3}=1\).

$$S{m}_{ij}={\lambda }_{1}S{a}_{ij}+{\lambda }_{2}S{h}_{ij}+{\lambda }_{3}S{d}_{ij}$$
(7)

3.2.5 Service collaboration degree

                            Collaboration among services is also a key factor that affects the service quality in the cloud, which represents the ability of multiple cloud manufacturing services to work together to efficiently accomplish a complex manufacturing task. Consequently, Service collaboration is mainly characterized by metrics such as service process execution time and the efficiency of information interaction among services. The faster information interaction and execution among services, the higher the inter-service collaboration level[42]. And then, service collaboration degree can be calculated by the following formula (8).

$$C{S}_{i\left(i+1\right)}=\frac{{T}_{ij}+{T}_{(i+1)j}}{{T}_{i(i+1)j}}$$
(8)

where \(C{S}_{i\left(i+1\right)}\) is the collaboration degree of best candidate service \({x}_{ij}\) and \({x}_{(i+1)j}\) for subtask \(S{T}_{i}\) and \(S{T}_{i+1}\), respectively, \({T}_{ij}\) (or \({T}_{(i+1)j}\)) denotes the time taken by service \({x}_{ij}\) (or \({x}_{(i+1)j}\)) to complete subtask \(S{T}_{i}\) (or \(S{T}_{i+1}\)) independently, and \({T}_{i(i+1)j}\) is the total time spent by two cloud manufacturing services \({x}_{ij}\), \({x}_{(i+1)j}\) cooperating to complete two manufacturing tasks. The calculation of \({T}_{i(i+1)j}\) is closely related to the interaction between services, which is calculated using the following formula.

$${T}_{i\left(i+1\right)j}=\left\{\begin{array}{c}{T}_{ij}+{T}_{(i+1)j}\mathrm{,} \, \, \, \, \, \, \, \, \, \, \, \, \, \, {\mathrm{S}}{\mathrm{u}}{\mathrm{b}}{\mathrm{t}}{\mathrm{a}}{\mathrm{s}}{\mathrm{k}}{\mathrm{s}} \, S{T}_{i} \, {\mathrm{a}}{\mathrm{n}}{\mathrm{d}} \, S{T}_{i+1} \, {\mathrm{a}}{\mathrm{r}}{\mathrm{e}} \, {\mathrm{e}}{\mathrm{x}}{\mathrm{e}}{\mathrm{c}}{\mathrm{u}}{\mathrm{t}}{\mathrm{e}}{\mathrm{d}} \, {\mathrm{s}}{\mathrm{e}}{\mathrm{r}}{\mathrm{i}}{\mathrm{a}}{\mathrm{l}}{\mathrm{l}}{\mathrm{y}} \, \, \\ max[{T}_{ij},{T}_{(i+1)j}], \, \, \, \, \, \, \, {\mathrm{S}}{\mathrm{u}}{\mathrm{b}}{\mathrm{t}}{\mathrm{a}}{\mathrm{s}}{\mathrm{k}}{\mathrm{s}} \, S{T}_{i} \, {\mathrm{a}}{\mathrm{n}}{\mathrm{d}} \, S{T}_{i+1} \, {\mathrm{a}}{\mathrm{r}}{\mathrm{e}} \, {\mathrm{e}}{\mathrm{x}}{\mathrm{e}}{\mathrm{c}}{\mathrm{u}}{\mathrm{t}}{\mathrm{e}}{\mathrm{d}} \, \, {\mathrm{p}}{\mathrm{a}}{\mathrm{r}}{\mathrm{a}}{\mathrm{l}}{\mathrm{l}}{\mathrm{e}}{\mathrm{l}}{\mathrm{l}}{\mathrm{y}}\\ {T}_{ij}+{T}_{(i+1)j}+2{\xi }_{i(i+1)}\sqrt{{T}_{ij}\cdot {T}_{(i+1)j}}, \, \, \, \, \, \, {\mathrm{S}}{\mathrm{u}}{\mathrm{b}}{\mathrm{t}}{\mathrm{a}}{\mathrm{s}}{\mathrm{k}}{\mathrm{s}} \, S{T}_{i} \, {\mathrm{a}}{\mathrm{n}}{\mathrm{d}} \, S{T}_{i+1} \, {\mathrm{a}}{\mathrm{r}}{\mathrm{e}} \, {\mathrm{e}}{\mathrm{x}}{\mathrm{e}}{\mathrm{c}}{\mathrm{u}}{\mathrm{t}}{\mathrm{e}}{\mathrm{d}} \, {\mathrm{i}}{\mathrm{n}} \, {\mathrm{c}}{\mathrm{l}}{\mathrm{o}}{\mathrm{s}}{\mathrm{e}} \, {\mathrm{c}}{\mathrm{o}}{\mathrm{u}}{\mathrm{p}}{\mathrm{l}}{\mathrm{i}}{\mathrm{n}}{\mathrm{g}}\end{array}\right.$$
(9)

where \({\xi }_{ij}\) is the coupling coefficient between manufacturing services \({x}_{ij}\) and \({x}_{(i+1)j}\); its value mainly depends on information interaction efficiency among services. The more frequent the information interaction between two services, the smaller the value of \({\xi }_{ij}\) (\(0<{\xi }_{ij}<1\)). For example, when two manufacturing services collaborate frequently and information interaction with each other is smooth, the value \({\xi }_{ij}\) can be 0.1; conversely, when the two services have no interaction, \({\xi }_{ij}\) is 0.9.

3.3 Double-constrained multi-objective optimization model

The goal of cloud manufacturing service composition is to select a service collaboration program with the best overall QoS among many composition solutions to complete complex manufacturing tasks submitted by users under various QoS constraint objectives. Therefore the constructed multi-objective optimization model for a cloud manufacturing service composition problem is as follows.

$$f(T)={\delta }_{1}Sm+{\delta }_{2}CS+{\delta }_{3}Sr+{\delta }_{4}St+{\delta }_{5}Sc$$
(10)
$$Sm=\sum_{i=1}^{N}{\mathrm{max}}\left(S{m}_{ij}\cdot {x}_{ij}\right)$$
(11)
$$CS=\sum_{i=1}^{N-1}C{S}_{i(i+1)}$$
(12)
$$\begin{array}{cc}s.t.&St\leq T_\mathrm{max}\\&Sc\leq C_\mathrm{max}\\&Sr\geq R_\mathrm{min}\end{array}$$
(13)
$$x_{ij}=\left\{\begin{array}{cc}1,&\mathrm T\mathrm h\mathrm e\;i-\mathrm t\mathrm h\;\mathrm m\mathrm a\mathrm n\mathrm u\mathrm f\mathrm a\mathrm c\mathrm t\mathrm u\mathrm r\mathrm i\mathrm n\mathrm g\;\mathrm s\mathrm u\mathrm b\mathrm t\mathrm a\mathrm s\mathrm k\;\mathrm i\mathrm s\;\mathrm a\mathrm s\mathrm s\mathrm i\mathrm g\mathrm n\mathrm e\mathrm d\;\mathrm t\mathrm o\;\mathrm t\mathrm h\mathrm e\;j-\mathrm t\mathrm h\;\mathrm c\mathrm l\mathrm o\mathrm u\mathrm d\;\mathrm s\mathrm e\mathrm{rvice}\\0,&\mathrm{others}\end{array}\right.$$
(14)

where \({T}_{{\mathrm{max}}}\), \({C}_{{\mathrm{max}}}\), and \({R}_{{\mathrm{min}}}\) are constraints given by the requirement users from the cloud platform in terms of service time, cost, and reliability, \({\delta }_{1}\), \({\delta }_{2}\), \({\delta }_{3}\), \({\delta }_{4}\), and \({\delta }_{5}\) are the weights of individual metrics, and \(\sum\limits_{i=1}^{5}{\delta }_{n}=1\).

However, service time and cost are negative indicators that users expect to be as low as possible, service reliability, service matching degree, and service collaboration degree are beneficial metrics for which users expect higher values. Moreover, these five indicators have different scales. Therefore, the above indicators need to be normalized by the formula (15). Formula (15a) is used to calculate the positive indicators, and other cost-based indicators are standardized by formula (15b).

$$\overline q=\left\{\begin{array}{ll}1&q_\mathrm{max}-q_\mathrm{min}=0\\(q-q_\mathrm{min})/(q_\mathrm{max}-q_\mathrm{min})&q_\mathrm{max}-q_\mathrm{min}\neq0(a)\\(q_\mathrm{max}-q)/(q_\mathrm{max}-q_\mathrm{min})&q_\mathrm{max}-q_\mathrm{min}\neq0(b)\end{array}\right.\begin{array}{c}\begin{array}{cc}&\end{array}\\\begin{array}{cc}&\end{array}\\\begin{array}{cc}&\end{array}\end{array}$$
(15)

4 An improved ant colony optimization algorithm

4.1 ACO algorithm

The ant colony optimization algorithm(ACO) is a new metaheuristic calculation method inspired by the foraging behavior of ant colonies in nature, which has been successfully applied to many fields [34]. Corresponding to the ACO algorithm, some parameters in this paper are as follows:

  1. 1.

    \({M}_{i}\) denotes the number of candidate services for the i-th manufacturing subtask.

  2. 2.

    \(m\) stands for the number of ants.

  3. 3.

    \({\tau }_{lk}(t)\) means the residual pheromone on the path from node l to node k at the time t. The initial time is set to \({\tau }_{lk}(0)=C\) and C is the initial pheromone concentration, usually a small constant.

  4. 4.

    \({\eta }_{lk}(t)\) represents heuristic information, and \({\eta }_{lk}(t)=1/{d}_{lk}\). \({d}_{lk}\) indicates the distance between node l to node k.

Thus, the probability that at moment t ant u chooses to move from node l to node k can then be calculated by the following Eq. (16).

$$p_{lk}^u\left(t\right)=\left\{\begin{array}{cc}\frac{\left[\tau_{lk}\left(t\right)\right]^\alpha\left[\eta_{ij}\left(t\right)\right]^\beta}{\sum\limits_{k\in allowedNs\left(l\right)}\left[\tau_{lk}\left(t\right)\right]^\alpha\left[\eta_{lk}\left(t\right)\right]^\beta}&,k\in allowedNs\left(l\right)\\0&\mathrm{,otherwise}\end{array}\right.$$
(16)

where \(\alpha\) and \(\beta\) denote the relative importance parameters of pheromone \(\tau\) and heuristic information \(\eta\), respectively. \(allowedNs(l)\) records the set of all nodes allowed to be selected starting from node l, which is also the set of the next optional cloud manufacturing services. When all ants reach the end node, the number of iterations is increased by 1(\(t\leftarrow t+1\)), and the pheromone is updated as shown in Eq. (17).

$${\tau }_{lk}(t+1)=(1-\rho )\cdot {\tau }_{lk}(t)+\Delta {\tau }_{lk}(t,t+1)$$
(17)

where \(\rho\) is the pheromone volatilization coefficient, \(\Delta {\tau }_{lk}(t,t+1)\) represents the pheromone concentration increment generated by the ant from node l to node k, calculated by the formula (18).

$$\Delta {\tau }_{lk}(t,t+1)=\sum_{u=1}^{m}\Delta {\tau }_{lk}^{u}(t,t+1)$$
(18)

where \(\Delta {\tau }_{lk}^{u}(t,t+1)\) denotes the pheromone concentration produced by ant u from node l to node k, which is calculated by the Eq. (19).

$$\Delta\tau_{lk}^u(t,t+1)=\left\{\begin{array}{cc}Q/L_u,&\mathrm a\mathrm n\mathrm t\;u\;\mathrm i\mathrm s\;\mathrm t\mathrm r\mathrm a\mathrm n\mathrm s\mathrm f\mathrm e\mathrm r\mathrm r\mathrm e\mathrm d\;\mathrm f\mathrm r\mathrm o\mathrm m\;\mathrm n\mathrm o\mathrm d\mathrm e\;l\;\mathrm t\mathrm o\;\mathrm n\mathrm o\mathrm d\mathrm e\;k\\0,&\mathrm{otherwise}\end{array}\right.$$
(19)

where \(Q\) is a constant, \({L}_{u}\) is the total distance traveled by ant u after traversing all nodes in the current time cycle.

4.2 Improvement strategies

The traditional ACO algorithm described above has been successful in solving the traveling salesman problem (TSP). However, the algorithm has the disadvantages of slow convergence and vulnerability to fall into local optimization, which makes it unsuitable for solving the service composition problem. Therefore, this paper proposes corresponding improvement strategies.

Firstly, the path chosen by the ant after each traversal is divided into N steps, namely \(\langle LS\to {S}_{1}\rangle ,\langle {S}_{1}\to {S}_{2}\rangle ,\dots ,\langle {S}_{N-1}\to {S}_{N}\rangle\), whereby the traversed nodes can be represented as follows.

$$allowedNs({S}_{i})={S}_{i}^{j}({S}_{i}^{j}\in {S}_{i},j=\mathrm{1,2},3,\cdots ,M)$$
(20)

Then, cloud manufacturing service composition is a multi-objective optimization problem, which is subject to dual constraints from service requestors and resource providers in the cloud platform. Therefore, it is necessary to eliminate invalid paths that do not satisfy these constraints. Specifically, only ants taking valid paths are selected to update the pheromone concentration, and only optimal paths can trigger pheromone updating. As a result, therefore, both the objective function and the above formula (19) need to be converted into the following equations.

$${f}^{\prime}(T)=1/{\delta }_{1}Sm+{\delta }_{2}CS+{\delta }_{3}Sr+{\delta }_{4}St+{\delta }_{5}Sc$$
(21)
$$\Delta\tau_{lk}^{\mathrm{best}}(t,t+1)=\left\{\begin{array}{lc}Q/L_{\mathrm{best}},&\mathrm t\mathrm h\mathrm e\;\mathrm b\mathrm e\mathrm s\mathrm t\;\mathrm a\mathrm n\mathrm t\;u\;\mathrm t\mathrm r\mathrm a\mathrm v\mathrm e\mathrm l\;<l\rightarrow k>\\0,&\mathrm{otherwise}\end{array}\right.$$
(22)

Although the above improvement strategies enhance the convergence speed of the algorithm, which may make it fall into the local optimum. For this reason, the roulette mechanism is adopted, so that the algorithm can go to the next candidate services with a smaller probability, and traverse the new path to solve the local optimum problem. The flow of the proposed improved ACO algorithm is shown in Fig. 2. The specific solution steps are described below:

  • Step 1: The set of paths that ants are allowed to visit is set. The number of ants m and the pheromone concentration C is initialized.

  • Step 2: All indicators are normalized according to Eq. (15), which is used to build the objective function (21).

  • Step 3: Randomly place m ants on each of the allowed path set nodes.

  • Step 4: Search all the paths connected to this ant node and calculate the state transition probability that the ant can visit the next node using the formula (16).

  • Step 5: A roulette mechanism is used to select the next node where the ant will visit based on the probability calculated in Step 4.

  • Step 6: Determine whether it is the optimal ant and whether the path is valid. If the answer is true, the access path pheromone is updated; otherwise, the pheromone increment on the invalid path is set to 0.

  • Step 7: Pheromones are updated and the contraindication table is cleared based on Eqs. (17)–(19).

  • Step 8: Repeat Steps 3 to 7 until the maximum number of iterations, and then the optimal solution is outputted.

Fig. 2
figure 2

Flow of IACO algorithm

5 Application case

5.1 Case description

To verify the feasibility and effectiveness of the proposed method in solving the cloud manufacturing service composition optimization problem, this paper applies the method to a cloud service application case of automotive component manufacturing. In this case, there are 100 car bumper manufacturing tasks are submitted by the service requestor to the cloud platform that has been developed and commercially operated by the Chongqing University intelligent manufacturing team for more than 10 years. The requestor specified the execution constraints for these manufacturing tasks, including execution time \({T}_{{\mathrm{max}}}\) of no more than 30 days, total cost \({C}_{{\mathrm{max}}}\) of no more than RMB 80,000, and service reliability \({R}_{{\mathrm{min}}}\) of no less than 0.93. Based on the manufacturing process, this complex manufacturing task is divided into five sub-tasks by invoking the task decomposition tool in the platform, including mold design and forging subtask \(S{T}_{1}\), part processing subtask \(S{T}_{2}\), assembly subtask \(S{T}_{3}\), performance testing subtask \(S{T}_{4}\), painting and packaging subtask \(S{T}_{5}\). Each subtask has been matched with a corresponding set of manufacturing cloud services using an intelligent search engine in the cloud platform, namely \(S=\left({S}_{1},{S}_{2},{S}_{3},{S}_{4},{S}_{5}\right)\), and QoS attribute values for each candidate service are shown in Table 1, which are dynamically updated in the cloud platform according to the service market. Logistics time and cost between candidate services are shown in Table 2.

Table 1 QoS attribute of candidate services
Table 2 Logistics time and cost between candidate services

Combining with the service history records shown in the cloud platform, the values of \({\lambda }_{1}\), \({\lambda }_{2}\), and \({\lambda }_{3}\) are set to 0.4, 0.3, and 0.3, respectively, so the matrix of service matching degree Sm can be obtained by using the Eq. (7).

$$Sm=\left[\begin{array}{ccccc}0.72& 0.29& 0.43& 0.53& 0.49\\ 0.77& 0.37& 0.44& 0.53& 0.54\\ 0.62& 0.48& 0.53& 0.47& 0.67\\ 0.31& 0.65& 0.69& 0.44& 0.64\\ 0.89& 0.61& 0.72& 0.65& 0.74\end{array}\right]$$

According to the above definition of service collaboration degree and its formulae (8) and (9), the service collaboration degree CS can be calculated as follows:

$$\begin{array}{cc}CS_{12}=\begin{bmatrix}0.736&0.684&0.546&0.632&0.667\\0.588&0.784&0.625&0.772&0.736\\0.909&1.000&0.589&0.770&0.770\\0.625&0.835&0.567&0.760&0.624\\0.523&0.836&0.628&0.668&0.914\end{bmatrix},&CS_{13}=\begin{bmatrix}1.000&0.579&0.668&0.775&0.652\\0.559&0.909&0.715&0.628&0.715\\0.652&0.553&0.855&0.756&0.954\\0.834&0.910&0.669&0.770&0.717\\0.910&0.810&0.773&0.825&0.866\end{bmatrix}\\CS_{14}=\begin{bmatrix}0.834&0.628&0.566&0.755&0.850\\0.866&0.910&0.909&0.563&0.772\\1.000&0.910&0.905&0.788&0.699\\0.556&0.770&0.642&0.885&0.916\\1.000&0.766&0.769&0.854&0.559\end{bmatrix},&CS_{15}=\begin{bmatrix}0.595&0.668&0.866&0.705&0.910\\0.899&0.866&0.909&1.000&0.699\\0.755&0.769&0.599&0.527&0.625\\0.771&0.671&0.593&0.925&0.936\\1.000&0.855&0.647&0.980&0.735\end{bmatrix}\\CS_{23}=\begin{bmatrix}0.835&0.863&0.985&0.772&0.593\\0.542&0.754&0.910&0.855&0.776\\0.669&0.996&1.000&0.885&0.668\\0.886&0.735&0.863&0.566&0.775\\0.566&0.897&0.910&0.915&0.866\end{bmatrix},&CS_{24}=\begin{bmatrix}0.860&0.960&0.875&0.834&0.836\\0.755&0.760&0.541&0.536&0.952\\0.845&0.865&0.596&0.945&0.987\\0.696&0.910&0.955&0.996&0.771\\0.962&0.625&0.788&0.667&0.911\end{bmatrix}\\CS_{25}=\begin{bmatrix}0.569&0.910&0.854&0.770&0.996\\0.820&0.520&0.778&0.652&0.837\\0.885&0.746&0.910&0.996&0.945\\0.536&0.642&0.668&0.886&0.955\\0.996&0.756&0.734&0.634&0.566\end{bmatrix},&CS_{34}=\begin{bmatrix}0.778&0.623&0.668&0.996&0.886\\0.714&0.557&0.770&0.996&0.995\\0.910&0.565&0.835&0.832&0.885\\0.945&0.856&0.775&0.536&0.533\\0.966&0.910&0.752&0.760&0.886\end{bmatrix}\\CS_{35}=\begin{bmatrix}0.863&0.775&0.966&0.775&0.911\\0.927&0.863&0.523&0.715&0.775\\0.759&0.912&0.690&0.910&0.836\\0.886&0.662&0.556&0.678&0.833\\0.889&0.799&0.835&0.978&0.955\end{bmatrix},&CS_{45}=\begin{bmatrix}0.887&0.775&0.663&0.995&0.669\\0.863&0.669&0.559&0.667&0.775\\0.998&0.687&0.597&0.710&0.812\\0.915&0.966&0.956&0.855&0.872\\0.823&0.833&0.956&0.996&0.886\end{bmatrix}\end{array}$$

5.2 Experimental analysis

The experiment is carried out using MATLAB R2018a, and the IACO algorithm parameters are set as follows: the number of ants \(m=10\), the initial pheromone concentration \(C=1\), the pheromone increment coefficient \(Q=1\), the pheromone factor \(\alpha =1\), the heuristic factor \(\beta =5\), the pheromone volatilization coefficient \(\rho =0.25\), the weights of five metrics \({\delta }_{1}={\delta }_{2}={\delta }_{3}={\delta }_{4}={\delta }_{5}=0.2\), and the maximum number of iterations is set to 100. The experimental result is shown in Fig. 3.

Fig. 3
figure 3

Experimental result

As illustrated in Fig. 3, the experimental result is convergent after 11 iterations of the algorithm, and the optimal fitness value obtained is 2.3889. Correspondingly, the values of five objective QoSs are \(St=28\), total \(Sc=79100\), \(Sr=0.968\), \(Sm=3.41\), and \(CS=8.157\), and the optimal service composition solution is \(\left({S}_{1}^{1},{S}_{2}^{5},{S}_{3}^{1},{S}_{4}^{5},{S}_{5}^{1}\right)\).

In order to validate the performance of the IACO algorithm, it was compared with the Particle Swarm Algorithm (PSO), Genetic Algorithm (GA), and the original Ant Colony Optimisation Algorithm (ACO) to solve the above service composition optimization problem via MATLAB R2018a. As shown in Fig. 4, it can be found that the proposed algorithm in this paper has a faster convergence rate and outperforms the other three algorithms in terms of accuracy and optimization effectiveness. Therefore, the proposed method in this paper has better performance in solving cloud service composition optimization problems.

Fig. 4
figure 4

Comparison of four algorithms

6 Conclusions

In order to realize more efficient and accurate matching and execution of various personalized manufacturing requirements and cloud services on the manufacturing service platform, the concepts of service matching degree between cloud services and manufacturing tasks, as well as the collaboration degree among cloud services were proposed in this paper. A novel evaluation system of cloud manufacturing service composition, including service time, service cost, service reliability, service matching degree, and service collaboration degree, was constructed. Then, taking into account the interests of both the service supplier and requestors in the platform, a two-constraint service composition optimization model was constructed, and solved by using the IACO algorithm. Finally, through a car bumper cloud manufacturing case from the cloud platform that has been developed and commercially operated by the Chongqing University intelligent manufacturing team, the feasibility and effectiveness of the proposed method were verified.

In future research, with the penetrating application of the new generation artificial intelligence technologies in the industrial field, we will devote ourselves to studying the application of advanced algorithms, such as deep learning and reinforcement learning, to support the efficient operation of cloud manufacturing services.