DROP TABLE
IF
	EXISTS common_algorithm_config;
CREATE TABLE common_algorithm_config (
	id SERIAL PRIMARY KEY,-- 自增长的主键
	tool VARCHAR ( 100 ) NOT NULL,-- 工具，长度限制为 100
	module VARCHAR ( 100 ) NOT NULL,-- 模块，长度限制为 100
	algorithm_name VARCHAR ( 100 ) NOT NULL,-- 算法名称，长度限制为 100
	start_api VARCHAR ( 255 ),-- 开始接口，长度限制为 255
	pause_api VARCHAR ( 255 ),-- 暂停接口，长度限制为 255
	terminate_api VARCHAR ( 255 ),-- 终止接口，长度限制为 255
	parameters JSONB,-- 参数，使用 JSONB 类型存储结构化数据
	create_by INT,-- 创建者 ID
	create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,-- 创建时间
	update_by INT,-- 更新者 ID
	update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,-- 更新时间
	remarks VARCHAR ( 500 ),-- 备注，长度限制为 500
	del_flag SMALLINT NOT NULL DEFAULT 0,-- 删除标志，0 表示未删除
	tenant_id INT,-- 租户 ID
	version INT -- 版本号

);


INSERT INTO common_algorithm_config ( tool, module, algorithm_name, start_api, terminate_api, parameters, remarks, tenant_id )
VALUES
	( '目标精确捕获技术设计支撑工具', '数据增强', '图像增强', 'http://127.0.0.1:11003/qushachen', 'http://127.0.0.1:11003/qushachen_stop',
	 '[{
      		"name": "中值滤波器核大小",
      		"agName": "s_v",
      		"value": "",
      		"validate": "",
      		"defaultValue": "41",
      		"required": true,
      		"index": 1,
      		"prompt": "正奇数范围（0~100）；终止滤波器核大小应当随着图片大小适当改变，当图片像素值增加时，应适当增加滤波器核大小参数。"
      	},
      	{
      		"name": "混合比例",
      		"agName": "ratio",
      		"value": "",
      		"validate": "",
      		"defaultValue": "0.33",
      		"required": true,
      		"index": 2,
      		"prompt": "正数范围（0~1）；将两种算法结果进行融合，当混合比例增加时，图片越接近原始灰度图像，当混合比例减小时，图片会凸显目标。"
      	}
      ]',
	 '图像增强算法配置', 0 );
INSERT INTO common_algorithm_config ( tool, module, algorithm_name, start_api, terminate_api, parameters, remarks, tenant_id )
VALUES
	( '目标精确捕获技术设计支撑工具', '数据增强', '图像逆光', 'http://127.0.0.1:11004/niguang', 'http://127.0.0.1:11002/niguang_stop',
	'[{
           		"name": "光照强度",
           		"agName": "light",
           		"value": "",
           		"validate": "",
           		"defaultValue": "48",
           		"required": true,
           		"index": 1,
           		"prompt": "正整数范围（40~60）；光照强度应随着图片亮度适当进行改变，即当逆光图像过暗时，应适当减小光照强度以提升算法效果。"
           	},
           	{
           		"name": "灰度对比拉伸参数",
           		"agName": "alpha",
           		"value": "",
           		"validate": "",
           		"defaultValue": "0.6",
           		"required": true,
           		"index": 2,
           		"prompt": "正数范围（0~1）；当图像对比度较低时，应适当增加拉伸参数以增强图像对比度。"
           	},
           	{
                "name": "灰度拉伸参数",
                "agName": "beta",
                "value": "",
                "validate": "",
                "defaultValue": "-20",
                "required": true,
                "index": 3,
                "prompt": "负整数范围（-30~-10）；当生成图像亮度过大，应适当减少参数以防止过度曝光。"
            }
           ]',
           '图像逆光算法配置', 0);
INSERT INTO common_algorithm_config ( tool, module, algorithm_name, start_api, terminate_api, parameters, remarks, tenant_id )
VALUES
	( '目标精确捕获技术设计支撑工具', '图像拼接', '侦察图像拼接算法_sift', 'http://127.0.0.1:11006/imageMosaic', 'http://127.0.0.1:11006/imageMosaic_stop', '[]', '侦察图像拼接算法_sift配置', 0 );
INSERT INTO common_algorithm_config ( tool, module, algorithm_name, start_api, terminate_api, parameters, remarks, tenant_id )
VALUES
	( '目标精确捕获技术设计支撑工具', '图像拼接', '侦察图像拼接算法_coordinate', 'http://127.0.0.1:11006/imageMosaic', 'http://127.0.0.1:11006/imageMosaic_stop', '[]', '侦察图像拼接算法_coordinate配置', 0 );
INSERT INTO common_algorithm_config ( tool, module, algorithm_name, start_api, terminate_api, parameters, remarks, tenant_id )
VALUES
	( '目标精确捕获技术设计支撑工具', '多目标跟踪', '多目标跟踪', 'http://127.0.0.1:10029/targetTrack', 'http://127.0.0.1:10029/targetTrack_stop',
	'[{
            "name": "模型权重",
            "agName": "yolo_model",
            "value": "",
            "validate": "",
            "defaultValue": "yolov8__best.pt",
            "required": true,
            "index": 1,
            "prompt": "使用yolov8进行目标检测时采用的模型权重，用户在给定的不同模型权重里选取。给定的模型权重为:[yolov8__best.pt, yolov8_best.pt, yolov8_best_new.pt, yolov8__best_new.pt]"
        },
        {
            "name": "跟踪方法",
            "agName": "tracking_method",
            "value": "",
            "validate": "",
            "defaultValue": "bytetrack",
            "required": true,
            "index": 2,
            "prompt": "在检测基础上跟踪目标时采用的跟踪方法，用户在给定的不同跟踪方法里选取。给定的跟踪方法为:[botsort, strongsort, bytetrack, ocsort, imprassoc, deepocsort]"
        },
        {
          "name": "视频帧宽度",
          "agName": "imgsz",
          "value": "",
          "validate": "",
          "defaultValue": "960",
          "required": true,
          "index": 3,
          "prompt": "输入视频的帧宽度，单位为像素，大于0的整数。"
        },
        {
            "name": "置信阈值",
            "agName": "conf",
            "value": "",
            "validate": "",
            "defaultValue": "0.5",
            "required": true,
            "index": 4,
            "prompt": "大于0小于1的浮点数。"
        },
        {
          "name": "交并比阈值",
          "agName": "交并比阈值",
          "value": "",
          "validate": "",
          "defaultValue": "0.7",
          "required": true,
          "index": 5,
          "prompt": "大于0小于1的浮点数。"
        }
     ]',
	 '多目标跟踪算法配置', 0 );
INSERT INTO common_algorithm_config ( tool, module, algorithm_name, start_api, terminate_api, parameters, remarks, tenant_id )
VALUES
	( '目标精确捕获技术设计支撑工具', '目标毁伤模块', '目标毁伤评估', 'http://localhost:11009/targetDamageAssessment', 'http://localhost:11009/targetDamageAssessment_stop', '[]', '目标毁伤评估算法配置', 0 );


INSERT INTO common_algorithm_config ( tool, module, algorithm_name, start_api, terminate_api, parameters, remarks, tenant_id )
VALUES
	( '目标精确捕获技术设计支撑工具', '多目标选择', '多源信息融合', '127.0.0.1:10027/objTrace', '127.0.0.1:10027/objTrace_stop',
	'[{
            "name": "输出宽度",
            "agName": "pic_width",
            "value": "",
            "validate": "",
            "defaultValue": "16.0",
            "required": false,
            "index": 1,
            "prompt": "输出图像宽度与DPI之比，大于0的浮点数，影响结果分辨率。"
        },
        {
            "name": "输出高度",
            "agName": "pic_height",
            "value": "",
            "validate": "",
            "defaultValue": "9.0",
            "required": false,
            "index": 2,
            "prompt": "输出图像的高度与DPI之比，其他同输出宽度。"
        },
        {
          "name": "DPI",
          "agName": "pic_dpi",
          "value": "",
          "validate": "",
          "defaultValue": "150",
          "required": false,
          "index": 3,
          "prompt": "输出图像的DPI，大于0的整数，同样影响输出结果的分辨率。"
        },
        {
            "name": "格式",
            "agName": "pic_type",
            "value": "",
            "validate": "",
            "defaultValue": ".png",
            "required": false,
            "index": 4,
            "prompt": "输出图像的格式，默认为png格式。"
        }
     ]',
	 '多源信息融合算法配置', 0 );


   INSERT INTO common_algorithm_config ( tool, module, algorithm_name, start_api, terminate_api, parameters, remarks, tenant_id )
VALUES
	( '目标精确捕获技术设计支撑工具', '多目标选择', '异源图像匹配定位', '127.0.0.1:10028/imgMatch', '127.0.0.1:10028/imgMatch_stop',
	'[{
            "name": "裁剪半径1",
            "agName": "cutsize",
            "value": "",
            "validate": "",
            "defaultValue": "200",
            "required": false,
            "index": 1,
            "prompt": "配准前的方形裁剪半径，单位为像素，范围由0到原图像半径（整数），避免调整过小。"
        },
        {
            "name": "裁剪半径2",
            "agName": "loc_cut_size",
            "value": "",
            "validate": "",
            "defaultValue": "50",
            "required": false,
            "index": 2,
            "prompt": "定位前的方形裁剪半径，避免调整过大，其他同裁剪半径1。"
        },
        {
          "name": "缩放比例1",
          "agName": "resize_scale",
          "value": "",
          "validate": "",
          "defaultValue": "1.0",
          "required": false,
          "index": 3,
          "prompt": "配准前裁剪结果的缩放比例，大于0的浮点数，影响结果中目标的大小。"
        },
        {
            "name": "缩放比例2",
            "agName": "loc_resize_scale",
            "value": "",
            "validate": "",
            "defaultValue": "2.0",
            "required": false,
            "index": 4,
            "prompt": "定位前裁剪结果的缩放比例，不改变结果目标大小，其他同缩放比例1。"
        },
        {
            "name": "阈值1",
            "agName": "threshold1",
            "value": "",
            "validate": "",
            "defaultValue": "5",
            "required": false,
            "index": 5,
            "prompt": "Canny边缘检测的低阈值，单位是强度，范围由0到最大强度（整数）。"
        },
        {
            "name": "阈值2",
            "agName": "threshold2",
            "value": "",
            "validate": "",
            "defaultValue": "15",
            "required": false,
            "index": 6,
            "prompt": "Canny边缘检测的高阈值，其他同阈值1。"
        },
        {
            "name": "阈值处理比例",
            "agName": "percent",
            "value": "",
            "validate": "",
            "defaultValue": "0.99",
            "required": false,
            "index": 7,
            "prompt": "按百分比进行阈值处理的比例，大于0小于1的浮点数，在合理范围内越大则可能去除更多干扰。"
        },
        {
            "name": "输出宽度",
            "agName": "pic_width",
            "value": "",
            "validate": "",
            "defaultValue": "9.0",
            "required": false,
            "index": 8,
            "prompt": "输出图像宽度与DPI之比，大于0的浮点数，影响结果分辨率。"
        },
        {
            "name": "输出高度",
            "agName": "pic_height",
            "value": "",
            "validate": "",
            "defaultValue": "9.0",
            "required": false,
            "index": 9,
            "prompt": "输出图像的高度与DPI之比，其他同输出宽度。"
        },
        {
          "name": "DPI",
          "agName": "pic_dpi",
          "value": "",
          "validate": "",
          "defaultValue": "150",
          "required": false,
          "index": 10,
          "prompt": "输出图像的DPI，大于0的整数，同样影响输出结果的分辨率。"
        },
        {
            "name": "格式",
            "agName": "pic_type",
            "value": "",
            "validate": "",
            "defaultValue": ".png",
            "required": false,
            "index": 11,
            "prompt": "输出图像的格式，默认为png格式。"
        }
     ]',
	 '异源图像匹配定位算法配置', 0 );
