节点文献

面向关系数据库SQL代码的自动评判算法研究

Research on Automatic Scoring Algorithm for SQL Code of A Relational Database

【作者】 吴娇娇

【导师】 何小卫;

【作者基本信息】 浙江师范大学 , 软件工程, 2018, 硕士

【摘要】 由于当代社会数据需求的变化,对数据操纵变得尤为重要。又由于结构化查询语言(SQL)是对数据库的实践操作,学习理解SQL代码可以更好地理解数据库,并为其他需要数据库辅助的工具提供更好的技术帮助。因此,对SQL代码的理解及熟练操作可以有效地提高数据库课程教学的质量。为提高评定SQL实验代码的效率以及稳定评分准确性,研究一套SQL代码的自动评分模型以及开发该模型配套的系统具有一定的必要性。本文在研究了国内外代码的自动评分算法和系统基础上,基于结构化度量技术,提出了两种针对SQL代码的自动评分模型:基于LCS(Longest Common Substring)以及基于权重层次节点匹配的SQL代码评分模型,并针对这两个模型实现了一个自动评判系统,该系统主要通过比对教师上传的SQL参考答案文档与学生上传的SQL代码作业,得出学生SQL作业的成绩和评论,使得教师与学生用户可以查看作业的成绩和评论。基于LCS的评分模型首先对SQL代码进行预处理,分析语义结构进而提取出SQL代码的特征,同时进行分词处理;然后,构建SQL代码的同义库,根据同义库将分词后的代码片段进行同义转换;之后运用最长公共子串算法对代码片段进行相似度匹配,赋予各个片段影响因子,得到代码总的相似度;最后分析人工评分数据制定相应的自动评分策略,从而评定出SQL代码的分数和评论。基于权重层次节点匹配的评分模型同样在预处理过程中删除、处理了部分SQL代码语句;分析了 SQL代码的词法结构,对特征进行标记符标记;继承使用了基于LCS模型的同义库;然后根据标记符标记对SQL代码进行树节点的提取,构建SQL语句树;然后,确定SQL语句树树节点与子树的权重,匹配树的相似度,得到树的相似度,进而确定SQL代码的相似度;最后,根据人工评审数据,多项式拟合拟合出相近数据,据此制定相应的评分策略得到SQL代码的评分结果。

【Abstract】 With the increasing demand for data,it becomes more and more important to manipulate data.Because Structured Query Language(SQL)is an important practical language of the database,learning and understanding SQL code is beneficial for understanding the database,and providing better technical assistance for other tools which require database technology.Therefore,the understanding and skilled operating of SQL code can improve the quality of database course teaching effectively.In order to improve the efficiency and accuracy of evaluating the SQL code,it is necessity to study a set of automatic scoring models of SQL code and to develop the supporting system based on the models.In this thesis,based on studying some automatic scoring algorithms and systems of computer program code in home and abroad,two kinds of SQL code automatic scoring models are proposed in view of the structure measurement technology:the SQL code scoring model by LCS and the SQL code scoring model based on the weighted hierarchical node matching.An automatic evaluation system is designed and implemented based on the two models above.The students’ scores and comments can be obtained by comparing the reference answer and the SQL code which is uploaded by students.Then,teacher and students can view the results in the system.The SQL code scoring model based on LCS is as follows:firstly,the SQL code is preprocessed,and the characteristics of the code is extracted by analyzing the semantic structure of SQL code paragraph and the word segment is executed at the same time.Secondly,a synonymous library of SQL code is built and the code snippet after the word segmentation is synonymy transformed.And then the longest common substring algorithm is used to calculate the similarity of code fragments and the impact factor of each fragment is set,which can be used for obtaining the total similarity between the SQL code paragraph and the referenced code.Finally,the scores and comments of the SQL code is assessed by the corresponding automatic scoring strategy which is developed by analyzing the manual scoring data.The SQL code scoring model based the weighted hierarchical node matching also removes and processes some SQL code statements.Secondly,the model analyzes the lexical structure of SQL code,tags the feature,and inherits the synonymous library based on the LCS model.Then according to the tags,the tree nodes from the SQL code are extracted for building the SQL statement tree.The weights of tree nodes and sub-tree of the SQL statement are determined,and the similarity of the tree is matched and obtained,which actually is the similarity between the provided SQL code and referenced code.Finally,according to the manual scoring data,the approximate data is handled by polynomial fitting which is used for formulating the corresponding scoring strategy and the final score result of the SQL code can be obtained.

节点文献中: 

本文链接的文献网络图示:

本文的引文网络