Ver Fonte

V0.1.5
1、完成了获取基础信息的函数
2、添加了一个子线程,定时获取基础信息,然后更新到EQM数据库中

Apple há 7 meses atrás
pai
commit
7083a6a6aa

+ 3 - 2
SecurePlayAuxServer/CMakeLists.txt

@@ -10,7 +10,7 @@ file(GLOB LOCAL_SRC
     ${CMAKE_SOURCE_DIR}/External/common/CurlFtp/*.cpp
     ${CMAKE_SOURCE_DIR}/External/common/Thread/*.cpp
     ${CMAKE_SOURCE_DIR}/External/common/CurlHttp/*.cpp
-    ${CMAKE_SOURCE_DIR}/External/common/threadPool/*.cpp
+    ${CMAKE_SOURCE_DIR}/External/common/ThreadPool/*.cpp
     
     ${LHQLog_SOURCE_DIRS}/*.cpp
     ${LHHTTPAPI_SOURCE_DIRS}/*.cpp
@@ -27,12 +27,13 @@ target_include_directories(${execName1} PRIVATE
     ${CMAKE_CURRENT_SOURCE_DIR}/common/LHLog
     ${CMAKE_CURRENT_SOURCE_DIR}/communication
 
+    ${CMAKE_SOURCE_DIR}/External/common
     ${CMAKE_SOURCE_DIR}/External/common/FmtLog
     ${CMAKE_SOURCE_DIR}/External/common/CurlFtp
     ${CMAKE_SOURCE_DIR}/External/common/Thread
     ${CMAKE_SOURCE_DIR}/External/common/CurlHttp
-    ${CMAKE_SOURCE_DIR}/External/common/threadPool
     ${CMAKE_SOURCE_DIR}/External/common/RingQueue
+    ${CMAKE_SOURCE_DIR}/External/common/ThreadPool
 
     ${LHQLog_INCLUDE_DIRS}
     ${LHHTTPAPI_SOURCE_DIRS}

+ 41 - 4
SecurePlayAuxServer/GlobalInfo.h

@@ -2,18 +2,23 @@
 #define GLOBALINFO_H
 
 #include <QString>
+#include <vector>
+#include "nlohmann/json.hpp"
 
-#/**
+/**
  * @brief 全局信息
  * 
  */
 
+using nJson = nlohmann::json;
+
+
 /* 算法相关信息 */
 struct AlgorithmInfo
 {
-    QString ActionID;       /* 算法ID */
-    QString ActionName;     /* 算法名称 */
-    int ActionTaskID;   /* 算法任务ID */
+    std::string ActionID;       /* 算法ID */
+    std::string ActionName;     /* 算法名称 */
+    int ActionTaskID;           /* 算法任务ID */
 
     AlgorithmInfo() = default;
     AlgorithmInfo(const AlgorithmInfo& other)
@@ -29,5 +34,37 @@ struct AlgorithmInfo
 };
 
 
+/* 设备列表 */
+struct DeviceInfo
+{
+    int PKID;                   /* 主键ID */
+    int DeviceID;               /* 设备ID */
+    int DevicePort;             /* 设备端口 */
+    std::string DeviceName;     /* 设备名称 */
+    std::string DeviceSerial;   /* 设备序列号 */
+    std::string DeviceType;     /* 设备类型 */
+    std::string UserAccount;    /* 用户账号 */
+    std::string UserPassword;   /* 用户密码 */
+    std::vector<AlgorithmInfo> vecAlgorithmInfo; /* 算法信息 */
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 #endif /* GLOBALINFO_H */

+ 81 - 11
SecurePlayAuxServer/SPAServer.cpp

@@ -4,6 +4,7 @@
 #include "CurlHttp.h"
 #include <filesystem>
 #include "CurlFtp.h"
+#include "ThreadPool/ThreadPool.h"
 
 #include <QVector>
 
@@ -17,9 +18,23 @@ SPAServer::SPAServer()
         return;
     }
 
-    m_fromSuperBrain.getToken();
-    // m_fromSuperBrain.getTaskTypeList();
+    m_threadRunning = true;
+
+
+    // m_fromSuperBrain.getToken();
+    // m_fromSuperBrain.getTaskTypeList(m_vecAlgorithmInfo);
+    // m_fromSuperBrain.getDeviceList(m_vecDeviceInfo);
 
+    // for(const auto& it : m_vecAlgorithmInfo)
+    // {
+    //     SPDLOG_LOGGER_INFO(m_logger, "ActionID:{} ActionName:{} ActionTaskID:{}", it.ActionID, it.ActionName, it.ActionTaskID);
+    // }
+    // for(const auto& it : m_vecDeviceInfo)
+    // {
+    //     SPDLOG_LOGGER_INFO(m_logger, "DeviceID:{} DeviceName:{} DeviceType:{}", it.DeviceID, it.DeviceName, it.DeviceType);
+    //     SPDLOG_LOGGER_INFO(m_logger, "Port:{} UserAccount:{} PWD:{}", it.DevicePort, it.UserAccount, it.UserPassword);
+    //     SPDLOG_LOGGER_INFO(m_logger, "ActionID:{} ActionName:{} ActionTaskID:{}", it.vecAlgorithmInfo[0].ActionID, it.vecAlgorithmInfo[0].ActionName, it.vecAlgorithmInfo[0].ActionTaskID);
+    // }
 
     // m_fromRedis.setRedisIPAndPort("172.16.36.80", 32222);
     // m_fromRedis.setRedisPassword("Ff1z@TOFr^iwd%Ra");
@@ -31,15 +46,14 @@ SPAServer::SPAServer()
 
     //|FTP|192.1.2.178:32021|lh|DWw7V9u0|
 
-    // m_toEQMDataBase.initWebApi("http://192.1.3.133:31000/v6/", "", "4c2f9fc91c22dd98331e47af2e2964f4");
-
-    // AlgorithmInfo info;
-    // info.ActionID = "123";
-    // info.ActionName = "test";
-    // info.ActionTaskID = 456;
-    // QVector<AlgorithmInfo> vecInfo;
-    // vecInfo.push_back(info);
-    // m_toEQMDataBase.writeAlgorithmInfo(vecInfo);
+    m_toEQMDataBase.initWebApi("http://192.1.3.133:31000/v6/", "", "4c2f9fc91c22dd98331e47af2e2964f4");
+    AlgorithmInfo info;
+    info.ActionID = "123";
+    info.ActionName = "test";
+    info.ActionTaskID = 456;
+    QVector<AlgorithmInfo> vecInfo;
+    vecInfo.push_back(info);
+    m_toEQMDataBase.writeAlgorithmInfo(vecInfo);
     
 }
 
@@ -48,4 +62,60 @@ SPAServer::~SPAServer()
 
 }
 
+/* 启动服务 */
+void SPAServer::startServer()
+{
+    /* 添加获取基础信息的线程 */
+    CPPTP.add_task(&SPAServer::fromSuperBrainThread, this);
+}
+
+
+/**
+ * @brief 从基础平台获取算法信息和设备信息的线程函数
+ * 
+ */
+void SPAServer::fromSuperBrainThread()
+{
+    SPDLOG_LOGGER_DEBUG(m_logger, "开启 fromSuperBrainThread 线程");
+    /* 获取一次token,后续失效了再获取 */
+    m_fromSuperBrain.getToken();
+    while (m_threadRunning)
+    {
+        SPDLOG_LOGGER_DEBUG(m_logger, "获取基础信息");
+        std::vector<AlgorithmInfo> vecAlgInfo;
+        std::vector<DeviceInfo> vecDevInfo;
+        m_fromSuperBrain.getTaskTypeList(vecAlgInfo);
+        m_fromSuperBrain.getDeviceList(vecDevInfo);
+
+        /* 对比数据库表格信息 */
+        std::vector<AlgorithmInfo> vecAlgUpdate;
+        std::vector<AlgorithmInfo> vecAlgDelete;
+        /* 取出要添加的 */
+        for(const auto& it : vecAlgInfo)
+        {
+            for(const auto& it0 : m_vecEqmAlgInfo)
+            {
+                if(it.ActionID != it0.ActionID)
+                {
+                    vecAlgUpdate.push_back(it);
+                }
+            }
+        }
+        /* 取出要删除的 */
+        for(const auto& it : m_vecEqmAlgInfo)
+        {
+            for(const auto& it0 : vecAlgInfo)
+            {
+                if(it.ActionID != it0.ActionID)
+                {
+                    vecAlgDelete.push_back(it);
+                }
+            }
+        }
+
+        std::this_thread::sleep_for(std::chrono::seconds(10));
+    }
+}
+
+
 

+ 16 - 0
SecurePlayAuxServer/SPAServer.h

@@ -15,12 +15,28 @@ public:
     SPAServer();
     ~SPAServer();
 
+    /* 启动服务 */
+    void startServer();
+
+private:
+    /* 从基础平台获取算法信息和设备信息的线程函数 */
+    void fromSuperBrainThread();
+
+
 private:
     std::shared_ptr<spdlog::logger> m_logger = nullptr;
 
+    bool m_threadRunning = true;                        /* 线程正在运行 */
+
     FromSuperBrain m_fromSuperBrain;
     FromRedis m_fromRedis;
     ToEQMDataBase m_toEQMDataBase;
+
+    /* 算法信息,这个就是tAction在内存中的数据,方便后续对比,程序启动的时候会先获取一份 */
+    std::vector<AlgorithmInfo> m_vecEqmAlgInfo;
+    /* 设备信息,这个是tActionCamer的信息 */
+    std::vector<DeviceInfo> m_vecEqmDevInfo;
+
 };
 
 #endif /* SPASERVER_H */

+ 95 - 12
SecurePlayAuxServer/communication/FromSuperBrain.cpp

@@ -3,6 +3,7 @@
 
 #include "CurlHttp.h"
 #include "fmt/format.h"
+#include "GlobalInfo.h"
 
 
 FromSuperBrain::FromSuperBrain()
@@ -28,26 +29,35 @@ FromSuperBrain::~FromSuperBrain()
 bool FromSuperBrain::getToken()
 {
     std::string response;
-    std::string httpBody = R"({"appSecret":"Setyir9yxvSiFGB/wsv4YHWiNmrgeaZhzJKi7c7Gmk04Z5Kd/hCifL+0WnfCRDJF","appKey":"x1pcq13r"})";
+    /* fmt需要 {{ 才能输出一个 { */
+    std::string httpBody = fmt::format(R"({{"appSecret":"{}","appKey":"{}"}})", m_appSecret, m_appKey);
     std::vector<std::string> vecHeader;
     vecHeader.push_back("Content-Type: application/json");
     std::string url = m_url + m_tokenPath;
-    SPDLOG_LOGGER_DEBUG(m_logger, "url:{}", url);
-    SPDLOG_LOGGER_DEBUG(m_logger, "httpBody:{}", httpBody);
+    // SPDLOG_LOGGER_DEBUG(m_logger, "url:{}", url);
+    // SPDLOG_LOGGER_DEBUG(m_logger, "httpBody:{}", httpBody);
     if(!CurlHttp::Post(url, vecHeader, httpBody, response))
+    {
+        SPDLOG_LOGGER_ERROR(m_logger, "{}", response);
+        return false;
+    }
+    // SPDLOG_LOGGER_DEBUG(m_logger, "response:{}", response);
+    /* 解析json信息 */
+    nJson json0 = nJson::parse(response);
+    auto code = json0["code"].get<std::string>();
+    if(code != "0")
     {
         SPDLOG_LOGGER_ERROR(m_logger, "Get Token failed");
         return false;
     }
-    SPDLOG_LOGGER_DEBUG(m_logger, "response:{}", response);
-    m_token = response;
+    json0["data"]["accessToken"].get_to(m_token);
+    // SPDLOG_LOGGER_DEBUG(m_logger, "Token:{}", m_token);
 
     return true;
 }
 
-
 /* 获取算法列表 */
-bool FromSuperBrain::getTaskTypeList()
+bool FromSuperBrain::getTaskTypeList(std::vector<AlgorithmInfo>& vecInfo)
 {
     if(m_token.empty())
     {
@@ -59,18 +69,35 @@ bool FromSuperBrain::getTaskTypeList()
     vecHeader.push_back(fmt::format("accessToken: {}", m_token));
     std::string url = m_url + m_taskTypeListPath;
     if(!CurlHttp::Get(url, vecHeader, response))
+    {
+        SPDLOG_LOGGER_ERROR(m_logger, "{}}", response);
+        return false;
+    }
+    // SPDLOG_LOGGER_DEBUG(m_logger, "TaskTypeList: \n{}", response);
+    /* 解析json信息 */
+    nJson json0 = nJson::parse(response);
+    auto retCode = json0.at("code").get<std::string>();
+    if(retCode != "0")
     {
         SPDLOG_LOGGER_ERROR(m_logger, "Get TaskTypeList failed");
         return false;
     }
-    SPDLOG_LOGGER_DEBUG(m_logger, "response:{}", response);
-    m_taskTypeList = response;
+    auto data = json0.at("data");
+    for(auto& it : data)
+    {
+        // SPDLOG_LOGGER_DEBUG(m_logger, "muAiName:{}", it["muAiName"].get<std::string>());
+        AlgorithmInfo info;
+        info.ActionID = it.at("ability").get<std::string>();
+        info.ActionName = it.at("muAiName").get<std::string>();
+        info.ActionTaskID = it["taskTypeId"].get<int>();
+        vecInfo.push_back(info);
+    }
 
     return true;
 }
 
 /* 获取设备列表信息 */
-bool FromSuperBrain::getDeviceList()
+bool FromSuperBrain::getDeviceList(std::vector<DeviceInfo>& vecInfo)
 {
     if(m_token.empty())
     {
@@ -83,10 +110,66 @@ bool FromSuperBrain::getDeviceList()
     std::string url = m_url + m_deviceListPath;
     if(!CurlHttp::Get(url, vecHeader, response))
     {
-        SPDLOG_LOGGER_ERROR(m_logger, "Get TaskTypeList failed");
+        SPDLOG_LOGGER_ERROR(m_logger, "{}", response);
+        return false;
+    }
+    // SPDLOG_LOGGER_DEBUG(m_logger, "DeivceList: \n{}", response);
+    /* 解析JSON信息 */
+    nJson json0 = nJson::parse(response);
+    auto retCode = json0.at("code").get<std::string>();
+    if(retCode != "0")
+    {
+        SPDLOG_LOGGER_ERROR(m_logger, "Get DeviceList failed");
+        return false;
+    }
+    DeviceInfo info;
+    nJson json1 = json0["data"];
+    for(const auto& it : json1)
+    {
+        info.DeviceID = it["deviceId"].get<int>();
+        info.DeviceName = it["deviceName"].get<std::string>();
+        info.DeviceSerial = it["deviceSerial"].get<std::string>();
+        info.DeviceType = it["deviceType"].get<std::string>();
+        /* 这三个可能是null */
+        info.DevicePort = it["port"].is_null() ? 0 : it["port"].get<int>();
+        info.UserAccount = it["userAccount"].is_null() ? "" : it["userAccount"].get<std::string>();
+        info.UserPassword = it["userPWD"].is_null() ? "" : it["userPWD"].get<std::string>();
+        /* 解析任务类型列表 */
+        nJson json2 = it["taskTypeList"];
+        for(const auto& it1 : json2)
+        {
+            AlgorithmInfo info1;
+            info1.ActionID = it1["ability"].get<std::string>();
+            info1.ActionName = it1["taskTypeName"].get<std::string>();
+            info1.ActionTaskID = it1["taskTypeId"].get<int>();
+            info.vecAlgorithmInfo.push_back(info1);
+        }
+        vecInfo.push_back(info);
+    }
+    
+
+    return true;
+}
+
+/* 图片识别 */
+bool FromSuperBrain::imageRecognition()
+{
+    if(m_token.empty())
+    {
+        SPDLOG_LOGGER_ERROR(m_logger, "Token is empty");
+        return false;
+    }
+    std::string response;
+    std::vector<std::string> vecHeader;
+    vecHeader.push_back(fmt::format("accessToken: {}", m_token));
+    /* 拼接地址 */
+    std::string url = m_url + m_imageRecognitionPath;
+    if(!CurlHttp::Get(url, vecHeader, response))
+    {
+        SPDLOG_LOGGER_ERROR(m_logger, "Get imageRecognition failed");
         return false;
     }
-    SPDLOG_LOGGER_DEBUG(m_logger, "response:{}", response);
+    SPDLOG_LOGGER_DEBUG(m_logger, "imageRecognition: \n{}", response);
 
     return true;
 }

+ 11 - 6
SecurePlayAuxServer/communication/FromSuperBrain.h

@@ -5,6 +5,9 @@
 
 #include "spdlog/spdlog.h"
 
+struct AlgorithmInfo;
+struct DeviceInfo;
+
 class FromSuperBrain
 {
 public:
@@ -13,9 +16,11 @@ public:
     /* 获取token */
     bool getToken();
     /* 获取算法列表 */
-    bool getTaskTypeList();
+    bool getTaskTypeList(std::vector<AlgorithmInfo>& vecInfo);
     /* 获取设备列表信息 */
-    bool getDeviceList();
+    bool getDeviceList(std::vector<DeviceInfo>& vecInfo);
+    /* 图片识别 */
+    bool imageRecognition();
 
 private:
     std::shared_ptr<spdlog::logger> m_logger = nullptr;
@@ -27,10 +32,10 @@ private:
     std::string m_appSecret;    /* 授权码 */
 
     std::string m_token;                            /* token */
-    std::string m_taskTypeList;                     /* 任务类型列表 */
-    const std::string m_tokenPath = "/external/broadcastToken";              /* 获取token数据 */
-    const std::string m_taskTypeListPath = "/external/getTaskTypeList";      /* 获取任务类型数据 */
-    const std::string m_deviceListPath = "/external/getBaseDeviceList";      /* 获取设备列表数据 */
+    const std::string m_tokenPath = "/external/broadcastToken";                 /* 获取token数据 */
+    const std::string m_taskTypeListPath = "/external/getTaskTypeList";         /* 获取任务类型数据 */
+    const std::string m_deviceListPath = "/external/getBaseDeviceList";         /* 获取设备列表数据 */
+    const std::string m_imageRecognitionPath = "/external/imageIdentify";       /* 图片识别 */
 };
 
 

+ 10 - 8
SecurePlayAuxServer/communication/ToEQMDataBase.cpp

@@ -4,6 +4,7 @@
 #include <QJsonObject>
 #include <QVector>
 
+
 ToEQMDataBase::ToEQMDataBase()
 {
     m_logger = spdlog::get("ToEQMDataBase");
@@ -77,19 +78,20 @@ bool ToEQMDataBase::writeAlgorithmInfo(QVector<AlgorithmInfo>& vecInfo)
         QJsonObject obj0;
         QString retStr;
         /* 操作名称,现在一次性将设备位置和线条信息都下载下来 */
-        obj0.insert("opName", "SPSS_InsertToAction");
-        QJsonObject obj1;
-        obj1.insert("actionID", it.ActionID);           /* 算法ID */
-        obj1.insert("actionName", it.ActionName);       /* 算法名称 */
-        obj1.insert("actionTaskID", it.ActionTaskID);   /* 算法类型 */
-        obj0.insert("paramList", obj1);         /* SQL语句的参数列表 */
-        auto strCmd = QJsonDocument(obj0).toJson(QJsonDocument::Compact);
+        nJson json0;
+        json0["opName"] = "SPSS_InsertToAction";
+        nJson json1;
+        json1["actionID"] = it.ActionID;                    /* 算法ID */
+        json1["actionName"] = it.ActionName;                /* 算法名称 */
+        json1["actionTaskID"] = it.ActionTaskID;            /* 算法类型 */
+        json0["paramList"] = json1;
+        QString strCmd = QString::fromStdString(json0.dump());
         int ret = m_httpApi->DBQDoInterface(enDBOperatorType::EDBOT_Insert, strCmd, retStr);
         if(ret < 0)
         {
             SPDLOG_LOGGER_DEBUG(m_logger,"写入tAction失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
         }
-        // SPDLOG_LOGGER_DEBUG(m_logger,"写入tAction成功!");
+        SPDLOG_LOGGER_DEBUG(m_logger,"写入tAction成功!");
     }
 
     return true;

+ 2 - 2
SecurePlayAuxServer/main.cpp

@@ -5,8 +5,7 @@
 #include "SPAServer.h"
 #include "LHLogInit.h"
 #include "LHQLogAPI.h"
-#include "ThreadPool.h"
-
+#include "ThreadPool/ThreadPool.h"
 #include <QCoreApplication>
 
 #include <QString>
@@ -32,6 +31,7 @@ int main(int argc, char* argv[])
     CPPTP.setThreadMaxNum(256);
 
     SPAServer server;
+    // server.startServer();
 
     return app.exec();
 }

+ 227 - 114
json.json

@@ -1,120 +1,233 @@
 {
-    "code": 0,
+    "code": "0",
+    "message": "成功",
     "data": [
         {
-            "id": "e9ae71e6d68ef79a5569b7e30eced077",
-            "name": "DM_192.1.2.44_EQM",
-            "busiType": "EQM",
-            "dbType": "Dm"
-        },
-        {
-            "id": "cb19819fb8eb5f27c1d909ed6b4faa7c",
-            "name": "sqlserver_192.1.3.142_prodsv2",
-            "busiType": "",
-            "dbType": "SqlServer"
-        },
-        {
-            "id": "eb16d1ca7669a48261756eda567a2a83",
-            "name": "sqlserver_192.1.3.153_Superlink_LYLB",
-            "busiType": "Prolink_Superlink",
-            "dbType": "SqlServer"
-        },
-        {
-            "id": "6c634bdc4975e4b73f8307df706bd7b3",
-            "name": "sqlserver_192.1.3.142_prolink_xm",
-            "busiType": "Prolink_Superlink",
-            "dbType": "SqlServer"
-        },
-        {
-            "id": "f21512c566358300943b194f7e850ad7",
-            "name": "192.1.3.153_Prolink_FJ_BC",
-            "busiType": "ProMusic",
-            "dbType": "SqlServer"
-        },
-        {
-            "id": "5a897bbdb8d9585b2a7093a87711d5b7",
-            "name": "61(Superlink_LYLB_B)",
-            "busiType": "Prolink_Superlink",
-            "dbType": "SqlServer"
-        },
-        {
-            "id": "4ecdc473a485148f0a3a127672b63820",
-            "name": "DM_192.1.2.10_EQM",
-            "busiType": "EQM",
-            "dbType": "Dm"
-        },
-        {
-            "id": "a0e44ef1cb650d2e1fc2ab5857b9277f",
-            "name": "49(Promusic_z4_b)",
-            "busiType": "ProMusic",
-            "dbType": "SqlServer"
-        },
-        {
-            "id": "6f3e5707785e2689130d5be880361a12",
-            "name": "61(Prolink_TY)",
-            "busiType": "Prolink_Superlink",
-            "dbType": "SqlServer"
-        },
-        {
-            "id": "019fac32befb831c60f3df76018ba360",
-            "name": "153(Prolink_CNR_20210611)",
-            "busiType": "Prolink_Superlink",
-            "dbType": "SqlServer"
-        },
-        {
-            "id": "aac6ca614ed4888dca36e11abadb12d8",
-            "name": "DM_192.1.2.44_EQM_ZBT",
-            "busiType": "EQM",
-            "dbType": "Dm"
-        },
-        {
-            "id": "60979a8faf99f16053540f9d7e990300",
-            "name": "61(EQM)",
-            "busiType": "EQM",
-            "dbType": "Dm"
-        },
-        {
-            "id": "4d91d3b9394343053e818a0d7790f7b4",
-            "name": "GBase_192.1.2.44_EQM",
-            "busiType": "EQM",
-            "dbType": "GBase"
-        },
-        {
-            "id": "c0723e144c8f3674b45d9903a03019c0",
-            "name": "DM_192.1.2.44_EQM_BJ",
-            "busiType": "EQM",
-            "dbType": "Dm"
-        },
-        {
-            "id": "4c2f9fc91c22dd98331e47af2e2964f4",
-            "name": "SQL_SERVER_192.1.3.105_EQM_BJ",
-            "busiType": "EQM",
-            "dbType": "SqlServer"
-        },
-        {
-            "id": "ee045e6eb09a9e7f344ecb87e6d49afd",
-            "name": "61(DBO)",
-            "busiType": "Prolink_Superlink",
-            "dbType": "Dm"
-        },
-        {
-            "id": "c1acfd2615f58826fe0dc93267bd6d5f",
-            "name": "105(Prolink_z9_ceshi)",
-            "busiType": "Prolink_Superlink",
-            "dbType": "SqlServer"
-        },
-        {
-            "id": "372f33529b10651d6c96523cfac77bcf",
-            "name": "DM_192.1.2.178_EQM",
-            "busiType": "EQM",
-            "dbType": "Dm"
+            "aiName": "疲劳检测",
+            "muAiName": "疲劳检测",
+            "sceneName": null,
+            "muAiTypeId": 6,
+            "taskTypeId": 6,
+            "taskTypeCode": "TaskType89j46ace4bx",
+            "needMark": false,
+            "supportSequential": false,
+            "isGaoTie": false,
+            "frequency": [
+                "5s",
+                "10s",
+                "15s",
+                "30s",
+                "60s",
+                "5min",
+                "15min",
+                "60min"
+            ],
+            "calTypeName": "自建应用",
+            "abilityType": 5,
+            "baseConfig": true,
+            "osConfig": false,
+            "ability": "OD210_021_004790_001-l2MahE4v",
+            "appStatus": 0,
+            "status": 0,
+            "orderType": 0,
+            "errorMsg": "安装成功",
+            "isUsed": null
+        },
+        {
+            "aiName": "摔倒识别",
+            "muAiName": "摔倒识别",
+            "sceneName": null,
+            "muAiTypeId": 5,
+            "taskTypeId": 5,
+            "taskTypeCode": "TaskType9gusadr93ou",
+            "needMark": false,
+            "supportSequential": false,
+            "isGaoTie": false,
+            "frequency": [
+                "5s",
+                "10s",
+                "15s",
+                "30s",
+                "60s",
+                "5min",
+                "15min",
+                "60min"
+            ],
+            "calTypeName": "自建应用",
+            "abilityType": 5,
+            "baseConfig": true,
+            "osConfig": false,
+            "ability": "OD210_021_001871_051-l2MahE4v",
+            "appStatus": 0,
+            "status": 0,
+            "orderType": 0,
+            "errorMsg": "安装成功",
+            "isUsed": null
+        },
+        {
+            "aiName": "睡岗识别",
+            "muAiName": "睡岗识别",
+            "sceneName": null,
+            "muAiTypeId": 4,
+            "taskTypeId": 4,
+            "taskTypeCode": "TaskTypeahabqwzwl1x",
+            "needMark": false,
+            "supportSequential": false,
+            "isGaoTie": false,
+            "frequency": [
+                "5s",
+                "10s",
+                "15s",
+                "30s",
+                "60s",
+                "5min",
+                "15min",
+                "60min"
+            ],
+            "calTypeName": "自建应用",
+            "abilityType": 5,
+            "baseConfig": true,
+            "osConfig": false,
+            "ability": "OD210_021_001870_017-l2MahE4v",
+            "appStatus": 0,
+            "status": 0,
+            "orderType": 0,
+            "errorMsg": "安装成功",
+            "isUsed": null
+        },
+        {
+            "aiName": "玩手机识别",
+            "muAiName": "玩手机识别",
+            "sceneName": null,
+            "muAiTypeId": 3,
+            "taskTypeId": 3,
+            "taskTypeCode": "TaskTypec2e94flbyyq",
+            "needMark": false,
+            "supportSequential": false,
+            "isGaoTie": false,
+            "frequency": [
+                "5s",
+                "10s",
+                "15s",
+                "30s",
+                "60s",
+                "5min",
+                "15min",
+                "60min"
+            ],
+            "calTypeName": "自建应用",
+            "abilityType": 5,
+            "baseConfig": true,
+            "osConfig": false,
+            "ability": "OD210_021_001866_001-l2MahE4v",
+            "appStatus": 0,
+            "status": 0,
+            "orderType": 0,
+            "errorMsg": "安装成功",
+            "isUsed": null
+        },
+        {
+            "aiName": "违禁品检测",
+            "muAiName": "违禁品检测",
+            "sceneName": null,
+            "muAiTypeId": 2,
+            "taskTypeId": 2,
+            "taskTypeCode": "TaskType49rugxtp855",
+            "needMark": false,
+            "supportSequential": false,
+            "isGaoTie": false,
+            "frequency": [
+                "5s",
+                "10s",
+                "15s",
+                "30s",
+                "60s",
+                "5min",
+                "15min",
+                "60min"
+            ],
+            "calTypeName": "自建应用",
+            "abilityType": 5,
+            "baseConfig": true,
+            "osConfig": false,
+            "ability": "OD210_021_002162_002-l2MahE4v",
+            "appStatus": 0,
+            "status": 0,
+            "orderType": 0,
+            "errorMsg": "安装成功",
+            "isUsed": null
+        },
+        {
+            "aiName": "盯屏",
+            "muAiName": "盯屏",
+            "sceneName": null,
+            "muAiTypeId": 1,
+            "taskTypeId": 1,
+            "taskTypeCode": "TaskType5h3ifgna34s",
+            "needMark": false,
+            "supportSequential": false,
+            "isGaoTie": false,
+            "frequency": [
+                "5s",
+                "10s",
+                "15s",
+                "30s",
+                "60s",
+                "5min",
+                "15min",
+                "60min"
+            ],
+            "calTypeName": "自建应用",
+            "abilityType": 5,
+            "baseConfig": true,
+            "osConfig": false,
+            "ability": "OD210_101_004362_006-l2MahE4v",
+            "appStatus": 0,
+            "status": 0,
+            "orderType": 0,
+            "errorMsg": "安装成功",
+            "isUsed": null
         }
-    ]
+    ],
+    "success": true
 }
 
-curl --location --request POST 'http://192.1.2.64:30000/vos/external/broadcastToken' \
---header 'Content-Type: application/json' \
---data-raw '{
-    "appSecret": "x1pcq13r/Setyir9yxvSiFGB/wsv4YHWiNmrgeaZhzJKi7c7Gmk04Z5Kd/hCifL",
-    "appKey": "0WnfCRDJF"
-}'
+{
+    "code": "0",
+    "message": "成功",
+    "data": [
+        {
+            "deviceId": 2,
+            "deviceName": "111222333",
+            "deviceSerial": "VID9cwyv6fiv0x",
+            "port": null,
+            "userAccount": null,
+            "userPWD": null,
+            "deviceType": "本地视频",
+            "taskTypeList": [
+                {
+                    "taskTypeId": 1,
+                    "ability": "OD210_101_004362_006",
+                    "taskTypeName": "盯屏"
+                }
+            ]
+        },
+        {
+            "deviceId": 6,
+            "deviceName": "广电研发",
+            "deviceSerial": "rtsp://admin:HZlh123456@172.16.3.229/Streaming/Channels/1601",
+            "port": null,
+            "userAccount": null,
+            "userPWD": null,
+            "deviceType": "视频流地址",
+            "taskTypeList": [
+                {
+                    "taskTypeId": 3,
+                    "ability": "OD210_021_001866_001",
+                    "taskTypeName": "玩手机识别"
+                }
+            ]
+        }
+    ],
+    "success": true
+}

+ 10 - 0
安播辅助服务程序说明.md

@@ -35,6 +35,16 @@
 ## 从行业超脑获取基础信息
 1. 使用http从行业超脑获取到`算法列表`和`设备列表`
 2. 这里使用一个线程单独读取,可能需要定时更新
+3. `算法列表`和`设备列表`和`tAction`对应的值,`算法列表`好像只有这三个只有用,读取到后写入到EQM数据库
+    |算法列表|设备列表|EQM|
+    |:--|:--|:--|
+    |ability|ability|ActionId|
+    |taskTypeId|taskTypeId|ActionTaskid|
+    |muAiName|taskTypeName|ActionName|
+4. `设备列表`获取的数据写入到EQM数据库的`tActionCamer`表格中,其对对应的关键字如下
+    |设备列表|tActionCamer|
+    |:--|:--|
+    |||
 
 ## 从Redis获取数据
 1. `Key`的组成:`%d : %s`, `DeviceID`, `算子编号`