Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Code clone detection optimization method and device based on knowledge graph and electronic equipment

A technology of knowledge graph and optimization method, applied in the field of software cloning, which can solve the problem that detection efficiency cannot adapt to large-scale open source code.

Pending Publication Date: 2022-03-04
NAT UNIV OF DEFENSE TECH
View PDF0 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

In this method, the detection efficiency of the existing code clone detection algorithm cannot adapt to the problem of large-scale open source code. In the process of code detection, the knowledge map of clone relationship is dynamically constructed, and the knowledge map is used to screen the candidate code fragments for clone detection, reducing the number of clone detection, and then Optimize the existing clone detection method to improve the efficiency of clone detection

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Code clone detection optimization method and device based on knowledge graph and electronic equipment
  • Code clone detection optimization method and device based on knowledge graph and electronic equipment
  • Code clone detection optimization method and device based on knowledge graph and electronic equipment

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0024] In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.

[0025] In one embodiment, such as figure 1 As shown, a code clone detection and optimization method based on knowledge graph is provided, which includes the following steps:

[0026] Step 100: Obtain a plurality of code fragments to be detected and a corresponding initial set of candidate code fragments obtained by screening the set of candidate code fragments corresponding to each code fragment to be detected by using a predetermined screening strategy, and combine the multiple code fragments to be detected into a set of code fragments to be detected List of code slices....

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to a code clone detection optimization method and device based on a knowledge graph and electronic equipment. The method comprises the following steps: obtaining a plurality of to-be-detected code snippets, and screening corresponding candidate code snippet sets by adopting a predetermined screening strategy to obtain corresponding initial candidate code snippet sets; screening the initially selected code snippets by utilizing knowledge of the knowledge graph to obtain an optimized candidate code snippet set; detecting a clone relationship between each to-be-detected code snippet and each candidate code snippet in the corresponding optimized candidate code snippet set by adopting a preset clone detection method, and constructing an optimized clone knowledge graph according to an obtained clone detection result; and obtaining all optimized clone pair sets according to the clone knowledge graph. According to the method, an existing clone detection method is not modified, the accuracy of the original clone detection method is not changed, meanwhile, the method does not depend on development languages, and the method can be suitable for all existing clone detection methods.

Description

technical field [0001] The present application relates to the technical field of software cloning, in particular to a code cloning detection and optimization method, device and electronic equipment based on a knowledge map. Background technique [0002] As an important means of software reuse, code cloning, on the one hand, accelerates the efficiency of software development, on the other hand, it also brings software quality problems, increases the difficulty of software defect repair, and brings about the problem of software intellectual property protection. For these reasons, a large number of code clone detection related research and a large number of clone detection algorithms have emerged in academia and industry, some of which focus on the efficiency (execution time) of clone detection. [0003] However, for the existing open source world, there are many open source projects, the amount of code is huge, and the situation of cloning is serious. Therefore, the existing ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/75G06F16/36
CPCG06F8/751G06F16/367
Inventor 王涛张迅晖余跃李志星张晏芝钟岩王怀民
Owner NAT UNIV OF DEFENSE TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products