Code reconstruction method and system on packet level based on combined clustering
A clustering and code technology, applied in the field of code reconstruction, can solve problems such as high time complexity of hierarchical clustering algorithm, unfavorable processing software, etc., to achieve the effect of improving security and reducing running time
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0033] Such as figure 1 As shown, this embodiment provides a method for refactoring code at the package level based on combination clustering, including the following steps:
[0034] S1: Obtain code data to be refactored;
[0035] S2: construct the entity attribute matrix of the code module from the code data to be reconstructed;
[0036] S3: Calculate the similarity between entities based on the entity attribute matrix to obtain an entity similarity matrix;
[0037] S4: According to entity similarity matrix, adopt density clustering algorithm to cluster entity and obtain entity cluster grouping;
[0038] It should be noted that, in this embodiment, the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm is used to cluster the entities. In addition, the OPTICS algorithm and the DENCLUE algorithm may also be used, for example.
[0039] S5: performing hierarchical clustering on each entity clustering group to obtain a clustering dendrogram;
[0040...
Embodiment 2
[0061] This embodiment provides a code reconstruction system at the package level based on combination clustering, including:
[0062] The code acquisition module is configured to: acquire code data to be refactored;
[0063] The entity attribute matrix construction module is configured to: construct the entity attribute matrix of the code module from the code data to be refactored;
[0064] The entity similarity matrix construction module is configured to: calculate the similarity between entities based on the entity attribute matrix to obtain an entity similarity matrix;
[0065] The entity clustering and grouping module is configured to: according to the entity similarity matrix, use the density clustering algorithm to cluster the entities to obtain the entity clustering groups;
[0066] The entity hierarchical clustering module is configured to: perform hierarchical clustering on each entity clustering group to obtain a clustering dendrogram;
[0067] The code refactorin...
Embodiment 3
[0069] This embodiment provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned code reconstruction method at the package level based on combination clustering is implemented. step.
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


