Clustering and selection method of microservices for intelligent manufacturing
[Objective]Intelligent manufacturing requires the agile development of industrial software,and microservices architecture for industrial software application is an important research direction at present.To improve developmental efficiency of industrial software,functional components in the form of microservices must be published on the internet,and a microservices library needs to be built for management,enabling users to choose according to their needs.To meet the demands of the increasingly complex business needs of users,the microservices library must efficiently combine numerous contained microservices to expand achievable functions.Based on the binding mechanism between the registry and microservices library,the quality of the two links of retrieval and selection in the microservices combination significantly impacts user experience.[Methods]In the process of service retrieval,a service clustering algorithm based on Sentence BERT and SOM(SBERT-SOM-k)is proposed to efficiently find a group of microservices that meet specific functional requirements of the microservices library.This method converts microservices into a text vector through Sentence BERT,mapping them to the output layer nodes of SOM.The iterated weight vector represents these output layer nodes,which can effectively improve the disadvantage of the k-means algorithm that is sensitive to noise and outliers.Because of the absence of a special microservices set related to industrial software at present,the experiment uses the open web service test dataset OWLS-TC4 to compare SBERT-SOM-k with three clustering algorithms:SBERT-k,LDA-k,and TFIDF-k and uses three indicators of accuracy,recall,and F-measure to evaluate the performance of the algorithm.In the service selection phase,to further select the optimal combination of microservices,nonfunctional requirements,such as availability,reliability,and response time,are considered as quality of service(QoS)indicators,which transformed into a multiconstraint single-objective optimization problem based on QoS.Furthermore,an improved genetic algorithm is proposed,which is redesigned in terms of encoding,crossover,mutation,selection,and constraint punishment.The improved genetic algorithm is used to achieve stable solutions for multiconstraint single-objective optimization problems.The experiment used QWS2.0,a real web service dataset that exists on the internet,to compare the number of iterations and fitness values of the improved genetic algorithm(IGA),cross unimproved but constrained genetic algorithm(NICGA),and cross unconstrained improved genetic algorithm(NICCGA)for obtaining the optimal solution under different task node numbers.[Results]The results of service clustering experiments show that the average accuracy of different clustering algorithms is the same.However,SBERT-SOM-k still has significant advantages over SBERT-k,LDA-k,and TF-IDF-k,with the average recall rates increased by 29.56%,19.36%,and 31.70%,and the corresponding average F-measure increased by 22.41%,13.77%,and 25.33%,respectively.Additionally,IGA can improve the optimization speed and quality of the service composition,effectively preventing premature convergence.[Conclusions]The proposed clustering and selection method has achieved good results.It can rapidly select microservices from the microservices library,meeting the needs of users.Furthermore,integrating these microservices into an industrial software system registry based on the microservices architecture will enhance user satisfaction and help to realize the efficient use of microservices.