iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/common/MdkConstant.java
@@ -18,4 +18,12 @@ * impl */ String C = "C++"; /** * Algs */ String ALGS = "Algs"; /** * libs */ String LIBS = "libs"; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MpkFileServiceImpl.java
@@ -234,11 +234,8 @@ LinkedHashMap<String, LinkedHashMap<String, List<MpkFileDTO>>> collect = entities.stream().collect(Collectors.groupingBy(MpkFileDTO::getMenuName, LinkedHashMap::new, Collectors.groupingBy(e -> StringUtils.isNotBlank(e.getGroupName()) ? e.getGroupName() : "default_group",LinkedHashMap::new,Collectors.toList()))); Map<String, Object> map1 = new HashMap<>(); map1.put("collects", collect); File xmlFile = new File(dirPath.getAbsolutePath() + File.separator + "menu.xml"); File xmlFile = new File(dirPath.getAbsolutePath() + File.separator + MdkConstant.LIBS + File.separator + "menu.xml"); GenUtils.drawTemplate("menu.xml.vm", new VelocityContext(map1), xmlFile); // C++源文件 FileUtil.copy("bak/C++", dirPath.getAbsolutePath(), true); List<String> javaFilePaths = new ArrayList<>(); List<String> cppFilePaths = new ArrayList<>(); @@ -281,21 +278,24 @@ GenUtils.drawTemplate("Jni.h.vm", dataContext, jniHFile); // 添加python源文件 String pyFilePath = dirPath.getAbsolutePath() + File.separator + "py" + File.separator + entity.getPyName() + ".pyd"; String pyFilePath = dirPath.getAbsolutePath() + File.separator + MdkConstant.ALGS + File.separator + entity.getPyModule().replace(".", File.separator) + File.separator + entity.getPyName() + ".pyd"; FileUtil.mkParentDirs(pyFilePath); FileUtil.copy(entity.getFilePath(), pyFilePath, true); } // FileUtil.copy("bak/libs", dirPath.getAbsolutePath(), true); //生成dll文件 String dllSavePath = dirPath.getAbsolutePath() + File.separator + "IAIL.MDK.Mid.Windows.dll"; String dllSavePath = dirPath.getAbsolutePath() + File.separator + MdkConstant.LIBS + File.separator + "IAIL.MDK.Mid.Jni.dll"; createDllFile(dirPath.getAbsolutePath(),cppFilePaths,dllSavePath); //utils + env java文件 File utilsJavaFile = new File(dirPath.getAbsolutePath() + File.separator + "IAILMDK" + File.separator + "utils" + File.separator + "AlgsUtils.java"); File utilsJavaFile = new File(dirPath.getAbsolutePath() + File.separator + "IAILMDK" + File.separator + "iail" + File.separator + "mdk" + File.separator + "model" + File.separator + "utils" + File.separator + "AlgsUtils.java"); FileUtil.mkParentDirs(utilsJavaFile); FileUtil.copy("bak/IAILMDK/utils/AlgsUtils.java", utilsJavaFile.getAbsolutePath(), true); javaFilePaths.add(utilsJavaFile.getAbsolutePath()); File envJavaFile = new File(dirPath.getAbsolutePath() + File.separator + "IAILMDK" + File.separator + "common" + File.separator + "Environment.java"); File envJavaFile = new File(dirPath.getAbsolutePath() + File.separator + "IAILMDK" + File.separator + "iail" + File.separator + "mdk" + File.separator + "model" + File.separator + "common" + File.separator + "Environment.java"); FileUtil.mkParentDirs(envJavaFile); FileUtil.copy("bak/IAILMDK/common/Environment.java", envJavaFile.getAbsolutePath(), true); javaFilePaths.add(envJavaFile.getAbsolutePath()); @@ -345,29 +345,22 @@ projectPackageHistoryModelService.insertBatch(historyModelList); // 删除临时文件 FileUtils.deleteDirectory(dirPath); // FileUtils.delete(new File(zipPath)); return bytes; } private void createDllFile(String dirPath, List<String> cppFilePaths, String dllSavePath) throws InterruptedException, IOException { cppFilePaths.add(dirPath + File.separator + "C++" + File.separator + "pch.cpp"); cppFilePaths.add(dirPath + File.separator + "C++" + File.separator + "dllmain.cpp"); cppFilePaths.add(dirPath + File.separator + "C++" + File.separator + "Environment.cpp"); cppFilePaths.add(dirPath + File.separator + "C++" + File.separator + "pyutils.cpp"); cppFilePaths.add(dirPath + File.separator + "C++" + File.separator + "convertutils.cpp"); String paths = cppFilePaths.stream().collect(Collectors.joining(" ")); String command = "cl /LD " + paths + " /EHsc /o " + dllSavePath; // String command = "cmd.exe /c cl -o " + dllSavePath + " /LD D:\\work\\mdk\\code\\makeDll\\src\\main\\java\\org\\example\\MakeDll.c D:\\work\\mdk\\code\\makeDll\\src\\main\\java\\org\\example\\MakeDll2.c"; String command = "cl /LD " + paths + " /EHsc /o " + dllSavePath + " /link " + "IAIL.MDK.Mid.Windows.lib"; log.info("执行cmd命令生成dll:" + command); ProcessBuilder builder = new ProcessBuilder("cmd", "/c", command); builder.directory(new File(dirPath + File.separator + "C++")); builder.directory(new File(dirPath + File.separator + MdkConstant.LIBS)); Process process = builder.start(); // 获取命令输出结果 InputStream inputStream = process.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "GBK")); // 设置编码为GBK String line; while ((line = reader.readLine()) != null) { System.out.println(line); log.info(line); } // 等待命令执行完成 process.waitFor(); @@ -416,7 +409,7 @@ private void pkgJar(String dirPath) throws InterruptedException { StringBuilder sb = new StringBuilder(); sb.append("jar -cvf"); sb.append(" ").append(dirPath).append(File.separator).append("IAILMDK.jar"); sb.append(" ").append(dirPath).append(File.separator).append(MdkConstant.LIBS).append(File.separator).append("IAILMDK.jar"); sb.append(" -C ").append(dirPath).append(File.separator).append("IAILMDK").append(File.separator).append(" ."); log.info("执行cmd命令打jar包:" + sb); Process process = RuntimeUtil.exec(sb.toString()); iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/Environment.cpp
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/PyGILThreadLock.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/convertutils.cpp
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/dllmain.cpp
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/Environment.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/PyGILThreadLock.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/PyGILThreadLock_bak.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/convertutils.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/framework.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/jawt.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/jawt_md.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/jdwpTransport.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/jni.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/jni_md.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/jvmti.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/jvmticmlr.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/opt.cpp
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/pch.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/pyutils.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/stdafx.cpp
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/stdafx.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/include/targetver.h
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/pch.cpp
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/C++/pyutils.cpp
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/resources/bak/IAILMDK/common/Environment.java
@@ -1,4 +1,4 @@ package common; package iail.mdk.model.common; /** * @Description iailab-module-model/iailab-module-model-biz/src/main/resources/bak/IAILMDK/utils/AlgsUtils.java
@@ -1,4 +1,4 @@ package utils; package iail.mdk.model.utils; import java.util.HashMap; iailab-module-model/iailab-module-model-biz/src/main/resources/bak/libs/IAIL.MDK.Mid.Windows.dllBinary files differ
iailab-module-model/iailab-module-model-biz/src/main/resources/bak/libs/status_code.xml
对比新文件 @@ -0,0 +1,20 @@ <status-codes> <status-code code="100" tips="系统正常运行"/> <status-code code="200" tips="算法模块加载失败"/> <status-code code="201" tips="算法方法加载失败"/> <status-code code="202" tips="类型不匹配"/> <status-code code="203" tips="找不到模型存储路径"/> <status-code code="204" tips="模型参数文件加载失败"/> <status-code code="205" tips="计算过程中的数据或数组维度不匹配"/> <status-code code="206" tips="数值错误"/> <status-code code="207" tips="第三方库问题"/> <status-code code="208" tips="评价指标计算错误"/> <status-code code="209" tips="数据长度问题"/> <status-code code="210" tips="初始化失败"/> <status-code code="211" tips="train/predict函数输入格式错误"/> <status-code code="212" tips="train/predict函数输出格式错误"/> <status-code code="300" tips="MDK未配置"/> <status-code code="301" tips="缺少依赖库"/> <status-code code="400" tips="系统异常,未知错误"/> <status-code code="401" tips="未能进入 Python"/> </status-codes> iailab-module-model/iailab-module-model-biz/src/main/resources/bak/libs/version.xml
对比新文件 @@ -0,0 +1,30 @@ <algorithm-list name="算法版本列表"> <!-- 说明:version="0.11" 即现行算法未显式标注版本的算法--> <algorithms name = "预测"> <algorithm name="非周期短期点预测" type="非周期完整数据" fileName="PredAperioComShortPoint" version="2.0"/> <algorithm name="类周期短期点预测" type="类周期完整数据" fileName="PredPerioComShortPoint" version="2.0"/> <algorithm name="中长期点预测" type="类周期完整数据" fileName="PredPerioComLongPoint" version="0.9.1"/> <algorithm name="N型数据集点预测" type="N型" fileName="PredNTypeComShortPoint" version="0.20.0"/> <algorithm name="调整用户短期点预测" type="阶跃" fileName="PredStepComShortPoint" version="1.0.5"/> <algorithm name="因素预测" type="短期点预测" fileName="PredFactComShortPoint" version="1.1.13"/> </algorithms> <algorithms name="数据预处理"> <algorithm name="滤波" fileName="PrepFilter" version="1.2.6"/> <algorithm name="数据填补" fileName="PrepDaImput" version="0.12.0"/> <algorithm name="异常点检测" fileName="PrepOutDetect" version="1.2.3"/> <algorithm name="特征选择" fileName="prepFeaSelect" version="0.9.5"/> </algorithms> <algorithms name="调度"> <algorithm name="单介质调度" fileName="scheSingleEgy" version="1.0.1"/> <algorithm name="热电调度" fileName="MSCoSchedul" version="1.0.1"/> <algorithm name="调度建议" fileName="schedulSuggest" version="1.0.1"/> </algorithms> </algorithm-list> iailab-module-model/iailab-module-model-biz/src/main/resources/template/cpp.vm
@@ -80,7 +80,7 @@ cout << "ConvertPydictToJhmap error" << endl; throw "函数返回值异常!"; } delete pModule; /*delete pModule; pModule = nullptr; delete pModule; @@ -106,7 +106,7 @@ delete[] pArg; pArg = nullptr; delete pArg; delete pArg;*/ return result; } iailab-module-model/iailab-module-model-biz/src/main/resources/template/impl.java.vm
@@ -1,7 +1,7 @@ package ${pkgName}.impl; import ${pkgName}.${pyName}; import utils.AlgsUtils; import iail.mdk.model.utils.AlgsUtils; import java.util.HashMap;