Unlock instant, AI-driven research and patent intelligence for your innovation.

Code retrieval method and system based on graph neural network and computer readable storage medium

A neural network and code technology, applied in the field of neural networks, can solve the problems of incomplete feature extraction, poor accuracy, and no consideration of code semantics and structural information, so as to achieve complete feature extraction, improve accuracy, and shorten training time. Effect

Pending Publication Date: 2022-01-04
GUANGDONG UNIV OF TECH
View PDF1 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The present invention provides a code retrieval method and system based on a graph neural network in order to overcome the defects of the existing code retrieval through natural language without considering the semantic and structural information of the complete code, incomplete feature extraction, and poor accuracy. and computer readable storage media

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 retrieval method and system based on graph neural network and computer readable storage medium
  • Code retrieval method and system based on graph neural network and computer readable storage medium
  • Code retrieval method and system based on graph neural network and computer readable storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0040] Such as figure 1 As shown, the first aspect of the present invention provides a code retrieval method based on a graph neural network, comprising the following steps:

[0041] S1: Obtain code data and perform code integrity preprocessing;

[0042] It should be noted that the code integrity preprocessing completes incomplete code fragments by means of code instrumentation to obtain a complete code that can pass compilation. The code data may be java code.

[0043] S2: Extract sequence information, control flow graph information, and program dependency graph information of the preprocessed code respectively;

[0044] It should be noted that sequence information, control flow graph information, and program dependency graph information are respectively extracted from the preprocessed complete code.

[0045] S3: Use the sequence information of the code, the control flow graph information, and the program dependency graph information to construct the code graph of the code...

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 discloses a code retrieval method and system based on a graph neural network and a computer readable storage medium. The method comprises the steps: S1, obtaining code data, and carrying out code integrity preprocessing; s2, sequence information, control flow graph information and program dependency graph information of the preprocessed codes are extracted respectively; s3, constructing a code graph of the code sequence by using the sequence information of the code, the control flow graph information and the program dependency graph information; s4, constructing a code retrieval model based on the graph neural network, and training the code retrieval model based on the graph neural network by utilizing the code sequence-based code graph and natural language description; and S5, performing code retrieval by using the trained code retrieval model based on the graph neural network. According to the method, code semantic and structural feature extraction is more complete. Meanwhile, a single graph neural network structure is adopted, the training time of the model is shortened, parameter adjustment is reduced, and the retrieval accuracy is improved.

Description

technical field [0001] The present invention relates to the technical field of neural networks, and more specifically, to a code retrieval method, system and computer-readable storage medium based on a graph neural network. Background technique [0002] The traditional method of code retrieval through natural language usually uses the sequence information of the code or the graph structure information of the code alone, and does not fully obtain the semantic and structural information of the code. In other methods for code retrieval through natural language, most of them use sequential neural network and tree neural network, while ignoring the characteristics of code graph structure. [0003] In the prior art, the Chinese invention patent with publication number CN107015905A disclosed a method and device for querying source code on August 4, 2017. The method for querying source code is pre-established with functional units in the software model The corresponding relationshi...

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
IPC IPC(8): G06F16/33G06F40/289G06F40/30G06N3/04G06N3/08
CPCG06F16/3344G06F40/289G06F40/30G06N3/049G06N3/084
Inventor 张凡龙陈宇琛车毅周玉奇陈晓茵林翠盈
Owner GUANGDONG UNIV OF TECH
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More