You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

01-Dubhe-DDL.sql 90 kB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541
  1. -- DML 脚本
  2. use `dubhe-cloud-prod`;
  3. -- 原boot单体项目 DDL 脚本内容
  4. CREATE TABLE IF NOT EXISTS `data_dataset` (
  5. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  6. `name` varchar(255) NOT NULL,
  7. `remark` varchar(255) DEFAULT NULL,
  8. `type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '类型 0: private 私有数据, 1:team 团队数据 2:public 公开数据',
  9. `team_id` bigint(20) DEFAULT NULL,
  10. `uri` varchar(255) DEFAULT '' COMMENT '数据集存储位置',
  11. `create_user_id` bigint(20) DEFAULT NULL,
  12. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  13. `update_user_id` bigint(20) DEFAULT NULL,
  14. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  15. `deleted` bit(1) DEFAULT NULL,
  16. `data_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '数据类型:0图片,1视频,2文本',
  17. `annotate_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '标注类型:2分类,1目标检测,5目标跟踪',
  18. `labels` varchar(255) NOT NULL DEFAULT '' COMMENT '标签集合,以逗号分隔',
  19. `status` int(11) NOT NULL DEFAULT '0' COMMENT '101:未标注 102:手动标注中 103:自动标注中 104:自动标注完成 105:标注完成 201:目标跟踪中 202:目标跟踪完成 203:目标跟踪失败 301:未采样 302:采样中 303:采样失败 401:增强中 402:导入中',
  20. `current_version_name` varchar(16) DEFAULT NULL COMMENT '当前版本号',
  21. `is_import` tinyint(1) DEFAULT '0' COMMENT '是否用户导入',
  22. `archive_url` varchar(255) DEFAULT NULL COMMENT '用户导入数据集压缩包地址',
  23. `decompress_state` tinyint(2) DEFAULT '0' COMMENT '解压状态: 0未解压 1解压中 2解压完成 3解压失败',
  24. `decompress_fail_reason` varchar(255) DEFAULT NULL COMMENT '解压失败原因',
  25. `is_top` tinyint(1) DEFAULT NULL COMMENT '是否为置顶',
  26. `origin_user_id` bigint(20) DEFAULT NULL COMMENT '资源拥有人id',
  27. `label_group_id` bigint(20) DEFAULT NULL COMMENT '标签组ID',
  28. `source_id` bigint(20) DEFAULT NULL COMMENT '数据集源ID',
  29. PRIMARY KEY (`id`) USING BTREE
  30. ) ENGINE=InnoDB AUTO_INCREMENT = 1 COMMENT='数据集管理';
  31. CREATE TABLE IF NOT EXISTS `data_dataset_label` (
  32. `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  33. `dataset_id` bigint(20) UNSIGNED NOT NULL,
  34. `label_id` bigint(20) UNSIGNED NOT NULL,
  35. `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  36. `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  37. `deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '删除(0正常,1已删除)',
  38. `create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人id',
  39. `update_user_id` bigint(20) NULL DEFAULT NULL COMMENT '修改人id',
  40. PRIMARY KEY (`id`) USING BTREE,
  41. UNIQUE INDEX `dataset_id`(`dataset_id`, `label_id`) USING BTREE
  42. ) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT='数据集标签';
  43. CREATE TABLE IF NOT EXISTS `data_dataset_version` (
  44. `id` bigint(19) NOT NULL AUTO_INCREMENT COMMENT '主键',
  45. `dataset_id` bigint(19) DEFAULT NULL COMMENT '数据集ID',
  46. `team_id` bigint(19) DEFAULT NULL COMMENT '团队ID',
  47. `create_user_id` bigint(19) DEFAULT NULL COMMENT '创建人',
  48. `create_time` datetime NOT NULL COMMENT '创建时间',
  49. `update_user_id` bigint(19) DEFAULT NULL COMMENT '修改人',
  50. `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  51. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '数据集版本删除标记0正常,1已删除',
  52. `version_name` varchar(8) NOT NULL COMMENT '版本号',
  53. `version_note` varchar(50) NOT NULL COMMENT '版本说明',
  54. `version_source` varchar(32) DEFAULT NULL COMMENT '来源版本号',
  55. `version_url` varchar(255) DEFAULT NULL COMMENT '版本信息存储url',
  56. `data_conversion` int(1) NOT NULL DEFAULT '0' COMMENT '数据转换;0:未复制;1:已复制;2:转换完成,3:转换失败',
  57. `origin_user_id` bigint(20) DEFAULT NULL COMMENT '资源用有人ID',
  58. `of_record` tinyint(1) DEFAULT '0' COMMENT '是否生成ofRecord文件',
  59. PRIMARY KEY (`id`) USING BTREE,
  60. UNIQUE KEY `unique_version` (`dataset_id`,`version_name`) COMMENT '数据集版本号唯一'
  61. ) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='数据集版本表';
  62. CREATE TABLE IF NOT EXISTS `data_dataset_version_file` (
  63. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  64. `dataset_id` bigint(20) DEFAULT NULL COMMENT '数据集ID',
  65. `version_name` varchar(8) DEFAULT NULL COMMENT '数据集版本',
  66. `file_id` bigint(20) DEFAULT NULL COMMENT '文件ID',
  67. `status` tinyint(1) NOT NULL DEFAULT '2' COMMENT '状态 0: 新增 1:删除 2:正常',
  68. `annotation_status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '101:未标注 102:手动标注中 103:自动标注完成 104:标注完成 105:标注未识别 201:目标跟踪完成',
  69. `backup_status` tinyint(3) unsigned DEFAULT '0' COMMENT '数据集状态备份,版本切换使用',
  70. `changed` bit(1) DEFAULT b'0' COMMENT '0 - 未改变,1 - 改变',
  71. `file_name` varchar(255) DEFAULT '' COMMENT '文件名称',
  72. PRIMARY KEY (`id`) USING BTREE,
  73. KEY `select_status` (`dataset_id`,`version_name`) USING BTREE,
  74. KEY `dataset_id_annotation_status` (`dataset_id`,`annotation_status`,`version_name`) USING BTREE,
  75. KEY `select_file` (`dataset_id`,`status`,`annotation_status`,`version_name`,`file_id`),
  76. KEY `file_state_annotation_finished` (`dataset_id`,`file_id`,`version_name`) USING BTREE
  77. ) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='数据集版本文件关系表';
  78. CREATE TABLE IF NOT EXISTS `data_file` (
  79. `id` bigint(20) unsigned zerofill NOT NULL AUTO_INCREMENT COMMENT 'ID',
  80. `name` varchar(255) NOT NULL DEFAULT '' COMMENT '文件名',
  81. `status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '状态:0-未标注,1-标注中,2-自动标注完成,3-已标注完成,4-目标追踪完成',
  82. `dataset_id` bigint(20) DEFAULT NULL COMMENT '数据集id',
  83. `url` varchar(255) NOT NULL DEFAULT '' COMMENT '资源访问路径',
  84. `create_user_id` bigint(20) DEFAULT NULL COMMENT '创建用户ID',
  85. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  86. `update_user_id` bigint(20) DEFAULT NULL COMMENT '更新用户ID',
  87. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  88. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '0正常,1已删除',
  89. `file_type` tinyint(4) DEFAULT '0' COMMENT '文件类型 0-图片,1-视频',
  90. `pid` bigint(20) DEFAULT '0' COMMENT '父文件id',
  91. `frame_interval` int(11) DEFAULT '0' COMMENT '帧间隔',
  92. `enhance_type` smallint(3) DEFAULT NULL COMMENT '增强类型',
  93. `width` int(11) DEFAULT NULL COMMENT '图片宽',
  94. `height` int(11) DEFAULT NULL COMMENT '图片高',
  95. `origin_user_id` bigint(19) DEFAULT NULL COMMENT '资源拥有者ID',
  96. `es_transport` int(1) DEFAULT '0' COMMENT '是否上传至es',
  97. `exclude_header` smallint(6) NOT NULL DEFAULT '1' COMMENT 'table数据导入时,是否排除文件头',
  98. PRIMARY KEY (`id`) USING BTREE,
  99. UNIQUE KEY `name_uniq` (`name`,`dataset_id`,`deleted`) USING BTREE,
  100. KEY `deleted` (`deleted`) USING BTREE,
  101. KEY `dataset_upt_time` (`dataset_id`,`update_time`) USING BTREE,
  102. KEY `uuid` (`url`,`deleted`) USING BTREE,
  103. KEY `status` (`dataset_id`,`status`,`deleted`) USING BTREE,
  104. KEY `es_transport` (`es_transport`) USING BTREE
  105. ) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='文件信息';
  106. CREATE TABLE IF NOT EXISTS `data_file_annotation` (
  107. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  108. `dataset_id` bigint(20) NOT NULL COMMENT '数据集ID',
  109. `label_id` bigint(20) NOT NULL COMMENT '标签ID',
  110. `version_file_id` bigint(20) NOT NULL COMMENT '版本文件ID',
  111. `prediction` double DEFAULT '0' COMMENT '预测值',
  112. `create_user_id` bigint(20) DEFAULT NULL,
  113. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  114. `update_user_id` bigint(20) DEFAULT NULL,
  115. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  116. `deleted` bit(1) NOT NULL DEFAULT b'0',
  117. `file_name` varchar(255) DEFAULT NULL COMMENT '文件名称',
  118. `status` tinyint(1) DEFAULT '0' COMMENT '状态 0: 新增 1:删除 2:正常',
  119. `invariable` tinyint(1) DEFAULT '0' COMMENT '是否为版本标注信息0:否 1:是',
  120. PRIMARY KEY (`id`),
  121. KEY `version_file_index` (`version_file_id`) USING BTREE,
  122. KEY `label_dataset_id_index` (`label_id`,`dataset_id`) USING BTREE
  123. ) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='数据集文件标注表';
  124. CREATE TABLE IF NOT EXISTS `data_group_label` (
  125. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  126. `label_id` bigint(20) DEFAULT NULL COMMENT '标签Id',
  127. `label_group_id` bigint(20) DEFAULT NULL COMMENT '标签组Id',
  128. `create_user_id` bigint(20) DEFAULT NULL,
  129. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  130. `update_user_id` bigint(20) DEFAULT NULL,
  131. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  132. `deleted` bit(1) NOT NULL DEFAULT b'0',
  133. PRIMARY KEY (`id`)
  134. ) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='标签组标签中间表';
  135. CREATE TABLE IF NOT EXISTS `data_label` (
  136. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  137. `name` varchar(255) NOT NULL DEFAULT '',
  138. `color` varchar(7) NOT NULL DEFAULT '#000000',
  139. `create_user_id` bigint(20) DEFAULT NULL,
  140. `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  141. `update_user_id` bigint(20) DEFAULT NULL,
  142. `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  143. `deleted` bit(1) NOT NULL DEFAULT b'0',
  144. `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '标签类型 0:自定义标签 1:自动标注标签 2:ImageNet 3: MS COCO',
  145. PRIMARY KEY (`id`) USING BTREE,
  146. KEY `dataset` (`name`,`deleted`) USING BTREE
  147. ) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='数据集标签';
  148. CREATE TABLE IF NOT EXISTS `data_label_group` (
  149. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  150. `name` varchar(255) NOT NULL DEFAULT '' COMMENT '标签组名称',
  151. `create_user_id` bigint(20) DEFAULT NULL,
  152. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  153. `update_user_id` bigint(20) DEFAULT NULL,
  154. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  155. `deleted` bit(1) NOT NULL DEFAULT b'0',
  156. `remark` varchar(255) DEFAULT NULL COMMENT '描述',
  157. `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '类型 0: private 私有标签组, 1:public 公开标签组',
  158. `origin_user_id` bigint(20) DEFAULT NULL COMMENT '资源拥有人',
  159. `operate_type` int(11) DEFAULT NULL COMMENT '操作类型 1:Json编辑器操作类型 2:自定义操作类型 3:导入操作类型',
  160. `label_group_type` int(1) NOT NULL DEFAULT '0' COMMENT '标签组数据类型 0:视觉 1:文本',
  161. PRIMARY KEY (`id`)
  162. ) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='标签组';
  163. CREATE TABLE IF NOT EXISTS `data_lesion_slice` (
  164. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  165. `create_user_id` bigint(20) DEFAULT NULL,
  166. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  167. `update_user_id` bigint(20) DEFAULT NULL,
  168. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  169. `lesion_order` int(11) NOT NULL COMMENT '序号',
  170. `slice_desc` varchar(255) DEFAULT NULL COMMENT '病灶层面',
  171. `medicine_id` bigint(20) DEFAULT NULL COMMENT '数据集ID',
  172. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '0正常,1已删除',
  173. `draw_info` text,
  174. `origin_user_id` bigint(19) DEFAULT NULL COMMENT '资源拥有者ID',
  175. PRIMARY KEY (`id`)
  176. ) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='数据病变切片';
  177. CREATE TABLE IF NOT EXISTS `data_medicine` (
  178. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  179. `name` varchar(255) NOT NULL COMMENT '数据集名称',
  180. `create_user_id` bigint(20) DEFAULT NULL COMMENT '创建用户ID',
  181. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  182. `update_user_id` bigint(20) DEFAULT NULL COMMENT '更新用户ID',
  183. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  184. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '0-正常 1-已删除',
  185. `status` smallint(4) DEFAULT NULL COMMENT '状态 101-未标注 103-自动标注中 104-自动标注完成 105-完成',
  186. `patient_id` varchar(50) DEFAULT NULL COMMENT '检查号(CT号或CR、DR号)',
  187. `study_instance_uid` varchar(64) DEFAULT NULL COMMENT '研究实例UID',
  188. `series_instance_uid` varchar(64) DEFAULT NULL COMMENT '序列实例UID',
  189. `modality` varchar(50) DEFAULT NULL COMMENT '模式',
  190. `body_part_examined` varchar(50) DEFAULT NULL COMMENT '部位',
  191. `merge_annotation` text COMMENT '自动标注内容合并后结果',
  192. `remark` varchar(255) DEFAULT NULL,
  193. `origin_user_id` bigint(20) NOT NULL COMMENT '资源拥有人',
  194. `type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '类型 0: private 私有数据, 1:team 团队数据 2:public 公开数据',
  195. `annotate_type` smallint(5) NOT NULL DEFAULT '0' COMMENT '标注类型: 1.器官分割 2.病灶检测之肺结节检测',
  196. PRIMARY KEY (`id`) USING BTREE
  197. ) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='医学数据集';
  198. CREATE TABLE IF NOT EXISTS `data_medicine_file` (
  199. `id` bigint(20) unsigned zerofill NOT NULL AUTO_INCREMENT COMMENT 'ID',
  200. `create_user_id` bigint(20) DEFAULT NULL COMMENT '创建用户ID',
  201. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  202. `update_user_id` bigint(20) DEFAULT NULL COMMENT '更新用户ID',
  203. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  204. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '0-正常 1-已删除',
  205. `medicine_id` bigint(20) DEFAULT NULL COMMENT '数据集ID',
  206. `name` varchar(225) DEFAULT NULL COMMENT '文件名称',
  207. `url` varchar(255) DEFAULT NULL COMMENT '文件地址',
  208. `instance_number` smallint(5) DEFAULT NULL COMMENT '实例序号',
  209. `sop_instance_uid` varchar(64) DEFAULT NULL COMMENT 'SOP实例UID',
  210. `origin_user_id` bigint(20) DEFAULT NULL COMMENT '资源拥有人',
  211. `status` tinyint(4) DEFAULT NULL COMMENT '状态 101-未标注 103-自动标注完成 104-完成',
  212. `image_position_patient` double(11,1) DEFAULT NULL,
  213. PRIMARY KEY (`id`) USING BTREE
  214. ) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='医学数据集';
  215. CREATE TABLE IF NOT EXISTS `data_sequence` (
  216. `id` int(11) NOT NULL,
  217. `business_code` varchar(50) NOT NULL,
  218. `start` int(11) NOT NULL,
  219. `step` int(11) NOT NULL,
  220. PRIMARY KEY (`id`),
  221. UNIQUE KEY `business_code_unique` (`business_code`) USING BTREE
  222. ) ENGINE=InnoDB COMMENT='自定义获取主键ID表';
  223. CREATE TABLE IF NOT EXISTS `data_task` (
  224. `id` bigint(20) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'ID',
  225. `total` int(11) NOT NULL DEFAULT 0 COMMENT '任务需要处理的文件总数',
  226. `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '任务状态 0.待分配 1.分配中 2.进行中 3.已完成 4.失败',
  227. `finished` int(11) NOT NULL DEFAULT 0 COMMENT '已完成的文件数',
  228. `failed` int(11) NOT NULL DEFAULT 0 COMMENT '失败文件数量',
  229. `files` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '文件id数组',
  230. `dataset_id` bigint(20) NULL DEFAULT NULL COMMENT '数据集ID',
  231. `annotate_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '标注类型:0分类,1目标检测',
  232. `data_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '数据类型:0图片,1视频',
  233. `labels` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '该自动标注任务使用的标签数组,json串形式',
  234. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '0正常,1已删除',
  235. `datasets` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '数据集id数组',
  236. `create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建用户ID',
  237. `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  238. `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
  239. `type` smallint(3) NULL DEFAULT NULL COMMENT '任务类型 0.自动标注 1.ofrecord 2.imageNet 3.数据增强 4.目标跟踪 5.视频采样',
  240. `dataset_version_id` bigint(20) NULL DEFAULT NULL COMMENT '数据集版本ID',
  241. `enhance_type` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '增强类型数组',
  242. `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '视频文件url',
  243. `frame_interval` int(11) NULL DEFAULT NULL COMMENT '视频帧间隔',
  244. `merge_column` varchar(255) DEFAULT NULL COMMENT 'csv合并列',
  245. `version_name` varchar(255) DEFAULT NULL COMMENT '转预置版本号',
  246. `target_id` bigint(20) NULL DEFAULT NULL COMMENT '目标数据集id',
  247. PRIMARY KEY (`id`) USING BTREE,
  248. KEY `deleted` (`deleted`) USING BTREE,
  249. KEY `ds_status` (`datasets`,`status`) USING BTREE
  250. ) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '标注任务信息';
  251. create table if not exists dict
  252. (
  253. id bigint auto_increment primary key,
  254. name varchar(255) not null,
  255. remark varchar(255) null,
  256. create_time datetime default CURRENT_TIMESTAMP null,
  257. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP
  258. )
  259. charset = utf8;
  260. create table if not exists dict_detail
  261. (
  262. id bigint auto_increment primary key,
  263. dict_id bigint null,
  264. label varchar(255) not null,
  265. value varchar(255) not null,
  266. sort bigint default 999 null,
  267. create_time datetime default CURRENT_TIMESTAMP null,
  268. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP
  269. )
  270. charset = utf8;
  271. create table harbor_project
  272. (
  273. id bigint unsigned auto_increment comment '主键ID'
  274. primary key,
  275. image_name varchar(100) not null comment '镜像名称',
  276. create_resource tinyint default 0 not null comment '0 - NOTEBOOK模型管理 1- ALGORITHM算法管理',
  277. create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间',
  278. create_user_id bigint null comment '创建用户ID',
  279. update_time timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
  280. update_user_id bigint null comment '更新用户ID',
  281. deleted bit default b'0' null comment '0正常,1已删除',
  282. sync_status tinyint(1) default 0 null comment '同步状态(默认为0,同步成功为1)',
  283. constraint image_name
  284. unique (image_name)
  285. )
  286. comment 'harbor project表' charset=utf8;
  287. create table if not exists log
  288. (
  289. id bigint auto_increment
  290. primary key,
  291. browser varchar(255) null,
  292. create_time datetime null,
  293. description varchar(255) null,
  294. exception_detail text null,
  295. log_type varchar(255) null,
  296. method varchar(255) null,
  297. params text null,
  298. request_ip varchar(255) null,
  299. time bigint null,
  300. username varchar(255) null
  301. )
  302. charset = utf8;
  303. create table if not exists menu
  304. (
  305. id bigint auto_increment primary key,
  306. pid bigint default 0 not null COMMENT '上级菜单ID',
  307. type int default 0 not null COMMENT '菜单类型: 0目录,1页面,2权限,3外链' ,
  308. name varchar(255) null COMMENT '名称',
  309. icon varchar(255) null COMMENT '菜单图标',
  310. path varchar(255) null COMMENT '路径或外链URL',
  311. component varchar(255) null COMMENT '组件路径',
  312. component_name varchar(255) null COMMENT '路由名称',
  313. layout varchar(255) null COMMENT '页面布局类型',
  314. permission varchar(255) null COMMENT '权限标识',
  315. back_to varchar(255) null COMMENT '上级菜单',
  316. ext_config varchar(255) null COMMENT '扩展配置',
  317. hidden bit default b'0' null COMMENT '菜单栏不显示',
  318. cache bit default b'0' null COMMENT '路由缓存 keep-alive',
  319. sort bigint default 999 null COMMENT '菜单排序',
  320. create_user_id bigint(20) DEFAULT NULL COMMENT '创建人id',
  321. update_user_id bigint(20) DEFAULT NULL COMMENT '修改人id',
  322. create_time datetime default CURRENT_TIMESTAMP null,
  323. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP,
  324. deleted bit(1) DEFAULT 0 COMMENT '删除标记 0正常,1已删除'
  325. )
  326. charset = utf8;
  327. create table if not exists `notebook` (
  328. `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  329. `origin_user_id` BIGINT(20) NOT NULL COMMENT '所属用户ID',
  330. `name` VARCHAR(100) NOT NULL COMMENT 'notebook名称(供K8S使用)',
  331. `notebook_name` VARCHAR(100) NULL DEFAULT NULL COMMENT 'notebook名称(供前端使用)',
  332. `description` VARCHAR(255) NULL DEFAULT NULL COMMENT '描述',
  333. `url` VARCHAR(255) NULL DEFAULT NULL COMMENT '访问 notebook 在 Jupyter 里所需的url',
  334. `total_run_min` INT(11) NOT NULL DEFAULT '0' COMMENT '运行总时间(分钟)',
  335. `cpu_num` INT(11) NOT NULL DEFAULT '0' COMMENT 'CPU数量(核)',
  336. `gpu_num` INT(11) NOT NULL DEFAULT '0' COMMENT 'GPU数量(核)',
  337. `mem_num` INT(11) NOT NULL DEFAULT '0' COMMENT '内存大小(M)',
  338. `disk_mem_num` INT(11) NOT NULL DEFAULT '0' COMMENT '硬盘内存大小(M)',
  339. `status` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '0运行,1停止, 2删除, 3启动中,4停止中,5删除中,6运行异常(暂未启用)',
  340. `status_detail` json default null comment '状态对应的详情信息',
  341. `last_start_time` TIMESTAMP NULL DEFAULT NULL COMMENT '上次启动执行时间',
  342. `last_operation_timeout` BIGINT(20) NULL DEFAULT NULL COMMENT '上次操作对应超时时间点(20200603121212)',
  343. `k8s_status_code` VARCHAR(100) NULL DEFAULT NULL COMMENT 'k8s响应状态码',
  344. `create_resource` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '0 - notebook 创建 1- 其它系统创建',
  345. `k8s_status_info` VARCHAR(255) NULL DEFAULT NULL COMMENT 'k8s响应状态信息',
  346. `k8s_namespace` VARCHAR(255) NOT NULL COMMENT 'k8s中namespace',
  347. `k8s_resource_name` VARCHAR(255) NOT NULL COMMENT 'k8s中资源名称',
  348. `k8s_image_name` VARCHAR(255) NOT NULL COMMENT 'k8s中jupyter的镜像名称',
  349. `k8s_pvc_path` VARCHAR(255) NOT NULL COMMENT 'k8s中pvc存储路径',
  350. `k8s_mount_path` VARCHAR(255) NOT NULL DEFAULT '/notebook' COMMENT 'k8s中容器路径',
  351. `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  352. `create_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '创建用户ID',
  353. `update_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  354. `update_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '更新用户ID',
  355. `deleted` BIT(1) NULL DEFAULT b'0' COMMENT '0正常,1已删除',
  356. `data_source_name` VARCHAR(255) NULL DEFAULT NULL COMMENT '数据集名称',
  357. `data_source_path` VARCHAR(255) NULL DEFAULT NULL COMMENT '数据集路劲',
  358. `algorithm_id` BIGINT(20) NULL DEFAULT '0' COMMENT '算法ID',
  359. PRIMARY KEY (`id`),
  360. INDEX `status` (`status`),
  361. INDEX `user_id` (`origin_user_id`),
  362. INDEX `name` (`name`),
  363. INDEX `last_operation_timeout` (`last_operation_timeout`),
  364. INDEX `k8s_namespace` (`k8s_namespace`),
  365. INDEX `k8s_resource_name` (`k8s_resource_name`)
  366. )
  367. COMMENT='notebook数据表'
  368. COLLATE='utf8_general_ci'
  369. ENGINE=InnoDB
  370. ;
  371. create table if not exists pt_dev_envs
  372. (
  373. id bigint auto_increment comment '主键'
  374. primary key,
  375. name varchar(255) not null comment '名称',
  376. remark varchar(255) null comment '描述',
  377. type varchar(255) not null comment '类型 ',
  378. cpu_num int not null comment 'CPU数量',
  379. gpu_num int not null comment 'GPU数量',
  380. mem_num int not null comment '内存大小单位M',
  381. pod_num int not null comment 'POD数量',
  382. status varchar(255) not null comment '状态 对应k8s的状态',
  383. dataset_id bigint null comment '数据集ID',
  384. image_id bigint null comment '镜像ID',
  385. storage_id bigint null comment '存储ID',
  386. duration int null comment '时长',
  387. start_time datetime null comment '开始时间',
  388. close_time datetime null comment '释放时间',
  389. create_time datetime null comment '创建时间',
  390. update_time datetime null comment '修改时间',
  391. create_user_id bigint null comment '创建人ID',
  392. update_user_id bigint null comment '修改人ID',
  393. team_id bigint null comment '团队ID',
  394. deleted bit default b'0' null comment '0正常,1已删除'
  395. )
  396. charset = utf8;
  397. create table if not exists pt_job_param
  398. (
  399. id bigint auto_increment comment '主键id'
  400. primary key,
  401. train_job_id bigint not null comment '训练作业jobId',
  402. algorithm_id bigint not null comment '算法来源id',
  403. run_params json null comment '运行参数(算法来源为我的算法时为调优参数,算法来源为预置算法时为运行参数)',
  404. param_f1 varchar(255) default '' null comment 'F1值',
  405. param_callback varchar(255) default '' null comment '召回率',
  406. param_precise varchar(255) default '' null comment '精确率',
  407. param_accuracy varchar(255) default '' null comment '准确率',
  408. create_user_id bigint null comment '创建人',
  409. deleted tinyint(1) default 0 null comment '删除(0正常,1已删除)',
  410. create_time timestamp null comment '创建时间',
  411. update_user_id bigint null comment '更新人',
  412. update_time timestamp null comment '更新时间',
  413. run_command varchar(255) default '' null COMMENT '运行命令',
  414. image_name varchar(127) default '' null COMMENT '镜像名称',
  415. delay_create_time timestamp null comment '创建时间',
  416. delay_delete_time timestamp null comment '创建时间'
  417. )
  418. comment 'job运行参数及结果表' charset = utf8mb4;
  419. create table if not exists pt_model_branch
  420. (
  421. id bigint auto_increment comment '主键'
  422. primary key,
  423. parent_id bigint null comment '父ID',
  424. version varchar(8) not null comment '版本号',
  425. url varchar(255) not null comment '模型地址',
  426. model_path varchar(255) not null comment '模型存储地址',
  427. model_source tinyint(3) not null comment '模型来源(用户上传、平台生成、优化后导入)',
  428. create_user_id bigint null comment '创建用户ID',
  429. update_user_id bigint null comment '更新用户ID',
  430. team_id bigint null comment '团队ID',
  431. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  432. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间',
  433. deleted bit default b'0' not null comment '0 正常,1 已删除',
  434. algorithm_id bigint null comment '算法ID',
  435. algorithm_name varchar(255) null comment '算法名称',
  436. algorithm_source tinyint(1) null comment '算法来源(1为我的算法,2为预置算法)',
  437. status tinyint(3) null comment '文件拷贝状态(0文件拷贝中,1文件拷贝成功,2文件拷贝失败)',
  438. origin_user_id bigint null comment '资源用有人ID'
  439. )
  440. comment '分支管理' charset = utf8;
  441. create table if not exists pt_model_info
  442. (
  443. id bigint auto_increment comment '主键'
  444. primary key,
  445. name varchar(255) not null comment '模型名称',
  446. frame_type tinyint not null comment '框架类型',
  447. model_format tinyint not null comment '模型文件的格式(后缀名)',
  448. model_description varchar(255) null comment '模型描述',
  449. model_type varchar(255) not null comment '模型分类',
  450. url varchar(255) null comment '模型地址',
  451. model_version varchar(8) null comment '模型版本',
  452. create_user_id bigint null comment '创建用户ID',
  453. update_user_id bigint null comment '更新用户ID',
  454. team_id bigint null comment '组ID',
  455. deleted bit default b'0' not null comment '0 正常,1 已删除',
  456. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  457. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间',
  458. model_resource tinyint default 0 null comment '模型是否为预置模型(0默认模型,1预置模型)',
  459. total_num bigint default 0 null comment '模型版本总的个数',
  460. origin_user_id bigint null comment '资源用有人ID',
  461. tags json null comment 'tag信息',
  462. packaged tinyint default 0 not null comment '模型是否已经打包,0未打包,1打包完成'
  463. )
  464. comment '模型管理' charset = utf8;
  465. create table if not exists pt_model_type
  466. (
  467. id bigint auto_increment comment '主键'
  468. primary key,
  469. frame_type tinyint not null comment '框架类型',
  470. model_type varchar(255) not null comment '模型文件的格式',
  471. create_user_id bigint null comment '创建用户ID',
  472. update_user_id bigint null comment '更新用户ID',
  473. deleted bit default b'0' not null comment '0 正常,1 已删除',
  474. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  475. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间',
  476. origin_user_id bigint null comment '资源用有人ID'
  477. )
  478. comment '模型格式' charset = utf8;
  479. create table if not exists pt_model_suffix
  480. (
  481. id bigint auto_increment comment '主键'
  482. primary key,
  483. model_type tinyint not null comment '模型文件的格式',
  484. model_suffix varchar(255) default '' not null comment '模型文件的格式对应后缀名',
  485. create_user_id bigint null comment '创建用户ID',
  486. update_user_id bigint null comment '更新用户ID',
  487. deleted bit default b'0' not null comment '0 正常,1 已删除',
  488. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  489. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间',
  490. origin_user_id bigint null comment '资源用有人ID'
  491. )
  492. comment '模型后缀名' charset = utf8;
  493. create table if not exists pt_project_template
  494. (
  495. id bigint auto_increment comment '主键'
  496. primary key,
  497. name varchar(255) not null comment '名称',
  498. remark varchar(255) null comment '描述',
  499. type varchar(255) not null comment '类型 ',
  500. dataset_id bigint null comment '数据集ID',
  501. image_id bigint null comment '镜像ID',
  502. code_url varchar(255) null comment '代码地址',
  503. cmd varchar(255) not null comment '命令行',
  504. create_time datetime not null comment '创建时间',
  505. update_time datetime null comment '修改时间',
  506. create_user_id bigint null comment '创建人ID',
  507. update_user_id bigint null comment '修改人ID',
  508. team_id bigint null comment '团队ID',
  509. deleted bit default b'0' null comment '0正常,1已删除'
  510. )
  511. charset = utf8;
  512. create table if not exists pt_storage
  513. (
  514. id bigint auto_increment comment '主键'
  515. primary key,
  516. name varchar(255) not null comment '名称',
  517. type varchar(255) not null comment '类型 ',
  518. size int not null comment '存储大小,单位M',
  519. storage_class varchar(255) null comment '对应k8s pvc的 storageClass',
  520. create_time datetime not null comment '创建时间',
  521. create_user_id bigint null comment '创建人ID',
  522. update_user_id bigint null comment '修改人ID',
  523. update_time datetime null comment '修改时间',
  524. team_id bigint null comment '团队ID',
  525. deleted bit default b'0' null comment '0正常,1已删除'
  526. )
  527. charset = utf8;
  528. create table if not exists pt_train
  529. (
  530. id bigint auto_increment comment '主键id'
  531. primary key,
  532. train_name varchar(64) not null comment '训练作业名',
  533. version_num int(8) default 1 not null comment '训练作业job有效版本数量',
  534. total_num int(8) default 1 not null comment '训练作业总版本数',
  535. deleted tinyint(1) default 0 not null comment '删除(0正常,1已删除)',
  536. create_user_id bigint null comment '创建人',
  537. create_time timestamp null comment '创建时间',
  538. update_user_id bigint null comment '更新人',
  539. update_time timestamp null comment '更新时间',
  540. train_key varchar(32) null,
  541. origin_user_id bigint null comment '资源拥有者ID'
  542. )
  543. comment '训练作业主表' charset = utf8mb4;
  544. create index idx_user_id
  545. on pt_train (create_user_id);
  546. create table if not exists pt_train_algorithm
  547. (
  548. id bigint auto_increment comment '主键'
  549. primary key,
  550. algorithm_name varchar(255) not null comment '算法名称',
  551. description varchar(255) default '' null comment '算法描述',
  552. algorithm_source tinyint(1) not null comment '算法来源(1为我的算法,2为预置算法)',
  553. algorithm_status tinyint(1) default 0 not null comment '算法上传状态,0:创建中,1:创建成功,2:创建失败',
  554. code_dir varchar(255) default '' null comment '代码目录',
  555. run_command varchar(255) default '' null comment '运行命令',
  556. run_params json null comment '运行参数',
  557. algorithm_usage varchar(255) default '' null comment '算法用途',
  558. accuracy varchar(255) default '' null comment '算法精度',
  559. p4_inference_speed int null comment 'P4推理速度(ms)',
  560. create_user_id bigint null comment '创建人',
  561. create_time timestamp null comment '创建时间',
  562. update_user_id bigint null comment '更新人',
  563. update_time timestamp null comment '更新时间',
  564. deleted tinyint(1) default 0 not null comment '删除(0正常,1已删除)',
  565. image_name varchar(127) null,
  566. is_train_model_out tinyint(1) default 1 null comment '是否输出训练结果:1是,0否',
  567. is_train_out tinyint(1) default 1 null comment '是否输出作业信息:1是,0否',
  568. is_visualized_log tinyint(1) default 0 null comment '是否输出可视化日志:1是,0否',
  569. inference tinyint(1) default 0 not null comment '算法文件是否可推理(1可推理,0不可推理)',
  570. origin_user_id bigint null comment '资源拥有者ID'
  571. )
  572. comment '训练算法表' charset = utf8mb4;
  573. create table if not exists pt_train_job
  574. (
  575. id bigint auto_increment comment '主键id'
  576. primary key,
  577. train_id bigint not null comment '训练作业id',
  578. train_version varchar(32) not null comment 'job版本',
  579. parent_train_version varchar(32) null comment 'job父版本',
  580. job_name varchar(64) not null comment '任务名称',
  581. description varchar(255) default '' null comment '描述',
  582. runtime varchar(32) default '' null comment '运行时长',
  583. model_path varchar(128) default '' null comment '训练输出位置',
  584. out_path varchar(128) default '' null comment '作业输出路径',
  585. resources_pool_type tinyint(1) default 0 not null comment '类型(0为CPU,1为GPU)',
  586. resources_pool_specs varchar(128) null comment '规格',
  587. resources_pool_node int(8) default 1 not null comment '节点个数',
  588. train_status tinyint(1) default 0 not null comment '训练作业job状态, 0为待处理,1为运行中,2为运行完成,3为失败,4为停止,5为未知,6为删除,7为创建失败)',
  589. status_detail json default null comment '状态对应的详情信息',
  590. `train_type` TINYINT(1) UNSIGNED ZEROFILL NULL DEFAULT '0' COMMENT '训练类型 0:普通训练,1:分布式训练',
  591. deleted tinyint(1) default 0 null comment '删除(0正常,1已删除)',
  592. create_user_id bigint null comment '创建人',
  593. create_time timestamp null comment '创建时间',
  594. update_user_id bigint null comment '更新人',
  595. update_time timestamp null comment '更新时间',
  596. visualized_log_path varchar(128) default '' null comment '可视化日志路径',
  597. data_source_name varchar(127) null comment '数据集名称',
  598. data_source_path varchar(127) null comment '数据集路径',
  599. train_job_specs_name varchar(32) null comment '训练规格名称',
  600. k8s_job_name varchar(70) null comment 'k8s创建好的job名称',
  601. val_data_source_name varchar(127) null comment '验证数据集名称',
  602. val_data_source_path varchar(255) null comment '验证数据集路径',
  603. val_type tinyint(1) default 0 null comment '是否验证数据集',
  604. origin_user_id bigint null comment '资源拥有者ID',
  605. train_msg varchar(128) null comment '训练信息(失败信息)',
  606. model_id bigint null comment '模型id',
  607. model_branch_id bigint null comment '模型对应版本id',
  608. model_resource tinyint(1) null comment '模型类型(0我的模型1预置模型2炼知模型)',
  609. teacher_model_ids varchar(255) null comment '教师模型ids',
  610. student_model_ids varchar(255) null comment '学生模型ids',
  611. constraint inx_tran_id_version
  612. unique (train_id, train_version)
  613. )
  614. comment '训练作业job表' charset = utf8mb4;
  615. create index inx_create_user_id
  616. on pt_train_job (create_user_id);
  617. create table if not exists pt_train_param
  618. (
  619. id bigint auto_increment comment '主键id'
  620. primary key,
  621. param_name varchar(128) not null comment '任务参数名称',
  622. description varchar(256) default '' null comment '描述',
  623. algorithm_id bigint not null comment '算法id',
  624. out_path varchar(128) default '' null comment '输出路径',
  625. run_params json null comment '运行参数(算法来源为我的算法时为调优参数,算法来源为预置算法时为运行参数)',
  626. algorithm_source tinyint(1) default 1 not null comment '算法来源(1为我的算法,2为预置算法)',
  627. log_path varchar(128) default '' null comment '日志输出路径',
  628. resources_pool_type tinyint(1) default 0 not null comment '类型(0为CPU,1为GPU)',
  629. resources_pool_specs varchar(128) null comment '规格',
  630. resources_pool_node int(8) default 1 not null comment '节点个数',
  631. deleted tinyint(1) default 0 null comment '删除(0正常,1已删除)',
  632. create_user_id bigint null comment '创建人',
  633. create_time timestamp null comment '创建时间',
  634. update_user_id bigint null comment '更新人',
  635. update_time timestamp null comment '更新时间',
  636. data_source_name varchar(127) null comment '数据集名称',
  637. data_source_path varchar(127) null comment '数据集路径',
  638. run_command varchar(255) default '' null COMMENT '运行命令',
  639. image_name varchar(127) default '' null COMMENT '镜像名称',
  640. train_job_specs_name varchar(32) null COMMENT '训练规格名称',
  641. origin_user_id bigint null comment '资源拥有者ID',
  642. `train_type` TINYINT(1) UNSIGNED ZEROFILL NULL DEFAULT '0' COMMENT '训练类型 0:普通训练,1:分布式训练',
  643. val_data_source_name varchar(127) null comment '验证数据集名称',
  644. val_data_source_path varchar(127) null comment '验证数据集路径',
  645. val_type tinyint(1) default 0 null comment '是否验证数据集(0否,1是)',
  646. model_id bigint null comment '模型id',
  647. model_branch_id bigint null comment '模型对应版本id',
  648. model_resource tinyint(1) null comment '模型类型(0我的模型1预置模型2炼知模型)',
  649. teacher_model_ids varchar(255) null comment '教师模型ids',
  650. student_model_ids varchar(255) null comment '学生模型ids'
  651. )
  652. comment '任务参数表' charset = utf8mb4;
  653. create table if not exists role
  654. (
  655. id bigint auto_increment
  656. primary key,
  657. name varchar(255) not null,
  658. permission varchar(255) null,
  659. remark varchar(255) null,
  660. create_user_id bigint(20) DEFAULT NULL COMMENT '创建人id',
  661. update_user_id bigint(20) DEFAULT NULL COMMENT '修改人id',
  662. deleted bit(1) DEFAULT 0 COMMENT '删除标记 0正常,1已删除',
  663. create_time datetime default CURRENT_TIMESTAMP null,
  664. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP
  665. )
  666. charset = utf8;
  667. create table if not exists roles_menus
  668. (
  669. role_id bigint not null,
  670. menu_id bigint not null,
  671. primary key (role_id, menu_id)
  672. )
  673. charset = utf8;
  674. create table if not exists service
  675. (
  676. id int auto_increment comment '主键'
  677. primary key,
  678. model_id int null comment '模型id',
  679. model_version int null comment '模板版本号',
  680. status int null comment '状态',
  681. config text null comment '配置信息',
  682. yaml_path varchar(255) null comment 'yaml配置信息',
  683. create_user_id int null comment '创建人',
  684. create_time datetime null comment '创建时间',
  685. update_user_id datetime null comment '更新人',
  686. update_time datetime null comment '更新时间'
  687. )
  688. comment '服务管理' charset = utf8;
  689. create table if not exists service_monitor
  690. (
  691. id int auto_increment comment '主键'
  692. primary key,
  693. service_id int null comment '服务id',
  694. system_info text null comment '占用系统信息',
  695. api_info text null comment '接口信息',
  696. create_time datetime null comment '创建时间'
  697. )
  698. comment '服务监控信息' charset = utf8;
  699. create table if not exists team
  700. (
  701. id bigint auto_increment
  702. primary key,
  703. create_time datetime null,
  704. enabled bit not null,
  705. name varchar(255) not null
  706. )
  707. charset = utf8;
  708. create table if not exists teams_users_roles
  709. (
  710. id bigint auto_increment
  711. primary key,
  712. role_id bigint null,
  713. team_id bigint null,
  714. user_id bigint null
  715. )
  716. charset = utf8;
  717. create table if not exists user
  718. (
  719. id bigint auto_increment
  720. primary key,
  721. email varchar(255) null,
  722. enabled bit not null,
  723. last_password_reset_time datetime null,
  724. nick_name varchar(255) null,
  725. password varchar(255) null,
  726. phone varchar(255) null,
  727. sex varchar(255) null,
  728. username varchar(255) null,
  729. remark varchar(255) null,
  730. create_time datetime default CURRENT_TIMESTAMP null,
  731. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP,
  732. create_user_id bigint(20) DEFAULT NULL COMMENT '创建人id',
  733. update_user_id bigint(20) DEFAULT NULL COMMENT '修改人id',
  734. deleted bit(1) DEFAULT 0 COMMENT '删除标记 0正常,1已删除',
  735. avatar_id bigint null
  736. )
  737. charset = utf8;
  738. create table if not exists user_avatar
  739. (
  740. id bigint auto_increment
  741. primary key,
  742. path varchar(255) null,
  743. real_name varchar(255) null,
  744. size varchar(255) null,
  745. create_user_id bigint(20) DEFAULT NULL COMMENT '创建人id',
  746. update_user_id bigint(20) DEFAULT NULL COMMENT '修改人id',
  747. deleted bit(1) DEFAULT 0 COMMENT '删除标记 0正常,1已删除',
  748. create_time datetime default CURRENT_TIMESTAMP null,
  749. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP
  750. )
  751. charset = utf8;
  752. create table if not exists users_roles
  753. (
  754. user_id bigint not null comment '用户ID',
  755. role_id bigint not null comment '角色ID',
  756. primary key (user_id, role_id)
  757. )
  758. comment '用户角色关联' charset = utf8;
  759. create table if not exists pt_auxiliary_info (
  760. id bigint(20) not null auto_increment comment '主键id',
  761. origin_user_id bigint(20) not null comment '资源拥有者id',
  762. type varchar(20) not null comment '类型',
  763. aux_info varchar(50) null default NULL comment '辅助信息',
  764. deleted tinyint(1) default 0 null comment '删除(0正常,1已删除)',
  765. create_user_id bigint null comment '创建人',
  766. create_time timestamp null comment '创建时间',
  767. update_user_id bigint null comment '更新人',
  768. update_time timestamp null comment '更新时间',
  769. primary key (`id`),
  770. index `inx_user_id_type` (`origin_user_id`, `type`) USING BTREE
  771. )
  772. comment='用户的辅助信息表,通过类型进行区分' charset = utf8;
  773. -- 新建镜像表
  774. create table pt_image
  775. (
  776. id int(8) auto_increment comment '主键'
  777. primary key,
  778. project_name varchar(100) not null comment '项目名',
  779. image_resource tinyint(1) not null comment '镜像来源(0:我的镜像,1:预置镜像)',
  780. image_status tinyint(1) not null comment '镜像状态(0:制作中,1:制作成功,2:制作失败)',
  781. image_name varchar(64) not null comment '镜像名称',
  782. image_url varchar(255) null comment '镜像地址',
  783. image_tag varchar(64) not null comment '镜像版本',
  784. remark varchar(1024) null comment '镜像描述',
  785. create_user_id bigint null comment '创建人',
  786. create_time timestamp null comment '创建时间',
  787. update_user_id bigint null comment '更新人',
  788. update_time timestamp null comment '更新时间',
  789. deleted tinyint(1) default 0 null comment '删除(0正常,1已删除)',
  790. origin_user_id bigint null comment '资源拥有者ID'
  791. )
  792. comment '镜像表' charset = utf8mb4;
  793. -- k8s资源表
  794. CREATE TABLE if not exists k8s_resource
  795. (
  796. id bigint auto_increment
  797. primary key,
  798. kind varchar(32) not null comment '资源类型',
  799. namespace varchar(64) not null comment '命名空间',
  800. name varchar(64) not null comment '名称',
  801. resource_name varchar(64) not null comment '资源名称',
  802. env varchar(32) null comment '环境',
  803. business varchar(32) null comment '所属业务模块',
  804. create_user_id bigint null comment '创建人',
  805. create_time timestamp default CURRENT_TIMESTAMP null comment '创建时间',
  806. update_user_id bigint null comment '更新人',
  807. update_time timestamp default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
  808. deleted tinyint(1) default 0 null comment '删除(0正常,1已删除)',
  809. INDEX name (name),
  810. INDEX resource_name (resource_name),
  811. constraint kind_namespace_name_uniq unique (kind,namespace,name) comment '资源唯一'
  812. )
  813. comment 'k8s资源表' charset = utf8mb4;
  814. -- k8s任务表
  815. CREATE TABLE if not exists k8s_task
  816. (
  817. id bigint auto_increment
  818. primary key,
  819. namespace varchar(64) not null comment '命名空间',
  820. resource_name varchar(64) not null comment '资源名称',
  821. task_yaml json not null comment '资源清单',
  822. business varchar(32) null comment '所属业务模块',
  823. apply_unix_time bigint default 0 not null comment '资源创建unix时间(精确到秒)',
  824. apply_display_time timestamp null comment '资源创建展示时间',
  825. apply_status tinyint(1) default 0 not null comment '状态(0无需操作,1未创建,2已创建)',
  826. stop_unix_time bigint default 0 not null comment '资源停止unix时间(精确到秒)',
  827. stop_display_time timestamp null comment '资源停止展示时间',
  828. stop_status tinyint(1) default 0 not null comment '状态(0无需操作,1未停止,2已停止)',
  829. create_time timestamp default CURRENT_TIMESTAMP null comment '创建时间',
  830. create_user_id bigint(20) default 0 null comment '创建用户ID',
  831. update_time timestamp default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
  832. update_user_id bigint(20) default 0 null comment '更新用户ID',
  833. deleted bit(1) default b'0' comment '0正常,1已删除',
  834. INDEX apply_unix_time(apply_unix_time),
  835. INDEX stop_unix_time(stop_unix_time),
  836. KEY `apply_status` (`apply_status`) USING BTREE,
  837. KEY `stop_status` (`stop_status`) USING BTREE,
  838. UNIQUE resource_name_namespace (resource_name,namespace) comment '唯一索引'
  839. )
  840. comment 'k8s任务表' charset = utf8mb4;
  841. -- 垃圾回收任务表
  842. CREATE TABLE `recycle_task` (
  843. `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  844. `recycle_module` VARCHAR(32) NOT NULL COMMENT '回收模块',
  845. `recycle_type` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '回收类型(0文件,1数据库表数据)',
  846. `recycle_custom` VARCHAR(64) NULL DEFAULT NULL COMMENT '回收定制化方式',
  847. `recycle_condition` TEXT NOT NULL COMMENT '回收条件(回收表数据sql、回收文件绝对路径)',
  848. `recycle_delay_date` DATE NULL DEFAULT NULL COMMENT '回收日期',
  849. `recycle_status` TINYINT(4) NULL DEFAULT '0' COMMENT '回收任务状态(0:待删除,1:已删除,2:删除失败,3:删除中,4:还原中,5:已还原)',
  850. `create_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人ID',
  851. `update_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '修改人ID',
  852. `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  853. `update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  854. `recycle_note` VARCHAR(512) NULL DEFAULT NULL COMMENT '回收说明',
  855. `remark` VARCHAR(512) NULL DEFAULT NULL COMMENT '备注',
  856. `recycle_response` VARCHAR(512) NULL DEFAULT NULL COMMENT '回收响应信息',
  857. `restore_custom` VARCHAR(64) NULL DEFAULT NULL COMMENT '还原定制化方式',
  858. `deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '删除(0正常,1已删除)',
  859. PRIMARY KEY (`id`)
  860. )
  861. COMMENT='垃圾回收任务表'
  862. COLLATE='utf8mb4_general_ci'
  863. ENGINE=InnoDB
  864. ;
  865. -- 创建系统版本控制表
  866. CREATE TABLE if not exists system_version
  867. (
  868. id INT(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  869. version INT(10) NOT NULL DEFAULT '0' COMMENT '版本号',
  870. create_time TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  871. create_user_id BIGINT(20) NULL DEFAULT '0' COMMENT '创建用户ID',
  872. update_time TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  873. update_user_id BIGINT(20) NULL DEFAULT '0' COMMENT '更新用户ID',
  874. deleted BIT(1) NULL DEFAULT b'0' COMMENT '0正常,1已删除',
  875. PRIMARY KEY (`id`) USING BTREE,
  876. UNIQUE INDEX `version` (`version`) USING BTREE
  877. )
  878. comment '系统版本控制表' charset = utf8mb4;
  879. -- 度量管理表
  880. create table if not exists pt_measure
  881. (
  882. id bigint(20) NOT NULL AUTO_INCREMENT primary key,
  883. name varchar(32) NOT NULL COMMENT '度量名称',
  884. dataset_id bigint(20) NOT NULL COMMENT '数据集id',
  885. dataset_url varchar(32) DEFAULT NULL COMMENT '数据集url',
  886. model_urls TEXT DEFAULT NULL COMMENT '模型url',
  887. measure_status tinyint(1) NOT NULL DEFAULT '0' COMMENT '度量文件生成状态,0:生成中,1:生成成功,2:生成失败',
  888. url varchar(200) DEFAULT NULL COMMENT '度量文件路径',
  889. origin_user_id bigint(20) DEFAULT NULL COMMENT '资源拥有人ID',
  890. create_user_id bigint(20) DEFAULT NULL COMMENT '创建人',
  891. update_user_id bigint(20) DEFAULT NULL COMMENT '更新人',
  892. create_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  893. update_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  894. description varchar(512) DEFAULT NULL COMMENT '度量描述',
  895. deleted tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除(0正常,1已删除)'
  896. )
  897. COMMENT ='度量管理表' charset = utf8mb4;
  898. create index user_id
  899. on pt_measure (create_user_id);
  900. -- 批量服务表
  901. CREATE TABLE IF NOT EXISTS serving_batch (
  902. id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  903. name VARCHAR(255) NULL DEFAULT NULL COMMENT '服务名称',
  904. resource_info VARCHAR(16) NULL DEFAULT NULL COMMENT '资源信息',
  905. model_resource TINYINT(8) NULL DEFAULT NULL COMMENT '模型来源(1-预置模型,0-我的模型)',
  906. model_id BIGINT(20) NULL DEFAULT NULL COMMENT '模型id',
  907. model_branch_id BIGINT(20) NULL DEFAULT NULL COMMENT '模型对应版本id',
  908. model_address VARCHAR(255) NULL DEFAULT NULL COMMENT '模型地址',
  909. input_path VARCHAR(255) NULL DEFAULT NULL COMMENT '输入数据目录',
  910. output_path VARCHAR(255) NULL DEFAULT NULL COMMENT '输出数据目录',
  911. status VARCHAR(8) NULL DEFAULT NULL COMMENT '服务状态:0为失败,1为部署中,2为运行中,3为停止,4为完成,5为未知)',
  912. status_detail json DEFAULT NULL COMMENT '状态对应的详情信息',
  913. progress VARCHAR(255) NULL DEFAULT NULL COMMENT '进度',
  914. start_time DATETIME NULL DEFAULT NULL COMMENT '任务开始时间',
  915. end_time DATETIME NULL DEFAULT NULL COMMENT '任务结束时间',
  916. resources_pool_node VARCHAR(255) NULL DEFAULT NULL COMMENT '节点个数',
  917. resources_pool_type TINYINT(4) NULL DEFAULT NULL COMMENT '节点类型(0为CPU,1为GPU)',
  918. resources_pool_specs VARCHAR(255) NULL DEFAULT NULL COMMENT '节点规格',
  919. pool_specs_info VARCHAR(255) NULL DEFAULT NULL COMMENT '规格信息',
  920. deploy_params JSON NULL DEFAULT NULL COMMENT '部署参数',
  921. frame_type TINYINT(4) NULL DEFAULT NULL COMMENT '框架类型',
  922. description VARCHAR(255) NULL DEFAULT NULL COMMENT '描述',
  923. image VARCHAR(255) NULL DEFAULT NULL COMMENT '镜像',
  924. image_name VARCHAR(255) NULL DEFAULT NULL COMMENT '镜像名称',
  925. image_tag VARCHAR(255) NULL DEFAULT NULL COMMENT '镜像版本',
  926. algorithm_id INT NULL DEFAULT NULL COMMENT '算法ID',
  927. use_script BIT(1) NULL DEFAULT b'0' COMMENT '是否使用脚本',
  928. script_path VARCHAR(255) NULL DEFAULT NULL COMMENT '推理脚本路径',
  929. origin_user_id BIGINT(20) NULL COMMENT '资源用有人ID',
  930. create_time TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
  931. create_user_id BIGINT(20) NULL DEFAULT NULL,
  932. update_time TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  933. update_user_id BIGINT(20) NULL DEFAULT NULL,
  934. deleted BIT(1) NULL DEFAULT b'0',
  935. PRIMARY KEY (id) USING BTREE,
  936. INDEX model_id (model_id),
  937. INDEX status (status),
  938. INDEX deleted (deleted)
  939. )
  940. COMMENT='云端Serving批量服务业务表'
  941. COLLATE='utf8_general_ci'
  942. ENGINE=InnoDB
  943. ROW_FORMAT=DYNAMIC
  944. ;
  945. -- 在线服务表
  946. CREATE TABLE IF NOT EXISTS serving_info (
  947. id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  948. name VARCHAR(255) NULL DEFAULT NULL COMMENT '服务名称',
  949. uuid VARCHAR(255) NULL DEFAULT NULL COMMENT '服务请求接口uuid',
  950. status VARCHAR(8) NULL DEFAULT NULL COMMENT '服务状态:0-异常,1-部署中,2-运行中,3-已停止',
  951. status_detail json DEFAULT NULL COMMENT '状态对应的详情信息',
  952. type TINYINT(4) NULL DEFAULT NULL COMMENT '服务类型:0-Restful,1-gRPC',
  953. model_resource TINYINT(1) NULL DEFAULT NULL COMMENT '模型来源(1-预置模型,0-我的模型)',
  954. running_node TINYINT(3) UNSIGNED NULL DEFAULT '0' COMMENT '运行节点数',
  955. total_node TINYINT(3) UNSIGNED NULL DEFAULT '0' COMMENT '服务总节点数',
  956. description VARCHAR(255) NULL DEFAULT NULL COMMENT '描述',
  957. origin_user_id BIGINT(20) NULL COMMENT '资源用有人ID',
  958. create_time TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
  959. create_user_id BIGINT(20) NULL DEFAULT NULL,
  960. update_time TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  961. update_user_id BIGINT(20) NULL DEFAULT NULL,
  962. deleted BIT(1) NULL DEFAULT b'0',
  963. PRIMARY KEY (id) USING BTREE,
  964. INDEX uuid (uuid),
  965. INDEX status (status),
  966. INDEX type (type),
  967. INDEX model_resource (model_resource),
  968. INDEX deleted (deleted)
  969. )
  970. COMMENT='云端Serving在线服务业务表'
  971. COLLATE='utf8_general_ci'
  972. ENGINE=InnoDB
  973. ROW_FORMAT=DYNAMIC
  974. ;
  975. -- 在线服务模型部署信息表
  976. CREATE TABLE IF NOT EXISTS serving_model_config (
  977. id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  978. serving_id BIGINT(20) NOT NULL COMMENT 'Serving信息id',
  979. model_id BIGINT(20) NULL DEFAULT NULL COMMENT '模型id',
  980. model_branch_id BIGINT(20) NULL DEFAULT NULL COMMENT '模型对应版本id',
  981. model_address VARCHAR(255) NULL DEFAULT NULL COMMENT '模型路径',
  982. release_rate VARCHAR(255) NULL DEFAULT NULL COMMENT '灰度发布分流(%)',
  983. resources_pool_type TINYINT(4) NULL DEFAULT NULL COMMENT '节点类型(0为CPU,1为GPU)',
  984. resources_pool_specs VARCHAR(255) NULL DEFAULT NULL COMMENT '节点规格',
  985. resources_pool_node VARCHAR(255) NULL DEFAULT NULL COMMENT '节点个数',
  986. url VARCHAR(255) NULL DEFAULT NULL COMMENT '模型部署url',
  987. frame_type TINYINT(4) NULL DEFAULT NULL COMMENT '框架类型',
  988. model_resource TINYINT(4) NULL DEFAULT NULL COMMENT '模型来源(0-我的模型,1-预置模型)',
  989. resource_info VARCHAR(16) NULL DEFAULT NULL COMMENT '资源信息',
  990. pool_specs_info VARCHAR(255) NULL DEFAULT NULL COMMENT '规格信息',
  991. deploy_params JSON NULL DEFAULT NULL COMMENT '部署参数',
  992. deploy_id VARCHAR(32) NULL DEFAULT NULL COMMENT '部署id(用于回滚)',
  993. model_version VARCHAR(8) NULL DEFAULT NULL COMMENT '模型版本',
  994. model_name VARCHAR(255) NULL DEFAULT NULL COMMENT '模型名称',
  995. ready_replicas TINYINT(4) NULL DEFAULT NULL COMMENT 'deployment已 Running的pod数',
  996. image VARCHAR(255) NULL DEFAULT NULL COMMENT '镜像',
  997. image_name VARCHAR(255) NULL DEFAULT NULL COMMENT '镜像名称',
  998. image_tag VARCHAR(255) NULL DEFAULT NULL COMMENT '镜像版本',
  999. algorithm_id INT NULL DEFAULT NULL COMMENT '算法ID',
  1000. use_script BIT(1) NULL DEFAULT b'0' COMMENT '是否使用脚本',
  1001. script_path VARCHAR(255) NULL DEFAULT NULL COMMENT '推理脚本路径',
  1002. create_user_id BIGINT(20) NULL DEFAULT NULL,
  1003. create_time TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
  1004. update_user_id BIGINT(20) NULL DEFAULT NULL,
  1005. update_time TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  1006. deleted BIT(1) NULL DEFAULT b'0',
  1007. PRIMARY KEY (id) USING BTREE,
  1008. INDEX serving_id (serving_id) USING BTREE,
  1009. INDEX model_id (model_id),
  1010. INDEX deleted (deleted)
  1011. )
  1012. COMMENT='云端Serving在线服务模型部署业务表'
  1013. COLLATE='utf8_general_ci'
  1014. ENGINE=InnoDB
  1015. ROW_FORMAT=DYNAMIC
  1016. ;
  1017. -- 模型优化内置算法、模型、数据集关系表
  1018. CREATE TABLE IF NOT EXISTS model_opt_build_in (
  1019. id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  1020. type TINYINT(4) NOT NULL COMMENT '算法类型(0-剪枝,1-蒸馏,2-量化)',
  1021. algorithm VARCHAR(255) NULL DEFAULT NULL COMMENT '算法名称',
  1022. algorithm_path VARCHAR(255) NULL DEFAULT NULL COMMENT '算法路径',
  1023. dataset VARCHAR(255) NULL DEFAULT NULL COMMENT '数据集名称',
  1024. dataset_path VARCHAR(255) NULL DEFAULT NULL COMMENT '数据集路径',
  1025. model VARCHAR(255) NULL DEFAULT NULL COMMENT '模型名称',
  1026. model_path VARCHAR(255) NULL DEFAULT NULL COMMENT '模型路径',
  1027. create_user_id BIGINT(20) NULL DEFAULT NULL COMMENT '创建用户ID',
  1028. create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1029. update_user_id BIGINT(20) NULL DEFAULT NULL COMMENT '更新用户ID',
  1030. update_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  1031. deleted BIT(1) NULL DEFAULT b'0' COMMENT '0正常,1已删除',
  1032. PRIMARY KEY (id) USING BTREE
  1033. )
  1034. COMMENT='模型优化内置算法、模型、数据集关系表'
  1035. COLLATE='utf8_general_ci'
  1036. ENGINE=InnoDB
  1037. ROW_FORMAT=DYNAMIC
  1038. ;
  1039. -- 模型优化用户数据集表
  1040. CREATE TABLE IF NOT EXISTS model_opt_dataset (
  1041. id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  1042. name VARCHAR(255) NOT NULL COMMENT '名称',
  1043. path VARCHAR(255) NOT NULL COMMENT '路径',
  1044. create_user_id BIGINT(20) NULL DEFAULT NULL COMMENT '创建人',
  1045. create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1046. update_user_id BIGINT(20) NULL DEFAULT NULL COMMENT '修改人',
  1047. update_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  1048. deleted BIT(1) NOT NULL DEFAULT b'0' COMMENT '0正常,1已删除',
  1049. PRIMARY KEY (id)
  1050. )
  1051. COMMENT='模型优化用户数据集表'
  1052. COLLATE='utf8_general_ci'
  1053. ENGINE=InnoDB
  1054. ;
  1055. -- 模型优化任务表
  1056. CREATE TABLE IF NOT EXISTS model_opt_task (
  1057. id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '任务ID主键',
  1058. name VARCHAR(100) NOT NULL COMMENT '任务名称',
  1059. description VARCHAR(1024) NULL DEFAULT NULL COMMENT '任务描述',
  1060. is_built_in BIT(1) NOT NULL COMMENT '是否内置',
  1061. model_id BIGINT(20) NULL DEFAULT NULL COMMENT '模型id',
  1062. model_name VARCHAR(255) NULL DEFAULT NULL COMMENT '模型名称',
  1063. model_address VARCHAR(255) NULL DEFAULT NULL COMMENT '模型路径',
  1064. algorithm_id BIGINT(20) NULL DEFAULT NULL COMMENT '优化算法id',
  1065. algorithm_type TINYINT(4) NULL DEFAULT NULL COMMENT '优化算法类型',
  1066. algorithm_name VARCHAR(255) NULL DEFAULT NULL COMMENT '优化算法',
  1067. algorithm_path VARCHAR(255) NULL DEFAULT NULL COMMENT '算法路径',
  1068. dataset_id BIGINT(20) NULL DEFAULT NULL COMMENT '数据集id',
  1069. dataset_name VARCHAR(255) NULL DEFAULT NULL COMMENT '数据集名称',
  1070. dataset_path VARCHAR(255) NULL DEFAULT NULL COMMENT '数据集路径',
  1071. command TEXT NULL COMMENT '运行命令',
  1072. params JSON NULL DEFAULT NULL COMMENT '运行参数',
  1073. origin_user_id BIGINT(20) NULL COMMENT '资源用有人ID',
  1074. create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1075. create_user_id BIGINT(20) NULL DEFAULT NULL COMMENT '创建人',
  1076. update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  1077. update_user_id BIGINT(20) NULL DEFAULT NULL COMMENT '修改人',
  1078. deleted BIT(1) NOT NULL DEFAULT b'0' COMMENT '删除标志',
  1079. PRIMARY KEY (id) USING BTREE,
  1080. INDEX name (name) USING BTREE,
  1081. INDEX algorithm_type (algorithm_type) USING BTREE,
  1082. INDEX create_time (create_time) USING BTREE
  1083. )
  1084. COMMENT='模型优化任务表'
  1085. COLLATE='utf8_general_ci'
  1086. ENGINE=InnoDB
  1087. ROW_FORMAT=DYNAMIC
  1088. ;
  1089. -- 模型优化任务实例记录表
  1090. CREATE TABLE IF NOT EXISTS model_opt_task_instance (
  1091. id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  1092. task_id BIGINT(20) NOT NULL COMMENT '任务Id',
  1093. task_name VARCHAR(127) NULL DEFAULT NULL COMMENT '任务名称',
  1094. is_built_in BIT(1) NULL DEFAULT NULL COMMENT '是否内置',
  1095. model_id BIGINT(20) NULL DEFAULT NULL COMMENT '模型id',
  1096. model_name VARCHAR(255) NULL DEFAULT NULL COMMENT '模型名称',
  1097. model_address VARCHAR(255) NULL DEFAULT NULL COMMENT '模型路径',
  1098. algorithm_id BIGINT(20) NULL DEFAULT NULL COMMENT '优化算法id',
  1099. algorithm_type TINYINT(4) NULL DEFAULT NULL COMMENT '优化算法类型',
  1100. algorithm_name VARCHAR(255) NULL DEFAULT NULL COMMENT '算法路径',
  1101. algorithm_path VARCHAR(255) NULL DEFAULT NULL COMMENT '使用类型 0-内置 1-我的',
  1102. dataset_id BIGINT(20) NULL DEFAULT NULL COMMENT '数据集id',
  1103. dataset_name VARCHAR(255) NULL DEFAULT NULL COMMENT '数据集名称',
  1104. dataset_path VARCHAR(255) NULL DEFAULT NULL COMMENT '数据集路径',
  1105. start_time DATETIME NULL DEFAULT NULL COMMENT '任务实例开始时间',
  1106. end_time DATETIME NULL DEFAULT NULL COMMENT '任务实例结束时间',
  1107. output_model_dir VARCHAR(255) NULL DEFAULT '0' COMMENT '输出模型路径',
  1108. log_path VARCHAR(255) NULL DEFAULT NULL COMMENT '日志地址',
  1109. status VARCHAR(8) NOT NULL DEFAULT '-1' COMMENT '-1-等待中,0-进行中,1-已完成,2-已取消,3-执行失败',
  1110. status_detail json DEFAULT NULL COMMENT '状态对应的详情信息',
  1111. command TEXT NULL COMMENT '运行命令',
  1112. params JSON NULL DEFAULT NULL COMMENT '运行参数',
  1113. opt_result_before MEDIUMTEXT NULL COMMENT '模型优化前性能参数',
  1114. opt_result_json_path_before VARCHAR(255) NULL DEFAULT NULL COMMENT '模型优化前性能参数json文件路径',
  1115. opt_result_after MEDIUMTEXT NULL COMMENT '模型优化后性能参数',
  1116. opt_result_json_path_after VARCHAR(255) NULL DEFAULT NULL COMMENT '模型优化后性能参数json文件路径',
  1117. origin_user_id BIGINT(20) NULL COMMENT '资源用有人ID',
  1118. create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1119. create_user_id BIGINT(20) NULL DEFAULT NULL COMMENT '创建人',
  1120. update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  1121. update_user_id BIGINT(20) NULL DEFAULT NULL COMMENT '修改人',
  1122. deleted BIT(1) NOT NULL DEFAULT b'0' COMMENT '删除标识:0-未删除,1-删除',
  1123. PRIMARY KEY (id) USING BTREE,
  1124. INDEX task_id (task_id) USING BTREE,
  1125. INDEX status (status) USING BTREE,
  1126. INDEX name (task_name) USING BTREE,
  1127. INDEX model_type (model_name) USING BTREE,
  1128. INDEX algorithm_type (algorithm_type) USING BTREE,
  1129. INDEX start_time (start_time) USING BTREE,
  1130. INDEX end_time (end_time) USING BTREE
  1131. )
  1132. COMMENT='模型优化任务实例记录表'
  1133. COLLATE='utf8_general_ci'
  1134. ENGINE=InnoDB
  1135. ROW_FORMAT=DYNAMIC
  1136. ;
  1137. CREATE TABLE `recycle` (
  1138. `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  1139. `recycle_module` VARCHAR(32) NOT NULL COMMENT '回收模块',
  1140. `recycle_delay_date` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '回收日期',
  1141. `recycle_custom` VARCHAR(64) NULL DEFAULT NULL COMMENT '回收定制化方式',
  1142. `recycle_status` TINYINT(4) NULL DEFAULT '0' COMMENT '回收任务状态(0:待删除,1:已删除,2:删除失败,3:删除中,4:还原中,5:已还原)',
  1143. `create_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人ID',
  1144. `update_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '修改人ID',
  1145. `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1146. `update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  1147. `recycle_note` VARCHAR(512) NULL DEFAULT NULL COMMENT '回收说明',
  1148. `remark` VARCHAR(512) NULL DEFAULT NULL COMMENT '备注',
  1149. `recycle_response` VARCHAR(512) NULL DEFAULT NULL COMMENT '回收响应信息',
  1150. `restore_custom` VARCHAR(64) NULL DEFAULT NULL COMMENT '还原定制化方式',
  1151. `deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '删除(0正常,1已删除)',
  1152. PRIMARY KEY (`id`)
  1153. )
  1154. COMMENT='垃圾回收任务主表'
  1155. COLLATE='utf8mb4_general_ci'
  1156. ENGINE=InnoDB
  1157. ;
  1158. CREATE TABLE `recycle_detail` (
  1159. `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  1160. `recycle_id` BIGINT(20) NOT NULL COMMENT '垃圾回收任务主表ID',
  1161. `recycle_type` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '回收类型(0文件,1数据库表数据)',
  1162. `recycle_condition` TEXT NOT NULL COMMENT '回收条件(回收表数据sql、回收文件绝对路径)',
  1163. `recycle_status` TINYINT(4) NULL DEFAULT '0' COMMENT '回收任务状态(0:待删除,1:已删除,2:删除失败,3:删除中)',
  1164. `create_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人ID',
  1165. `update_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '修改人ID',
  1166. `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1167. `update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  1168. `recycle_note` VARCHAR(512) NULL DEFAULT NULL COMMENT '回收说明',
  1169. `remark` VARCHAR(512) NULL DEFAULT NULL COMMENT '备注',
  1170. `recycle_response` VARCHAR(512) NULL DEFAULT NULL COMMENT '回收响应信息',
  1171. `deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '删除(0正常,1已删除)',
  1172. PRIMARY KEY (`id`),
  1173. INDEX `recycle_task_main_id` (`recycle_id`)
  1174. )
  1175. COMMENT='垃圾回收任务详情表'
  1176. COLLATE='utf8mb4_general_ci'
  1177. ENGINE=InnoDB
  1178. ;
  1179. -- auth服务 token存储
  1180. CREATE TABLE IF NOT EXISTS `oauth_access_token` (
  1181. `token_id` varchar(256) DEFAULT NULL,
  1182. `token` blob,
  1183. `authentication_id` varchar(256) DEFAULT NULL,
  1184. `user_name` varchar(256) DEFAULT NULL,
  1185. `client_id` varchar(256) DEFAULT NULL,
  1186. `authentication` blob,
  1187. `refresh_token` varchar(256) DEFAULT NULL
  1188. ) comment 'auth token存储表' ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1189. -- auth服务 客户端权限配置
  1190. CREATE TABLE IF NOT EXISTS `oauth_client_details` (
  1191. `client_id` varchar(256) NOT NULL,
  1192. `resource_ids` varchar(256) DEFAULT NULL,
  1193. `client_secret` varchar(256) DEFAULT NULL,
  1194. `scope` varchar(256) DEFAULT NULL,
  1195. `authorized_grant_types` varchar(256) DEFAULT NULL,
  1196. `web_server_redirect_uri` varchar(256) DEFAULT NULL,
  1197. `authorities` varchar(256) DEFAULT NULL,
  1198. `access_token_validity` int(11) DEFAULT NULL,
  1199. `refresh_token_validity` int(11) DEFAULT NULL,
  1200. `additional_information` varchar(4096) DEFAULT NULL,
  1201. `autoapprove` varchar(256) DEFAULT NULL,
  1202. PRIMARY KEY (`client_id`) USING BTREE
  1203. ) comment '客户端权限配置表' ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  1204. -- auth服务 权限token刷新
  1205. CREATE TABLE IF NOT EXISTS `oauth_refresh_token` (
  1206. `token_id` varchar(256) DEFAULT NULL,
  1207. `token` blob,
  1208. `authentication` blob
  1209. ) comment '权限token刷新表' ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1210. -- 操作权限表
  1211. CREATE TABLE if not exists `permission` (
  1212. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  1213. `pid` bigint(20) NOT NULL DEFAULT '0' COMMENT '父id',
  1214. `name` varchar(64) DEFAULT NULL COMMENT '菜单/操作按钮名称',
  1215. `permission` varchar(128) DEFAULT NULL COMMENT '权限标识',
  1216. `create_user_id` bigint(20) DEFAULT NULL COMMENT '创建人id',
  1217. `update_user_id` bigint(20) DEFAULT NULL COMMENT '修改人id',
  1218. `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  1219. `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  1220. `deleted` bit(1) DEFAULT b'0' COMMENT '删除标记 0正常,1已删除',
  1221. PRIMARY KEY (`id`)
  1222. )
  1223. ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='权限表';
  1224. -- 角色权限组关联表
  1225. create table if not exists `roles_auth`(
  1226. role_id bigint not null,
  1227. auth_id bigint null
  1228. )ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='角色权限关联表';
  1229. -- 用户组表
  1230. CREATE TABLE if not exists `pt_group`
  1231. (
  1232. id BIGINT(20) not null auto_increment primary key,
  1233. name varchar(32) default null comment '用户组名称',
  1234. description varchar(255) default null comment '备注',
  1235. create_user_id bigint null comment '创建人id',
  1236. update_user_id bigint null comment '修改人id',
  1237. create_time datetime default CURRENT_TIMESTAMP null,
  1238. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP,
  1239. deleted bit default b'0' null comment '删除标记 0正常,1已删除'
  1240. ) ENGINE = InnoDB
  1241. DEFAULT CHARSET = utf8
  1242. ROW_FORMAT = DYNAMIC COMMENT ='用户组表';
  1243. create unique index group_name_uindex
  1244. on pt_group (name);
  1245. -- 用户组-用户关联表
  1246. create table if not exists `user_group`(
  1247. group_id BIGINT(20) not null comment '用户组id',
  1248. user_id bigint(20) not null comment '用户id'
  1249. )
  1250. comment '用户组-用户关联表' charset =utf8;
  1251. create index group_user_group_id
  1252. on user_group (group_id);
  1253. create unique index group_user_user_id
  1254. on user_group (user_id);
  1255. create table if not exists `auth`(
  1256. id bigint auto_increment
  1257. primary key,
  1258. auth_code varchar(32) not null comment '权限code',
  1259. description varchar(255) null comment '描述',
  1260. create_user_id bigint null comment '创建人id',
  1261. update_user_id bigint null comment '修改人id',
  1262. create_time datetime default CURRENT_TIMESTAMP null,
  1263. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP,
  1264. deleted bit default b'0' null comment '删除标记 0正常,1已删除'
  1265. )
  1266. comment '权限管理表';
  1267. create index auth_index_auth_code
  1268. on auth (auth_code);
  1269. create table if not exists `auth_permission`
  1270. (
  1271. auth_id bigint not null,
  1272. permission_id bigint not null
  1273. )
  1274. comment '权限组-权限关联表';
  1275. create table if not exists resource_specs
  1276. (
  1277. id int auto_increment comment '主键ID'
  1278. primary key,
  1279. specs_name varchar(128) default '' not null comment '规格名称',
  1280. resources_pool_type tinyint(1) default 0 not null comment '规格类型(0为CPU, 1为GPU)',
  1281. module int not null comment '所属业务场景(0:通用,1:dubhe-notebook,2:dubhe-train,3:dubhe-serving)',
  1282. cpu_num int not null comment 'CPU数量,单位:核',
  1283. gpu_num int not null comment 'GPU数量,单位:核',
  1284. mem_num int not null comment '内存大小,单位:M',
  1285. workspace_request int not null comment '工作空间的存储配额,单位:M',
  1286. create_user_id bigint null comment '创建人',
  1287. create_time timestamp null comment '创建时间',
  1288. update_user_id bigint null comment '更新人',
  1289. update_time timestamp null comment '更新时间',
  1290. deleted tinyint(1) default 0 not null comment '删除(0正常,1已删除)'
  1291. )
  1292. comment '资源规格';
  1293. create table if not exists `tadl_algorithm` (
  1294. `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  1295. `name` VARCHAR(64) NOT NULL COMMENT '算法名称' COLLATE 'utf8_general_ci',
  1296. `model_type` INT(11) NOT NULL COMMENT '模型类别',
  1297. `algorithm_version_id` BIGINT(20) NULL DEFAULT NULL COMMENT '算法版本id',
  1298. `description` VARCHAR(255) NULL DEFAULT NULL COMMENT '算法描述' COLLATE 'utf8_general_ci',
  1299. `create_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人',
  1300. `update_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人',
  1301. `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1302. `deleted` BIT(1) NOT NULL DEFAULT b'0' COMMENT '删除(0:正常,1:删除)',
  1303. `update_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  1304. `default_metric` VARCHAR(64) NOT NULL COMMENT '默认主要指标' COLLATE 'utf8_general_ci',
  1305. `one_shot` BIT(1) NOT NULL DEFAULT b'0' COMMENT '是否oneshot',
  1306. `algorithm_type` VARCHAR(50) NOT NULL COMMENT '算法类型' COLLATE 'utf8_general_ci',
  1307. `platform` VARCHAR(64) NOT NULL COMMENT '算法框架' COLLATE 'utf8_general_ci',
  1308. `platform_version` VARCHAR(64) NOT NULL COMMENT '算法框架版本' COLLATE 'utf8_general_ci',
  1309. `gpu` BIT(1) NULL DEFAULT b'0' COMMENT '是否支持gpu计算(0支持,1不支持)',
  1310. PRIMARY KEY (`id`) USING BTREE
  1311. )
  1312. COMMENT='tadl 算法表'
  1313. COLLATE='utf8_general_ci'
  1314. ENGINE=InnoDB
  1315. AUTO_INCREMENT=1
  1316. ;
  1317. create table if not exists `tadl_algorithm_stage` (
  1318. `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '算法阶段id',
  1319. `name` VARCHAR(64) NOT NULL COMMENT '阶段名称' COLLATE 'utf8_general_ci',
  1320. `stage_order` TINYINT(4) NOT NULL COMMENT '阶段排序',
  1321. `algorithm_id` BIGINT(20) NULL DEFAULT NULL COMMENT '算法id',
  1322. `algorithm_version_id` BIGINT(20) NULL DEFAULT NULL COMMENT '算法版本',
  1323. `dataset_name` VARCHAR(64) NULL DEFAULT NULL COMMENT '数据集ID' COLLATE 'utf8_general_ci',
  1324. `dataset_id` BIGINT(20) NULL DEFAULT NULL COMMENT '数据集id',
  1325. `dataset_version` VARCHAR(64) NULL DEFAULT NULL COMMENT '数据集版本id' COLLATE 'utf8_general_ci',
  1326. `dataset_path` VARCHAR(255) NOT NULL COMMENT '数据集路径' COLLATE 'utf8_general_ci',
  1327. `python_version` VARCHAR(64) NULL DEFAULT NULL COMMENT 'command命令所使用的python环境' COLLATE 'utf8_general_ci',
  1328. `execute_script` VARCHAR(64) NULL DEFAULT NULL COMMENT 'command命令所使用py文件' COLLATE 'utf8_general_ci',
  1329. `multi_gpu` BIT(1) NOT NULL DEFAULT b'0' COMMENT '是否支持多卡训练(0支持,1不支持)',
  1330. `max_trial_num` INT(11) NOT NULL COMMENT '默认最大运行次数',
  1331. `max_exec_duration` DECIMAL(20,4) NOT NULL COMMENT '当前阶段默认最大执行时间',
  1332. `trial_concurrent_num` INT(11) NOT NULL COMMENT 'trial默认并发数量',
  1333. `max_exec_duration_unit` VARCHAR(64) NULL DEFAULT NULL COMMENT '最大运行时间单位\n年(y)\n月(m)\n周(w)\n日(d)\n小时(h)\n分钟(min)\n秒(s)\n毫秒(ms)\n微秒(us)\n纳秒(ns)\n皮秒(ps)\n飞秒(fs)' COLLATE 'utf8_general_ci',
  1334. `create_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人',
  1335. `create_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1336. `update_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人',
  1337. `update_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  1338. `deleted` BIT(1) NOT NULL COMMENT '是否删除(0正常,1删除)',
  1339. PRIMARY KEY (`id`) USING BTREE
  1340. )
  1341. COMMENT='tadl算法阶段表'
  1342. COLLATE='utf8_general_ci'
  1343. ENGINE=InnoDB
  1344. AUTO_INCREMENT=1
  1345. ;
  1346. create table if not exists `tadl_algorithm_version` (
  1347. `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '算法版本id',
  1348. `algorithm_id` BIGINT(20) NULL DEFAULT NULL COMMENT '算法id',
  1349. `version_name` VARCHAR(64) NULL DEFAULT NULL COMMENT '版本名称' COLLATE 'utf8_general_ci',
  1350. `description` VARCHAR(255) NULL DEFAULT NULL COMMENT '版本说明' COLLATE 'utf8_general_ci',
  1351. `version_source` VARCHAR(64) NULL DEFAULT NULL COMMENT '版本来源' COLLATE 'utf8_general_ci',
  1352. `data_conversion` INT(11) NOT NULL DEFAULT '0',
  1353. `create_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1354. `deleted` BIT(1) NOT NULL DEFAULT b'0' COMMENT '是否删除(0正常,1删除)',
  1355. `create_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人',
  1356. `update_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人',
  1357. `update_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  1358. PRIMARY KEY (`id`) USING BTREE
  1359. )
  1360. COMMENT='tadl 算法版本表'
  1361. COLLATE='utf8_general_ci'
  1362. ENGINE=InnoDB
  1363. AUTO_INCREMENT=1
  1364. ;
  1365. create table if not exists `tadl_experiment` (
  1366. `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  1367. `name` VARCHAR(64) NOT NULL COMMENT '实验名称' COLLATE 'utf8_general_ci',
  1368. `description` VARCHAR(255) NULL DEFAULT NULL COMMENT '实验描述' COLLATE 'utf8_general_ci',
  1369. `algorithm_id` BIGINT(20) NOT NULL COMMENT '算法id',
  1370. `algorithm_version_id` BIGINT(20) NOT NULL COMMENT '算法版本id',
  1371. `model_type` INT(11) NULL DEFAULT NULL COMMENT '模型类型',
  1372. `status` INT(11) NOT NULL COMMENT '实验状态:(\n待运行:101,\n等待中:102,\n运行中:103,\n已暂停:104,\n已完成:202,\n运行失败:203\n)',
  1373. `status_detail` JSON NULL DEFAULT NULL COMMENT '状态详情',
  1374. `update_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人',
  1375. `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1376. `update_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  1377. `start_time` TIMESTAMP NULL DEFAULT NULL COMMENT '启动时间',
  1378. `end_time` TIMESTAMP NULL DEFAULT NULL COMMENT '结束时间',
  1379. `deleted` BIT(1) NULL DEFAULT b'0' COMMENT '是否删除(0正常,1删除)',
  1380. `create_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人',
  1381. PRIMARY KEY (`id`) USING BTREE,
  1382. INDEX `tadl_experiment_name` (`name`) USING BTREE
  1383. )
  1384. COMMENT='tadl实验表'
  1385. COLLATE='utf8_general_ci'
  1386. ENGINE=InnoDB
  1387. AUTO_INCREMENT=1
  1388. ;
  1389. create table if not exists `tadl_experiment_stage` (
  1390. `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  1391. `experiment_id` BIGINT(20) NOT NULL COMMENT '实验id',
  1392. `algorithm_stage_id` VARCHAR(64) NOT NULL COMMENT '算法阶段ID' COLLATE 'utf8_general_ci',
  1393. `stage_name` VARCHAR(64) NULL DEFAULT NULL COMMENT '阶段名称' COLLATE 'utf8_general_ci',
  1394. `stage_order` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '阶段在实验中所处的先后顺序',
  1395. `resource_id` INT(11) NULL DEFAULT NULL COMMENT '实验资源配置id',
  1396. `resource_Name` VARCHAR(255) NULL DEFAULT NULL COMMENT '实验资源值' COLLATE 'utf8_general_ci',
  1397. `max_trial_num` INT(11) NOT NULL COMMENT '最大trail次数',
  1398. `trial_concurrent_num` INT(11) NOT NULL COMMENT 'trail并发数量',
  1399. `max_exec_duration` DECIMAL(20,4) NOT NULL DEFAULT '0.0000' COMMENT '最大运行时间',
  1400. `status` INT(11) NULL DEFAULT NULL COMMENT '实验阶段状态状态 (101:待运行,102:运行中,201:已完成,202:运行失败)',
  1401. `update_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  1402. `create_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人',
  1403. `update_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人',
  1404. `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1405. `deleted` BIT(1) NOT NULL DEFAULT b'0' COMMENT '是否删除(0正常,1删除)',
  1406. `start_time` TIMESTAMP NULL DEFAULT NULL COMMENT '启动时间',
  1407. `begin_time` TIMESTAMP NULL DEFAULT NULL COMMENT '每次开始运行的时间',
  1408. `end_time` TIMESTAMP NULL DEFAULT NULL COMMENT '结束时间',
  1409. `max_exec_duration_unit` VARCHAR(64) NULL DEFAULT NULL COMMENT '最大运行时间单位\n年(y)\n月(m)\n周(w)\n日(d)\n小时(h)\n分钟(min)\n秒(s)\n毫秒(ms)\n微秒(us)\n纳秒(ns)\n皮秒(ps)\n飞秒(fs)' COLLATE 'utf8_general_ci',
  1410. `run_time` BIGINT(32) NULL DEFAULT '0' COMMENT '暂停前已经运行的时间',
  1411. PRIMARY KEY (`id`) USING BTREE,
  1412. INDEX `tadl_experiment_stage_experiment_id_stage_order_index` (`experiment_id`, `stage_order`) USING BTREE
  1413. )
  1414. COMMENT='tadl实验阶段表'
  1415. COLLATE='utf8_general_ci'
  1416. ENGINE=InnoDB
  1417. AUTO_INCREMENT=1
  1418. ;
  1419. create table if not exists `tadl_trial` (
  1420. `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  1421. `experiment_id` BIGINT(20) NOT NULL COMMENT '试验id',
  1422. `stage_id` VARCHAR(64) NULL DEFAULT NULL COMMENT '实验阶段ID' COLLATE 'latin1_swedish_ci',
  1423. `name` VARCHAR(64) NOT NULL COMMENT 'trial名称' COLLATE 'latin1_swedish_ci',
  1424. `start_time` TIMESTAMP NULL DEFAULT NULL COMMENT '开始时间',
  1425. `end_time` TIMESTAMP NULL DEFAULT NULL COMMENT '结束时间',
  1426. `status` INT(11) NOT NULL COMMENT 'trial状态 (101:待运行,102:等待中,103:运行中,201:已完成,202:运行失败,203:未知)',
  1427. `resource_name` VARCHAR(64) NULL DEFAULT NULL COMMENT 'k8s实验资源值' COLLATE 'latin1_swedish_ci',
  1428. `update_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  1429. `create_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人',
  1430. `update_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人',
  1431. `create_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1432. `deleted` BIT(1) NOT NULL DEFAULT b'0' COMMENT '是否删除(0正常,1删除)',
  1433. `sequence` INT(11) NOT NULL COMMENT '顺序',
  1434. PRIMARY KEY (`id`) USING BTREE
  1435. )
  1436. COMMENT='tadl 实验详情表'
  1437. COLLATE='latin1_swedish_ci'
  1438. ENGINE=InnoDB
  1439. AUTO_INCREMENT=1
  1440. ;
  1441. create table if not exists `tadl_trial_data` (
  1442. `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  1443. `experiment_id` BIGINT(20) NOT NULL COMMENT '实验id',
  1444. `stage_id` BIGINT(20) NOT NULL COMMENT '实验阶段ID',
  1445. `trial_id` BIGINT(20) NOT NULL COMMENT 'trial id',
  1446. `type` VARCHAR(64) NULL DEFAULT NULL COMMENT '指标类型' COLLATE 'utf8_general_ci',
  1447. `sequence` INT(11) NULL DEFAULT NULL COMMENT '序列',
  1448. `category` VARCHAR(64) NULL DEFAULT NULL COMMENT '类别' COLLATE 'utf8_general_ci',
  1449. `value` DECIMAL(17,14) NULL DEFAULT NULL COMMENT '最优数据',
  1450. `create_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1451. `update_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  1452. `create_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人',
  1453. `update_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人',
  1454. `deleted` BIT(1) NOT NULL DEFAULT b'0' COMMENT '是否删除(0正常,1删除)',
  1455. PRIMARY KEY (`id`) USING BTREE
  1456. )
  1457. COMMENT='tadl trial 运行结果表'
  1458. COLLATE='utf8_general_ci'
  1459. ENGINE=InnoDB
  1460. AUTO_INCREMENT=1
  1461. ;

一站式算法开发平台、高性能分布式深度学习框架、先进算法模型库、视觉模型炼知平台、数据可视化分析平台等一系列平台及工具,在模型高效分布式训练、数据处理和可视分析、模型炼知和轻量化等技术上形成独特优势,目前已在产学研等各领域近千家单位及个人提供AI应用赋能