In this section, we propose an adaptive adjustment approach, which uses fuzzy logic technology to adjust the number of quality levels automatically.
5.1. The Initialization of Quality Level
Quality levels are initialized for each QoS attribute of each service class by dividing the value range of each QoS attribute into discrete quality values as shown in
Figure 3.
represents the
th QoS attribute value of the
th candidate service of service class
;
indicates the
th quality level of the
th QoS attribute of service class
. It can be calculated as
, and
is the number of quality levels of the
th QoS attribute of service class
.
can computed as shown in Equation (5).
and are, respectively, the maximum and minimum quality value of service class for QoS attribute , and .
In this section, we exemplify the QoS constraints decomposition process by a composite service containing three sequential service classes with three QoS attributes. As shown in
Table 2, each QoS attribute is associated to a weight and a constraint.
We assume that the number of quality levels of each QoS attribute of each service class is 3.
Figure 4 describes the procedure of the constraints’ decomposition. For service class
, the global price constraint is divided into three local constraints
,
and
.
5.2. General Fuzzy Logic System
Fuzzy logic is an approximate reasoning technology based on multi-valued logic, which is suitable to deal with uncertainty [
29]. It is able to support decision-making and evaluate uncertain parameters. In the existing researches [
30,
31,
32,
33], fuzzy logic technology has been used for service ranking in the process of service selection. In this paper, we propose an adaptive adjustment method for the number of quality level based on fuzzy logic (AAQL).
The general fuzzy logic system (FLS) includes four basic parts—fuzzification, fuzzy rule base, fuzzy inference, and defuzzification, as shown in
Figure 5. The first step is fuzzification, in which crisp inputs are mapped into the fuzzy set. The fuzzy set can be defined by the membership function. Assuming that
is a normal set, any function
() that can map
to [0,1], can determine a fuzzy set A.
() is called the membership function. For any
,
(
) is the membership of
, which describes the degree of
belonging to
. The next step is fuzzy inference, which determines what extent each rule in the fuzzy rule base applies to the current fuzzified inputs. IF–THEN rule is the common fuzzy rule to represent human knowledge in the general FLS. The IF part includes memberships of attributes of an individual, and the THEN part is a special concept called Rank. A fuzzy rule shows which composition of attributes a user is willing to accept to which degree, where attributes and degree of acceptance are vague [
34]. A simple IF–THEN fuzzy rule can be:
IF Price = Expensive and Time = Slow THEN Rank = Bad.
Finally, the fuzzified output is converted into a crisp output. This step is called “defuzzification”.
5.3. Adaptive Quality Level Based on Fuzzy Logic
AAQL can automatically adjust the number of quality levels according to user’s preferences [
35], utility function values, and time cost. We assume that there are two input variables and one output variable. The input variables are the normalized number of quality levels of the
th QoS attribute
and the normalized function value of the quality levels
. The output variable is
, the change ratio of
.
and
can be defined as below:
where
or
is the maximum or the minimum number of quality levels and
is the current number of quality levels.
or
is the maximum or the minimum function value of the current quality levels.
is the current function value of the quality levels, and it can be calculated as Equation (7).
is the user’s preference for the
th attribute, and
.
can be dynamically obtained and normalized through the method in Reference [
29]. Both
and
are the normalization value
and
and they can be calculated by Equation (8).
and are, respectively, the maximum and the minimum utility function values of the composite service under the current quality levels. is the current utility function value. and are, respectively, the maximum and the minimum time cost of the process of quality level initialization and quality level combination. is the current time cost.
Firstly, AAQL maps the input variables
and
into the fuzzy set. We assume that there are three fuzzy labels—L, M, and B, where L denotes “Little”, M denotes “Middle”, and B denotes “Big”. This paper uses the triangular and trapezoidal shapes to define membership functions of
,
, and
, as shown in
Figure 6.
Secondly, according to the fuzzy rules, AAQL uses the fuzzy inference to get the fuzzy output variable
. The nine fuzzy rules of AAQL are as listed in
Table 3, and the surface projection is shown as
Figure 7. The basic fuzzy inference algorithm is Min–Max algorithm. However, the IF part consists of multiple attributes, which have different effects on the conclusion. For the Min algorithm, the conclusion is only determined by the attribute with the least membership. No matter how the membership of the other attributes change, as long as the minimum membership remains unchanged, the conclusion does not change. That is to say, Min–Max algorithm is insensitive to the changes of input facts. As a result, the common Min–Max algorithm is not suitable for AAQL. In this paper, we assign weights to
and
, respectively. Based on the weighted sum of
and
, we can infer the membership of the corresponding conclusion. Obviously, the weights are very important. At present, there is no definite method to get the exact weights. We designed a number of experiments by setting different user preferences and other parameters, and we conducted experiments to search for the optimal number of quality levels for each experiment. By summarizing the experimental results, we assign the weight of
0.7 and the weight of
0.3. Obviously, as the weights are set empirically, they are still not accurate. In our future work, we will improve the method for assigning the weights.
This paper adopts the center of gravity (COG) defuzzification method [
36] to get the accurate and concrete value of
. According to
, the new number of quality levels can be adaptively adjusted as Equation (9), where
is the new
and
is the original one.
For example, we assume that and . The calculation process of is as follows:
(1) Fuzzification of the input variables.
According to the membership functions in
Figure 6, we can get the membership values of
and
, as shown in
Table 4 and
Table 5.
(2) Invoking the corresponding fuzzy rules.
When the fuzzy label of
is L, the membership value is 0, and when the fuzzy label of
is B, the membership value is 0. So, the fuzzy rules in
Table 4, of which IF parts contain the fuzzy label of
is L or the fuzzy label
is B, are not be invoked. Finally, there are four rules invoked, which are listed in
Table 6.
Rule 1: The membership value of belonging to “M” is 0.35, and the membership value of belonging to “L” is 0.1, so the degree of Rule 1 can be calculated as: .
Rule 2: The membership value of belonging to “M” is 0.35, and the membership value of belonging to “M” is 0.35, so the degree of Rule 2 can be calculated as: .
Rule 3: The membership value of belonging to “B” is 0.1, and the membership value of belonging to “L” is 0.1, so the degree of Rule 3 can be calculated as: .
Rule 4: The membership value of belonging to “B” is 0.1, and the membership value of belonging to “M” is 0.35, so the degree of Rule 4 can be calculated as:
The conclusion of Rule 1 is the fuzzy label of is B, so the membership value of belonging to “B” is 0.275. For Rule 2, the fuzzy label of is L, so the membership value of belonging to “L” is 0.35. For Rule 3 and Rule 4, the fuzzy label is M, so the membership value of belonging to “M” is .
(3) Defuzzification of the output variable.