Composition of Web Services of Multi-Population Adaptive Genetic Algorithm Based on Cosine Improvement

Web quality of service (QoS) awareness requires not only the selection of specific services to complete specific tasks, but also the comprehensive quality of service of the whole web service composition. How to select the web service composition with the highest comprehensive QoS is a NP hard problem. In this paper, an improved multi population genetic algorithm is proposed. Cosine adaptive operator is added to the algorithm to avoid premature algorithm caused by improper genetic operator and the disadvantage of destroying excellent individuals in later period. Experimental results show that compared with the common genetic algorithm and multi population genetic algorithm, this algorithm has the advantages of shorter time consumption and higher accuracy, and effectively avoids the loss of effective genes in the population.


Research Significance and Background
With the increasing number of Web services in recent years, a large number of Web services were published on the network. Literature [1] and [2] pointed out that a single service has been unable to meet the needs of users, and more and more users need to combine web services to meet more needs. With the continuous development of network technology, users are not only satisfied with the realization of functional requirements, but also required to achieve good Journal of Computer and Communications non-functional requirements such as price, event, throughput and so on.
Web service composition is a process of selecting specific services from several abstract tasks and combining them into large granular services. According to the literature [3], from the perspective of business process, web service composition essentially refers to the connection of various tasks required by users in different ways. For a web service combination, each abstract task is completed by a specific service in the corresponding candidate service set. They have the same functions, but users can filter the services through a series of non-functional attributes: that is, the QoS attribute is used to constrain the service. However, there may be constraints among non-functional attributes. For example, when the price of service portfolio decreases, availability may also decrease. However, we need multiple indicators to judge the quality of services portfolio, and the problem will be transformed into multi-objective optimization. Therefore, it is a difficult problem to find a global QoS optimal solution under the premise of satisfying local constraints and completing the task flow.

Current Research Status
With the continuous development of intelligent optimization algorithms in recent years, more and more swarm intelligence optimization algorithms are studied and applied in Web service composition. For example, the cuckoo search based web service composition method proposed in reference [3], and the flying ant colony algorithm model proposed in reference [4] based on the improved ant colony algorithm to solve the multi-objective optimization and service selection problems in QoS, but at the same time, these methods can not avoid falling into the local optimal situation. Reference [5] proposed a new particle swarm optimization algorithm, bee colony optimization algorithm, to solve the multi-objective web service composition problem. Reference [6] used the improved NSGA-II algorithm to establish a multi-objective optimization model, and modified the population quality by crowding strategy. Combined with the above literature, I combine the crowding strategy with the elite strategy, and apply it to the algorithm proposed in this paper to ensure the quality of the selected individuals in the population. Combined with the idea of multimodality and niche in references [7] and [8], a new adaptive genetic algorithm MCGA is proposed to solve the problem of web service composition. The simulation results show that the algorithm has high superiority and feasibility, and can meet the actual needs. Definition 2 in general, we can represent the problem of Web service combination by a quaternion (S, C in , C out , Q), S representing the finite set of services, C in representing the input finite set of services, C out representing the finite set of outputs, Q representing the finite set of service quality QoS.

QoS Related Calculations
The connection mode of each abstract service can be divided into parallel, sequential, and selected ways in the process of Web service combination oriented to business flow. For example, the ( 1 2 , , , n w w w  ) is connected in a sequential manner, while the ( 1 According to the above definition, we give the following Table 1, calculate the Web service QoS formula of different connection modes. Table 1 is shown below. During the calculation of QoS, due to the different units of measurement of response time, availability and other attributes, the range of values is different, which will lead to the excessive proportion of some attributes and affect the overall results. Hence, we here normalize the QoS by formulas (1) and (2) and convert them to values of 0 to 1. For negative attributes such as response time and price, we normalize the attributes by (1). For positive attributes such as reputation, availability, throughput and so on, we normalize them by formula (2). For positive attributes such as reputation, availability and throughput.

Background and Basic Thought of Genetic Algorithm
Genetic algorithm is a random search algorithm based on probability proposed by Professor John Holland and his students of the University of Michigan in the Table 1. QoS formulas for composite services. 1970s. In the service computing problem, the service subscript is encoded and combined to represent the solution of a service composition on the chromosome. At the same time, the genetic operator in genetics is introduced to perform crossover and mutation operations, so as to obtain the next generation population. In this process, the new generation population is more adaptive to the environment than the previous generation. After continuous iteration, the last generation population can be approximately regarded as the optimal solution which is most suitable for the current environment. How to choose the genetic operator greatly affects the superiority of the algorithm.

General Process of Genetic Algorithm
Obviously, fixed crossover and genetic operators can not meet our needs, so Srinvas et al. proposed adaptive genetic algorithm [9] the reference (Adaptive GA, short for AGA). The crossover rate and variation rate are linearly adjusted between the average fitness and the maximum fitness of the population, as shown in (3), (4) below.
( ) represents the maximum fitness of the population, avg f represents the average fitness of the population, f ′ represents the larger fitness in the cross operation, and f represents the fitness of the individual.
From the formulas (3) and (4), it is not difficult to see that the optimal individuals in the population are difficult to change at the beginning of the algorithm. Therefore, the simple linear adaptive operator is easy to make the algorithm converge to the excellent individuals at a certain stage. It is obvious that the optimal individual in this stage is not necessarily the global optimal, so we can see that the above linear adaptive operator still has the possibility to converge the algorithm locally. In this paper, a cosine adaptive genetic operator can be used to solve this family problem effectively.
Through the above analysis, we can conclude that the traditional genetic algorithm has the problem of premature convergence, and the population is easy to lose the diversity of genes in the early stage and fall into the problem of local search for the optimal solution. In the early stage, the individual fitness in the population is low, the smaller genetic operator is not easy to produce the excellent individual, but in the later stage of the algorithm, the individual adaptation value in the population is higher. It will destroy the good individuals in the population. Therefore, we need a genetic operator that can change with the algorithm.
In addition, when the amount of data is too large or the number of individuals in the population is not enough, the probability of the emergence of excellent genes will be reduced, so that the optimal solution can not be obtained. For example, if an abstract service has too many specific services, fewer individuals and low variation rates reduce the possibility of optimal gene emergence. Based on the above problems, this paper proposes a Web service combination method based on multiple group genetic algorithms to solve the problem, which can make the algorithm jump out of the local extremum and create a new search plane, which effectively avoids the precocity of the algorithm.

Chromosome Representation
In the algorithm proposed in this paper, a chromosome represents a set of service combinations, abstract services represent a gene locus on the chromosome, and the number of abstract services is the number of loci. Each specific service can be represented as a gene. We put similar specific services into a service set to generate a candidate service set. Each locus will correspond to a specific set of candidate services to achieve a task in the business process by selecting a specific service in the set of candidate services. Select a service on each locus to form a chromosome, which is represented as a set of service combinations.
In terms of chromosome structure and gene coding, an integer encoding method is similar to that used in the reference [8], A chromosome structure contains N loci, each locus holds Type, connection of abstract services subscript Index, of specific services in the service candidate set and the attributes that measure the quality of service calculated by fitness function in formula (3)

Cosine Adaptive Operator
The genetic operator design of genetic algorithm has a very important influence  avg , 2

Improved Double Population Genetic Algorithm Implementation
In the process of convergence of genetic algorithm, with the iteration, the individuals in the population will become more and more single, and the population diversity will decrease, so there will be a situation of falling into the local optimal solution. Most of the reasons for this are the lack of excellent genes in the population, which leads to the algorithm only finding the optimal solution in some local candidate services. In order to overcome the above problems, this paper proposes a model based on the combination of parallel multi-group structure and elite multi-population structure to obtain the optimal solution through the convergence of elite population. When the population is initialized separately, multiple populations execute the MCGA algorithm separately, and each generation of excellent individuals is retained into the elite population. When each population MCGA executed, it is executed again in the elite population MCGA, and the optimal individual is obtained by judging the conditions. Algorithm 1 illustrates the steps of MCGA.
In genetic operation, we use single point crossover to minimize the possibility of reducing individual fitness. The specific operations are as follows: 1 2 , C C represents the chromosomes operated for the parent generation, 1 2 , Pick chromosomes X j ~ X i by roulette wheel selection algorithm where (X j ≠ X i ) 6 Corssover operator to q t P 7 Mutation operator to q t P 8 Add best solution X e to elite population P e and q++ 9 end for and t++ 10 end while 11 for (q = 0 to max generation n) do 12 Evaluate fitness of each chromosomes 13 Selection operator to P e 14 Corssover operator to P e 15 Mutation operator to P e 16 q++ 17 end for the chromosomes after the cross operation, and ∂ is the part of the crossover.
When we choose individuals to cross, we apply crowding strategy to individual selection strategy. Individuals with higher crowding degree were selected as the parents of the next generation population.
when the population of genetic algorithm lacks effective genes, the algorithm tends to be local and precocious. If the excellent candidate service on a candidate service set is missing in the model of Web service combination, the algorithm must not find the global optimal solution. Therefore, we use the two cosines adaptive operator mentioned above and design the crossover operator and genetic operator according to formula (3) and formula (4) respectively.
When calculating the fitness value, we first normalize the QoS by expression (1) and expression (2) respectively. At the same time, the service quality of each service is scored by the scoring function (5), and the fitness value is calculated by formula (6). At the same time. The higher the score, the better the solution of the service composition.
In order to optimize the selection of individuals by roulette algorithm, we use penalty function (7) to reduce the fitness value of inferior services to reduce the possibility of the individual being selected in the subsequent roulette algorithm.
In the later stage of the algorithm, it is helpful to retain excellent service group merging and eliminate inferior service combination in the early stage, which speeds up the convergence of the algorithm. In order to ensure the randomness of the process, the ∂ random number of [0.0.2] is introduced into expression (7) By adjusting the number of candidate servers to observe the running time of the algorithm and select the service score to judge the performance of the algorithm.

Experimental Design
Automatically generate three data sets by java random numbers, each data set  Table 2 compares the three algorithms with a population size of 20 in the initial test, the optimal service selected after 100 iterations. Each item in the table is an optimal solution selected under the data set. In this set of solutions, The QoS value of the specific service corresponding to each abstract service is added together to obtain the overall QoS value of the service combination, Arrange them in Cost/Availability/Time/Reputation order.
We can see from the above experimental results that when there are fewer services in the candidate server, the three algorithms can find the optimal solution, but when the number of services is increasing, the comprehensive QoS value of