Automatic program correction method based on knowledge graph

A knowledge map and program technology, applied in the field of program automatic correction, can solve problems such as troublesome, low efficiency, and complicated writing

CN112486568AActive Publication Date: 2021-03-12ZHEJIANG SCI-TECH UNIV
11 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Current Assignee / Owner
Publication Date
2021-03-12

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention discloses an automatic program correction method based on a knowledge graph, and the method comprises the following steps: S1, obtaining an open source code on a network, carrying out the analysis of the obtained source code through a code knowledge graph construction program, and generating a code knowledge graph; s2, writing a skeleton program which allows missing or errors to occur; and S3, analyzing the skeleton program through a code completion program, and correcting and supplementing the skeleton program by utilizing the code knowledge graph to obtain a normally executed complete program. According to the invention, a defective skeleton program can be automatically trimmed to obtain a complete program, and the method has the characteristics of simplifying programming,improving programming efficiency and reducing manual labor amount.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The present invention relates to a method for automatically correcting programs, in particular to a method for automatically correcting programs based on knowledge graphs. Background technique

[0002] At present, the automation development technology of program design is changing from the original componentized and model-driven method to the deep learning-based and semantic-driven method. At present, there are already existing methods for generating required program fragments through natural language processing. However, these methods require large-scale computing support of neural networks, and there is no unified standard. The logical structure, construction methods, and automated practical applications of code knowledge graphs are not It has not been solved well, and it cannot provide a complete programming method. Programmers need to be very rigorous when writing programs, and there must be no gaps or mistakes. Amendment, programming is complex, ...

Examples

Embodiment Construction

[0055] The present invention will be further described below in conjunction with the examples, but not as a basis for limiting the present invention.

[0056] Example.

[0057] A method for automatically correcting programs based on knowledge graphs, such as figure 1 As shown, it specifically includes the following steps:

[0058] S1. Obtain the open source code on the network, analyze the acquired source code through the code knowledge graph construction program, and generate the code knowledge graph;

[0059] S2. Write a skeleton program that allows missing or errors;

[0060] S3. Analyze the skeleton program through the code completion program, use the code knowledge graph to correct and supplement the skeleton program, and obtain a complete program that is normally executed.

[0061] In the S1., the code knowledge graph is an RDF triple structure. The RDF triple structure consists of code entities and code relations. Code entities are all grammatical components of a p...