Bonus-Cloud-AI-V2/sql/bonus_ai.sql

286 lines
16 KiB
MySQL
Raw Normal View History

2024-10-23 08:03:27 +08:00
/*==============================================================*/
/* Table: ai_annotation_task */
2024-10-23 08:03:27 +08:00
/*==============================================================*/
drop table if exists ai_annotation_task;
create table ai_annotation_task
2024-10-23 08:03:27 +08:00
(
2024-11-25 18:10:02 +08:00
task_id bigint(20) not null auto_increment comment '任务id',
dataset_id bigint(20) not null comment '数据集id',
task_name varchar(64) comment '任务名称',
task_uuid varchar(64) comment '任务唯一标识id',
description varchar(500) default '' comment '描述',
2024-11-27 12:19:34 +08:00
annotation_scene char(1) default '0' comment '标注场景(对应数据集的数据类型)',
annotation_type char(2) default '0' comment '标注类型(不同数据类型有不同的标注类型,如图片:图像分类,物体检测等)',
2024-11-25 18:10:02 +08:00
labels varchar(200) comment '允许的标签集',
2024-11-27 12:19:34 +08:00
is_annotation_team char(1) default '0' comment '标注团队id0未启用,1启用团队',
2024-11-25 18:10:02 +08:00
annotation_status char(1) default '0' comment '0未标注1正在标注2已标注3正在审核4已审核',
label_studio_project_id bigint(20) comment "label studio 对应的projectId"
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
2024-11-27 16:25:18 +08:00
start_time datetime default null comment '任务开始时间',
end_time datetime default null comment '任务结束时间',
2024-11-25 18:10:02 +08:00
create_by varchar(64) default '' comment '创建者',
update_by varchar(64) default '' comment '更新者',
update_time datetime default null comment '更新时间',
create_time datetime default null comment '创建时间',
primary key (task_id)
)engine=innodb comment = '标注任务';
/*==============================================================*/
/* Table: ai_annotation_task_annotator_map */
/*==============================================================*/
drop table if exists ai_annotation_task_annotator_map;
create table ai_annotation_task_annotator_map
2024-10-23 08:03:27 +08:00
(
annotator_id bigint(20) not null comment '标注人员',
reviewer_id bigint(20) not null comment '审核人员',
task_id bigint(20) not null comment '任务id',
file_id bigint(20) not null comment '文件id',
2024-11-25 18:10:02 +08:00
file_url varchar(200) default '' comment '文件网络路径',
label_studio_task_id bigint(20) comment "label studio 对应的taskId"
description varchar(500) default '' comment '描述',
2024-11-27 12:19:34 +08:00
annotation_status char(1) default '0' comment '0未标注1已标注2已审核3 审核驳回',
annotation_result text comment '标注结果(json串)',
2024-11-27 12:19:34 +08:00
annotation_resource char(1) default '0' comment '0人工标注1智能标注',
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
annotation_time datetime default null comment '标注时间',
review_time datetime default null comment '审核时间',
audit_failed_reason varchar(200) default '' comment '审核驳回原因',
create_by varchar(64) default '' comment '创建者',
update_by varchar(64) default '' comment '更新者',
update_time datetime default null comment '更新时间',
create_time datetime default null comment '创建时间',
primary key (annotator_id, reviewer_id, task_id, file_id)
)engine=innodb comment = '标注人员、审核人员和任务和基础文件的关联关系';
/*==============================================================*/
/* Table: ai_annotation_team_member */
/*==============================================================*/
drop table if exists ai_annotation_team_member;
create table ai_annotation_team_member
2024-10-23 08:03:27 +08:00
(
member_id bigint(20) not null comment '成员id',
role_id char(1) not null comment '角色标志0 标注1审核2管理',
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
create_by varchar(64) default '' comment '创建者',
update_by varchar(64) default '' comment '更新者',
update_time datetime default null comment '更新时间',
create_time datetime default null comment '创建时间',
primary key (member_id, role_id)
)engine=innodb comment = '标注人员和角色关联表';
2024-10-23 08:03:27 +08:00
/*==============================================================*/
/* Table: ai_basic_file */
2024-10-23 08:03:27 +08:00
/*==============================================================*/
drop table if exists ai_basic_file;
create table ai_basic_file
2024-10-23 08:03:27 +08:00
(
file_id bigint(20) not null auto_increment comment '文件id',
parent_id bigint(20) not null default 0 comment '父节点id',
ancestors varchar(200) comment '祖级列表',
file_name varchar(200) comment '文件名',
file_url varchar(200) comment '文件网络路径',
2024-11-20 14:07:37 +08:00
file_size bigint comment '文件大小',
file_last_modifytime datetime default null comment '文件最后修改时间',
upload_time datetime default null comment '上传时间',
2024-11-27 12:19:34 +08:00
is_directory char(1) default '0' comment '是否文件夹',
is_public char(1) default '0' comment '0 no, 1 yes',
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
create_by varchar(64) default '' comment '创建者',
create_time datetime default null comment '记录的插入时间',
update_by varchar(64) default '' comment '记录的更新时间',
update_time datetime default null comment '更新时间',
primary key(file_id)
)
engine=innodb comment = '文件基础表';
/*==============================================================*/
/* Table: ai_dataset */
/*==============================================================*/
drop table if exists ai_dataset;
create table ai_dataset
2024-10-23 08:03:27 +08:00
(
dataset_id bigint(20) not null auto_increment comment '数据集id',
dataset_uuid varchar(64) comment '数据集唯一标识id',
dataset_name varchar(200) comment '数据集名称',
description varchar(500) default '' comment '描述',
2024-11-27 12:19:34 +08:00
data_type char(1) default '0' comment '数据类型',
data_source char(1) default '0' comment '数据来源(0:local,1:obs)',
input_path varchar(200) comment '输入路径',
output_path varchar(200) comment '输入路径',
2024-11-26 12:44:17 +08:00
input_id bigint(20) comment '输入文件夹id',
output_id bigint(20) comment '输出文件夹id'
annotation_status char(1) comment '标注状态(0no, 1 yes)',
is_public char(1) default '0' comment '0 no, 1 yes',
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
create_by varchar(64) default '' comment '创建者',
create_time datetime default null comment '创建时间',
update_by varchar(64) default '' comment '更新者',
update_time datetime default null comment '更新时间',
primary key(dataset_id)
)
engine=innodb comment = '数据集表';
/*==============================================================*/
/* Table: ai_dataset_file_map */
/*==============================================================*/
drop table if exists ai_dataset_file_map;
create table ai_dataset_file_map
2024-10-23 08:03:27 +08:00
(
file_id bigint(20) not null comment '文件id',
dataset_id bigint(20) not null comment '数据集id',
description varchar(500) comment '描述',
is_annotated char(1) default '0' comment '关联数据集时是否已标注(0代表未标注1代表已标注)',
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
create_by varchar(64) default '' comment '创建者',
update_by varchar(64) default '' comment '更新者',
update_time datetime default null comment '更新时间',
create_time datetime default null comment '创建时间',
primary key(file_id, dataset_id)
)
engine=innodb comment = '数据集和文件关联关系表';
/*==============================================================*/
/* Table: ai_dataset_log */
/*==============================================================*/
drop table if exists ai_dataset_log;
create table ai_dataset_log
2024-10-23 08:03:27 +08:00
(
log_id bigint(20) not null auto_increment comment '日志id',
task_id bigint(20) comment '任务id',
dataset_id bigint(20),
file_id bigint(20),
operation_type varchar(64) comment '操作类型(0代表标注1代表审核)',
operation_by varchar(64) default '' comment '操作人',
operation_time datetime default NULL comment '操作时间',
2024-11-27 12:19:34 +08:00
operation_result char(1) default '0' comment '操作结果(如审核通过,审核不通过)',
operation_reason varchar(500) comment '操作原因(如不通过原因)',
value_before text comment '操作之前的值',
value_after text comment '操作之后的值',
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
create_by varchar(64) default '' comment '创建者',
update_by varchar(64) default '' comment '更新者',
update_time datetime default null comment '更新时间',
create_time datetime default null comment '创建时间',
primary key(log_id)
)
engine=innodb comment = '数据集日志表';
/*==============================================================*/
/* Table: ai_dataset_version */
/*==============================================================*/
drop table if exists ai_dataset_version;
create table ai_dataset_version
2024-10-23 08:03:27 +08:00
(
version_id bigint(20) not null comment '版本id',
version_name text comment '版本名称',
version_description varchar(200) not null comment '版本描述',
dataset_id bigint(20) not null comment '数据集id',
task_id bigint(20) not null comment '任务id',
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
create_by varchar(64) default '' comment '创建者',
update_by varchar(64) default '' comment '更新者',
update_time datetime default null comment '更新时间',
create_time datetime default null comment '创建时间',
primary key(version_id)
)engine=innodb comment = '数据集版本表';
/*==============================================================*/
/* Table: ai_file_label_map */
/*==============================================================*/
drop table if exists ai_file_label_map;
create table ai_file_label_map
2024-10-23 08:03:27 +08:00
(
file_id bigint(20) not null comment '文件id',
label_id bigint(20) not null comment '标签id',
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
create_by varchar(64) default '' comment '创建者',
update_by varchar(64) default '' comment '更新者',
update_time datetime default null comment '更新时间',
create_time datetime default null comment '创建时间',
primary key (file_id, label_id)
)
engine=innodb comment = '文件和标签关联表';
/*==============================================================*/
/* Table: ai_labels */
/*==============================================================*/
drop table if exists ai_labels;
create table ai_labels
(
label_id bigint(20) not null auto_increment comment '标签id',
ancestors varchar(200) comment '祖级列表',
parent_id bigint(20) not null default 0 comment '父节点id',
label_name bigint(20) comment '标签名称',
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
create_by varchar(64) default '' comment '创建者',
update_by varchar(64) default '' comment '更新者',
update_time datetime default null comment '更新时间',
create_time datetime default null comment '创建时间',
primary key (label_id)
)engine=innodb comment = '标签表';
/*==============================================================*/
/* Table: ai_version_file_map */
/*==============================================================*/
drop table if exists ai_version_file_map;
create table ai_version_file_map
(
version_id bigint(20) not null comment '版本id',
file_id bigint(20) not null comment '文件id',
annotation_result text comment '标注结果(json串)',
primary key(version_id, file_id)
)engine=innodb comment = '版本和文件关联表';
2024-10-23 08:03:27 +08:00
2024-12-12 18:08:46 +08:00
/*==============================================================*/
/* Table: ai_intelligent_annotation_service */
/*==============================================================*/
drop table if exists ai_intelligent_annotation_service;
create table ai_intelligent_annotation_service
(
intelligent_annotation_service_id bigint(20) not null auto_increment,
intelligent_annotation_service_name varchar(128) default '' comment '智能标注服务名称',
intelligent_annotation_service_url varchar(128) default '' comment '智能标注服务url',
2024-12-20 11:26:58 +08:00
conf_level FLOAT default 0.5 comment '置信度',
2024-12-12 18:08:46 +08:00
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
create_by varchar(64) default '' comment '创建者',
update_by varchar(64) default '' comment '更新者',
2024-12-17 13:36:14 +08:00
update_time datetime default CURRENT_TIMESTAMP on UPDATE CURRENT_TIMESTAMP comment '更新时间',
create_time datetime default CURRENT_TIMESTAMP comment '创建时间',
2024-12-12 18:08:46 +08:00
primary key(intelligent_annotation_service_id)
2024-12-18 17:52:37 +08:00
)engine=innodb comment = '智能标注服务’;
2024-12-12 18:08:46 +08:00
INSERT INTO ai_intelligent_annotation_service (
intelligent_annotation_service_name,
intelligent_annotation_service_url,
intelligent_annotation_service_labels,
del_flag,
create_by,
update_by,
update_time,
create_time
) VALUES (
'丝束缺陷检测', -- 智能标注服务名称
'http://192.168.0.21:8081/annotate', -- 智能标注服务URL
'tiaojuan,zhujiesi,yulinwen', -- 智能标注服务标签
'0', -- 是否删除 (0代表存在)
'admin', -- 创建者
'admin', -- 更新者
NOW(), -- 更新时间
NOW() -- 创建时间
2024-12-18 17:52:37 +08:00
);
INSERT INTO bns_ai.sys_menu (menu_name,parent_id,order_num,`path`,component,query,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,update_time,remark,system_type) VALUES
('智能标注服务管理',2020,6,'ailabel','dataCenter/ailabel/index',NULL,1,0,'C','0','0','dataCenter:ailabelservice:list','example','admin','2024-12-16 06:55:59','admin','2024-12-16 07:23:53','','0')
commit
select * from sys_menu where menu_name = '智能标注服务管理'
INSERT INTO bns_ai.sys_menu (menu_name,parent_id,order_num,`path`,component,query,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,update_time,remark,system_type) VALUES
('查询',2075,1,'',NULL,NULL,1,0,'F','0','0','dataCenter:ailabelservice:list','#','admin','2024-12-16 06:57:54','admin','2024-12-17 09:05:49','','0'),
('添加',2075,2,'',NULL,NULL,1,0,'F','0','0','dataCenter:ailabelservice:add','#','admin','2024-12-16 06:58:47','',NULL,'','0'),
('修改',2075,3,'',NULL,NULL,1,0,'F','0','0','dataCenter:ailabelservice:edit','#','admin','2024-12-16 06:59:25','',NULL,'','0'),
('删除',2075,4,'',NULL,NULL,1,0,'F','0','0','dataCenter:ailabelservice:remove','#','admin','2024-12-16 07:00:11','',NULL,'','0')