A service clustering method based on particle swarm fuzzy clustering

Through the method based on particle swarm fuzzy clustering, the problem that the service clustering method in the prior art fails to fully consider semantic relationships and interrelationships is solved, and more efficient and accurate service clustering is achieved, reducing resource waste.

CN113988149BActive Publication Date: 2025-02-07XIAN UNIV OF POSTS & TELECOMM
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110780627.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-09
Publication Date
2025-02-07
Estimated Expiration
2041-07-09

AI Technical Summary

Technical Problem

In the prior art, service clustering methods fail to fully consider the semantic relationship between vocabulary and the interconnection between services, resulting in low service discovery efficiency, low accuracy, and high resource waste rate.

Method used

The service clustering method based on particle swarm fuzzy clustering is adopted to realize service clustering by obtaining service data, preprocessing data, determining the number of clusters, initializing particle swarms, updating particle position and fitness values.

Benefits of technology

It improves the accuracy of service clustering, reduces resource waste rate, and can more effectively discover and recommend services that meet user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113988149B_ABST
    Figure CN113988149B_ABST
Patent Text Reader

Abstract

The present invention discloses a service clustering method based on particle swarm fuzzy clustering, comprising: obtaining service data corresponding to a plurality of services; preprocessing the service data to obtain target service data, wherein the target service data includes keyword data and keyword frequency data; determining the number of clusters of services corresponding to the service data; initializing the particle swarm; determining the fitness value of each particle; updating the speed and position of each particle; judging whether the position of each particle after the update satisfies the global position optimal value; clustering the services according to the judgment result, wherein when the position of the particle satisfies the global position optimal value, clustering the services is performed based on the fuzzy clustering algorithm; when the position of the particle does not meet the global position optimal value, repeating steps 5 to 8 until the service clustering is completed. The present invention can consider the mutual relationship between services, thereby improving the accuracy of service clustering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of computer technology, and in particular relates to a service clustering method based on particle swarm fuzzy clustering. Background Art

[0002] With the development of service-oriented architecture technology, services have become an important software resource on the Internet. How to accurately find services that meet user needs from a huge number of services has become a hot issue in the field.

[0003] In the prior art, service clustering methods based on topic models are usually used for service discovery, service recommendation and service management, such as a multifunctional Web service clustering method based on LDA (latent Dirichlet allocation) and fuzzy C-means; and a semantic Web service discovery method based on fuzzy clustering optimization.

[0004] However, the service clustering methods in the prior art mainly use models such as LDA and k-means. These models can usually only work in the same field. Therefore, they generally have the following two shortcomings:

[0005] 1) The semantic relationship between words is not fully considered, resulting in low efficiency and accuracy of service discovery.

[0006] 2) The interconnections between services are not fully considered, resulting in low accuracy of service clustering, inability of data services to collaborate with each other, and high resource waste. Summary of the invention

[0007] In order to solve the above problems existing in the prior art, the present invention provides a service clustering method based on particle swarm fuzzy clustering. The technical problem to be solved by the present invention is achieved through the following technical solutions:

[0008] A service clustering method based on particle swarm fuzzy clustering includes: step 1: obtaining service data corresponding to multiple services, wherein the service data includes: service description documents, types corresponding to the service description documents and the number of the service description documents; step 2: preprocessing the service data to obtain target service data, wherein the target service data includes keyword data and keyword frequency data; step 3: determining the number of clusters of services corresponding to the service data; step 4: initializing the particle swarm; step 5: determining the fitness value of each particle; step 6: updating the speed and position of each particle; step 7: judging whether the updated position of each particle meets the global position optimal value; step 8: clustering the services according to the judgment result, wherein when the position of the particle meets the global position optimal value, the services are clustered based on the fuzzy clustering algorithm; when the position of the particle does not meet the global position optimal value, steps 5 to 8 are repeated until the service clustering is completed.

[0009] In one embodiment of the present invention, step 1 includes: step 1-1: crawling multiple service description documents from a service website through a preset crawling tool; step 1-2: performing statistical calculations on the service description documents according to preset statistical calculation rules to obtain the type corresponding to each of the service description documents and the number of the service description documents.

[0010] In one embodiment of the present invention, the step 2 includes: step 2-1: based on a preset keyword processing rule, processing the service data to extract keywords from the service data; step 2-2: based on a preset word frequency calculation rule, calculating the word frequency of the keywords in the service data, expressed as:

[0011]

[0012]

[0013] Among them, n ij represents the number of the jth word in the i-th service document, n ij is the number of all words in the ith service, n ij Represents the number of documents, IF ij Indicates keyword frequency, IDF i Calculate the importance of service documents, where N represents the number of service documents, n i Represents a document n ij The number of .

[0014] Beneficial effects of the present invention:

[0015] The present invention can improve the accuracy of service clustering and reduce the resource waste rate based on the mutual relationship between services.

[0016] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a flow chart of a service clustering method based on particle swarm fuzzy clustering provided by an embodiment of the present invention;

[0018] Figure 2 is a bar chart of the number of services in the experiment of the present invention;

[0019] Figure 3 is a comparison chart of accuracy indicators when clustering is performed using different clustering algorithms provided by an embodiment of the present invention;

[0020] Figure 4 is a comparison chart of recall rate indicators when clustering is performed using different clustering algorithms provided by an embodiment of the present invention;

[0021] Figure 5 It is a comparison diagram of entropy indicators when clustering is performed using different clustering algorithms provided by an embodiment of the present invention;

[0022] Figure 6 It is a comparison chart of the F value index when clustering is performed using different clustering algorithms provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0023] The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.

[0024] Example

[0025] See also Figure 1 , Figure 1 1 is a flow chart of a service clustering method based on particle swarm fuzzy clustering provided by an embodiment of the present invention, the method comprising:

[0026] Step 1: Obtain service data corresponding to multiple services, wherein the service data includes: a service description document, a type corresponding to the service description document, and the number of the service description documents.

[0027] Optionally, the step 1 includes:

[0028] Step 1-1: Use the preset crawling tool to crawl multiple service description documents from the service website.

[0029] Step 1-2: Perform statistical calculation on the service description documents according to preset statistical calculation rules to obtain the type corresponding to each service description document and the number of the service description documents.

[0030] For example, use the rvest package in the R language to crawl multiple service description documents from the Programmable Web service website.

[0031] Step 2: Preprocess the service data to obtain target service data, wherein the target service data includes keyword data and keyword frequency data.

[0032] For example, the service description document is preprocessed through the tm package of R language.

[0033] The present invention can use the target service description document as input data of a particle swarm-based fuzzy clustering algorithm to achieve clustering of services.

[0034] Optionally, step 2 includes:

[0035] Step 2-1: Based on preset keyword processing rules, the service data is processed to extract keywords from the service data.

[0036] Optionally, step 2-1 includes:

[0037] Step 2-11: Filter the stop words in the service data.

[0038] Step 2-12: Restore the verbs in the service data to stems.

[0039] Step 2-2: Based on the preset word frequency calculation rule, the word frequency of the keyword in the service data is calculated, which is expressed as:

[0040]

[0041]

[0042] Among them, n ij represents the number of the jth word in the i-th service document, n ij is the number of all words in the ith service, n ij Represents the number of documents, IF ij Indicates keyword frequency, IDF i Calculate the importance of service documents, where N represents the number of service documents, n i Represents a document n ij The number of .

[0043] Step 3: Determine the number of service clusters corresponding to the service data.

[0044] In the service clustering algorithm, the number of clusters plays a crucial role in the accuracy of service clustering.

[0045] Optionally, step 3 includes:

[0046] Step 3-1: Calculate the density of the service corresponding to each service data Dens(x i ), expressed as:

[0047]

[0048]

[0049] Among them, x i ={x i1 ,x i2 ,…x im} represents a service, the service x i It is represented as a set of m classification attributes, where n represents the number of services.

[0050] Step 3-2: Determine the cutoff distance dc corresponding to each service.

[0051] dc is the similarity value between two services calculated by using the improved cosine similarity based on Gram. In the present invention, the number of neighbor services selected by dc is about 1% to 2% of the total service data.

[0052] Step 3-3: Sort the values ​​of the density of the services in descending order, expressed as:

[0053] rank=arg(sort(Dens(x i )),descent).

[0054] Step 3-4: Determine the adjacent service x of each service according to the cutoff distance i , expressed as:

[0055] Neib(x i ).

[0056] Step 3-5: Allocate the adjacent services corresponding to each service to the cluster center of each service to form multiple clusters.

[0057] Step 3-6: Determine the number of clusters as the number of service clusters.

[0058] See Table 1, which is a detailed code corresponding to the number of clusters of the service corresponding to the service data:

[0059] Table 1 determines the number of clusters of the service corresponding to the service data

[0060]

[0061] Step 4: Initialize the particle swarm.

[0062] Optionally, step 4 includes:

[0063] Step 4-1: Set a particle group, which includes N particles p.

[0064] Each particle consists of two parts: control variables and cluster assignments.

[0065] Step 4-2: Randomly generate control variables C = (c1, c2, ..., c k ), where c i The value is greater than 0 and less than 1.

[0066] Step 4-3: Determine the number of clusters in the particle swarm, expressed as: C(p) = k, where k = k max .

[0067] Step 4-4: Based on the control variables, the services in the non-core area are classified to determine the number of effective service clusters in each particle, which is expressed as:

[0068] h t+1 (p) = count(C (t+1) (p)|c j >0.5|),j=1,...k (3)

[0069] Among them, when c j When ≥0.5, the services in the non-core area are classified into the service cluster; or when c j When <0.5, services in non-core areas are not included in the service cluster.

[0070] Step 4-5: Obtain the initial position of the effective service cluster to obtain a fuzzy membership matrix, which is expressed as:

[0071] W(p)=initial_pos(n,h(p)).

[0072] Step 4-6: Set the initialization speed of each particle and the allocation speed of the cluster corresponding to each particle to initialize the particle group.

[0073] The control variable is used to identify how many clusters are active; secondly, the speed and position of the initial particles are set. The initialization process of the particle swarm is shown in Table 2:

[0074] Table 2 Particle swarm initialization algorithm

[0075]

[0076] The initialization speed of each particle and the allocation speed of the clusters corresponding to each particle are set as shown in Table 3:

[0077] Table 3 Particle swarm velocity initialization algorithm

[0078]

[0079] Among them, the second line represents the speed of the particles, which is set randomly, and the third line represents the distribution speed of the clusters.

[0080] Step 5: Determine the fitness value of each particle.

[0081] Optionally, step 5 includes:

[0082] Based on the fitness function, the fitness value of each particle is calculated, which is expressed as:

[0083] Fit(x i )=π+sep (4)

[0084]

[0085]

[0086] Among them, Fit(x i ) represents the particle fitness value, W = (ω ij ) is a fuzzy matrix, k = k max , Z=z1,z2,…,z k is the cluster center of the service, α is the weight, d(x i , z j ) represents the distance between service i and cluster j, d(z i , z j ) represents the distance between cluster i and cluster j.

[0087] Formula (5) is the compactness function, and formula (6) is the fuzzy separability function.

[0088] Step 6: Update the velocity and position of each particle.

[0089] Optionally, step 6 includes:

[0090] Step 6-1: Match the new active cluster number for each particle, expressed as:

[0091]

[0092] Step 6-2: Calculate the hesitation degree of each particle, expressed as:

[0093]

[0094] Among them, γ is the hesitation control parameter.

[0095] Step 6-3: Update the speed of each particle according to the number of active clusters and the degree of hesitation.

[0096] The updating process of particle velocity is shown in Table 4:

[0097] Table 4 Particle swarm velocity update algorithm

[0098]

[0099] Step 6-4: Update the particle speed and cluster allocation W t (p) Make comparison.

[0100] Step 6-5: Update the position of each particle according to the comparison result, wherein when the updated particle velocity is equal to the cluster allocation, the position of each particle is updated according to the sum of the updated particle velocity and the cluster allocation, expressed as: Alternatively, when the updated particle speed is less than the cluster allocation value, a first adjustment is made to the cluster allocation position, and the position of each particle is updated based on the sum of the updated particle speed and the rough allocation after the first adjustment; or, when the updated particle speed is greater than the cluster allocation value, a second adjustment is made to the cluster allocation position, and the position of each particle is updated based on the sum of the updated particle speed and the rough allocation after the second adjustment.

[0101] The updating process of particle position is shown in Table 5:

[0102] Table 5 Particle swarm position update algorithm

[0103]

[0104] Among them, the particle speed size is a, the size of the cluster allocation is b, and the size_reduce and size_increase functions are used to adjust the size of the position before cluster allocation.

[0105] According to the pseudocode in Table 5, it can be seen that for each particle in the first to third rows, the particle speed is a and the cluster allocation size is b; the fourth to fifth rows indicate that if the particle speed is equal to the cluster allocation size, the updated cluster allocation function is equal to the sum of the previous cluster allocation function and the previous particle speed; the sixth to eighth rows indicate that if the particle speed is smaller than the cluster allocation size, the size of the cluster allocation function is reduced to the same size as the cluster particle speed, and the updated cluster allocation function is equal to the sum of the previous cluster allocation function and the previous particle speed; the ninth to eleventh rows indicate that if the particle speed is larger than the cluster allocation size, the size of the cluster allocation function is increased to the same size as the cluster particle speed, and the updated cluster allocation function is equal to the sum of the previous cluster allocation function and the previous particle speed; the twelfth to thirteenth rows end the if statement and the for loop statement.

[0106] Step 7: Determine whether the updated position value of each particle is less than the global optimal position value.

[0107] Optionally, before step 7, the method further includes:

[0108] Step S11: Obtain the original individual extreme value pbest and the original local extreme value gbest corresponding to each particle.

[0109] Step S12: Set the fitness value Fit(x i ) is compared with the original individual extreme value pbest, and the target individual extreme value of each particle is determined according to the comparison result. i )>pbest, then Fit(x i ) value is determined as the target individual extreme value, otherwise the original individual extreme value is determined as the target individual extreme value.

[0110] Step S13: Set the fitness value Fit(x i ) is compared with the original local extreme value gbest, and the target local extreme value of each particle is determined according to the comparison result. If Fit(x i )>gbest, then Fit(x i ) is determined as the target local extremum, otherwise the original local extremum is determined as the target local extremum.

[0111] Step S14: Determine the target individual extreme value and the target local extreme value as the global position optimal value.

[0112] Step 8: Cluster the services according to the judgment results. When the particle position value is less than the global position optimal value, cluster the services based on the fuzzy clustering algorithm. When the particle position value is greater than or equal to the global position optimal value, repeat steps 5 to 8 until the service clustering is completed.

[0113] Optionally, the present invention is deployed with a preset number of iterations, and the steps 5 to 8 are repeated until the service clustering is completed, including:

[0114] Repeat steps 5 to 8 until the number of repetitions reaches a preset number of iterations, and then determine that the service clustering is completed.

[0115] The present invention adopts a fuzzy clustering algorithm based on cosine similarity improved by Gram to perform clustering.

[0116] Optionally, clustering the services based on a fuzzy clustering algorithm includes:

[0117] Step S21: Calculate the dynamic sliding window, expressed as:

[0118]

[0119] Among them, W i represents the size of the i-th window of service data, S i It represents the variance of the Gram value of the service data in the window, and n is the dynamic change of the window.

[0120] The Gram algorithm uses a sliding window to assist in the similarity of services. When the Gram value in the window is small, the service window should be enlarged to speed up the detection of service similarity. When the Gram value in the sliding window is large, the window should be reduced to improve the accuracy of the calculation of service similarity, thereby improving the accuracy of the service clustering algorithm. i Updated by the variance value of the service data in the window.

[0121] Step S22: Calculate the cosine similarity value based on the keyword frequency data, expressed as:

[0122]

[0123] Where n is the number of service samples, a i and b i Represented as a vector of two services.

[0124] Step S23: Based on the cosine similarity, the services are clustered by a fuzzy clustering algorithm, which is expressed as:

[0125]

[0126] Satisfy the conditions

[0127] 0≤u ij ≤1, 1≤i≤c, 1≤j≤n (11)

[0128] Where X={x1,x1,…,x n} is the service sample set, n is the number of samples, V = {v1, v2, …, v c} is the cluster center of c service clusters, u ij represents the membership degree of the i-th service sample, d ij is the service sample i and service cluster v i The distance between them, that is, the cosine similarity.

[0129] d ij It is the improved cosine similarity based on Gram.

[0130] Fuzzy c-means (FCM) is used for service clustering. It measures the weighted similarity between the services in the service data set and the centers of c service clusters. The final service clustering result is obtained by iterating the objective function. The objective function is shown in formula (9):

[0131] In summary, the present invention can improve the accuracy of service clustering based on the relationships between services.

[0132] The above method of the present invention is verified based on experiments:

[0133] 1. Experimental Data

[0134] The present invention crawls Web service text data from Programmable Web sites and performs statistical calculations on these data sets, including counting the number of each service and sorting the number of services in descending order, such as Figure 2 As shown in the figure, the number of Mapping services is nearly 1,000 at most. In the dataset, the services with more than 200 and less than 300 services include search, social, eCommerce, photos, music, etc. The number of other services is less than 200. In the experiments in this chapter, search, social, eCommerce, photos, music and other services are selected for clustering.

[0135] 2. Evaluation indicators

[0136] In order to evaluate the effectiveness of the clustering method proposed in the present invention, commonly used accuracy, recall, entropy and F value are used as evaluation criteria. Below the formula is a brief description of each indicator: Accuracy is an important indicator for measuring the performance of clustering algorithms. The higher the accuracy, the better the performance; Recall is an important indicator for measuring the performance of clustering algorithms. The higher the recall, the better the performance; Entropy represents the degree of chaos of an object. If the entropy value is larger, it means that the object is chaotic. If the entropy value is smaller, it means that the object is stable and the chaos coefficient is low; F value is a linear combination of accuracy and recall, which measures the performance of clustering algorithms in a comprehensive way. The accuracy is shown in formula (12), the recall is shown in formula (13), the entropy is shown in formula (14), and the F value is shown in formula (16):

[0137]

[0138]

[0139]

[0140]

[0141]

[0142] c i represents cluster i, succ(c i ) represents the number of web services placed in the correct cluster c i ,mispl(c i ) represents the placement in cluster c i The number of wrong web services in, missed(c i ) represents the number of web services that should be in cluster c i , but put it in other clusters, P ij Represents the probability that data point i belongs to cluster j, calculated as shown in formula (15).

[0143] 3. Simulation Experiment

[0144] Conduct experiments according to steps 1-8 in the technical solution and make comparisons in terms of accuracy, recall, entropy, F-value, etc.

[0145] Experiment 1:

[0146] from Figure 3The data shown is a comparison of the accuracy of different clustering algorithms. The NFC-NSPO in the figure is the method of the present invention. From the comparative experimental data, it can be seen that our method is obviously superior to other algorithms. Since the present invention adopts the cosine similarity calculation based on the Gram improvement to calculate the similarity between services, the Gram algorithm uses a sliding window to perform auxiliary operations on the service similarity. When the Gram value in the window is small, the service window should be expanded to accelerate the detection of service similarity. When the Gram value in the sliding window is large, the window should be reduced to improve the accuracy of service clustering. Secondly, the advantage of using the particle swarm algorithm is that it can find the global optimal solution through the movement of particles, avoid the fuzzy clustering algorithm from randomly selecting cluster centers and falling into local optimality, thereby improving the clustering accuracy of NFC-NSPO.

[0147] Experiment 2:

[0148] from Figure 4 The data shown is a comparison of the recall rates of different clustering algorithms. The NFC-NSPO in the figure is the method of the present invention. From the comparative experimental data, it can be seen that the k-modes algorithm has the highest recall rate, followed by NFC-NSPO. Since the similarity calculation of k-modes uses the Hamming distance to measure the similarity between services, by comparing whether each bit of the vector is the same, if different, the Hamming distance increases by 1, otherwise, the Hamming distance remains unchanged, thereby obtaining the similarity between services, resulting in low clustering accuracy.

[0149] Experiment 3

[0150] from Figure 5 The data shown is a comparison of entropy values ​​of different clustering algorithms. In terms of entropy, the largest one is k-protype, followed by PSO-kmeans, and the smallest one is NFC-NSPO algorithm. The k-protype algorithm is an improved algorithm that combines k-means and k-modes. This method can process both numerical data and categorical data. Since Web services only have a small amount of numerical data, to some extent, k-protype is weakened to k-modes, and the k-protype algorithm is easily affected by the center position of the cluster and is prone to fall into local optimality, so the k-protype algorithm is unstable.

[0151] Experiment 4

[0152] from Figure 6 The data shown is a comparison of the F values ​​of different clustering algorithms. NFC-NSPO is the highest, followed by k-modes, and the worst is k-protype. Figure 3 and recall Figure 4It can be concluded that NFC-NSPO is significantly higher than other algorithms in terms of accuracy, and lower in terms of recall than the k-modes algorithm. In summary, NFC-NSPO is slightly higher than K-modes. The NFC-NSPO algorithm, firstly, uses the improved cosine similarity based on Gram to better calculate the similarity between two samples. Secondly, the combination of the particle swarm algorithm and the fuzzy clustering algorithm can avoid the problem of accuracy caused by the random selection of cluster positions by the fuzzy clustering algorithm, thereby improving the accuracy of service clustering.

[0153] Experiment 5

[0154] In clustering algorithms, similarity functions play an important role. Even if the same clustering algorithm uses different similarity functions, the accuracy of the clustering algorithm obtained is different. This paper improves the similarity function and verifies the improvement from an experimental perspective. It uses the same algorithm to use different similarity functions to compare accuracy, recall, entropy, and F-value.

[0155]

[0156] It can be seen from Table 1 that NFC-NSPO (Gram-Cosine similarity) has the highest accuracy, with a value of 0.896; followed by NFC-NSPO (Cosine similarity), with a value of 0.842, and the worst is NFC-NSPO (Euler). In terms of recall, NFC-NSPO (Gram-Cosine similarity) has the highest recall, with a value of 0.734; the worst is NFC-NSPO (Manhatten), with a value of 0.612. In terms of entropy, NFC-NSPO (Euler) has the highest entropy value, with a value of 0.773; the worst is NFC-NSPO (Gram-Cosine similarity), with a value of 0.713. In terms of F value, NFC-NSPO (Gram-Cosine similarity) has the highest F value, with a value of 0.806; the worst is NFC-NSPO (Euler), with a value of 0.637.

[0157] The reasons are analyzed as follows: because NFC-NSPO (Gram-Cosine similarity) uses cosine similarity based on Gram improvement to better calculate the similarity between two samples, this method can adjust the window size between individuals and clusters. When the Gram value in the window is small, the service window should be expanded to accelerate the detection of service similarity. When the Gram value in the sliding window is large, the window should be reduced to improve the calculation accuracy of service similarity, thereby improving the accuracy of the service clustering algorithm.

[0158] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.

[0159] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0160] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification.

[0161] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in a claim. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0162] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.

Claims

1. A service clustering method based on particle swarm fuzzy clustering, characterized in that: include: Step 1: Obtain service data corresponding to multiple services, wherein the service data includes: a service description document, a type corresponding to the service description document, and the number of the service description documents; Step 2: pre-processing the service data to obtain target service data, wherein the target service data includes keyword data and keyword frequency data; Step 3: Determine the number of service clusters corresponding to the service data; Step 3 includes: Step 3-1: Calculate the density of the service corresponding to each service data Dens(x i ), expressed as: Wherein, xi={xi1,xi2,…xim} represents a service, and the service x i It is represented as a set of m classification attributes as features, and n represents the number of services; Step 3-2: Determine the cutoff distance dc corresponding to each service; Step 3-3: Sort the values ​​of the density of the services in descending order, expressed as: rank=arg(sort(Dens(xi)),descent); Step 3-4: According to the cutoff distance, determine the adjacent service xi of each service, expressed as: Neib(x i ); Step 3-5: assigning adjacent services corresponding to each service to the cluster center of each service to form multiple clusters; Step 3-6: Determine the number of clusters as the number of service clusters; Step 4: Initialize the particle swarm; Step 5: Determine the fitness value of each particle; Step 6: Update the speed and position of each particle; Step 6 includes: Step 6-1: Match the new active cluster number for each particle, expressed as: Step 6-2: Calculate the hesitation degree of each particle, expressed as: Among them, γ is the hesitation control parameter; Step 6-3: updating the speed of each particle according to the number of active clusters and the degree of hesitation; Step 6-4: Update the particle speed and cluster allocation W t (p) to make comparisons; Step 6-5: Update the position of each particle according to the comparison result, wherein when the updated particle velocity is equal to the cluster allocation, the position of each particle is updated according to the sum of the updated particle velocity and the cluster allocation, expressed as: Alternatively, when the updated particle speed is less than the cluster allocation value, a first adjustment is made to the position of the cluster allocation, and the position of each particle is updated according to the sum of the updated particle speed and the rough allocation after the first adjustment; or, when the updated particle speed is greater than the cluster allocation value, a second adjustment is made to the position of the cluster allocation, and the position of each particle is updated according to the sum of the updated particle speed and the rough allocation after the second adjustment; Step 7: Determine whether the updated position value of each particle is less than the global position optimal value; before step 7, the method further includes: Step S11: obtaining the original individual extreme value pbest and the original local extreme value gbest corresponding to each particle; Step S12: Set the fitness value Fit(x i ) is compared with the original individual extreme value pbest, and the target individual extreme value of each particle is determined according to the comparison result. i )>pbest, then Fit(x i ) value is determined as the target individual extreme value, otherwise the original individual extreme value is determined as the target individual extreme value; Step S13: Set the fitness value Fit(x i ) is compared with the original local extreme value gbest, and the target local extreme value of each particle is determined according to the comparison result. If Fit(x i )>gbest, then Fit(x i ) is determined as the target local extreme value, otherwise the original local extreme value is determined as the target local extreme value; Step S14: determining the target individual extreme value and the target local extreme value as the global position optimal value; Step 8: Cluster the services according to the judgment results. When the particle position value is less than the global position optimal value, cluster the services based on the fuzzy clustering algorithm. When the particle position value is greater than or equal to the global position optimal value, repeat steps 5 to 8 until the service clustering is completed.

2. The method according to claim 1, characterized in that: The step 1 comprises: Step 1-1: Use the preset crawling tool to crawl multiple service description documents from the service website; Step 1-2: Perform statistical calculation on the service description documents according to preset statistical calculation rules to obtain the type corresponding to each service description document and the number of the service description documents.

3. The method according to claim 1, characterized in that The step 2 comprises: Step 2-1: Processing the service data based on a preset keyword processing rule to extract keywords from the service data; Step 2-2: Based on the preset word frequency calculation rule, the word frequency of the keyword in the service data is calculated, which is expressed as: Among them, n ij represents the number of the jth word in the i-th service document, n ij is the number of all words in the ith service, n ij Represents the number of documents, IF ij Indicates keyword frequency, IDF i Calculate the importance of service documents, where N represents the number of service documents, n i Represents a document n ij The number of .

4. The method according to claim 1, characterized in that: The step 4 comprises: Step 4-1: Setting a particle group, wherein the particle group includes N particles p; Step 4-2: Randomly generate control variables C = (c1, c2, ..., ck), where c i The value of is greater than 0 and less than 1; Step 4-3: Determine the number of clusters in the particle swarm, expressed as: C(p) = k, where k = k max ; Step 4-4: Based on the control variables, the services in the non-core area are classified to determine the number of effective service clusters in each particle, which is expressed as: h t+1 (p)=count(C (t+1) (p)|c j >0.5),j=1,...k, Among them, when c j When ≥0.5, the services in the non-core area are classified into the service cluster; or when c j When <0.5, services in non-core areas are not included in the service cluster; Step 4-5: Obtain the initial position of the effective service cluster to obtain a fuzzy membership matrix, which is expressed as: W(p) = initial_pos(n,h(p)); Step 4-6: Set the initialization speed of each particle and the allocation speed of the cluster corresponding to each particle to initialize the particle group.

5. The method according to claim 1, characterized in that The step 5 comprises: Based on the fitness function, the fitness value of each particle is calculated, which is expressed as: Fit(x i )=π+sep, Among them, Fit(xi) represents the particle fitness value, W=(ω ij ) is a fuzzy matrix, k = k max ,Z=z1,z2,…,z k is the cluster center of the service, α is the weight, d(x i ,z j ) represents the distance between service i and cluster j, d(z i ,z j ) represents the distance between cluster i and cluster j.

6. The method according to claim 1, characterized in that The clustering of the services based on the fuzzy clustering algorithm includes: Step S21: Calculate the dynamic sliding window, expressed as: Among them, W i represents the size of the i-th window of service data, S i Represents the variance of the Gram value of the service data in the window, and n is the dynamic change of the window; Step S22: Calculate the cosine similarity value based on the keyword frequency data, expressed as: Where n is the number of service samples, a i and b i Represented as a vector of two services; Step S23: Based on the cosine similarity, the services are clustered by a fuzzy clustering algorithm, which is expressed as: Satisfy the conditions 0≤u ij ≤1, 1≤i≤c, 1≤j≤n; Where X={x1,x1,…,x n } is the service sample set, n is the number of samples, V = {v1, v2, …, v c } is the cluster center of c service clusters, u ij represents the membership degree of the i-th service sample, d ij is the service sample i and service cluster v i The distance between them, that is, the cosine similarity.

7. The method according to claim 3, characterized in that The step 2-1 comprises: Step 2-11: Filtering stop words in the service data; Step 2-12: Restore the verbs in the service data to stems.

Citation Information

Patent Citations

  • Improved fuzzy C-mean clustering method based on quantum particle swarm optimization

    CN102831474A