Compare commits
6 Commits
e6e1bee8df
...
nh
Author | SHA1 | Date | |
---|---|---|---|
ae97005a7c | |||
fb2ee66b5b | |||
5ef521438a | |||
ed4cd0643a | |||
02538ef4f4 | |||
d219fbc92a |
@ -102,5 +102,31 @@ public class ModelController {
|
||||
return OptResult.success(datasetList);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取模型训练信息")
|
||||
@GetMapping("/getModelTrainInfo")
|
||||
public OptResult getModelTrainInfo(Long id){
|
||||
log.info("获取模型训练信息");
|
||||
ModelTrainInfoVO modelTrainInfo = modelService.getModelTrainInfo(id);
|
||||
return OptResult.success(modelTrainInfo);
|
||||
}
|
||||
|
||||
@Operation(summary = "模型修改成训练中")
|
||||
@PutMapping("/updateModelTrain")
|
||||
public OptResult updateModelTrain(Long id){
|
||||
log.info("模型修改成训练中");
|
||||
modelService.updateModelTrain(id);
|
||||
return OptResult.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "模型更新小版本")
|
||||
@PutMapping("/updateModelVersionMinor")
|
||||
public OptResult updateModelVersionMinor(@RequestBody ModelVersionDTO dto){
|
||||
log.info("模型更新小版本");
|
||||
modelService.updateModelVersionMinor(dto);
|
||||
return OptResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -5,14 +5,14 @@ import com.bipt.intelligentapplicationorchestrationservice.pojo.ModelLogVO;
|
||||
public interface EvaluationMapper {
|
||||
/*
|
||||
* 查询模型评估日志详情
|
||||
* @param id 模型评估日志id
|
||||
* @param id 模型版本id
|
||||
* @return 模型评估日志详情
|
||||
*/
|
||||
ModelLogVO selectLogDetail(Long id);
|
||||
|
||||
/*
|
||||
* 更新模型评估日志状态(评估通过则上线)
|
||||
* @param id 模型评估日志id
|
||||
* @param id 模型版本id
|
||||
* @param status 模型评估日志状态
|
||||
*/
|
||||
void update(Long id, Integer status);
|
||||
|
@ -76,4 +76,11 @@ public interface ModelMapper {
|
||||
*/
|
||||
@Select("select dataset_id,dataset_name from dataset")
|
||||
List<DatasetEntity> listDataset();
|
||||
|
||||
/**
|
||||
* 获取模型训练信息
|
||||
* @param id 模型版本表id
|
||||
* 返回模型训练信息
|
||||
*/
|
||||
ModelTrainInfoVO getModelTrainInfo(Long id);
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ import java.time.LocalDateTime;
|
||||
@AllArgsConstructor
|
||||
public class ModelEvaluation implements Serializable {
|
||||
private Long id; // 评估记录id
|
||||
private Long modelId; // 关联模型id
|
||||
private Long modelVersionId; // 关联模型id,后续修改成了模型版本id
|
||||
private LocalDateTime evaluationTime; // 评估时间
|
||||
private String evaluationResult; // 评估结果
|
||||
private String operator; // 评估操作人员
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.bipt.intelligentapplicationorchestrationservice.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ModelTrainInfoVO {
|
||||
private Long id;
|
||||
private Integer datasetId; // 数据集id
|
||||
private String modelConfig; // 模型配置信息
|
||||
private String dsPath;// 版本信息表id
|
||||
private String dataPreHandleFile; // 数据预处理文件存储路径
|
||||
}
|
@ -12,6 +12,7 @@ import java.time.LocalDateTime;
|
||||
@AllArgsConstructor
|
||||
public class ModelVersionDTO {
|
||||
private Long id; // 模型版本id
|
||||
private Long modelId; // 模型id
|
||||
private String version; // 模型版本
|
||||
private Integer datasetId; // 数据集id
|
||||
private String modelConfig; // 模型配置信息
|
||||
|
@ -72,6 +72,10 @@ public class ModelServiceImpl implements ModelService {
|
||||
return modelVOList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询模型详情
|
||||
* @param id
|
||||
*/
|
||||
@Override
|
||||
public ModelVersion detail(Long id) {
|
||||
log.info("查询模型详情");
|
||||
@ -79,13 +83,23 @@ public class ModelServiceImpl implements ModelService {
|
||||
return modelVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新模型
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
public void updateModel(ModelVersionDTO dto) {
|
||||
// 更新模型还需要更新操作人和时间
|
||||
// TODO: 更新模型还需要更新操作人和时间
|
||||
log.info("更新模型");
|
||||
dto.setCreateTime(LocalDateTime.now());
|
||||
dto.setUpdateTime(LocalDateTime.now());
|
||||
modelMapper.update(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除模型版本
|
||||
* @param id
|
||||
*/
|
||||
@Override
|
||||
public void deleteModelVersion(Long id) {
|
||||
log.info("删除模型版本");
|
||||
@ -149,6 +163,9 @@ public class ModelServiceImpl implements ModelService {
|
||||
log.info("模型生命周期更新成功,新状态为: {}", targetLifeCycle);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模型生命周期列表
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, String>> listLifeCycle() {
|
||||
return Arrays.stream(ModelLifecycle.values())
|
||||
@ -159,6 +176,9 @@ public class ModelServiceImpl implements ModelService {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模型数据集列表
|
||||
*/
|
||||
@Override
|
||||
public List<DatasetEntity> listDataset() {
|
||||
List<DatasetEntity> datasetEntityList = modelMapper.listDataset();
|
||||
@ -166,4 +186,41 @@ public class ModelServiceImpl implements ModelService {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模型训练信息
|
||||
* @param id
|
||||
*/
|
||||
@Override
|
||||
public ModelTrainInfoVO getModelTrainInfo(Long id) {
|
||||
ModelTrainInfoVO modelTrainInfoVO = modelMapper.getModelTrainInfo(id);
|
||||
return modelTrainInfoVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 模型训练(把模型修改成训练中)
|
||||
* @param id
|
||||
*/
|
||||
@Override
|
||||
public void updateModelTrain(Long id) {
|
||||
// 更新当前模型的生命周期为训练中
|
||||
modelMapper.updateLifeCycleById(id, ModelLifecycle.TRAINING.getDbValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* 模型小版本更新
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
public void updateModelVersionMinor(ModelVersionDTO dto) {
|
||||
// 更新模型小版本(其实是新增一个小版本)
|
||||
ModelVersion modelVersion = new ModelVersion();
|
||||
BeanUtils.copyProperties(dto, modelVersion, "id", "modelId");
|
||||
modelVersion.setModelId(dto.getModelId()); // 把模型id设置成该模型版本关联的模型id
|
||||
modelVersion.setCreateTime(LocalDateTime.now());
|
||||
modelVersion.setUpdateTime(LocalDateTime.now());
|
||||
modelVersion.setOperateUser("zs");
|
||||
// TODO: 后续可能还需要更新操作人
|
||||
modelMapper.insertModelVersion(modelVersion);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,4 +23,10 @@ public interface ModelService {
|
||||
List<Map<String, String>> listLifeCycle();
|
||||
|
||||
List<DatasetEntity> listDataset();
|
||||
|
||||
ModelTrainInfoVO getModelTrainInfo(Long id);
|
||||
|
||||
void updateModelTrain(Long id);
|
||||
|
||||
void updateModelVersionMinor(ModelVersionDTO dto);
|
||||
}
|
||||
|
5
src/main/resources/application-dev.properties
Normal file
5
src/main/resources/application-dev.properties
Normal file
@ -0,0 +1,5 @@
|
||||
# 阿里云OSS配置
|
||||
aliyun.oss.endpoint=oss-cn-beijing.aliyuncs.com
|
||||
aliyun.oss.bucketName=ipz-nh
|
||||
aliyun.oss.accessKeyId=LTAI5tBeto7V7BPWBcCjeP7A
|
||||
aliyun.oss.accessKeySecret=bjQGt2G4J5yetxuY5cT5ZnKnIOqe4O
|
@ -9,7 +9,7 @@
|
||||
from model_log m1,
|
||||
model_info m2,
|
||||
model_version m3
|
||||
where m1.model_id=m2.id and m3.model_id=m2.id and m1.model_id = #{id}
|
||||
where m1.model_version_id=m3.id and m3.model_id=m2.id and m1.model_version_id = #{id}
|
||||
</select>
|
||||
|
||||
<!--更新模型信息(目前只更新模型是否上线,后续如果更多需求可优化>-->
|
||||
|
@ -31,8 +31,8 @@
|
||||
<!--查询模型详细信息-->
|
||||
<select id="selectById" resultType="com.bipt.intelligentapplicationorchestrationservice.pojo.ModelVersion">
|
||||
SELECT
|
||||
t1.model_name,
|
||||
t2.version, t2.dataset_id, t2.model_config,
|
||||
t1.model_name, t1.id modelId,
|
||||
t2.version, t2.dataset_id, t2.model_config, t2.id,
|
||||
t2.model_path, t2.status, t2.create_time, t2.update_time, t2.model_size,
|
||||
t2.data_pre_handle_file, t2.model_super_args, t2.model_args_size, t2.model_source_code_url, t2.model_file,
|
||||
t2.model_design_document, t2.life_cycle, t2.operate_user
|
||||
@ -62,4 +62,15 @@
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!--获取模型训练信息-->
|
||||
<select id="getModelTrainInfo" resultType="com.bipt.intelligentapplicationorchestrationservice.pojo.ModelTrainInfoVO">
|
||||
select m1.dataset_id,
|
||||
m1.id,
|
||||
m1.model_config,
|
||||
d2.ds_path,
|
||||
m1.data_pre_handle_file
|
||||
from model_version m1,dataset d2
|
||||
where m1.dataset_id=d2.dataset_id and m1.id=#{id}
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user