An Efficient QoS-aware Services Selection in IoT using A Reputation Improved- Social Spider Optimization Algorithm

Internet of Things (IoT) has been grown rapidly over the last years to connect a considerable number of spatially distributed objects or actuators. The connected objects create new functionality and provide various services to enhance and satisfy End-users daily lives. The issue is to provide the End-users with optimal services based on their requirements. The critical challenge is to select the optimal service from similar services functionally and various services non-functionality requirements (Quality of services). To achieve this challenge, this paper proposed a services selection model under QoS constraints in the IoT environment. The introduced model implements a meta-heuristic optimization algorithm with a friendly Likert scale measurement method. It aims to improve the performance of bio-inspired optimizing algorithms, called a Social Spider Optimization (SSO) Algorithm, by adding a reputation value to member's weight. The proposed model used a Likert scale measurement to evaluate the reputation of the services from the End-users. In the experiments, a comparative study was done between an original SSO and the proposed RI-SSO model. The results show the efficiency of the proposed RI-SSO model against the original SSO, in both maximization and minimization problems. It obtains a better outperform in terms of fitness values.


INTRODUCTION
Internet of Things (IoT) is a coherent environment, which aims to link physical things together. It senses things by using a massive number of sensors and actuators. Theses actuators connected to create new applications that facilitate End-users life. The provided applications composite from any number of abstract services connected as one service for End-user to perform more complex functions [1]. In the IoT environment, the number of sensors continuously increasing, this leads to an increase in the number of services. The provided services from the same sensors type; are similar in their functional properties, but they differ in their non-functional properties. The service selection algorithm is fundamental in the IoT environment. It is an NP-hard problem that aims to select an optimal abstract service from a set of concrete services. The selection criteria build based on the Quality of Service (QoS) constraint that is defined by the End-users. ITU-T E.860 defined QoS [2] as " The degree of conformance of the service delivered to a user by a provider with an agreement between them." In the IoT environment, QoS formed in several architectures. Authors in [3] proposed QoS architecture to be appropriate )with IoT architecture. They divided QoS into three main layers (Sensor layer, Network layer, and Application layer). These layers integrated the traditional QoS attributes with other essential qualities in IoT Architecture (e.g., network deployment cost, Energy efficiency management, information accuracy). This paper focused on QoS from the Application Layer. It represents the highest layer in IoT architecture, which consists of many distributed services composed to be one service or application. This layer aims to deal with ranking services based on users' requirements of QoS. Examples for QoS in the application layer as (Performance time, Execution Time, Availability, Services Perform Price, and Reliability) [3]. To this end, many solutions have been developed to address the QoS aware of service selection schemes. The proposed solution aimed to solve a selection problem by using a bioinspired Meta-heuristic Optimization Algorithm (M-HOP). M-HOP algorithms are one of the widely used to address the services selection problem. A Meta-heuristic is artificial intelligence algorithms introduced by Glover in 1986. It comes from the combination of two Greek terms meta-(metá, which means the highlevel), and heuristic (euriskein, which means "I find, discover").
One of the recent M-HOP used to solve the optimization problem is a Social Spider Optimization Algorithm (SSO). The proposed solution improved the behavior of SSO by enhancing the member weights in the colony. The member weights increase or decrease based on the service reputation that takes from the End-user. The reputation value also called historical information [4] or End-user feedback information [5]. This information gathered from End-user after using a service. The proposed model introduced an easily friendly method to gather this historical information by using a Likert Scale measurement. It called a Reputation Improved-Social Spider Algorithm (RI-SSO) because it improved the behavior of SSO based on gathered Reputation information. The rest of this paper organized as follows: First, the next section introduced the related works. Section three and four show the services in the IoT environment and services selection process, respectively. In section five, a QoS composition model discussed. Composed services selection model and fitness function defined in section six and section seven, respectively. The Likert scale measurement explained in section eight. Section nine illustrated an original social spider optimization algorithm. The proposed model of the Reputation Improved-Social Spider Optimization (RI-SSO) algorithm explained in section ten. Section eleven shows the experiment settings and dataset. Section twelve explored the conclusion. Finally, the recommendation and future work discussed in section thirteen.

RELATED WORK
Select the optimal services that match the Enduser requirement is a core study for many researchers over the years. There are many studies done by applying bio-inspired optimizing algorithms. In particular, the meta-heuristic algorithms proposed to enhance the QoS constraints aware a services selection process in IoT environment. Authors in [6], [7],and [8] applying a Meta-heuristic algorithm by considering the objective QoS information which is supported by the service providers. Li et al. [7] introduced an optimization solution in the cloud logistics platform in IoT and Cloud computing environments. They termed the services selection problem as a constraint satisfaction problem (CSP). The proposed a dynamic model depend on Practical Swarm Optimization (PSO) algorithm. They considered four QoS constraints (availability, reliability, time, and cost). Liu et al. [8] proposed a Cooperative Evolution algorithm (CE) by integrating two meta-heuristics algorithms (Genetic Algorithm (GA) and Canonical PSO (CPSO) algorithm). They computed four QoS factors in their algorithm (cost, time, availability, and reliability). In their approach, authors regarded some characteristics for compositions implemented on a large scale like: ensures the diversity of the population, convergence in the global best solution, optimize a local best solution, and fit the Self-adaptive mechanism of learning rates. M. Elhosenya et al. [6] proposed a new model to improve health services applications (HAS) in an industry 4.0 and cloud-IoT based environment. The model aimed to optimize virtual machine selection (VMs). It executed using three different Metaheuristic optimization algorithms (Parallel Particle swarm optimization (PPSO), Particle swarm optimizer (PSO), and Genetic Algorithm (GA)). Authors regarded five factors: reduce the performance time, adjust the required storage of patient's data, optimize the resource utilization, improve the scheduling of medical requests tasks, and provide a real-time data retrieval mechanism for HAS. While there are some researchers [5], [4] and [10] emphasize the subjective QoS feedback information that comes from End-user after using selected services. Such as Mejri et al. [5]adopted a self-adaptive approach to ensure scalability in the IoT environment. The introduced approach consists of two models: QoS prediction model: used an Artificial Neural Network (ANN) to predict QoS by considering three contexts (user, service, and network). A technique for Order of Preference by Similarity to Ideal Solution (TOPSIS) model: to present the optimal service to the consumer of the services. They optimized two QoS factors: execution time and reliability. Nwe et al. in [4], presented a new model called a Flexible QoS-Based Service Selection Algorithm (FQSA) to match, rank, and select the distributed things on dynamic IoT environments. The selection factors divided into two main categories: Objective Information category comes from the service providers, and the Subjective Information category comes from the service consumers. The model allowed the End-user to request the QoS criteria in an easy and friendly manner using a flexible, userfriendly assessment form. It divided into two parts based on two previous factors: First part to calculate the user subjective factors, authors implemented a Similarity Aggregation Method (SAM)) to evaluate the creditability of the different End-users. Also, to understand QoS characteristics and extract End-users input meaning, they used QoS ontology, WordNet, and ontological reasoning. In the second part of finding the objective factors, the proposed FQSA algorithm implemented Artificial Neural Network Back-propagation Algorithm (ANN-BP) to improve a selection performance rate to be acceptable in real-time service selection. Also, few researchers introduced the optimization solutions for the selection problem using a social spider algorithm (SSO). Mousa et al. [9] proposed SSO as a solution for services selection process-aware QoS constraints. The proposed model introduced in the general web services environment by considering the objective QoS information only. The authors satisfied in the three QoS factors (execution time, availability, and throughput). Their experimental results show that SSO has less execution time and better global searching than PSO.
In [10], Divyad et al. proposed an idea for ranking the services in the registry based on End-user evaluation or feedback to enhance a selection and discovery processes. They proposed the SSO algorithm for the first optimizing processes. Then they proposed to use the gathered information to rank services in the registry for further optimized. They calculated the fitness value by considering response time, availability, and cost as the metrics in the selection process. They proposed their idea only as steps without any computation and without any method to explain how feedback information will gather from End-User. Also, they did not show any experimental setting or any experimental results for their model. Therefore, in this article the proposed optimization model can differentiate from the above state-of-the-art models in two main parts: Firstly, the model proposed an improved SSO algorithm for IoT applications called Reputation Improved-SSO (RI-SSO). Secondly, it offered an easy, friendly method; most of the typical End-user manipulates with it before. It proposed to use the Likert-type management to calculate subjective QoS information (the retrieval evaluation feedback information comes from End-user).

SERVICES SELECTION IN IoT
ENVIRONMENT In the IoT environment, there are numerous benefits and facilities provides to the End-users. These facilities provided as applications like health care, smart home, smart cities, animal tracking, manufacturing, and many critical applications. The applications build from many abstract services. These services compose together and deliver to the End-users to satisfy their requirements. For each abstract service, there are many concrete services, which are similar in their functional properties but different in nonfunction properties.
The proposed model applies the Horizontal adaptation to optimize the selection problem. The goal in the Horizontal adaptation is to find the ideal concrete service from a set of functionality equivalent candidate services for each abstract service separately [13] [7] , as in Fig (1). It regards more appropriate for IoT environment, which contains the enormous number of sensors that provide services with the equivalent in functional properties and different in non-functional properties.
Horizontal adaptation provides greater flexibility for user intervention [13], which enables the user to implement and modify the abstract workflow when required.

QoS COMPOSITION MODEL
The selection of an optimal service that meets End-user requirements depends on QoS factors values that distinguished from one service to another. This approach identifies five QoS factors in the application layer. These factors selected from two quality types [14]. The first type is the Business Quality Type (BQT): it means an economic value that is offered by applying services. This value is using to evaluate the right service based on business value. This paper studied two BQT factors, they are: Reputation qRP(s): This is a social evaluation of service depending on the rates coming from different users after requesting services. Execution Price qEP(s): It is a price value that the user pays for the service invocation to a provider during or after using the service. The second type is the System Quality Type (SQT): it means QoS related to the system, based on process time, determines QoS properties. Three SQT factors considered in this paper are: Reliability qRE (s): It is the probability ratio to complete the services successfully. Availability qAV(s): It refers to a probability ratio that the service is running and can be accessed when invoked. Response Time qRT(s): It indicates the delay between the service request and the time. The service response was received. It can be measures by seconds. To optimize the QoS value, the behavior of factors are varied from one factor to another [9]. Some factors optimized by getting the minimum values; they called Negative QoS factors. Other factors optimized by getting the maximum values; they called Positive QoS factors. The optimal results for the Negative QoS factors (Execution Price and Response Time) are the smallest values. It evaluated as in equation (1).
Moreover, the optimal results for Positive QoS factors (Reputation, Reliability, and Availability) are the highest values. They evaluated as in equation (2).
Where , (1< <5) indicates the number of QoS factors. CS indicates concrete services. and represent the maximum and minimum values of the -th QoS factor, respectively. QoS vector of concrete service CS is defined as follows:

SERVICES SELECTION MODEL
To compose services together using general web services technologies, there are four main composition structures (sequential, parallel, cycle, and branch) [8] [15], as shown in Fig(2). Sequential, is to execute the composition of services in sequential order one follows to others.
Parallel, tasks are performed simultaneously by moving to the next task until all of these parallel tasks achieve. Cycle, at least one task must performed more than one time. Branch, only one task from a set of optional tasks will be selected then moves to the next step. In the proposed model, the sequential workflow of services composition will be considered. In a sequential workflow, the QoS value for each concrete service calculated by aggregating the corresponding values of each factor. The sequence-structure applies two types of QoS aggregation functions, as in Table (1

FITNESS FUNCTION
To get the optimal selection process, the objective function or fitness value calculated by considering the five QoS factors for candidate concrete services in all abstract services. The objective function or fitness value is calculated based on an optimization type to maximize or minimize the services selection as in equation (4):

Objective Function = [Min(WRT*FRT(CSij))+Min(WEP*FEP(CSij))+Max(WAV*FAV (CSij))+Max(WRE*FRE(CSij))+Max(WRP*FRP(CSij))] (4)
Where, FQoS(CSij) represents the summation or multiplicative function for each factor. For simplicity's sake, our model calculates the summation for all QoS factors. And represents the weight for each factor, the , (1< <5) represents the number of QoS factors. In our model, we consider the End-users interested in services with high response time and execution price, so we give them a high weight equal to 0.25 for both of them. The reputation weight equals 0.20, while availability and reliability get less interested, so we give them low weights equal 0.15 for both of them as in equation (5), (6 ).

LIKERT-TYPE
Likert-Type defined in [18] as "a psychometric response scale primarily used in questionnaires to obtain participant's preferences or degree of agreement with a statement or set of statements." The scale measurement named by Dr. Rensis Likert in 1932. His goal was to improve a means of measuring psychological attitudes directly in a "scientific" method. There are many structures introduced to measure the levels of granularity. Our proposed solution implemented the most commonly used structure is a 5-point scale or levels [19]. The scales starting ranging from "Strongly Disagree", " Disagree", "Neither", " Agree", and "Strongly Agree " as in Fig (3). Each scale assigned to coding like using numeric value or alphabet value. This value used to measure the attitude under investigation, usually starting at one and incremented by one for each level. The introduced paper uses a Likert-type to measure the agreement level of service taken from End-users after using it. The agreement level provides the feedback value about the Enduser preference saved which as reputation value to each service. In the beginning, the reputation value set to equal zero. To analyze the collected feedback data, the median value is not the mean value of each service calculated to get a more precise answer. The median used because our solution used the Likert-type does not use a Likert scale [19]. For example if the service si, evaluated ten times from End-users as follow: 3,1,3,2,4,3,4,2,1,1. To calculate the median value, first, we need to reorder the evaluation list in ascending order as 1,1,2,2,3,3,3,3,4,4. Then find the position of middle one by divide the (list_length / 2): (10/2=5 th position). The result rounded to the nearest integer number for odd list length. So the median is equal to 3, which indicates "Neither". The reputation value saved as a decimal number as in Table (2) -this the reputation value for service si, is equal to 0.6.   [20] to find an optimal solution of complex optimization problems in continuous search space. In this artical the original SSO and proposed RI-SSO used to solve the services selection problem in discrete search space, namely the Nearest Integer method [9]. One of the primary behavior in the SSO colony is mating behavior, females used the vibrations of the male spiders over the web to determine a heavier spider fitness. SSO colony consists of two main components: Communal Web: represent a search space of the optimization problem of the SSO algorithm where all spiders have a position on it. Each position represents an available solution to the optimization problem on the web. When a spider leaves the web, its position represents an unavailable solution to the optimization problem [21]. Social Members: They are spiders on the web which they an agent of SSO to perform optimization. It represents the complete population ( ). Social members are divided into two members group [20][21] as in Fig (4). Females group: F represent 65% -90% of the total colony members, F= {f1, f2, f3, …, fNf}. Males group: M represent 35% -10% of the total colony members, M= {m1, m2, m3, …, mNm}. Whereas = F ⋃ .= ⋃ , S= {s1, s2, s3, …, sN}, so ={ s1=f1, s2=f2, …, sNf =fNf , sNf+1 =m1 , sNf+2 =m2, ..., sN = mNm }. On the basis of gender, each individual is calculated through a set of different evolutionary operators that emulate different cooperative behaviors. Also spider receives a weight according to the fitness value of the solution on web.

Fitness Evaluation
On the web, each spider has a weight SWi, which represents the solution quality. The weight value of each solution in population calculated by equation (7): Where ( ) is the fitness value obtained by the calculation of the spider position concerning the fitness or objective function in equation (4), the bests and worst values are the maximum and the minimum values of the solutions in the population.

Social Members (Spiders)
Each spider s on the web has a memory to store two types of information: Individual situation information used to describe the spider s, which

Vibrations through the Communal Web
The communal web is used as a mediator to transmit information among the spiders. This information is encoded as small vibrations for the collective coordination of all individuals in the web. Vibrations strength are affected by two properties; the intensity source, and the intensity attenuation. The intensity source of the vibration also called the weight factor: it calculated by fitness function as in equation (8) in the range [0, + ∞] [21]. whereas members have the highest weight generating stronger vibrations compared to members having the lowest weight.

SSO Algorithm levels
To obtain an optimization selection solution by using SSO Algorithm, there are three levels : Initialization level: is a start step in optimization processes done by initializing the following:  The optimization search space which represents the hyper-dimensional spider web.
 The spider's positions (feasible solution for services selection) represent the population over the web. They generated randomly with their fitness, which represents the quality of each offered solutions.  The objective function will use to select an optimal solution based on End-user preference.  The End-user defined a value for the QoS factors to be used in SSA, representing female attraction. Iteration level: SSO performs searching iteratively until finding the optimal solution between offered solutions. For each iteration; spiders on the population move to a new position and perform the following steps:  Evaluate the fitness values of each spider in the population .  Generate the vibrations for all spiders by using equation (8).  Propagates these vibrations intensity over the web using equation (11).  Select the strongest vibration value from , in maximization problems strongest vibration means the largest value and vice versa in minimization problems.  Compare the intensity value of with the sorted intensity value of the target vibration . If is less than , the inactive degree reset to zero. Otherwise, value retained, and is incremented by one.  Move a random walk towards by using dimension mask to direct the spider movement.
is a binary vector ∈ [ , ] of length equal to the web dimension of the optimization problem. Its value is changed based on the probability 1 − _ . If the value is changed, all vector elements have a probability of _ to be an equal one, and a probability of 1 − _ is zero.
Whereas, _ is a user pre-defined parameter that detects the probability of changing the mask. Moreover, _ is also a user pre-defined controlled parameter∈ [0,1].
 Generate a new following position , based on the mask for As in equation (12) Final level: This level handles any constraint that can happen during iteration level lead to violating the optimization problem, such as spiders can move out of the web (maximum and minimum bounds) during the random walk step, which means the offered solution will be unavailable.
Where, ̅ is the upper bound on the search space, and is the lower bound.

PROPOSED MODEL
The proposed model build based on two natural behaviors in the social spider colony. These behaviors and proposed solution are arranged in the following two points The first point, the natural behavior of mating between social spider members, done between a females and dominant males (males with better fitness) [21]. As a result of a mating a new offspring generated with new fitness values. The generated fitness values based on the strength of the dominated male who performs a mating. Fitted male mating generates fitted offspring and vice versa [22]. To represent this behavior in the optimization selection problem, the females represent the End-Users, and Dominated males represent the candidate services. The proposed solution aims to enhance and emulate this natural behavior. It regards a subjective factor by evaluating the feedback value take from the End-user to each service. Then add this evaluation value to the selected service as a reputation factor. The reputation value gathered by using an easy, friendly method called a Likert-type measurement, as in section 8. Then generate a new fitness value based on collected information on services reputation. The new fitness value of the service represents the new offspring with new fitness value. This added value leads to improve the next service selection process based on the collected evaluation from a previous selection process. The second point, the behavior of attraction or dislike between females and males, has been evolved based on the propagation of the vibrations across the web from males to females. In original SSO, the strength of vibrations intensity sensed based on two properties [22] weight and distance as physical energy phenomena as in equations (8), (9), and (11). The more energetic vibration generated either by large spiders or neighboring members on the web. Generally, in physics, the intensity defined as "the quantity of energy the wave conveys per unit time across a surface of unit area" [23]. The intensity formula is: = (15) Where P is the power, and A is the area. From the above equation, the relation between intensity and power is directly proportional. So the increase in the power value leads to an increase in the intensity value. In a social spider colony, the power represents by members' weight. So the proposed approach focuses on the effect of members weights based on the collected evaluation information. If the Endusers satisfy with selected services, they evaluate it with a high agreement point, for example (Strongly Agree, or Agree) and vice versa. This evaluation converts to reputation value to be (1.0, 0.8), respectively. The reputation value added to the member's weights or its fitness value as in equation (16). The service with a high reputation value meets the spider with high intensity that enhances the attraction of dominated males and vice versa. Our optimization model summarizes in the following steps as in Fig (6) where blue processes represent the Original SSO, and the red processes are the addition improvement: Step 1: In the initial steps, the selection process implements by the Original SSO as in section9.4, and the reputation value set to equal zero.
Step 2: The selected services deliver to the Enduser, who evaluates it based on QoS constraints. The Likert scale measurement is used based on 5-points scales to get the evaluation value from the End-user.
Step 3: The reputation value calculated from the evaluation information as in Table (2). The value is one from the following (0.2, 0.4, 0.6, 0.8, and 1.0). The reputation value added to each service as a reputation property.
Step 5: Evaluate the vibration intensity value by update the original SSO equation (17) to calculate as following: Then calculate the best vibration intensity receive in population and save it.
Step 6: Add the best vibration intensity receive value to the target vibration position as in this equation: The parameter's value using SSO and RI-SSO are [21]:  r_a = 1 represents the parameter that controls the attenuation rate of the vibration intensity over the distance.  p_c = 0.7, represent the user-defined attribute that describes the probability of changing mask.  p_m = 0.1, represent the user-controlled parameter defined between (0, 1). In the experiments, the number of stopping criteria (iterations) set to 50 and the population size to optimize the fitness value is sets to 20 for five abstract services. Each type of abstract service has a group of concrete services, as in

Performance Comparison
To analyze the performance of approach RI-SSO, the behavior of Original SSO compared with RI-SSO in two behaviors, one when the reputation value equals 0.2 the first or minimum point in Likert-type measurement. Other when the reputation value equals 0.8, the fourth or previous maximum point in Likert-type measurement. The comparison is made based on three evaluations: firstly, it recorded the best intensity receive values obtain from the three behaviors for minimization and maximization problems. Results show that the increases in reputation value leads to an increase in the best intensity received values in maximization problem as in Fig (8.a). Furthermore, lead to a decrease in the best intensity receives values in minimization problems, as in Fig (8.b). Secondly, it observed the evolution of fitness value over the two optimization types: For a maximization problem, it observed the fitness value of the cost factor. Results show in Fig  (9.a) the RI-SSO with reputation 0.8 gets the best performance by obtaining the less fitness value than RI-SSO with reputation 0.2 and Original SSO. For the minimization problem, it observed the fitness value of the availability factor. Results show in Fig (9.b) the RI-SSO with reputation 0.8 gets the best performance by obtaining the highest fitness values than reputation 0.2 and Original SSO. Thirdly, to approve the feasibility and efficiency of RI-SSO, it calculated the fitness values to optimize the five QoS factors by using equation (4). The result shown in Fig (10) demonstrates that SSO with a high reputation value can achieve better fitness values in this selection problem than SSO with low reputation value and original SSO. Thus, the RI-SSO can be used to optimize a selection problem by getting high availability and reliability while keeping a low cost and execution time.

CONCLUSION
To facilitate End-users life, IoT environments content a massive number of actuators that provide different services for them. The similar actuators can provide services with similar functionality but different in non-functional requirement. So the different End-users request the same service with different QoS criteria. Thus make a process of selecting the required service with the optimal QoS is an NP-hard problem. This paper proposed a meta-heuristic algorithm to solve the services selection problem. The proposed approach classified into two parts: First part is collecting feedback information about services from End-users who used it-this information collected through a user-friendly tool named Likert-type measurement. The median value of feedback saves as reputation value for each service. The second part is to find an optimal services selection solution by using a Reputation Improved-Social Spider Optimization (RI-SSO) algorithm, which regards reputation information.
The model uses the collected information to improve the behavior of Original SSO. It adds value to new offspring in the SSO model by updating a fitness weight based on an average calculation of reputation information. The RI-SSO upgrades the reliability of the searching process by selecting a service that appropriates with the End-user preference. The comparison studies find that the proposed approach RI-SSO has an extreme fitness function value than Original SSO. The simulation results approve the efficiency of using the Likert-type with SSO in services selection is much higher than using SSO only.
12. RECOMMENDATION AND FUTURE WORK Future work, aims to increase the dataset scale and implement a real-world case study for IoT application. Also recommends using a prediction tool that predicts the quantities and qualitative QoS which End-user can require based on evaluation information collected from Likerttype measurement.

DECLARATIONS Availability of data and materials
The data and materials were available online from 2019 to submitted date.

Competing interests
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. Funding There is no funding supporter for this research.

Authors' contributions
The two main contributions of this article are  Collect the End-user feedback information using a friendly method Likert scale measurement in Services selection Algorithms and keep it as Reputation value for each service.  Improve the performance of Social Spider Optimization Algorithm by using the collected Reputation value and add it to the weight of each spider in the web.