Keywords

1 Introduction

During the last decade, many organizations embraced service-oriented computing technologies, seeking better visibility and more market opportunities. Web services (APIs) with complementary functionalities (called components) collaborate as part of the same service composition to provide value-added services [5, 7]. The success and longevity of collaborations in a service composition strongly depend on the ability of the different components to maintain long-term Quality of Service (QoS) requirements [4]. Developing long-term compositions raises the challenge of selecting components that satisfy QoS requirements over long time periods. Such selection implies predicting long-term QoS trends (i.e., QoS during a long period). The main challenge related to forecasting long-term QoS is that QoS values may fluctuate in the future.

We identify three advantages for leveraging long-term QoS trends during composition. First, developers rely on predicted QoS to accurately select the best services that are likely to fulfill composition requirements over a long time period. This caters for durable partnerships among component services. Second, component services undergo several changes during their lifespan (e.g., a service going out of business) that may lead to breaking contracts between composite and component services. Developers will then be able to substitute components by services with comparable long-term QoS. Third, service providers (e.g., cloud providers) may rely on QoS prediction for better resources management and workload balancing. For instance, they may harness more server resources (processor and memory) during peak periods. Accurate QoS prediction allows service providers to adjust their cloud resources to satisfy users’ demands as accurately as possible in the future. This reduces contract disruption between long-term composite services and their components because of QoS violations.

Several techniques for QoS-based service composition have been proposed in the literature [9, 11, 12]. However, they mostly focus on static QoS values observed during composition time. In practice, QoS varies over time; such future variations need to be taken into consideration while designing composite services. Unlike current techniques, we propose a deep learning approach for long-term service compositions. We use deep recurrent Long Short Term Memories (LSTMs) [3] to predict long-term QoS trends. Such predictions cater for selecting best Web services that satisfy QoS-related composition requirements in the long run. To the best of our knowledge, this is the first work that uses deep learning and particularly deep recurrent LSTMs for long-term QoS-aware service composition and substitution.

The rest of the paper is organized as follows. Section 2 describes our deep learning approach for QoS prediction. Section 3 presents our technique for leveraging the predicted QoS during composition and substitution times. Section 4 discusses the experimental study. Section 5 reviews related work. Section 6 concludes the paper.

2 Using Deep Learning for QoS Prediction

The aim of the proposed approach is to assist developers in designing composite services and substituting components while considering long-term QoS trends. The composition middleware implements techniques to identify, orchestrate, and substitute component services. The way component and substitute services are selected by the middleware is out of the scope of this paper. Our approach augments any existing composition and substitution technique such as the ones proposed in [5] with long-term QoS prediction and compliance capabilities.

2.1 QoS Composition Requirements

Developers provide two kinds of composition requirements to the composition middleware: middleware-specific requirements such as functional and semantic features (out of the scope of this paper) and QoS requirements. For each QoS metric, developers specify preferred and acceptable intervals. Figure 1 shows an example of QoS requirements for processing speed between \([T_{0}, T_{1}]\) (e.g., this year’s summer season), \([T_{1}, T_{2}]\) (e.g. this year’s fall season), ..., \([T_{7}, T_{8}]\). Gray and dark rectangles refer to acceptable and preferred QoS intervals, respectively. Figure 1 also shows the predicted computation speed \(Q_{1}(t)\), \(Q_{2}(t)\), and \(Q_{3}(t)\) that three services \(S_{1}\), \(S_{2}\), and \(S_{3}\) are likely to guarantee the next two years. Our approach compares the areas under the predicted curves with the area under the required QoS that are either bounded by the acceptable or preferred rectangles.

Fig. 1.
figure 1

Examples of QoS Prediction Trends

2.2 Predicting Long-Term QoS Trends

The QoS Predictor (QP) handles QoS prediction for all services and stores the predicted QoS curves in a QoS Repository. It has access to log files that contain QoS data observed over time for the different Web services in the system. The way QoS is monitored and obtained is out of the scope of this paper. [4] and [2] give details about QoS monitoring techniques.

QP learns from the history of observed QoS values to forecast long-term QoS trend. For that purpose, we train deep recurrent Long Short Term Memories (LSTMs) [3] with sequences of QoS values observed at different periods of time. LSTM is a particular type recurrent nets with the ability to avoid the long-term dependency problem. They can remember information for long periods of time. Unlike classic recurrent nets, LSTMs overcome very well the problem of vanishing gradient and can learn from size variable sequences of data. LSTM is trained with n raw data \(X_{j}\). Each \(X_{j}\) is composed by an input \(Q_{i}\) and an output \(Q_{i+1}\) where \(Q_{i}\) and \(Q_{i+1}\) denote observed service QoS at times \(T_{i}\) and \(T_{i+1}\) respectively. The goal behind training the LSTM with sequences of QoS is to predict services future QoS values for a given period of time.

Predicting QoS trends is time consuming. To minimize the incurred overhead on the overall composition development (during component selection) and execution (during component substitution) times, we define two techniques for bootstrapping QoS prediction: random and first-hit. The random technique arbitrarily selects a service in the system during off-peak hours, and executes prediction algorithms for that service. This technique has the advantage of calculating predictions offline, with little or no impact on composition/substitution times. However, it may perform prediction for services that are never used in compositions/substitutions. The first-hit bootstrapping technique runs prediction algorithms for a service when it first participates in a composition/substitution. In contrast to random bootstrapping, this technique carries out prediction only for services that are used in compositions or substitutions. Although the first-hit method is executed online (during composition or substitution), its overhead is reduced by limiting it to first-time composed or substituted services.

Once QoS prediction trends are generated, there is a need to keep them up-to-date as more QoS data is gathered. Performing prediction on more QoS data improves prediction accuracy. We define three event-based techniques for updating QoS predictions: periodic, popularity-based, and change-based QoS update techniques. The periodic technique updates prediction at the end of each time period T (e.g., at the end of each week). The popularity-based technique updates prediction whenever a service reaches a new popularity level. We say that a service is popular if it participated in N composition and substitution since the latest update. The change-based technique updates prediction for a given service whenever big changes, above a certain level C, are noticed in the QoS log of that service. Note that values of T, N, and C are selected by cloud providers and may be adjusted to deal with various environment conditions.

3 Long-Term QoS Compliance Checking

The composition middleware sends two types of recommendation requests to the Long-Term QoS Compliance Checker (LQCC): composition and substitution requests. A composition recommendation request includes the ID of a potential component along with QoS requirements to LQCC. LQCC requests the QoS prediction trend for the component from the QoS Predictor. Then, it checks compatibility between the QoS prediction and QoS requirement intervals, and returns a composition recommendation to the middleware. A substitution recommendation request includes IDs of the services to substitute and potential substitutes to LQCC. LQCC obtains the QoS prediction trends for the component to substitute and potential substitute from the QoS Predictor. Then, it checks whether the two trends are close enough to each other and returns a substitution recommendation to LQCC.

3.1 Checking Compliance for Service Composition

We introduce two heuristics to check long-term QoS compliance for composition: Conservative and Soft heuristics. The conservative heuristic states that a service S is long-term QoS compliant with the developer’s QoS requirement iff for each time interval \([T_{i}, T_{i+1}]\) in the prediction time interval \([{\alpha }, {\beta }]\), the area under the predicted QoS curve of S is greater than the area under the lower bound of the preferred QoS requirement curve, and is less than or equal the area under the higher bound of the preferred QoS requirement curve. The rational behind this heuristic is to make sure the component’s QoS prediction curve remains within the preferred interval throughout the various time periods.

$$ \int _{t_{i}}^{t_{i+1}}(q(t) - p_{lower}(t))> \epsilon ~and \int _{t_{i}}^{t_{i+1}}(p_{higher}(t) - q(t)) > \epsilon $$

where \(\epsilon \) (\(\epsilon \ge 0\)) is a composition compliance threshold, q(t), \(p_{higher}(t)\), and \(p_{lower}(t)\) stand for the component’s predicted QoS, the preferred higher bound QoS, and the preferred lower bound QoS respectively.

The soft composition compliance heuristic states that a component is long-term QoS compliant with the developer’s QoS requirements iff the sum of the areas under the component’s predicted QoS curves is superior to the sum of the areas under the lower bound of the acceptable QoS curves, and is less than or equals to the sum of the areas under the higher bound of the preferred QoS curves. The rationale behind this heuristic is to make sure that the overall component’s QoS prediction curve is within any of the preferred or acceptable QoS intervals. The component’s curve may fall outside the QoS requirement boundaries within a certain time period \([T_{i}, T_{i+1}]\) as long as there are other time periods that make up for the QoS loss in \([T_{i}, T_{i+1}]\).

$$ (\sum _{i=\alpha }^{i=\beta -1} \int _{t_{i}}^{t_{i+1}}(q(t) - a_{lower}(t)))> \epsilon ~and~ (\sum _{i=\alpha }^{i=\beta -1} \int _{t_{i}}^{t_{i+1}}(p_{higher}(t) - q(t))) > \epsilon $$

where \(\epsilon \) is a composition compliance threshold (\(\epsilon \ge 0\)), q(t), \(p_{higer}(t)\), and \(a_{lower}(t)\) stand for the predicted QoS, the preferred QoS requirement upper bound, and the acceptable QoS requirement lower bound.

3.2 Checking Compliance for Service Substitution

Similarly to composition, we introduce two heuristics to check long-term QoS compliance for substitution: Conservative and Soft substitution heuristics. The conservative heuristic states that a service S is long-term QoS compliant with a potential candidate substitute C iff for each time interval \([T_{i}, T_{i+1}]\) in the prediction time interval \([{\alpha }, {\beta }]\), the difference between the two areas under the predicted QoS curves of S and C is less than or equal a threshold value \(\epsilon \) (\(\epsilon \ge 0\)).

$$ \int _{t_{i}}^{t_{i+1}}|(q_{S}(t) - q_{C}(t))| \le \epsilon $$

where \(q_{S}(t)\) and \(q_{C}(t)\) stand for the predicted QoS of S and C respectively.

The soft heuristic states that a service S is long-term QoS compliant with a potential candidate substitute C iff the sum of the differences between the areas under the predicted QoS curves of S and C is less than or equal to the sum of the areas under the required QoS curves.

$$ (\sum _{i=\alpha }^{i=\beta -1} \int _{t_{i}}^{t_{i+1}}|(q_{S}(t) - q_{C}(t))|) \le \epsilon $$

where \(\epsilon \) is a threshold such that \(\epsilon \ge 0\), \(q_{S}(t)\) and \(q_{C}(t)\) stand for the predicted QoS of S and C, respectively.

4 Experimental Study

The goal of our experiments is to assess the ability of the proposed approach to correctly recommend services for composition and substitution. The accuracy of such recommendation strongly depends on the accuracy of forecasting long-term QoS. We ran our experiments on a 64-bit Windows 10 environment, in a machine equipped with an intel i7 and 12 GO RAM. We used KerasFootnote 1 with Google’s TensorflowFootnote 2 as back-end for implementing and training the LSTM model. As it is difficult to get the history of real QoS values, we generated synthetic QoS values (disk storage usage) over different periods of time. Generated values are used to train our QoS prediction models.

Fig. 2.
figure 2

Comparison of Predicted Storage with LSTMs and ARIMA Models

We compare the accuracy of the proposed prediction with the one that uses ARIMA model [9]. ARIMA (AutoRegressive Integrated Moving Averages) has been successfully used for time series forecasting. Auto regressive means the prediction of x(t) depends on \(p=k, p,k \in N\) previous terms. For instance, for \(p = 3\), the prediction of x(t) depends on \(x(t-1)\),\(x(t-2)\), and \(x(t-3)\). Moving averages means the prediction depends on the \(q=k, q,k \in N\) previous errors.

Figure 2 shows a comparison of the prediction accuracy of our approach (LSTM) and ARIMA. Both models are trained with service storage data from Summer-2009 until Spring-2011 and tested with service storage data from Summer-2012 until Spring-2012. Figure 2 shows that both LSTM and ARIMA achieves comparable accuracy on the training data. However, LSTM outperforms ARIMA on test data. The justification is that LSTM uses many deep hidden layers with non linear transformations among the layers such as sigmoid and tanh functions. LSTM also saves information longer by using the forget and update gates, hence the bigger the training set, the better LSTM learns and the more accurate is the prediction. On the other hand, ARIMA bases the prediction on p lags which means that the prediction depends on p previous terms.

5 Related Work

In this section, we review the main techniques related to QoS-aware composition of Web services. [9] used the Autoregressive Integrated Moving Average (ARIMA) model to predict future behaviours of the service requests. However, it is not suitable for designing long-term composition as it does not gather stochastic request arrivals. [13] used matrix factorization of a user-service matrix to predict future QoS that can be used for designing compositions. Singular Value Decomposition SVD decomposes the user-service matrix into the product of a user matrix and a service matrix. The reconstructed matrix from the previous product contains the predicted QoS values. Previous approaches rely on instantaneous service QoS values for predicting future QoS that can be used for designing compositions. Our approach uses deep recurrent LSTMs to foresee how QoS values are expected to evolve in time. Such prediction allows providers to better allocate resources to services and developers to better select services for designing long-term compositions. Our approach achieves a more accurate QoS forecasting than the linear methods such as ARIMA [9]. Deep recurrent LSTMs use many hidden layers and non linear transformations between the layers such as tanh function. [10] proposed a model for cloud service providers that predicts consumer’s service usage behavior (i.e., next requests) and computes the costs of these requests with the goal to maximize cloud service providers incomes. [8] proposes an approach to compose customer requests using the provider long-term qualitative model. Long-term qualitative model is represented as a temporal CP-net. IaaS composition is transformed as a preference maximization optimization problem. [6] defines an approach for long-term QoS-aware cloud service composition. It introduces three meta-heuristic namely Genetic Algorithm, Simulated annealing, and Tabu search to select only services with the best averaged long-term QoS. Our approach relies on deep learning for service QoS prediction. Additionally, we use QoS prediction for both long-term service composition and substitution. LSTMs have been successfully used to solve different prediction problems such as predicting human trajectory in crowded spaces [1]. To the best of our knowledge, this is the first work that uses deep learning for designing long-term QoS aware service composition and substitution techniques.

6 Conclusion

In this paper, we proposed a deep learning approach for service composition using long-term predicted QoS trends. We used deep recurrent Long Short Term Memories (LSTMs) to predict QoS trends over future time periods. The predicted QoS is used during (i) composition time to ascertain that selected components statisfy developers’ QoS requirements in the long run and (ii) substitution to verify that a component and its potential substitute have similar QoS trends. Experiments conducted over synthetic data show that the use of LSTMs for QoS prediction outperforms other techniques such as ARIMA.