1 Introduction

Cloud manufacturing (CMfg) is a smart networked manufacturing paradigm based on cloud computing and Internet of Things, aiming at realizing broader global cooperation, higher product individualization, resource sharing thoroughly and completed service system [1, 2]. In CMfg environment, various distributed manufacturing resources are encapsulated into a resource pool and aggregated in the form of service to users on demand though visualization. The manufacturing demanders can search and acquire the corresponding services from the cloud platform at any time according to their requirements. Then, the various manufacturing tasks of product lifecycle are carried out sequentially [3]. At present, some core technologies in CMfg have been widely studied, where service composition and optimal selection (SCOS) is considered as a key technology for diversity, heterogeneity and complexity of services [4]. In SCOS, finding the optimal composition service from all possible ones to execute the manufacturing task is treated as a challenge.

The quality of service (QoS) evaluation is regarded as an effective approach to ensure high quality in service [5]. So far, there are more than 20 evaluation indicators related to web services [6], where parts of indicators have been applied to service optimization in the cloud manufacturing environment. The typical QoS evaluation indicators mainly include cost, time, availability and reliability [7, 8]. In addition, other indicators include reputation, security, throughput [9], logistics time and cost [10], service coverage [11], pass rate [12] and anti-risk capabilities [13] are also used to establish a QoS evaluation function.

However, there is a non-negligible problem that huge energy consumption is generated during the execution of composition service, especially for the unreasonable service combination solution since the wide distribution and diversity of the manufacturing resource in cloud manufacturing. In the time of emphasizing on green and sustainable manufacturing, energy consumption is necessary to be taken into account in SCOS problem. Currently, there are few studies related to energy consumption. In reference [14], an energy-aware QoS evaluation function for service composition was established, and group leader algorithm was introduced to solve proposed problem. Tao et al. [15] formulated a more comprehensive services composition model considering energy consumption and proposed Pareto solution–based hybrid genetic algorithm to solve the model. Reference [16] proposed a dynamic adaptive replacement policy to reduce the power consumption in the big data environment. Zheng et al. [17] put forward a hybrid energy-aware resource allocation approach and adopted non-dominated sorting genetic algorithm to conduct the composition optimization process. But, the models in the above literature are not closely combined with the actual situation, which makes their models not well applied. In order to form a complete system in service composition, the efficient approach considering energy consumption is still worthy for further research. In response, an energy-aware service composition and optimization approach is proposed to ensure high-quality and low-energy consumption in service in this paper.

The SCOS problem based on QoS is proved to be a NP-hard problem [18]. At present, the intelligent algorithms have been widely used to solve the composition optimization problems in cloud environments since their fast optimization, such as genetic algorithm (GA) [19, 20], artificial bee colony algorithm (ABC) [21], max–min ant system (MMAS) [22], flower pollination algorithm (FPA) [23, 24], ant colony optimization algorithm (ACO) [25], particle swarm optimization algorithm (PSO) [26] and chaos algorithm (Chaos) [27]. Recently, an algorithm called Grey wolf optimizer (GWO) [28], proposed by Mirjalili et al., has caused widespread concern. GWO is inspired by the grey wolf prey activity and has been successfully applied in other fields, such as shop scheduling [29], parameter optimization [30] and image classification [31], due to its significant advantages of strong convergence performance, few parameters and easy implementation. The advantage of GWO is important for SCOS in CMfg since its large and complicated search space, while it has not been applied in this field. In order to solve the energy-aware service composition and optimal selection (EA-SCOS) problem effectively and precisely, two improvements on the GWO are proposed to further enhance the solution accuracy of the algorithm, and the improved GWO (IGWO) is applied to conduct the composition optimization process in this paper.

The rest of this paper is organized as follows. The detail problem description and mathematical model considering energy aware are presented in Sect. 2. The operation process of IGWO and the solution of IGWO corresponding to service composition are designed in Sect. 3. The comparative experiment and analysis are performed to verify the proposed approach in Sect. 4. Finally, the conclusion and the future research plans are introduced in Sect. 5.

2 Problem description and mathematical model

In cloud manufacturing, a complex manufacturing task is usually decomposed into several subtasks and then each subtask is executed in a logical order. The determination and selection of services for each subtask are key steps in SCOS, which ensure the functional and non-functional requirements for services obtained. The process of SCOS can be divided into the following steps [7]: (1) request analysis and task decomposition, (2) service searching and matching, (3) qualified candidate services set acquisition, (4) composition of optimal services. The detail description for the process of SCOS is comprehensive in the existing literature [32] and will not be repeated in this section.

2.1 The classical QoS evaluation

At present, there are more than 20 evaluation indicators related to web services, where parts of indicators have been applied to service optimization in the cloud manufacturing environment. The typical QoS evaluation indicators mainly include time (qte), cost (qct), availability (qav), and reliability (qre). The descriptions for the four indicators are shown in Table 1, and more details about these attributes are provided in [8].

Table 1 The typical QoS evaluation indicators

2.2 Energy consumption evaluation

After the four typical evaluation indicators are integrated to the QoS model, users can obtain high-quality services, but the energy consumption problems still exist, which can be reflected in the following two aspects: (1) In the manufacturing process, the production equipment used by low-cost service may have been ageing, which will generate high energy consumption. (2) In the logistics process, mountain road may be selected to avoid the ubiquitous highway tolls, which also lead to high energy consumption. In fact, the energy consumption generated during the execution of the service is high enough to be seriously considered. On the other hand, the increasing awareness of environmental protection has gradually considered green manufacturing as a significant criterion in selecting qualified manufacturing service [33,34,35], among which energy consumption has become a significant component. Therefore, energy consumption in SCOS is necessary to be considered to ensure high-quality and low-energy consumption in service.

Based on the above problems, the energy consumption (EC) in SCOS considered in this paper mainly includes manufacturing energy consumption (Emanu) and logistics energy consumption (Elogi). Therefore, the calculation model of energy consumption for a single manufacturing service is as follows.

$$ \mathrm{EC}={E}_{\mathrm{manu}}+{E}_{\mathrm{logi}} $$
(1)

2.2.1 Manufacturing energy consumption

Generally, the manufacturing energy consumption depends on the process level and production equipment, and the machining energy consumption is mainly considered in the manufacturing process. The calculation formula of machining energy consumption is shown as Eq. (2) according to [14].

$$ \left\{\begin{array}{l}{E}_{\mathrm{manu}}=\sum \limits_{i=1}^{n_1}{e}_i\times t\\ {}{e}_i=\underset{0}{\overset{t_1}{\int }}{p}_{i1} dt+\underset{0}{\overset{t_2}{\int }}{p}_{i2} dt+\underset{0}{\overset{t_3}{\int }}{p}_{i3} dt\end{array}\right. $$
(2)

where ei represents the unit machining energy consumption of a certain energy typ; i means energy type; n1 indicates the number of energy types; t is the processing time of corresponding service; and pi1, pi2 and pi3 respectively represent primary energy consumption per unit time in the status of normal load, no-load and additional load conditions.

2.2.2 Logistics energy consumption

The logistics energy consumption depends on the fuel types, the shipping distance and road types. The calculation method of logistics energy consumption is shown as Eq. (3) based on literature [36].

$$ {E}_{\mathrm{logi}}=\lambda \times \sum \limits_{j=1}^{n_2}{e}_j\times d $$
(3)

where ej represents the unit logistics energy consumption of a certain fuel type, j means fuel type, n2 indicates the number of fuel types, d is the total shipment distance of corresponding service and λ denotes road types.

2.3 Comprehensive mathematical model

Given the difference of expression form, range interval and quantitative unit between the indicators, the raw data should be normalized. In the process of normalization, the evaluation indicators are classified as positive attribute indicator (qk+) and negative attribute indicator (qk), which can be calculated by Eq. (4) and Eq. (5) respectively [37].

$$ {q}_k^{+}=\left\{\begin{array}{l}\frac{x_k-{x}_{\mathrm{min}}}{x_{\mathrm{max}}-{x}_{\mathrm{min}}},\mathrm{if}\ {x}_{\mathrm{max}}\ne {x}_{\mathrm{min}}\\ {}\kern1.75em 1\kern2em ,\mathrm{if}\ {x}_{\mathrm{max}}={x}_{\mathrm{min}}\ \end{array}\right. $$
(4)
$$ {q}_k^{-}=\left\{\begin{array}{l}\frac{x_{\mathrm{max}}-{x}_k}{x_{\mathrm{max}}-{x}_{\mathrm{min}}},\mathrm{if}\ {x}_{\mathrm{max}}\ne {x}_{\mathrm{min}}\\ {}\kern1.75em 1\kern2em ,\mathrm{if}\ {x}_{\mathrm{max}}={x}_{\mathrm{min}}\ \end{array}\right. $$
(5)

where xmin and xmax respectively represent the minimum and maximum values of the evaluation indicators. Moreover, the larger the value of qk+, the better the quality of the service, such as availability (qav) and reliability (qre); the smaller the value of qk-, the better the quality of the service, such as time (qte), cost (qct) and energy consumption (qec).

There are four main types of service compositions: sequential, parallel, selective and circular, of which three (parallel, selective and circular) can be converted into sequential structure by related methods [38]. Table 2 gives the aggregate function of the sequential structure, where N represents the number of cloud manufacturing services (CMS) in the composition service.

Table 2 QoS aggregation function of the sequential structure

According to the linear weighting method, the QoS value of the composition service can be calculated according to Eq. (6), where w1, w2, w3, w4 and w5 are weight coefficients.

$$ \mathrm{CQ}={w}_1\times {Q}_{\mathrm{TE}}+{w}_2\times {Q}_{\mathrm{CT}}+{w}_3\times {Q}_{\mathrm{AV}}+{w}_4\times {Q}_{\mathrm{RE}}+{w}_5\times {Q}_{\mathrm{EC}} $$
(6)

In summary, the EA-SCOS problem is equivalent to find the maximum value of function CQ.

3 GWO in EA-SCOS problem

Obviously, EA-SCOS is a typical combinatorial optimization problem with the characteristics of dynamic and uncertainty. At present, intelligent algorithms are mainly employed to solve such problems because of their well adaptability. However, the balance between the convergence speed of algorithms and accuracy of the solutions is hard to be controlled. Recently, a novel algorithm, called Grey wolf optimizer (GWO) [28], has caused widespread concern. GWO is inspired by the grey wolf prey activity, characterized by strong convergence performance, few parameters and easy implementation. And it has been successfully applied in other fields [29,30,31], because of its excellent performance.

To address the proposed problem effectively, the original GWO is improved to enhance the accuracy of the solution. So far, GWO has not been applied to the service composition problem in CMfg. Hence, a new method is designed for such problem in this paper.

3.1 The basic concept of GWO algorithm

GWO is a novel swarm intelligence algorithm proposed by Mirjalili et al in 2014, which is inspired by the social hierarchy and hunting behaviour of grey wolves. There are four levels: α, β, δ and ω ordered by descending in power, of which the α wolf is the leader of a wolf group, and the ω wolves are the lowest rank among group. The hunt process is guided by α, β and δ wolves, which are concomitantly followed by the ω wolves. A complete iterative process consists of searching, encircling and hunting. The detail description for the iterative process is below.

  1. (1)

    Searching: An important criterion for grey wolves in searching is the distance from the grey wolf to the prey, which is calculated by Eq. (7)

$$ \left\{\begin{array}{l}D=\left|\mathbf{C}\cdotp {\mathbf{X}}_P(t)-\mathbf{X}(t)\right|\\ {}\mathbf{C}=2{\mathbf{r}}_2\\ {}{\mathbf{r}}_2=\operatorname{rand}\left(0,1\right)\end{array}\right. $$
(7)

where t denotes the current iteration, and XP and X represent the position vector of prey and grey wolf, respectively. C means coefficient vectors, and r2 is random vector in the interval [0, 1].

  1. (2)

    Encircling prey: Grey wolves habitually encircle prey during the hunt. The equations that simulate this encircling behaviour are presented as follows

$$ \left\{\begin{array}{l}{\mathbf{X}}_i\left(t+1\right)={\mathbf{X}}_P(t)-{\mathbf{A}}_i\cdotp {D}_i\\ {}{D}_i=\left|{\mathbf{C}}_i\cdotp {\mathbf{X}}_P(t)-{\mathbf{X}}_i(t)\right|\\ {}{\mathbf{A}}_i=2a{\mathbf{r}}_1-a\\ {}{\mathbf{C}}_i=2a{\mathbf{r}}_2\\ {}a=2-2t/{t}_{\mathrm{max}}\\ {}{\mathbf{r}}_1,{\mathbf{r}}_2=\operatorname{rand}\left(0,1\right)\end{array}\right. $$
(8)

where i used to identify different wolves, a is linearly decreased from 2 to 0 in iterations and tmax represent the maximum number of iteration. A means coefficient vectors, and r1 is random vector in the interval [0, 1].

  1. (3)

    Hunting: As the position of the prey (optimum) in the abstract search space is not known, the GWO supposes that the α, β and δ wolves have better knowledge of the location of the prey. Thus, in the GWO, the prey is required to update their positions according to the positions of α, β and δ wolves, via the formulas given below

$$ \left\{\begin{array}{c}{D}_{\alpha }=\left|{C}_1\cdotp {X}_{\alpha }(t)-X(t)\right|\\ {}{D}_{\beta }=\left|{C}_2\cdotp {X}_{\beta }(t)-X(t)\right|\\ {}{D}_{\delta }=\left|{C}_3\cdotp {X}_{\delta }(t)-X(t)\right|\\ {}{X}_1={X}_{\alpha }(t)-{A}_1\cdotp {D}_{\alpha}\\ {}{X}_2={X}_{\beta }(t)-{A}_2\cdotp {D}_{\beta}\\ {}{X}_3={X}_{\delta }(t)-{A}_3\cdotp {D}_{\delta}\\ {}X=\left({X}_1+{X}_2+{X}_3\right)/3\end{array}\right. $$
(9)

Then, the other wolves update their positions randomly around the latest prey according to Eq. (8).

To sum up, a series of control strategies in GWO such as random changes of parameters A and C, speed variation and position update are applied to ensure that the optimal solution can be searched in the global scope.

3.2 The adjustment for control factor

Actually, any swarm intelligent optimization algorithm has two different operations: global search and local search in the iterative process. In standard GWO, the transition between global search and local search is generated by the values of a and A. Half of the iterations are devoted to global search (|A| ≥ 1), and the other half are used for local search (|A| < 1) [28]. Excessive global search will probably not provide satisfactory optimization results. However, excessive local search usually plunges into local optima [39]. For the proposed problem in this paper, more local search is obtained to improve the accuracy of the solution. In response, a new method is proposed to calculate the control factor a using Eq. ( t=15pt b=10pt10).

$$ a=2-2\times \log \left(1+\left(\exp -1\right)t/{t}_{max}\right) $$
(10)

As shown in Fig. 1, based on Eq. (10), the number of iterations used for global search and local search are 38% and 62%, respectively.

Fig. 1
figure 1

Control factor a curve

3.3 The improvement for position-updating strategy

For original position-updating strategy, only the information of the α, β and δ wolves is shared to the next generations. As a result, GWO may easily get trapped in a local optimum because of the lack of diversity among wolves. In order to enhance the diversity of the population, the information of ω wolves is added in the position-updating strategy, and the weight of the information for ω wolves is non-linearly increased in iterations. The novel rule for position-updating is formulated as Eq. (11).

$$ \left\{\begin{array}{l}\mathbf{X}=\left(1-\omega (t)\right)\cdotp \frac{{\mathbf{X}}_1+{\mathbf{X}}_2+{\mathbf{X}}_3}{3}+\omega (t)\cdotp \frac{\sum \limits_4^k{\mathbf{X}}_i}{k-3}\\ {}\omega (t)={c}_1{\left(\frac{t}{t_{\mathrm{max}}}\right)}^{\theta },\theta >1\end{array}\right. $$
(11)

where k represents grey wolf population size, c1 indicates coefficient in the interval [0.25, 0.5] and θ means non-linear control coefficient.

3.4 Representation scheme

In GWO, each wolf is deemed as a potential solution. The fittest solution is regarded as α wolf, and the second and third best solutions are expressed as β and δ wolves, respectively. The remaining candidate solutions are regarded as ω wolves.

For the proposed EA-SCOS problem, the position vector of each wolf represents a service composition solution and the dimension of the vector represents the number of subtasks. The mathematical expression is shown as follows.

$$ {X}_i=\left[ CM{S}_1\left({x}_1\right), CM{S}_2\left({x}_2\right),\dots, CM{S}_j\left({x}_j\right),\dots, CM{S}_n\left({x}_n\right)\right] $$
(12)

where CMSj(xj) represent the selected service for jth subtask, n denotes the number of subtasks and xn means the serial number of the selected service in the corresponding candidate service set. Meanwhile, the serial number matrix of the services is expressed as

$$ \mathbf{W}(x)=\left[\begin{array}{cccc}1& 1& \cdots & 1\\ {}2& 2& \cdots & 2\\ {}\vdots & \vdots & \ddots & \vdots \\ {}{m}_1& {m}_2& \cdots & {m}_n\end{array}\right] $$
(13)

where mn denotes the maximum number of services in the corresponding candidate service set. In addition, the initial search space P is described as

$$ \mathbf{P}=\left[\begin{array}{cccc}{CMS}_1(1)& {CMS}_2(1)& \cdots & {CMS}_n(1)\\ {}{CMS}_1(2)& {CMS}_2(2)& \cdots & {CMS}_n(2)\\ {}\vdots & \vdots & \ddots & \vdots \\ {}{CMS}_1\left({m}_1\right)& {CMS}_2\left({m}_2\right)& \cdots & {CMS}_n\left({m}_n\right)\end{array}\right] $$
(14)

In summary, Xi = [CMS1(3), CMS2(11), CMS3(7), CMS4(41), CMS5(11)] indicates that five subtasks are comprised in the composition solution. The first position shows that subtask 1 is executed by the 3rd service from its corresponding candidate service set, and the same applies to the remaining positions.

3.5 IGWO operation process for EA-SCOS problem

After the basic principle of IGWO and the solution of IGWO corresponding to in EA-SCOS problem are introduced in detail, a flowchart illustrating the IGWO is shown in Fig. 2. In addition, the specific operations are indicated in Algorithm 1, where steps 1–4 are initialization phase, steps 5–6 denote encircling prey, step 7 represents hunting and step 8 indicates stopping iteration.

Algorithm 1. IGWO operation steps

Step 1: Initialize the algorithm parameters A, C, tmax, c1, θ and set t = 0, i = 1.

Step 2: Initialize the search space P based on the scale of services composition, and set the population size of grey wolves k.

Step 3: Construct the combined service for each wolf at random, and calculate the QoS value of composition services according to Eq. (6).

Step 4: Find α, β and δ wolves, respectively.

Step 5: Update the parameters A, C using Eq. (10) and Eq. (8).

Step 6: Update the position of grey wolves based on Eq. (11) and Eq. (9) and calculate the QoS value of composition services according to Eq. (6).

Step 7: Update α, β and δ wolves, respectively.

Step 8: Determine whether the iterations of IGWO t is greater than tmax. If so, output the optimal solution; otherwise, go to step 5.

Fig. 2
figure 2

The flowchart of GWO for EA-SCOS problem

4 Numerical simulation and analysis

In this section, three experimental schemes are designed to evaluate the effect of the proposed model on reducing energy consumption, verify the effectiveness of the improved strategies and test the performance of the improved algorithm, respectively. The simulation environment for this experiment is as follows: PC, CPU Intel Core i5-4460 3.20 GHz, 8 GB RAM, Windows 10, MATLAB R2016b.

4.1 Scheme 1: the impact of the proposed model on reducing energy consumption

In this experimental scheme, the positive QoS is initialized within [0.8, 0.95], and the negative QoS is set within [0.6, 0.75]. In a same search space, the actual energy consumption corresponding to the optimal composition service without the energy consumption indicator is marked as QEC1, and the energy consumption corresponding to the optimal composition service with the energy consumption indicator is termed as QEC2. Then, the two groups of experiments are conducted to reflect the differences between QEC1 and QEC2. For the first group, the number of subtasks N is fixed as 10, and the number of the candidate services M in each candidate service set varies from 50 to 100 with an increment of 50. For another, M is fixed as 50, and N varies from 15 to 20 with a step of 5. The weight coefficients corresponding to time (qte), cost (qct), availability (qav), reliability (qre) and energy consumption (qec) are taken as w1 = 0.2, w2 = 0.25, w3 = 0.15, w4 = 0.15, w5 = 0.25, respectively. The algorithm for the experiment is IGWO, where the population size is 50, the maximum number of iterations is 50 and the coefficients c1 = 0.3 and θ = 2. Due to the stochastic nature of the evolutionary algorithms, each algorithm is performed 20 times independently. The experimental results are shown in Fig. 3.

Fig. 3
figure 3

Average energy consumption of manufacturing tasks

As shown in Fig. 3, QEC1 is greater than QEC2 in the same search space for all runs. Obviously, energy consumption can be reduced in the model including energy consumption indicator. In order to quantitatively analyse the difference between QEC1 and QEC2, the energy saving ratio of the single subtask is given in Table 3. It can be seen that the maximum energy saving rate is 9% for the single subtask, which has a significant effect on reducing energy consumption for comprehensive tasks. Referring to Fig. 3 and Table 3, there are good reasons to believe that the proposed model is valid for reducing service energy consumption.

Table 3 The energy saving ratio of the single subtask

4.2 Scheme2: the verification for the proposed improvements

In this scheme, the original GWO, GWO with the improved strategy for control factor (GWO-1), GWO with the novel position-updating strategy (GWO-2) and GWO involving both of the two improvements (IGWO) are compared in 6 EA-SCOS problems. For all the algorithms, the maximum iterations and population size are configured as 200 and 30, respectively. With respect to the 6 instances, the number of subtasks N is given as 20, and the corresponding candidate services M ranges from 200 to 300 with a step of 20. In addition, the method to initialize the search space of EA-SCOS problem is the same as scheme 1. Moreover, all the algorithms run 30 times and the statistical results are exhibited as below. The best results are highlighted in italics for each instance.

As shown in Table 4, IGWO achieves the best results on all the instances based on the mean of QoS. In terms of the maximum QoS, IGWO and GWO-1, which include the improved strategy for control factor, provide the best solutions on all the problems, except for 20_240. This is due to the more local search is obtained during the iteration for the two algorithms. It can also be observed that IGWO and GWO-2 obtain the advantage over its competitors for 5 out of the 6 instances according to the minimum QoS, which can be attributed to better population diversity. On the other hand, Fig. 4 depicts the distribution of confidence interval obtained by the four algorithms on the 6 problems. It can be seen that IGWO obtains significant advantage over the original GWO on all the instances. Likewise, both GWO-1 and GWO-2 obtain the advantage over the standard GWO for 4 out of the 6 instances. As such, there are good reasons to indicate that the proposed improvements have obvious, positive effect on the accuracy of solutions for IGWO.

Table 4 The statistical results of QoS for GWO and its improved versions
Fig. 4
figure 4

The confidence intervals of the optimum solutions for GWO and its competitors

4.3 Scheme 3: the performance of IGWO for EA-SCOS problems

In order to test the performance of the proposed algorithm for addressing EA-SCOS problem, IGWO is compared with GWO, GA and MMAS. As shown in Table 5, all the algorithms are tested in 9 EA-SCOS problems.

Table 5 The scale of the EA-SCOS problem

The QoS values of the five evaluation indicators and their corresponding weight coefficients are the same as scheme 1. The parameter settings of each algorithm are shown in Table 6. Likewise, each algorithm is performed 30 times and the results are shown as below.

Table 6 The parameter settings of the algorithms

Figure 5 presents the box plot of the average QoS fitness values obtained by the four algorithms. It is obvious that IGWO achieves the best solution based on the mean of QoS for all the scales, except for scale 8. In the same way, GWO, MMAS and GA provide the second, third best and the worst results, respectively. A careful inspection reveals that the distribution of the solutions obtained by the fours algorithms follow a same trend, which is due to the fact that all the algorithms possess the same objective function. In terms of the maximum of QoS, the solutions found by IGWO and GWO are better than the solutions found by MMAS and GA on all the scale. Mover, IGWO obtains significantly advantage than the standard GWO on scales 3, 6, 7, 8 and 9. Therefore, it can be concluded that IGWO performs best compared to the other algorithms in terms of the accuracy of the optimal solution. This is because more local search is obtained to improve the optimal value, as well as the diversity of the population is enhanced to avoid local optimum. Moreover, it can be noticed that as the scale of the service composition problem increases, the gap of the maximum value between IGWO and other algorithms becomes more obvious, but the stability of IGWO needs to be enhanced.

Fig. 5
figure 5

Performance comparison of different algorithms

In order to quantitatively evaluate the performance difference of the algorithms, one-way analysis of variance (ANOVA) is employed to assess the statistical significance between IGWO and its competitors. Table 7 records the part of results of one-way ANOVA, which includes the mean of QoS and F value. For the mean, IGWO achieves the best results on all the scales, except for scale 8. The solutions obtained by MMAS are smaller than the solutions obtained by both IGWO and GWO, and GA always provides the lowest QoS among the four algorithms, which is a good agreement with Fig. 5. With respect to the statistical significance, it is clearly that all the F values are greater than the critical value (F-crit), which denotes a significant difference in the statistical results. Hence, it can be concluded that the proposed IGWO achieves best accuracy of solution over the compared algorithms for most of SCOS problems.

Table 7 The statistical results of one-way ANOVA for the four algorithms

In addition, the average time consumption of the algorithms in all scales is shown in Fig. 6. It can be seen that the time consumption does not change obviously with the increase of the number of candidate services, while the time consumption increases significantly when the number of subtasks increases. This is due to the fact that the dimension of the objective function increases as the number of subtasks increases, which results in greater computation. Nevertheless, the number of candidate services affects the search space rather than the computation. Moreover, it can also be observed that MMAS obtains highest time consumption while GA obtains lowest, which is attributed to the search efficiency of the algorithms. IGWO obtains higher time consumption than the original GWO, which is result of that the improved position-updating strategy enhances the population diversity to avoid the local optimum, as well as increases computation. However, the time consumption of IGWO is still within the acceptable range.

Fig. 6
figure 6

The average time consumption of the algorithms

To sum up, GWO as a new algorithm has been successfully applied to address the SCOS problem. Meanwhile, the improved GWO can effectively improve the accuracy of optimization results within acceptable time complexity.

5 Conclusion and future work

In order to follow the development trend of manufacturing in the future, the high-quality and low-consumption services should be provided in CMfg. In response, the energy-aware service composition model and the improved grey wolf algorithm are proposed in this paper. The main contributions of this study are summarized as follows:

  1. (1)

    Based on QoS evaluation, the energy-aware service composition model is established. Firstly, the evaluation methods of five indicators are described. In particular, the energy consumption (manufacturing energy consumption and logistics energy consumption) is introduced in detail. Then, the objective function of EA-SCOS problem is given.

  2. (2)

    Considering the characteristics of the proposed model, the improved grey wolf algorithm is proposed. Specifically, more local search is performed to improve the accuracy of the solution by adjusting the control parameters. Meanwhile, the diversity of the populations is enhanced to avoid local optimum via improving the position-updating strategy. In addition, the representation scheme and the operation process for EA-SCOS problem are introduced.

  3. (3)

    In experiments, the proposed model is valid for reducing service energy consumption. Moreover, the improved strategies have a good effect on the accuracy of solutions, and the performance of IGWO for addressing EA-SCOS problem is better than GWO, MMAS and GA.

Factually, the service composition model is still extensible, and the evaluation for energy consumption is not comprehensive. In future work, other necessary evaluation indicators will be considered, as well as the energy consumption in other stages will be studied. In addition, we try to combine the GWO with other algorithms to improve its performance.