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

Code clone detection method and system based on isomorphic network

A detection method and code technology, applied in the field of code detection, to achieve good application prospects, improve efficiency and accuracy

Active Publication Date: 2020-12-04
HENAN VALLEY INNOVATION NETWORK TECH
View PDF10 Cites 6 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Therefore, it is difficult for traditional code clone detection technology without semantic representation information to effectively identify Type4 code clones.

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 method and system based on isomorphic network
  • Code clone detection method and system based on isomorphic network
  • Code clone detection method and system based on isomorphic network

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0032] In order to make the purpose, technical solution and advantages of the present invention more clear and understandable, the present invention will be further described in detail below in conjunction with the accompanying drawings and technical solutions.

[0033] With the success of deep learning methods in natural language processing, image processing and other fields, it can also be applied to the field of program analysis. The biggest advantage of deep learning is to get rid of the "feature engineering" problem and be able to automatically learn data features. By drawing on many achievements of deep learning in the direction of natural language processing, the program code is treated as a natural language to extract semantic features, and semantic features are an important indicator for identifying Type4 level code clones. The use of deep learning related technologies in the field of natural language processing can well promote the development of related technologies...

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 belongs to the technical field of code detection, and relates to a code clone detection method and system based on an isomorphic network. The method comprises the steps that: an abstractsyntax tree of the function level of to-be-compared program source codes is extracted, all leaf nodes of the abstract syntax tree are corresponding to sentence text information of the program sourcecodes, and the non-leaf nodes of the abstract syntax tree are corresponding to the structure information of the program source codes; the abstract syntax tree is rearranged, so that a reconstructed abstract syntax tree which forms an isomorphic network model with a recursive auto-encoder can be obtained, and each node of a hidden layer of the recursive auto-encoder is associated with the non-leafnode of the reconstructed abstract syntax tree; recursive auto-encoder model convergence parameters are trained and learned, and model parameters used for obtaining an intermediate vector are trainedthrough a loss function; a text semantic vector of the syntax tree is extracted as input, and intermediate vectors of the to-be-compared program source codes are obtained through the converged model parameters; and the similarity of the to-be-compared program source codes is judged according to theapproximation degree of the intermediate vectors. The code clone detection efficiency and accuracy are improved by automatically learning code hiding features.

Description

technical field [0001] The invention belongs to the technical field of code detection, and in particular relates to a code clone detection method and system based on an isomorphic network. Background technique [0002] Copying a piece of code, with or without modification, so that two or more pieces of code are similar to each other is called code cloning. Code cloning can speed up software development, which is a common demand in the industry. But code cloning also leads to widespread defect duplication. When the original code has defects, the cloned code usually also has the same defects, which will spread the defects in the software system, introduce vulnerabilities into the system itself, and bring security risks. Therefore, code clone detection techniques are widely used to retrieve known vulnerabilities in unknown codes. As a basic analysis technique, code clone detection is of great significance for maintaining software quality. The problem of code clone detection...

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/75G06F40/30G06N3/04G06N3/08
CPCG06F8/751G06F40/30G06N3/08G06N3/045Y02D10/00
Inventor 姚金龙谷晶中左洪强程杰张阳光郑宏亮高军涛
Owner HENAN VALLEY INNOVATION NETWORK 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