A Web Service Clustering Method Combining Semantic Enhancement and Heterogeneous Association

Using synonym replacement and the SimCSE framework to generate semantically enhanced service function vectors, combined with the improved GATNE model to generate service association vectors, fused functions and collaborative associations, the problem of sparse features and association fusion in Web service clustering is solved, and the clustering efficiency is significantly improved. class quality.

CN115952425BActive Publication Date: 2024-10-01BEIJING QINGYI TECHNOLOGY DEVELOPMENT CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310006140.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-04
Publication Date
2024-10-01
Estimated Expiration
2043-01-04

AI Technical Summary

Technical Problem

In the existing Web service clustering methods, the service function vector features are sparse and the quality is not high, and the functional association and collaboration association cannot be effectively integrated, which affects the clustering quality.

Method used

Use synonym replacement to construct twin service descriptions, use the SimCSE framework to generate semantically enhanced service function vectors, and construct service heterogeneous association graphs. Use the improved GATNE model to generate service association vectors, and integrate function vectors and association vectors into service representation vectors to achieve clustering.

Benefits of technology

It improves the feature density and quality of service function vectors, effectively integrates functional associations and collaborative associations, and improves the accuracy and quality of service clustering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115952425B_ABST
    Figure CN115952425B_ABST
Patent Text Reader

Abstract

The present invention discloses a Web service clustering method integrating semantic enhancement and heterogeneous association. Firstly, a twin sample of service description is constructed by replacing synonyms, and a semantically enhanced service function vector is generated under the SimCSE framework. Then, a service heterogeneous association graph is established from the perspective of function and collaboration, and a random walk strategy for service association strength is designed. The improved GATNE model is used to realize the embedded representation of service nodes in the heterogeneous association graph, and an association vector of Web service is generated. Finally, the service function vector and the association vector are fused into a service representation vector to realize service clustering. By organically integrating the functional association and collaborative association of services, the quality of service clustering is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of service computing, and in particular relates to a Web service clustering method integrating semantic enhancement and heterogeneous association. Background Art

[0002] Web services are the mainstream organizational form of current network services. They are Web applications with specific business functions that are encapsulated using standardized protocols and interfaces. They are cross-platform, cross-language, easy to call and integrate. With the help of existing Web services, software developers can not only achieve agile development of network-based software systems, but also achieve rapid iteration of software products. The large number of Web services published on various service registration platforms provide users with abundant choices when building business systems. At the same time, how to quickly find services that meet their needs from a large number of similar Web services has also become a difficult problem. Service clustering aggregates Web services with similar functions and divides them into different service clusters, which can effectively reduce the service search space and is a commonly used method to improve service discovery efficiency.

[0003] Currently, Web services mainly use unstructured natural language to describe service functions. The mainstream service clustering methods usually adopt topic models or neural network models to generate feature vectors (often called service function vectors) for service function descriptions, and realize service clustering by calculating the similarity of these function vectors. In recent years, the collaborative relationship between services has attracted the attention of researchers in service clustering. Based on the business scenarios or combined Mashup services of common participation, researchers can build a service collaboration network, realize the vectorization of nodes in the collaboration network through some walking strategies or graph neural network models, and then calculate the collaboration similarity between service nodes and integrate the collaboration similarity into service clustering. Related research results show that fully exploring and utilizing the collaborative relationship formed between services can improve the quality of service clustering.

[0004] In the existing service clustering methods that consider collaborative associations, there are two technical difficulties that affect the quality of service clustering during clustering:

[0005] (1) The feature density of service function vectors generated by existing methods is sparse, and the quality of service function vectors is difficult to improve, which in turn affects the quality of service clustering.

[0006] Most existing methods use BERT or an improved neural network model based on BERT to generate service function vectors. However, the vector space generated by BERT is anisotropic, and the generated service function vector has sparse features because the service function description text is short and has mixed semantics. Some methods improve the semantic density of service function vectors by enhancing the semantic feature strength of nouns in service descriptions. However, although nouns account for a high proportion in the description text, the proportion of repeated words in the description text is very low, resulting in very limited improvement in the feature density and discrimination of the generated function vector, making it difficult to improve the quality of the service function vector.

[0007] (2) Existing methods treat collaborative association and functional association as mutually exclusive and lack a unified technical means to integrate the two. They are unable to quantitatively evaluate the strength of the service association formed by the two, which affects the quality of service clustering.

[0008] Existing methods believe that collaborative association and functional association are mutually exclusive. Services with collaborative association are complementary in function and should not be classified into one category. Therefore, the service clustering quality can only be improved by calculating the collaborative similarity of services, which has a very limited improvement on clustering quality.

[0009] However, in the service collaboration network constructed by the component services of Mashup services in ProgrammableWeb, there are 1018 Web services with collaborative relationships, of which 579 services have common category labels, that is, they have functional associations. The above data show that the functions of Web services have become significantly diversified. When clustering, it is necessary to fully consider the functional compatibility and complementarity between Web services. Therefore, the organic integration of service functional association and collaborative association will further improve the quality of service clustering. However, there is currently a lack of a unified technical means to integrate the two, and it is impossible to quantitatively evaluate the strength of the service association formed by the two, which makes it difficult to promote the rationality of clustering from the perspective of service association and improve the quality of clustering. Summary of the invention

[0010] In view of the problems in the prior art that the service function vector features are sparse and of low quality, and the current service clustering method fails to integrate the functional association and collaborative association, the present invention proposes a Web service clustering method that integrates semantic enhancement and heterogeneous association, which organically integrates the functional association and collaborative association of services and further improves the quality of service clustering.

[0011] The present invention is implemented by adopting the following technical solution: a Web service clustering method integrating semantic enhancement and heterogeneous association, comprising the following steps:

[0012] Step A: Construct a data set suitable for service clustering;

[0013] Step B: Constructing a service function vector for semantic enhancement and contrastive learning:

[0014] Step B1: construct a twin service description sample by replacing the verbs in the service description with synonyms;

[0015] Step B2: Under the SimCSE framework, contrastive learning technology is used to generate function vectors for the original service description and the twin service description respectively, and the mean of the two function vectors is used as the semantically enhanced service function vector of the original service description;

[0016] Step C: Generate a service association vector:

[0017] Step C1: Based on the label sharing and collaboration relationship between services, a service heterogeneous association graph integrating functional association and collaboration association is constructed to model the functional association and collaboration association between Web services;

[0018] Step C2: design a random walk strategy that integrates service association strength from the perspectives of functional association strength and collaborative association strength, and prioritize the sampling of nodes with high association in the path sequence;

[0019] Step C3: Implement node embedding for the service heterogeneous association graph based on the improved GATNE model to generate a service association vector;

[0020] Step D: merge the service function vector and the service association vector into a service representation vector to achieve service clustering.

[0021] Furthermore, in step B1, the verbs are replaced with synonyms to construct twin samples of the service description, and D = {d1, d2, ..., d n} is a service description text collection, d i ={w1,w2,…,w n} is a description text of a Web service. First, i The word components in the word are tagged with part of speech. For the word w j , get its synonym w j ′, d i The service description generated by replacing all verbs in the text with their synonyms is d′ i , the service description text set after verb replacement is recorded as D′.

[0022] Furthermore, step B2 is specifically implemented in the following manner:

[0023] (1) Using the SimCSE framework, we generate function vectors for the service description texts in D and D′ respectively:

[0024] Let h i1 =SimCSE(di ,D),h i2 =SimCSE(d′ i ,D′), and finally d i The generated semantically enhanced service function vector is denoted as h i , namely SE-SimCSE(s i )=h i The corresponding function vector:

[0025]

[0026] (2) Generate a service function vector sfv(s) for each Web service s participating in the clustering. The set of function vectors of all services is SRV = {sfv(s)}:

[0027] sfv(s)=SE-SimCSE(s).

[0028] Furthermore, the step C1 specifically includes the following steps:

[0029] Define functional association: If there is a label l such that l∈s i .L∩s j .L, then it is called service s i With Services j There is a functional association, denoted as: s i ~s j ;

[0030] Define a collaborative relationship: There exists a Mashup service m such that s i ∈mS∧s j .∈mS, then the service is called s i With Services j There is a collaborative relationship, recorded as:

[0031] Definition of service heterogeneous association graph: The service heterogeneous association graph is an undirected weighted graph HCG = (V, E, W), where: V = {v1, v2, ..., v n} is the service node set, node v i Represents Web services i ; E = {Ef, Ec}, Ef and Ec are the function-related edge set and the collaboration-related edge set respectively; e = (v i ,v j )∈Ef i With v j Corresponding services i and j Satisfaction i ~s j ; e=(v i ,vj )∈Ec i With v j Corresponding services i and j satisfy W={w ij} is the edge weight set,

[0032] w ij =Nl(s i ,s j ); w ij =Nm(s i ,s j );

[0033] The service heterogeneous association graph contains two types of edges. One type is the functional association edge of the service. If two services s i With s j If there is a same label, then the node v in HCG i and v j A functional association edge is established between them, and the weight of the functional association edge is service s i With s j The number of common labels, denoted as Nl(s i ,s j ); the other type is the collaborative association edge. If two services s i With s j coexist in the same Mashup service component set, then the node v in the HCG i and v j A collaborative association edge is established between them, and the weight of the collaborative association edge is service s i With s j The number of services participating in the Mashup is denoted as Nm(s i ,s j ).

[0034] Furthermore, in step C1, if service s i With s j If they participate in the same service composition process together, they will be treated as having a collaborative relationship.

[0035] Furthermore, the step C2 specifically includes:

[0036] (1) Calculate the service function association strength:

[0037]

[0038] (2) Set the meta-path pattern T = v1 → v2 → ... v t →vt+1 →v l In the example, the edge type of each step is different from the edge type r of the previous step. If the edge type of the t-1th step is r, then the tth step starts from v i to v j The transition probability is the service association strength normalized by the softmax function:

[0039]

[0040] Among them, N t+1 (v i ,r) indicates v i Different from the associated node set of edge type r, for a random walk path P = (v p1 ,…,v pl ), v pt The context is C = {v pk |v pk ∈P,|kt|≤c,t≠k}, k is a constant, 1≤k≤l, where c is the radius of the window size.

[0041] Furthermore, in step C3, the improved GATNE model refers to:

[0042] According to w ij ∈W calculates the normalized service association weight for each node and integrates it into the edge embedding representation generation process. The specific edge weight fusion method is as follows:

[0043]

[0044]

[0045] Among them, Ne_f(v i ) and Ne_c(v i ) represent the node v i The number of connected functional association edges and collaborative association edges, w i,j With w i,k The nodes v i The point v connected to the current edge j With v k The normalized service association weight is Z v , and Represent the maximum and minimum values ​​of the average edge weight respectively. Therefore, the node v i The overall representation of the edge of type r is improved as follows:

[0046]

[0047] In the above formula, bi For node v i The node-based representation of a r is a hyperparameter, which is the attention coefficient assigned to different types of edges, a i,r is the self-attention mechanism coefficient, is the trainable transfer matrix, U i For node v i The edge embedding representation of .

[0048] Furthermore, in step C3:

[0049] The designed random walk strategy is combined with the improved GATNE model to generate a node embedding representation model GAT-HCG suitable for service heterogeneous association graphs. The service set S participating in clustering and the heterogeneous association graph G are taken as input to generate a service association vector set SCV=GAT-HCG(S,G), where the service association vector corresponding to the service s in the set S is represented as sc v(s).

[0050] Furthermore, in step D, the function vector and the association vector of each service are concatenated to generate a service representation vector, that is, The set of all service representation vectors is recorded as SRV; K-means++ is used as the clustering algorithm to generate the service clustering set SC=K-means++(SRV,sn), where sn is the number of clusters to be generated.

[0051] Compared with the prior art, the advantages and positive effects of the present invention are:

[0052] This scheme proposes a Web service clustering method based on K-means++ fusion semantic enhancement and heterogeneous association. It uses service function vector and service association vector to splice into Web service representation vector, and uses K-means++ to achieve service clustering. It mines Web service representation from two perspectives: service description text and different association forms, and improves the accuracy of Web service clustering.

[0053] Among them, the proposed service function vector generation method adopts the method of replacing synonyms of verbs to construct twin samples of service descriptions, strengthens the semantic feature information of verbs representing service business operations, generates high-quality service function vectors based on the contrastive learning model under the SimCSE framework, increases the feature density of service function vectors, effectively alleviates the anisotropy of BERT vector space, and improves the generation quality of service function vectors; the Web service association vector generation method based on the improved GATNE solves the problem that the GATNE model cannot handle the edge weights of heterogeneous edges and can only treat all neighboring nodes of each node with equal weights, making the edge embedding representation generation of nodes more reasonable;

[0054] In addition, the constructed service heterogeneous association graph models the functional association edges and collaborative association edges of the service in one graph, and assigns weights to the functional association edges and collaborative association edges. Compared with the existing single functional association graph or collaborative association graph, this heterogeneous association graph facilitates the organic integration of functional association and collaborative association, and uses edge weights to conveniently calculate the association strength. In addition, a service heterogeneous association graph walking strategy with association strength correction is proposed, which can not only efficiently capture the semantic association strength generated between service nodes in different association types, but also maximize the service function similarity in the node sequence, ensuring that nodes with high service association strength are sampled into the path sequence first, thereby improving the corpus sampling quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 This is a schematic diagram of the process of the Web service clustering method according to an embodiment of the present invention;

[0056] Figure 2 This is a schematic diagram of the research framework described in the embodiment of the present invention;

[0057] Figure 3 A schematic diagram of a heterogeneous association diagram serving an embodiment of the present invention;

[0058] Figure 4 This is a schematic diagram of heterogeneous service association density evaluation according to an embodiment of the present invention;

[0059] Figure 5 This is an example diagram of a Web service according to an embodiment of the present invention;

[0060] Figure 6 This is an example diagram of the Mashup service according to an embodiment of the present invention. DETAILED DESCRIPTION

[0061] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described below in conjunction with the accompanying drawings and embodiments. In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention can also be implemented in other ways different from those described herein, and therefore, the present invention is not limited to the specific embodiments disclosed below.

[0062] This embodiment proposes a Web service clustering method that integrates semantic enhancement and heterogeneous associations. Figure 1 and Figure 2 As shown, the specific steps include:

[0063] Step A: Construct a data set suitable for service clustering;

[0064] Step B: Generate service function vector:

[0065] (1) Construct twin service description samples by using synonym replacement for verbs in service descriptions;

[0066] (2) Under the SimCSE framework, contrastive learning technology is used to generate function vectors for the original service description and the twin service description respectively, and the mean of the two function vectors is used as the semantically enhanced service function vector of the original service description;

[0067] Step C: Generate a service association vector:

[0068] According to the label sharing and collaboration relationship between services, a service heterogeneous association graph integrating functional association and collaboration association is constructed, a random walk strategy integrating service association strength is designed, and node embedding is implemented for the service heterogeneous association graph based on the improved GATNE model to generate service association vectors.

[0069] Step D: merge the service function vector and the service association vector into a service representation vector to achieve service clustering.

[0070] Specific:

[0071] 1. Web service data processing involved in clustering

[0072] First, crawl Web services and Mashup services (combined services) from service registration platforms such as ProgrammableWeb and RestfulAPI. Clean the obtained services and build a data set suitable for service clustering. Perform operations such as case conversion, word segmentation, stop word removal, and stemming on the service description texts of all Web services. Mashup services are used to extract service collaboration relationships, and their corresponding service descriptions are not processed. Figure 5 and Figure 6 As shown, the Web services and Mashup services involved in clustering are defined as follows:

[0073] Definition 1. Web Service

[0074] A Web service is defined as a four-tuple, s = (Id, n, L, d), where Id is the service identification number, n is the service name, L is the service tag set, and d is the service description information.

[0075] Definition 2.Mashup Service

[0076] A Mashup service is defined as a five-tuple, m = (Id, n, L, d, S), where Id is the identification number of the Mashup service, n is the name of the Mashup service, L is the Mashup service label set, d is the Mashup service description information, and S is the set of constituent services of the Mashup service.

[0077] 2. Generate service function vector

[0078] Construct a service function vector for semantic enhancement and contrastive learning, replace the verbs in the description text d of service s with synonyms, and generate a twin service description text d′ for each service; then adopt the SimCSE framework to generate function vectors for d and d′ respectively based on contrastive learning, and take the mean of the two function vectors as the final service function vector of service s.

[0079] 2.1 Generate a sample set of twin service descriptions

[0080] The verbs are replaced with synonyms to construct twin samples of service descriptions. Let D = {d1, d2, …, d n} is a service description text collection, d i ={w1,w2,…,w n} is a description text of a Web service. First, we use the StanfordNLP tool to analyze d i The word components in the word are tagged with part of speech. For the word w j , get its synonyms w through WordNet j ′, d i The service description generated by replacing all verbs in the text with their synonyms is d′ i The service description text set after verb replacement is denoted as D′.

[0081] 2.2 Using the SimCSE framework, a service function vector generation method SE-SimCSE for semantic enhancement and contrastive learning is constructed to generate semantically enhanced service function vectors.

[0082] (1) Using the SimCSE framework, generate function vectors for the service description texts in D and D′ respectively. Let h i1 =SimCSE(d i ,D),h i2 =SimCSE(d′ i ,D′), and finally d i The generated semantically enhanced service function vector is denoted as h i , namely SE-Sim CSE(s i )=h i The corresponding function vector:

[0083]

[0084] (2) Generate a service function vector sfv(s) for each Web service s participating in clustering. The set of function vectors of all services is SRV = {sfv(s)}.

[0085] sfv(s)=SE-SimCSE(s)

[0086] This step proposes a service function vector generation method for semantic enhancement and contrastive learning. It replaces the verbs in the service description by synonym replacement, constructs twin service description samples, and uses the SimCSE framework to generate service function vectors based on contrastive learning. It can effectively solve the following two shortcomings of existing technical methods:

[0087] (1) By constructing a twin service description, the verb density in the service description is increased. Verbs are mostly descriptive words that describe key service operations, thereby increasing the feature density of the operational level of the service function description and reducing the semantic sparsity of the service function vector.

[0088] (2) The SimCSE framework adopted generates feature vectors based on contrastive learning. This method can effectively alleviate the anisotropy of service function vectors generated by current neural network models represented by BERT, thereby improving the quality of service function vectors.

[0089] 3. Generate service association vector

[0090] This method abstracts services into nodes. If two services have the same label, a functional association edge is established, and the weight of the edge is the number of identical labels. If two services are components of the same Mashup service, a collaborative association edge is established, and the weight of the edge is the number of Mashup services that both services participate in.

[0091] 3.1 Construct a heterogeneous service association graph to model the functional association and collaboration association between Web services. See the following definition for details.

[0092] Definition 3. Functional association.

[0093] If there is a label l such that l∈s i .L∩s j .L, then it is called service s i With Services j There is a functional association, denoted as: s i ~s j .

[0094] Definition 4. Collaborative association.

[0095] There exists a Mashup service m such that s i ∈mS∧s j .∈mS, then the service is called s i With Services j There is a collaborative relationship, recorded as:

[0096] Definition 5. Service heterogeneous association graph.

[0097] The service heterogeneous association graph is an undirected weighted graph HCG = (V, E, W), where:

[0098] (1) V = {v1, v2, …, v n} is the service node set, node v i Represents Web services i ;

[0099] (2) E = {Ef, Ec}, where Ef and Ec are the functional association edge set and the collaborative association edge set respectively.

[0100] 1)e=(v i ,v j )∈Ef i With v j Corresponding services i and j Satisfaction i ~s j .

[0101] 2)e=(v i ,v j )∈Ec i With v j Corresponding services i and j satisfy

[0102] (3)W={w ij} is the edge weight set, w ij =Nl(s i ,s j ); w ij =Nm(s i ,s j );

[0103] The service heterogeneous association graph contains two types of edges. One type is the functional association edge of the service. If two services s i With s j If there is a same label, then the node v in HCG i and v j A functional association edge is established between them, and the weight of the functional association edge is service s i With s j The number of common labels, denoted as Nl(s i ,s j ). Another type is the collaborative association edge. If two services s i With sj coexist in the same Mashup service component set, then the node v in the HCG i and v j A collaborative association edge is established between them, and the weight of the collaborative association edge is service s i With s j The number of services participating in the Mashup is denoted as Nm(s i ,s j ). Special note: if service s i With s j If they participate in the same service composition process together, they will also be treated as having collaborative relationships.

[0104] Figure 3 A service heterogeneous association graph constructed for the component services of some Mashup services registered in the ProgrammableWeb website. The nodes are the corresponding Web services, the dashed edges are the functional association edges, the solid edges are the collaborative association edges, and the values ​​on the edges are the edge weights.

[0105] 3.2 Construct a walking strategy with service association strength correction. On the basis of Metapath2vec++ walking probability, the service association strength is integrated, the walking probability of the next hop of each node is calculated, and random walking is performed according to the probability to generate a sampling sequence.

[0106] The service association strength was established from the two perspectives of functional association strength and collaborative association strength. The service association strength was integrated with the Metapath2vec++ walking probability, and a walking strategy for the service heterogeneous association graph with association strength correction was established. It can not only efficiently capture the semantic association strength generated between service nodes in different association types, but also maximize the service function similarity in the node sequence, ensuring that nodes with high service association strength are sampled into the path sequence first, thereby improving the corpus sampling quality.

[0107] (1) Calculate the service function correlation strength, see the following formula:

[0108]

[0109] (2) Set the meta-path pattern T = v1 → v2 → ... v t →v t+1 →v l In the example, the edge type of each step is different from the edge type r of the previous step. If the edge type of the t-1th step is r, then the tth step starts from v i to v j The transition probability is the service association strength normalized by the softmax function:

[0110]

[0111] According to the above formula, N t+1 (v i ,r) indicates v i Different from the set of associated nodes of edge type r. For a random walk path P = (v p1 ,…,v pl ), v pt The context is C = {v pk |v pk ∈P,|kt|≤c,t≠k}, k is a constant, 1≤k≤l, where c is the radius of the window size.

[0112] 3.3 Improvement of the GATNE model for node embedding in heterogeneous service association graphs towards edge weight fusion

[0113] The following improvements are made to GATNE: According to w ij ∈W calculates the normalized service association weight for each node and integrates it into the edge embedding representation generation process. The specific edge weight fusion method is as follows:

[0114]

[0115]

[0116] Among them, Ne_f(v i ) and Ne_c(v i ) represent the node v i The number of connected functional association edges and collaborative association edges, w i,j With w i,k The nodes v i The point v connected to the current edge j With v k The normalized service association weight is Z v , and Represent the maximum and minimum values ​​of the average edge weight respectively. Therefore, the node v i The overall representation of the edge of type r is improved as follows:

[0117]

[0118] In the above formula, b i For node v i The node-based representation of a r is a hyperparameter, which is the attention coefficient assigned to different types of edges, a i,r is the self-attention mechanism coefficient, is the trainable transfer matrix, U i For node v i The edge embedding representation of .

[0119] Based on this method, the model is able to distinguish the importance of different neighboring nodes in the edge embedding representation generation process of the current node, solving the problem that the GATNE model cannot handle the edge weights of heterogeneous edges and can only treat all neighboring nodes of each node with equal weights.

[0120] 3.4 Combine the designed walking strategy with the improved GATNE model to generate the node embedding representation model GAT-HCG suitable for serving heterogeneous association graphs.

[0121] The service set S and the heterogeneous association graph G involved in clustering are used as input to generate a service association vector set SCV=GAT-HCG(S,G). The service association vector corresponding to the service s in the service set S is represented as scv(s).

[0122] This step aims to solve the problem that the current service clustering method fails to integrate functional association and collaborative association. A service heterogeneous association graph is constructed. Based on the optimized walk strategy and GATNE model, a service association vector is generated to achieve a unified representation of functional association and collaborative association, so as to effectively solve the following deficiencies in the existing technical methods:

[0123] (1) Collaborative associations and functional associations are modeled as different types of weighted edges, and a service heterogeneous association graph is constructed, which organically integrates the two types of associations in one graph.

[0124] (2) A walking strategy that integrates the service association strength is established based on Metapath2vec++. Metapath2vec++ randomly samples associated nodes with equal probability according to the type of heterogeneous edges. When processing the sampling of service heterogeneous association graphs, it may not be possible to prioritize the nodes with the strongest functional association into the path sequence, making it impossible for the model to sample and generate the strongest association sequence. The walking strategy designed in this embodiment can not only efficiently capture the semantic association strength generated between service nodes in different association types, but also maximize the service function similarity in the node sequence, ensuring that nodes with high service association strength are sampled into the path sequence first, thereby improving the quality of corpus sampling.

[0125] (3) The GATNE model is optimized to calculate the normalized service association weight for each node and integrate it into the service association vector to improve the generation quality of the association vector. When generating edge embedding representations of nodes, GTANE cannot handle the edge weights of heterogeneous edges and treats all neighboring nodes of each node as equal weights. For heterogeneous associations of Web services, edge weights represent the closeness of the association between services. Ignoring edge weights makes it difficult for the model to distinguish the importance of nodes in different neighborhoods in the association, which in turn affects the generation quality of service association representations. The optimized model in this embodiment effectively solves the above problems.

[0126] 4. Web service clustering based on semantic enhancement and heterogeneous service association

[0127] The function vector of each service is concatenated with the association vector to generate a service representation vector, that is, The set of all service representation vectors is recorded as SRV. K-means++ is used as the clustering algorithm to generate the service clustering set SC = K-means++ (SRV, sn), where sn is the number of clusters to be generated. By splicing the semantically enhanced service function vector and the association vector, the function similarity and the association similarity are organically integrated, and high-quality service clustering is achieved with the help of K-means++.

[0128] In this step, in order to address the problem that the current service clustering method is mainly based on functional similarity and lacks a measure of the strength of the association between services, the function vector and the association vector are spliced, and a service clustering method that integrates the service function vector and the association vector is constructed based on K-means++. This method can take into account both the functional and association similarities of the services, while avoiding the proportional adjustment between functional similarity and association similarity, thereby improving the clustering quality and reducing the complexity of clustering.

[0129] Experimental results and analysis

[0130] 20,439 Web services and 6,218 Mashup services were crawled from the ProgrammableWeb service registration platform. After deleting some data with too short service descriptions, duplicate registrations, or too few services in the category, 19,241 Web services were retained, belonging to 132 categories; 4,773 Mashup services, including a total of 1,018 combined Web services, belong to 116 categories. All service description texts were processed by case conversion, word segmentation, stop word removal, and stemming, and then service clustering was performed.

[0131] The incremental dataset construction method commonly used in the service clustering field is adopted. The main label of the service is used as the category, and the 19241 services are divided into three datasets as shown in Table 1. The experiment is carried out in the experimental environment shown in Table 2. The evaluation indicators are the internal indicators DBI and SC, and the external indicators AMI, NMI and Purity. Except that the lower the DBI value, the better the clustering effect, the higher the other indicators, the higher the clustering accuracy.

[0132] Table 1. Overview of the dataset

[0133]

[0134] Performance comparison of service function vector generation models

[0135] This section compares the performance of SE-SimCSE proposed in this paper with the currently popular service function vector generation model. LDA, GSDMM, RoBERTa and SimCSE models are selected, among which LDA and GSDMM are topic models, and RoBERTa and SimCSE are neural network models improved based on BERT.

[0136] The service function vectors generated by different models for the service descriptions in the data sets DS1 to DS3 are clustered using the K-means++ algorithm. The clustering evaluation indicators are shown in Table 2:

[0137] Table 2 Performance comparison of service function vector generation models

[0138]

[0139] As shown in Table 2, the service function vector generated by the LDA model has the worst service clustering quality, and the clustering quality of the function vector generated by GSDMM is significantly better than that of LDA. This is mainly because GSDMMM is suitable for extracting short text topic features. RoBERTa has similar performance to GSDMM. The service function vector generated by SimCSE can generate high-quality service clustering. From the clustering evaluation indicators, it can be seen that the clustering quality is higher than that of LDA, GSDMM and RoBERTa. SE-SimCSE is a service function vector generation method proposed in this patent. It introduces a semantic enhancement mechanism based on the SimCSE framework. From the clustering evaluation data on three data sets, it can be seen that SE-SimCSE is 7.4%, 9.1%, 9.2%, 7.9% and 5.3% higher than SimCSE in terms of DBI, SC, AMI, NMI and Purity respectively. It can be seen that the SE-SimCSE method proposed in this patent can improve the quality of service function vector generation and is better than the currently popular service function vector generation model.

[0140] Evaluation of the effectiveness of service association in improving service clustering quality

[0141] The clustering method constructed by using the SE-SimCSE framework to generate function vectors and combining it with the K-means++ algorithm is called SE-KW. The service clustering generated at this time does not consider service association. Based on SE-KW, the clustering method constructed after introducing heterogeneous associations of services is called SEHSA-KW. At this time, the generated clustering incorporates service association information. Table 3 shows the quality of service clustering generated by the two methods. The comparative data can evaluate the impact of introducing service association on clustering quality.

[0142] Table 3 Evaluation of the effectiveness of service association in improving service clustering quality

[0143]

[0144] On the DS1 to DS3 datasets, the SEHSA-KW method that introduces heterogeneous service associations outperforms SE-KW in all evaluation indicators, indicating that the quality of service clustering is improved after the introduction of service associations. The mean values ​​of clustering evaluation indicators on the three datasets show that compared with the SE-KW method, the SEHSA-KW method improves DBI, SC, AMI, NMI and Purity by 14.5%, 11.7%, 10.4%, 11.9% and 12.6% respectively. In summary, introducing heterogeneous service associations in the clustering process can significantly improve the clustering quality.

[0145] To further verify the strength of the influence of heterogeneous association density of services on clustering accuracy, data sets DS4 to DS9 are constructed as shown in Table 4. Among them, DS9 is 116 types of Web services in all Mashup services, totaling 1018 services. Among the 1018 services, the number of services with functional associations is 1002, the number of collaborative associations is 1018, and the number of services with both functional associations and collaborative associations (i.e., heterogeneous associations) is 579. The heterogeneous association density is defined as the ratio of the number of services with heterogeneous associations to the total number of services, which is 56.9% in DS9.

[0146] Based on the DS9 dataset, datasets DS4 to DS8 were constructed by randomly adding Web services to dilute the heterogeneous association density. The density and number of associated services of each dataset can be seen in Table 5.

[0147] Table 4 Overview of heterogeneous service association density dataset

[0148]

[0149] The patented method SEHSA-KW is used to implement clustering in the data sets DS4 to DS9. The clustering evaluation indicators are shown in Table 5:

[0150] Table 5 Evaluation of heterogeneous service association density

[0151]

[0152] According to the data, as the proportion of service heterogeneous associations increases, the values ​​of SC, AMI, NMI and Purity indicators show an upward trend; except for a slight fluctuation in DS6, the DBI indicator shows an overall downward trend, indicating that the quality of service clustering is constantly improving with the increase of service heterogeneous association density. In the DS9 data set, the service heterogeneous association density is the highest and the quality of service clustering is also the best. Figure 4The figure is a line trend chart corresponding to the service clustering evaluation index under different association densities. From the shape of the line in the figure, it can be seen that the introduction of heterogeneous associations can effectively improve the quality of service clustering.

[0153] Comparison of SEHSA-KW method with other clustering methods

[0154] The service clustering methods published in well-known domestic and foreign journals in the past two years are selected for comparison to verify the advancedness of the method proposed in this patent. The experimental results are shown in Table 6, which mainly include the following methods:

[0155] (1) LFW+K: A length-feature-weighted service vectorization representation method is proposed. It considers parameters such as the dimension of the web service document, the maximum frequency of the term in the document, and the number of times the term appears in other documents to assign term weights accordingly to extract functional representations for clustering.

[0156] (2) GWSC: Multiple corresponding structural relationship graphs and attribute bipartite graphs are constructed for the structural relationship between Web services and their own attribute information. The random walk algorithm is used to generate the structural context and attribute context of Web services. The Skipgram model is used to train the joint context to obtain a representation vector that integrates multi-dimensional information, and the SVM model is used to achieve classification prediction of Web services.

[0157] (3) KW-TG-SC: An improved GSDMM model is proposed to overcome the problem of low quality of service representation vectors generated by traditional topic models. The service collaboration relationship is modeled based on the constructed service collaboration graph, and the collaboration nodes are vectorized using Node2vec. The collaboration similarity is calculated, and finally, service clustering is achieved based on k-means++, which combines functional similarity and collaboration similarity.

[0158] (4) UCSI-SC: It learns the functional representation of service description based on Doc2vec, establishes an association network based on the service structure relationship, uses label sharing and collaboration as mutually exclusive associations to achieve association representation learning, obtains unified features by training the service classification model on partially labeled data, and finally uses the spectral clustering algorithm to cluster services.

[0159] Table 6 Horizontal evaluation of SEHSA-KW clustering method

[0160]

[0161] From the above data comparison, it can be seen that SEHSA-KW has obtained the highest score in the five clustering evaluation indicators of the three data sets. Therefore, the quality of the generated service clustering is better than the comparison method. Compared with the other four methods, the improvement ranges of the internal indicators DBI and SC are: 7.8%-19.6% and 3%-15%, respectively, indicating that in the clustering constructed by this patent method, the compactness of the elements in the cluster is improved and the distance between clusters is increased. The improvement ranges of the external indicators AMI, NMI and Purity are: 3.3%-10.3%, 2.1%-10.1% and 1.4%-9.6%, respectively, indicating that the accuracy of service clustering is significantly higher than that of the other four methods, and the degree of consistency between the clustering results and the actual categories of the services is significantly improved. Compared with the other four methods, the patented method has an average improvement of 13.7%, 9%, 6.8%, 6.1% and 5.5% in DBI, SC, AMI, NMI and Purity indicators.

[0162] Among the above four methods, the LFW+K method has the lowest clustering quality. The main reason is that it lacks consideration of the contextual information of the terms in the service description documents, fails to capture the implicit semantic relationship between Web service description documents, and does not mine the associations between Web services.

[0163] Compared with LFW+K, the GWSC model extracts structural context and text attribute context from the network, effectively capturing the implicit semantic relationship between texts while also exploring the association of Web services. However, its learning goal of text attributes is too focused on context association, and it does not learn the functional characteristics of high-quality Web services. In addition, since only some of the called services participate in the construction of the structural bipartite graph, it cannot fully coordinate the features with the embedding representation of the text attribute bipartite graph nodes, making it more difficult to capture the feature information of services that are not called by the Mashup, which to some extent hinders the improvement of clustering accuracy.

[0164] KW-TG-SC comprehensively considers text semantics and service association, and the scores of various indicators are relatively high. Although it improves the GSDMM model suitable for short text topic extraction, the quality of topic feature extraction is still limited by the quality and length of the service description text. In terms of service association, it only considers the collaboration between Web services, but ignores the label sharing relationship, resulting in insufficient in-depth mining of service function association, which affects the extraction effect of association representation vectors.

[0165] UCSI-SC is most similar to the method of this patent, and learns the service features involved in clustering from the perspectives of service function semantics and association. However, the Doc2Vec model used in this method performs worse than the SE-SimCSE model used in the method of this patent when extracting functional features from short text service descriptions. In addition, this paper regards function and collaboration as two completely mutually exclusive associations, and fails to consider issues such as association strength, which limits the further improvement of service clustering effects.

[0166] From the above comparative experiments, it can be seen that the SEHS-KW clustering method proposed in this patent not only constructs a high-quality service function vector generation model, but also the introduced service heterogeneous association can improve the quality of service clustering. The overall performance of the method is better than the currently popular service clustering method, and experiments have proved that with the increase of service association strength, the quality of service clustering can be further improved.

[0167] The above description is only a preferred embodiment of the present invention and does not limit the present invention in other forms. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.

Claims

1. A Web service clustering method integrating semantic enhancement and heterogeneous associations, It is characterized in that The following steps are involved: Step A: Construct a data set suitable for service clustering; Step B: Constructing a service function vector for semantic enhancement and contrastive learning: Step B1: construct a twin service description sample by replacing the verbs in the service description with synonyms; Step B2: Under the SimCSE framework, contrastive learning technology is used to generate function vectors for the original service description and the twin service description respectively, and the mean of the two function vectors is used as the semantically enhanced service function vector of the original service description; Step C: Generate a service association vector: Step C1: Based on the label sharing and collaboration relationship between services, a service heterogeneous association graph integrating functional association and collaboration association is constructed to model the functional association and collaboration association between Web services; Step C2: design a random walk strategy that integrates service association strength from the perspectives of functional association strength and collaborative association strength, and prioritize the sampling of nodes with high association in the path sequence; Step C3: Implement node embedding for the service heterogeneous association graph based on the improved GATNE model to generate a service association vector; Step D: merge the service function vector and the service association vector into a service representation vector to achieve service clustering.

2. The Web service clustering method integrating semantic enhancement and heterogeneous association according to claim 1, Features: In step B1, the verbs are replaced with synonyms to construct twin samples of the service description, and D = {d 1 ,d 2 ,…,d n } is a service description text collection, d i ={w 1 ,w 2 ,…,w n } is a description text of a Web service. First, i The word components in the word are tagged with part of speech. For the word w j , get its synonym w j ′, d i The service description generated by replacing all verbs in the text with their synonyms is d′ i , the service description text set after verb replacement is recorded as D′.

3. The Web service clustering method integrating semantic enhancement and heterogeneous association according to claim 2, Features: The step B2 is specifically implemented in the following manner: (1) Using the SimCSE framework, we generate function vectors for the service description texts in D and D′ respectively: Let h i1 =SimCSE(d i ,D),h i2 =SimCSE(d′ i ,D′), and finally d i The generated semantically enhanced service function vector is denoted as h i , namely SE-SimCSE(s i )=h i The corresponding function vector: (2) Generate a service function vector sfv(s) for each Web service s participating in the clustering. The set of function vectors of all services is SRV = {sfv(s)}: sfv(s)=SE-SimCSE(s).

4. The Web service clustering method integrating semantic enhancement and heterogeneous association according to claim 1, Features: The step C1 specifically comprises the following steps: Define functional association: If there is a label l such that l∈s i .L∩s j .L, then it is called service s i With Services j There is a functional association, denoted as: s i ~s j ; Define a collaborative relationship: There exists a Mashup service m such that s i ∈mS∧s j .∈mS, then the service is called s i With Services j There is a collaborative relationship, recorded as: Definition of service heterogeneous association graph: The service heterogeneous association graph is an undirected weighted graph HCG = (V, E, W), where: V = {v 1 ,v 2 ,…,v n } is the service node set, node v i Represents Web services i ; E = {Ef, Ec}, Ef and Ec are the function-related edge set and the collaboration-related edge set respectively; e = (v i ,v j )∈Ef i With v j Corresponding services i and j Satisfaction i ~s j ; e=(v i ,v j )∈Ec i With v j Corresponding services i and j satisfy W={w ij } is the edge weight set, w ij =Nl(s i ,s j ); w ij =Nm(s i ,s j ); The service heterogeneous association graph contains two types of edges. One type is the functional association edge of the service. If two services s i With s j If there is a same label, then the node v in HCG i and v j A functional association edge is established between them, and the weight of the functional association edge is service s i With s j The number of common labels, denoted as Nl(s i ,s j ); the other type is the collaborative association edge. If two services s i With s j coexist in the same Mashup service component set, then the node v in the HCG i and v j A collaborative association edge is established between them, and the weight of the collaborative association edge is service s i With s j The number of services participating in the Mashup is denoted as Nm(s i ,s j ).

5. The Web service clustering method integrating semantic enhancement and heterogeneous association according to claim 4, Features: In step C1, if service s i With s j If they participate in the same service composition process together, they will be treated as having a collaborative relationship.

6. The Web service clustering method integrating semantic enhancement and heterogeneous association according to claim 5, Features: The step C2 specifically includes: (1) Calculate the service function association strength: (2) Set in the meta-path mode T = v 1 →v 2 →...v t →v t+1 →v l In the example, the edge type of each step is different from the edge type r of the previous step. If the edge type of the t-1th step is r, then the tth step starts from v i to v j The transition probability is the service association strength normalized by the softmax function: Among them, N t+1 (v i ,r) indicates v i Different from the associated node set of edge type r, for a random walk path P = (v p1 ,…,v pl ), v pt The context is C = {v pk |v pk ∈P,|kt|≤c,t≠k}, k is a constant, 1≤k≤l, where c is the radius of the window size.

7. The Web service clustering method integrating semantic enhancement and heterogeneous association according to claim 6, Features: In step C3, the improved GATNE model refers to: According to w ij ∈W calculates the normalized service association weight for each node and integrates it into the edge embedding representation generation process. The specific edge weight fusion method is as follows: Among them, Ne_f(v i ) and Ne_c(v i ) represent the node v i The number of connected functional association edges and collaborative association edges, w i,j With w i,k The nodes v i The point v connected to the current edge j With v k The edge weight of the normalized service association weight is Z v , and Represent the maximum and minimum values ​​of the average edge weight respectively. Therefore, the node v i The overall representation of the edge of type r is improved as follows: Among them, b i For node v i The node-based representation of a r is a hyperparameter, the attention coefficient assigned to different types of edges, a i,r is the self-attention mechanism coefficient, is the trainable transfer matrix, U i For node v i The edge embedding representation of .

8. The Web service clustering method integrating semantic enhancement and heterogeneous association according to claim 7, Features: In step C3: The designed random walk strategy is combined with the improved GATNE model to generate a node embedding representation model GAT-HCG suitable for service heterogeneous association graphs. The service set S participating in clustering and the heterogeneous association graph G are taken as input to generate a service association vector set SCV=GAT-HCG(S,G), where the service association vector corresponding to the service s in the set S is represented as scv(s).

9. The Web service clustering method integrating semantic enhancement and heterogeneous association according to claim 1, Features: In step D, the function vector and the association vector of each service are concatenated to generate a service representation vector srv(s), that is, sfv(s) represents the service function vector, scv(s) represents the service association vector, and the set of all service representation vectors is recorded as SRV; K-means++ is used as the clustering algorithm to generate the service clustering set SC=K-means++(SRV,sn), where sn is the number of clusters to be generated.

Citation Information

Patent Citations

  • Service and tag recommendation method based on random walk

    CN102750375A

  • Method for extracting conceptual word meaning development veins based on construction

    CN110502640A

  • Web data clustering method based on Mashup service function feature representation and density peak detection

    CN111475607A

  • User pension service recommendation method, computer equipment and storage medium

    CN112148974A

  • Restful type Web service clustering method fusing service cooperation relationship

    CN112749281A