Clustering and selection method of microservices for intelligent manufacturing
WANG Liping1,2, SHI Huijie2, WANG Dong1
1. Department of Mechanical Engineering, Tsinghua University, Beijing 100084, China; 2. School of Mechanical and Electrical Engineering, University of Electronic Science and Technology of China, Chengdu 611731, China
Abstract:[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.
王立平, 史慧杰, 王冬. 面向智能制造的微服务聚类与选择方法[J]. 清华大学学报(自然科学版), 2024, 64(1): 109-116.
WANG Liping, SHI Huijie, WANG Dong. Clustering and selection method of microservices for intelligent manufacturing. Journal of Tsinghua University(Science and Technology), 2024, 64(1): 109-116.
[1] 辛园园, 李俊晖, 李阵. 微服务组合方法研究进展[J]. 无线通信技术, 2018, 27(3):42-46. XIN Y Y, LI J H, LI Z. Research progress of microservices composition methods[J]. Wireless Communication Technology, 2018, 27(3):42-46. (in Chinese) [2] BEGUM M F, KUMAR P N, BALAJI T, et al. Clustering Web documents to bootstrap the discovery of Web services[J]. International Journal of Advance Research in Computer Science and Management, 2017, 3(2):2394-2697. [3] CHEN Y P, WANG X, XIA H, et al. Research on Web service clustering method based on word embedding and topic model[M]//LIU Y, WANG L P, ZHAO L, et al. Advances in Intelligent Systems and Computing, Fuzzy Systems and Knowledge Discovery. Cham, Switzerland:Springer, 2019:980-987. [4] YANG D J, HE D. Web service clustering method based on word vector and biterm topic model[C]//2021 IEEE 6th International Conference on Cloud Computing and Big Data Analytics. Chengdu, China:IEEE, 2021:299-304. [5] FEKIH H, MTIBAA S, BOUAMAMA S. An efficient user-centric Web service composition based on harmony particle swarm optimization[J]. International Journal of Web Services Research, 2019, 16(1):1-21. [6] XIA Y M, CHEN J L, MENG X W. On the dynamic ant colony algorithm optimization based on multi-pheromones[C]//Seventh IEEE/ACIS International Conference on Computer and Information Science. Portland, OR, USA:IEEE, 2008:630-635. [7] DAHAN F, MATHKOUR H, ARAFAH M. Two-Step artificial bee colony algorithm enhancement for QoS-Aware Web service selection problem[J]. IEEE Access, 2019, 7:21787-21794. [8] PUROHIT L, KUMAR S, KSHIRSAGAR D. Analyzing genetic algorithm for web service selection[C]//20151st International Conference on Next Generation Computing Technologies. Dehradun, India:IEEE, 2015:999-1003. [9] 徐甜, 刘凌霞. 基于改进遗传算法的Web服务优化组合研究[J]. 计算机应用与软件, 2016, 33(5):24-27. XU T, LIU L X. On optimisation of Web service composition based on improved genetic algorithm[J]. Computer Applications and Software, 2016, 33(5):24-27. (in Chinese) [10] 李笠, 李广鹏, 常亮, 等. 约束进化算法及其应用研究综述[J]. 计算机科学, 2021, 48(4):1-13. LI L, LI G P, CHANG L, et al. Survey of constrained evolutionary algorithms and their applications[J]. Computer Science, 2021, 48(4):1-13. (in Chinese) [11] REIMERS N, GUREVYCH I. Sentence-BERT:Sentence embeddings using siamese BERT-networks[C]//Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP). Hong Kong, China:Association for Computational Linguistics, 2019:3982-3992. [12] KOHONEN T. The self-organizing map[J]. Proceedings of the IEEE, 1990, 78(9):1464-1480. [13] 杨洁. 服务计算:服务管理与服务组合流程[M]. 北京:清华大学出版社, 2017. YANG J. Service computing:Service management and service composition process[M]. Beijing:Tsinghua University Press, 2017. (in Chinese) [14] 夏虹, 李增智. 粒子群算法求解Web服务组合中基于QoS的服务选择[J]. 北京邮电大学学报, 2009, 32(4):63-67. XIA H, LI Z Z. A particle swarm optimization algorithm for service selection problem based on quality of service in web services composition[J]. Journal of Beijing University of Posts and Telecommunications, 2009, 32(4):63-67. (in Chinese) [15] 张旭云. Web服务组合中QoS评估及服务选择的关键技术研究[D]. 南京:南京大学, 2011. ZHANG X Y. Research on QoS evaluation and service selection in web service composition[D]. Nanjing:Nanjing University, 2011. (in Chinese)